Skip to content

feat(distribution): Claude plugin runtime + dist/ in git + Windows doctor#13

Merged
nanami-he merged 3 commits into
mainfrom
he-c-fix-release-polish
Apr 29, 2026
Merged

feat(distribution): Claude plugin runtime + dist/ in git + Windows doctor#13
nanami-he merged 3 commits into
mainfrom
he-c-fix-release-polish

Conversation

@nanami-he
Copy link
Copy Markdown
Owner

@nanami-he nanami-he commented Apr 29, 2026

Lands the G0 multi-channel distribution work from PRD-v3.md plus polish items: doctor.ts Windows support, golden retriever frame mapping fix, hermetic build:reactions.

Note on PR size: ~35K of the line count is the first commit of dist/ artifacts. Real review surface is ~200 lines across non-dist files. dist/ entering git is a deliberate G0 architectural decision so the Claude Code plugin install path doesn't require bun.

Summary

G0 multi-channel distribution

  • .claude-plugin/plugin.json: switch from bun + server/index.ts (required bun + source on disk) to node + dist/server.js (works as long as the user has node)
  • .gitignore: drop the dist/ line so the bundled artifacts that ship to npm are also visible to plugin / git-clone install paths
  • New cli/plugin-manifest.test.ts: pins the manifest to node + dist/server.js so future regression doesn't quietly break plugin installs
  • New .githooks/pre-commit: rebuilds dist/ + statusline assets when staged files touch any build input. Pure doc/test/PRD commits skip the rebuild
  • package.json adds prepare script so contributors get the hook automatically on bun install

Hermetic build:reactions

  • scripts/build-reactions.ts only writes dist/reactions-pool.json by default — no longer touches ~/.petsonality/
  • New sync:reactions script (and --sync-runtime flag / PETSONALITY_SYNC_RUNTIME=1 env var) for the dev "I want my local hooks updated" path
  • New scripts/build-reactions.test.ts verifies the hermetic guarantee

Doctor Windows polish (PRD M5 item)

  • Detects Windows and replaces 7 Unix-only tryExec calls with native equivalents (cmd.exe /c ver, $PSVersionTable, WT_SESSION / ConEmuANSI, etc.)
  • Status script path picks .ps1 on Windows
  • New cli/doctor.test.ts

Bug fixes

README polish

  • Replaces the hardcoded npm-0.4.0 badge with the dynamic npm/v/petsonality badge — auto-updates on each release

Tests

```
bun test
311 → 317 pass (+6 across plugin-manifest.test, build-reactions.test, doctor.test, statusline-art.test)
```

Test Plan

  • bun test (317 pass)
  • bun run build (clean)
  • npm pack --dry-run shows dist/ artifacts in tarball
  • pre-commit hook smoke-tested (rebuilds when source files staged, skips when only docs staged)
  • Native Windows + claude plugin install smoke testing — pending real-host verification post-merge

Known follow-up

  • dist/reactions-pool.json is non-deterministic across builds: scripts/build-reactions.ts samples 200 random times into a Set, so the iteration order varies between runs. This produces ~700 lines of harmless noise in commits that touched build inputs. Worth a follow-up PR to make the build deterministic (sort the output, or iterate the source pools deterministically without sampling).

Refs

PRD-v3.md G0 (multi-channel distribution architecture). Closes the open task list there except for Homebrew formula (long-term) and the live Windows / plugin smoke tests (need real host).

Three small polish items folded onto the multi-channel branch before
flipping #13 out of draft:

- New `.githooks/pre-commit` rebuilds dist/ + statusline assets
  whenever staged files touch any build input (server/, cli/,
  scripts/, statusline/, hooks/, skills/, package.json, plugin.json,
  bun.lock). Pure docs/test/PRD commits skip the rebuild and stay
  fast. Without this hook it's easy to land main with dist/
  out-of-sync from source — exactly the failure mode dist-in-git was
  supposed to prevent.

- `package.json` adds a `prepare` script that runs
  `git config core.hooksPath .githooks` so contributors who clone
  + `bun install` get the hook for free. The `|| true` keeps it
  silent in environments without git (npm tarball install).

- README: drop the new "lightweight companion layer for developers
  who want their coding environment to feel present, responsive,
  and alive" sentence. It read more abstract/marketing than the
  existing "still there at 2am when you're stuck on a bug" line
  right below it. Less is more.
@nanami-he nanami-he changed the title Fix release polish and plugin runtime feat(distribution): Claude plugin runtime + dist/ in git + Windows doctor Apr 29, 2026
@nanami-he nanami-he marked this pull request as ready for review April 29, 2026 19:03
@nanami-he nanami-he merged commit 2cb5366 into main Apr 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant