feat: fix init clobber + add prospec upgrade path (BL-044)#42
Merged
Conversation
- fix(init): per-file skip-if-exists guard so re-running init never clobbers curated trust-zone files (CONSTITUTION/_conventions/_index); rebuilds only missing files, .prospec.yaml-last marker preserved - feat(cli): add `prospec upgrade` — record the prospec version in .prospec.yaml (canonical format) + run agent sync + print a migration report; not in INIT_COMMANDS so the config-existence gate blocks uninitialized projects - feat(types): redefine .prospec.yaml `version` as the prospec version the project uses; add types/version.ts (PROSPEC_VERSION single source) and types/canonical-docs.ts; register prospec-upgrade skill (excludeFromEntryConfig) - feat(skill): add /prospec-upgrade — scan init-created files, refresh their format to the latest templates with per-file consent, localize new-skill triggers, re-sync - feat(skill): /prospec-knowledge-update asks consent before migrating drifted AI-knowledge format (Phase 2.5) - feat(agent-sync): name the skills missing skill_triggers in the hint; quickstart localizes fill-missing instead of all-or-nothing - docs: document `prospec upgrade` + /prospec-upgrade in README (x2), bump skill count 16->17, sync _index and types module README - test: cover init recovery, upgrade orchestrator, missing-trigger detection, version semantics, entry-exclusion contract; adds e2e + integration
- mark BL-044 complete in planning/backlog.md (catalog ✅ + completion note, Grade A) - upgrade this repo via `prospec upgrade`: .prospec.yaml `version` 1.0 -> 0.3.2 (now the prospec version) + canonical re-serialization - localize the new prospec-upgrade skill triggers to Traditional Chinese via /prospec-upgrade (16 existing entries untouched)
- archive fix-init-clobber-add-upgrade: summary.md → prospec/specs/_archived-history/ (committed audit trail); artifacts moved to .prospec/archive (gitignored) - graduate REQs into Feature Specs: project-setup (US-011/012), agent-integration (US-433/434), ai-knowledge (US-353) - renumber 4 REQ ids that collided with drift-detection/sdd-workflow: TYPES-034→037, SERVICES-031→035, TEMPLATES-109→121, TEMPLATES-110→122 - sync module READMEs (types/services/cli/templates/tests) + module-map keywords for the upgrade path; refresh raw-scan.md - add "Upgrading Prospec" guide to README + README.zh-TW (prospec upgrade -> /prospec-upgrade) with the correct github:benwu95/prospec install - product.md last_updated; harvest PB-003/004/005 recurrences into _lessons-ledger
Prospec Check |
Test Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
prospec initdata-loss hole and adds the missing version-upgrade path (BL-044).P0 — init clobber fix.
prospec init's idempotency gate only checked.prospec.yaml, but then unconditionally overwrote 7+ files including the curated trust zone (CONSTITUTION.md/_conventions.md/_index.md). Deleting.prospec.yamlto re-localize triggers wiped curated content. Init now uses a per-file skip-if-exists guard (matchingknowledge-init.service) — it rebuilds only missing files; the.prospec.yaml-last completion marker is preserved.P1 — upgrade path.
prospec upgrade(CLI, zero-LLM): records the prospec version in.prospec.yamlversion(canonical re-serialize) + re-runsagent sync+ prints a migration report. Writes no docs; not inINIT_COMMANDS, so an uninitialized project getsConfigNotFound./prospec-upgrade(Skill): scans the filesprospec initcreated, refreshes their format to the latest templates with per-file consent, localizes triggers for newly-added skills (fill-missing), and re-syncs..prospec.yamlversionnow means the prospec version the project uses (a legacy"1.0"is treated as stale and bumped on first upgrade). No separateprospec_versionfield.P2 — close the trigger re-localization gap.
agent syncnow names the skills missing askill_triggersentry (partial localization), and/prospec-quickstartfills only the missing triggers — so you never need to delete.prospec.yamlto re-localize. Also:/prospec-knowledge-updatenow asks for consent before migrating drifted AI-knowledge format.How it was verified
verify:skills(28/28), and the drift engine (8/8, 0 warn) all green; coverage 96%.prospec upgrade+/prospec-upgrade—version1.0→0.3.2, the new skill's triggers localized, init-created docs untouched.Notes
README.md+README.zh-TW.mdgained an "Upgrading Prospec" guide.readme-countscheck not covering_indexfile counts.🤖 Generated with Claude Code