Skip to content

feat(product-development): add the retrofit guide for codebases without specs - #59

Merged
prometheas merged 5 commits into
epic/35-product-development-0.2.0from
35/47-retrofit
Nov 30, 2026
Merged

prometheas merged 5 commits into
epic/35-product-development-0.2.0from
35/47-retrofit

Conversation

@prometheas

@prometheas prometheas commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Refs #47 (product-development: retrofit guide for codebases without specs), part of #35 (product-development 0.2.0 release).

Delivery overview

Adds references/retrofit.md, the path from "a codebase" to a set of features in the right stages, for projects that adopt the skill after their code exists. It has four steps: a maintainer braindump run like the Vision Grill; eight feature lenses, each run by its own subagent from a short prompt template that returns candidate features with evidence; one feature inventory the maintainer approves; and routing of each approved feature to modernization, shaping/ or ideas/. It also covers the wayfinder rule for large codebases, with a link to its public source, and works end to end without it. A synthetic task-tracker example routes one feature to each destination. tests/fixtures/retrofit/ is the bundle that example seeds, and tests/retrofit.bats checks the acceptance criteria that can be checked mechanically. SKILL.md links the guide from its workflows, its workflow-selection table, its sub-agent dispatch table, its reference list and its description.

Acceptance criteria (#47):

  • A retrofit reference documents the four steps, the eight lenses and the wayfinder rule with a link to its source, and SKILL.md links it.
  • The guide works end to end when wayfinder is not installed. The example declines it and runs all four steps.
  • Each lens has a short subagent prompt template that returns candidate features with evidence: a shared preamble, a report format and eight templates of 4–5 lines each.
  • The guide states that the feature inventory is deleted after seeding, and that code alone never admits a spec.
  • A synthetic example inventory shows one feature routed to each destination.

Governing decisions (do not weaken)

  • Approval scopes the retrofit only. Inventory approval ratifies nothing, and no feature reaches features/ without a promotion PR. A change whose code already shipped still goes through promotion, as SKILL.md's Promotion workflow already requires.
  • The inventory stays outside docs/product/ and never merges to the default branch. It lists code, which the feature-tags reference (product-development: link code to features with @feature tags #38, @feature tags) bars from the product bundle, and it has no type on the OKF profile's closed list (Spike: evaluate an OKF compatibility profile for product documentation #25, OKF profile). It is deleted once its features are seeded. The retrofit PR body records each feature's destination and the maintainer's approval.
  • Specs in other formats are evidence for shaping. The shaping document's provenance record carries the lens evidence: packages and API surfaces under Current artifacts, and tests, PRs and prior specs under Evidence, each linked. It never carries a list of code files.
  • Retirement reuses the modernization guide's rules (product-development: modernization guide for specs written with 0.1.0 #46, modernization guide) through a link to its step 7 instead of restating them. So a prior spec of shipped behavior stays until canonization.
  • 0.1.0 scaffolding is reconciled before seeding. In a mixed project, 0.1.0's docs/product/AGENTS.md and README.md (which init.sh keeps) are rewritten from the current templates as the modernization guide's setup describes, through a link rather than a restatement.
  • wayfinder is recommended, never invoked, and its GitHub writes are approved. It has disable-model-invocation: true, which I checked in its source. The agent explains which thresholds hold and the user invokes it. On a GitHub-backed tracker its map and child issues are GitHub writes, so the maintainer sees and approves each one under SKILL.md's GitHub Writes rule (from Improve product-development plugin with lifecycle review and handoff workflows #18, GitHub Writes approval), which covers helper workflows; local Markdown tracker operations fall outside that rule. The link points to https://github.com/mattpocock/skills/tree/main/skills/engineering/wayfinder; I checked through the GitHub API that it is public (MIT, main at 255351f). Its map can scope the lenses but is not the inventory.
  • One subagent per lens, always. Without wayfinder, each lens reads package by package as needed and always reads the shared root files and the whole repository's history, so root-level material such as the example's openspec/ is never missed.
  • The fixture is the bundle root (tests/fixtures/retrofit/), like the OKF profile fixture, so the existing "every skill fixture conforms" validator test passes on it. The 0.1.0 folder routed to modernization stays --pending.

Rejected alternatives

  • Keeping the inventory as a typed document in docs/product/. That would need a new OKF type and would break the rule that nothing in the bundle lists code.
  • A fourth "struck" destination. Struck candidates (dead code) stay listed in the inventory with their reason, but they are not routed. product-development: retrofit guide for codebases without specs #47 names exactly three destinations.
  • Restating the modernization retirement and scaffold-reconciliation rules. product-development: retrofit guide for codebases without specs #47 says to apply the same rules, so the guide links to them.
  • Splitting each lens into one subagent per app or package. It multiplies subagents and can miss shared root files and repo-wide history.

Changes outside the packet's core files

Commit checklist

  • feat: add the retrofit guide, fixture and suite — 997ba27
  • docs: link the retrofit guide from the skill and sibling references — 1619323
  • test: cover open questions and provenance links in the retrofit fixture (review findings 1, 5, 6) — 8a7e36b
  • fix: close review gaps in the retrofit guide (review findings 1–4; already-live interim behavior) — 9b1ba40

Review fixes (independent review at 1619323)

  1. Finish commands now run open-questions.py index --pending … before check; the fixture records a live question (shaping OQ-1) and carries the register with its index. A test runs the reference's command block as written against a stale-index copy (it failed with "index is stale" before the fix). — 8a7e36b, 9b1ba40
  2. One subagent per lens; package-by-package reading plus shared root files and whole-repo history, in the step, the fallback, the preamble and the worked example. — 9b1ba40
  3. Mixed projects reconcile 0.1.0 AGENTS.md/README.md before seeding via a link to modernization's setup. — 9b1ba40
  4. wayfinder approval stated at the recommendation, resolved by the GitHub Writes rule; removed from Open decisions. — 9b1ba40
  5. Fixture provenance links the OpenSpec spec, the test file and group, and #123-style PR placeholders on github.com/example. — 8a7e36b
  6. features/ asserted as an exact file list; inventory test relabelled as bundle exclusion and checks beside the bundle. — 8a7e36b

Open decisions

  • Already-live behavior: what establishes Shipped? For a retrofit change whose behavior was already live when it was ratified, it is undecided what evidence establishes Shipped and which release check precedes recording that historical signal. The guide stops at the promotion PR for that case and says so. Interim behavior: after promotion the change stays Ratified, no Shipped entry is recorded and no ship signal is fired, so canonization (and retiring any prior spec of that behavior) waits for the decision. product-development: retrofit guide for codebases without specs #47 and the campaign brief don't settle this.

Resolved: whether wayfinder's tracker writes need approval. The GitHub Writes rule settles it (see Governing decisions).

Deferred (tracked, not dropped)

  • None.

Test evidence

All suites in docs/development.md pass with nix develop -c bats … at 9b1ba40: marketplace 10, plugin-package 14, init 73, feature-evolution 95, open-questions 67, board-mapping 43, okf-profile 46, vision-anatomy 29, lifecycle-review-handoff 50, canonization 27, feature-tags 61, modernization 59, retrofit 32, delivery-engineering 8, okf-bundle 13, branch-guard 48. git diff --check is clean; no tracked __pycache__ or .pyc files.

🤖 Generated with Claude Code

…ut specs

Add references/retrofit.md: the four steps (a maintainer braindump run
like the Vision Grill, eight feature lenses each run by its own subagent,
one feature inventory the maintainer approves, routing to modernization,
shaping/ or ideas/), a short prompt template per lens with a shared
preamble and report format, and the wayfinder rule for large codebases
with a link to its public source and the steps that work without it.

The inventory's approval scopes the retrofit only and ratifies nothing;
the inventory stays outside docs/product/ and is deleted once its
features are seeded. Code alone never admits a spec; specs in other
formats are evidence for shaping. Retirements follow the modernization
guide's approval rules, and market details go to research notes.

A synthetic task-tracker example routes one feature to each destination.
tests/fixtures/retrofit/ is the bundle it seeds, checked by the profile
check (with the 0.1.0 folder pending) and the pinned validator.
tests/retrofit.bats checks the mechanical acceptance criteria and is
listed in docs/development.md.

Refs #47, #35
SKILL.md gains a Retrofit workflow section (trigger, process, gate), a
workflow-selection row for codebases whose features have no product docs
or only specs in other formats, a feature-lens row in the sub-agent
dispatch table, a reference-list entry, and "retrofit a codebase that has
no specs" in its description. The one-behavior case still routes to
Discovery and Design.

The feature-tags reference now links the retrofit guide where it calls
tags optional evidence, and the modernization and vision references
replace their pending issue mentions with links to it.

Refs #47, #35
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: b158705d-176b-4528-9b10-319c1044e345

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…in the retrofit fixture

The seeded shaping document now records a design-level open question
("every weekday" schedules) and the fixture carries the register,
docs/product/open-questions.md, with a regenerated index that lists it,
so the suite exercises the path where a retrofit records a question.

The provenance record's Evidence row links each source with synthetic
links: the OpenSpec spec, the recurrence test file and its group, and
the feat(recurrence) pull requests (#123-style placeholders on
github.com/example). A new test requires those links and refuses any
non-synthetic URL in the fixture.

The features/ assertion now lists the exact files expected there instead
of grepping for an unquoted feature-spec type, which quoted YAML would
bypass. The inventory test is relabelled as bundle exclusion and also
checks that no inventory sits beside the fixture.

Refs #47, #35
- Finishing: regenerate the open-questions index, with the same
  --pending flags, before open-questions.py check, so a retrofit that
  records a question no longer fails with "index is stale". A test runs
  the reference's command block as written on a copy of the fixture with
  a stale index.
- Lenses: one subagent per lens in every case. Without wayfinder each
  lens reads package by package as needed and always reads the shared
  root files and the whole repository's history; the preamble's Scope
  and the worked example say the same, so the example's root-level
  openspec/ is in every lens's scope.
- Mixed projects: when 0.1.0 left docs/product/AGENTS.md and README.md,
  reconcile them before seeding, linking modernization's setup rather
  than restating it. The worked example now has that scaffolding.
- wayfinder: on a GitHub-backed tracker its map and child issues are
  GitHub writes, so the maintainer approves each one under SKILL.md's
  GitHub Writes rule; local Markdown tracker operations fall outside it.
  SKILL.md's Retrofit process says the same.
- Already-live behavior: the guide stops at the promotion PR, and the
  ratified change records no Shipped entry until the skill settles what
  evidence and release check apply.

Refs #47, #35
@prometheas

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Action not completed

Head commit changed.

… changes

The retrofit guide said an already-live change had no settled path past
ratification, which could lead an agent to skip the handoff when the
promotion PR merges. The handoff still applies as for any ratified change:
drafted at merge and sent once the implementation-level check passes. Only
recording Shipped pauses until the maintainer rules on the ship signal for
behavior that was already live.

Refs #47, #35
@prometheas
prometheas merged commit 19ec5e8 into epic/35-product-development-0.2.0 Nov 30, 2026
1 check passed
@prometheas

Copy link
Copy Markdown
Contributor Author

Review note: the review gate was Codex gpt-6.2-sol at high effort, with a first review and a narrow check of the fixes. The check's one remaining finding (the handoff still applies to an already-live change) was fixed in d837563. CodeRabbit's full review of 9b1ba40 was requested but hadn't posted when this PR merged; any comments it leaves will be answered on the final PR to main (#60, the 0.2.0 release). All 16 suites (675 tests) passed at d837563.

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