Skip to content

v0.4.1 — No-Clobber, Completed: Agent-Config User Blocks & `/prospec-upgrade` Path Fixes

Choose a tag to compare

@benwu95 benwu95 released this 22 Jun 05:15

Prospec v0.4.1

v0.4.0 made re-running init safe — but the no-clobber promise stopped at the agent config
files
. prospec agent sync still overwrote CLAUDE.md / AGENTS.md unconditionally, and
prospec init skipped an existing AGENTS.md entirely — so any hand-written agent
instructions were destroyed or ignored. And the brand-new /prospec-upgrade Skill that 0.4.0
shipped had two path/resolution bugs that made it fail on first real use. v0.4.1 finishes
the no-clobber guarantee
(extending the prospec:auto / prospec:user block contract to the
agent config files) and repairs the upgrade path, then brings the deployed skills and config
under version control.

31 source files changed · +745 / −116 · 1 merged PR (#43) · plus prospec-* skills, AGENTS.md & CLAUDE.md now version-controlled


✨ Headline features

User edits in CLAUDE.md / AGENTS.md now survive every command (PR #43)

Agent config files now use the same prospec:auto / prospec:user block contract that
_index.md already relies on. A new mergeManagedDoc(generated, existing) does an in-place
auto-block swap that preserves the user block
; a marker-less hand-written file is migrated
into the user block
instead of discarded, and the merge is idempotent (two syncs in a row
are byte-identical). agent sync and init both route through it — init now merges the
managed AGENTS.md instead of skipping it, while the curated trust zone (CONSTITUTION.md /
_conventions.md / _index.md) keeps its skip-if-exists guard. So your custom instructions now
survive init / agent sync / quickstart / upgrade. (PR #43)

/prospec-upgrade actually works now — two resolution fixes

The 0.4.0 upgrade Skill couldn't find the latest templates. Step 2 pointed at a root-level
templates/init/ that never exists
— the package ships and loads templates from
src/templates/ (because tsc doesn't copy .hbs into dist/); that path is now corrected.
A package-root fallback was added for pnpm link / global installs where
require.resolve can't see the package: derive the root by following $(which prospec) back up
from the bin shim. And a source-repo short-circuit handles dogfooding — when the project's
own package.json name is @benwu95/prospec, use . as the root and skip require.resolve
(which fails on a self-reference with no exports field). (bb0bf25, 8446a8b)

Deployed prospec skills & agent config are now version-controlled

.gitignore now tracks the deployed prospec-* skills under .claude/ and .agents/,
plus AGENTS.md and CLAUDE.md — so changes to generated config are reviewable in git instead
of invisible. (698437d)


🔁 Dogfood

The whole change ran through prospec's own SDD lifecycle
(story → plan → tasks → implement → review → verify → archive → learn) on this repo, reaching
0-critical adversarial review and verify grade S. The DRY follow-up that resolved both
review majors — a shared single-source auto-block helper (hasAutoBlock / replaceAutoBlock)
plus readFileIfExists adopted across the knowledge services — was then promoted to the team
playbook as PB-006 (single-source helper for parallel modules).

🧪 Quality & tests

  • The suite grew 1,760 → 1,786 tests — new coverage for the block-merge primitive,
    marker-less migration, idempotent re-sync, and the init / agent sync merge routes.
  • prospec check drift engine 8/8 PASS (0 warn), coverage 96%, typecheck + lint clean.
  • Real-CLI e2e confirmed: a brownfield CLAUDE.md / AGENTS.md is migrated into the user block
    and preserved across init → agent sync, idempotent on re-sync.

📊 Compared to v0.4.0

v0.4.0 v0.4.1
Tests 1,760 1,786
agent sync on CLAUDE.md / AGENTS.md unconditional overwrite (loses edits) auto/user block merge (edits preserved)
init with an existing AGENTS.md skipped entirely migrated into the user block
/prospec-upgrade template lookup broken (templates/init/, pnpm-link) fixed (src/templates/init/ + CLI-shim / self-ref fallbacks)
Deployed skills + agent config gitignored version-controlled
Verify grade A S

⬆️ Upgrade notes

Run prospec agent sync (or any of init / quickstart / upgrade): a marker-less
hand-written CLAUDE.md / AGENTS.md is migrated into the prospec:user block on first
sync
, then preserved byte-for-byte on every later sync — keep your custom instructions inside
that user block. If you adopted 0.4.0's /prospec-upgrade, re-sync to pick up the fixed
Skill
(prospec agent sync). The trust zone is unchanged — still skip-if-exists.


Merged PRs

  • #43 feat: preserve user edits in CLAUDE.md / AGENTS.md via auto/user blocks