modify-flow
Skill2 starsChanged 6 days agoMITView on GitHub
Propose and plan a change to an already-documented flow, entity, or business rule — as opposed to create-flow-documentation / create-entity-lifecycle, which document a flow for the first time. USE THIS SKILL when the user mentions: modify flow, change existing behaviour, disable/remove a feature, proposal for a change, modification proposal, change request, "how do we document this change", update the business rule, or any request to alter behaviour that already has a shipped flow/entity/BR doc under a bounded-context-style docs tree. Language- and framework-agnostic. Produces a proposal.md (product rationale + current vs desired behaviour + real-code scope), an implementation-plan.md (phased, grounded in whatever layering this specific codebase actually uses), then updates the original flow/entity/business-rule docs in place once implemented.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adr-amendSkill
- adr-createSkill
- adr-review-alternativesSkill
- adr-validateSkill
- agents-maintainerSkill
- audit-docsSkill
- explore-domainSkill
- sdlc-guideSkill
- setup-sdlcSkill
- inception-workshopSkill
- prd-workshopSkill
- user-story-mappingSkill
- reverse-engineer-domainSkill
- create-moduleSkill
- implement-flowSkill
- create-entity-lifecycleSkill
- create-featuresSkill
- create-flow-documentationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
47 rules. About 0 are common, 18 are distinctive, and 29 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
29
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 35
NO PROACTIVE BUSINESS DECISIONS: If an open question exists, record it in Section 10 (Open Questions) of proposal.md, stop, and wait.
- Very specific: line 36
NEVER CREATE PARALLEL LIVING DOCS: Living docs under bounded-contexts/ describe currently shipped code only.
- Very specific: line 60
Test/build/lint commands: Read the repo's README.md, CLAUDE.md, AGENTS.md, CONTRIBUTING.md, or build config to find real verification …
- Distinctive: line 61
Feature-flag system: Check whether the repo already uses one (Unleash, LaunchDarkly, config toggle, env var convention).
- Distinctive: line 62
Cross-repo dependencies: Read CLAUDE.md or AGENTS.md for a Cross-Repo Dependencies section.
- Very specific: line 65
Do NOT guess file paths, test commands (npm test, ./gradlew), or module layouts without checking the repo.
- Very specific: line 66
Do NOT skip templates/proposal.md in Step 2 unless the user explicitly instructs you to use a different template file.
- Distinctive: line 67
PASS CONDITION: All 5 repository dimensions above are verified from real files.
- Very specific: line 88
Do NOT silently self-select Light tier to avoid writing proposal.md.
- Very specific: line 99
Read affected derived docs: Read the affected flow doc(s), entity doc(s), domain-service doc(s) (bounded-contexts/{ctx}/domain-services/ — …
- Very specific: line 106
Search docs/product/bounded-contexts//invariants/INV-*.md and docs/product/discovered/invariants/INV-RAW-*.md across all bounded contexts …
- Very specific: line 107
Verify whether the change preserves enforcement or introduces an unconstrained code path.
- Distinctive: line 114
Never promote a status silently.
- Distinctive: line 118
Test values on both sides of every boundary: past / present / future, same / next period (month, year), empty / one / many, and mixed …
- Distinctive: line 119
Ask what a caller gains by passing an unusual value (can it bypass a limit, permission, or uniqueness rule?).
- Distinctive: line 123
Do NOT trust markdown documentation without reading the underlying source code files.
- Very specific: line 124
Do NOT declare a side effect "intended" before completing check 10 (boundary-values check).
- Distinctive: line 125
PASS CONDITION: Every affected doc, source file, test file, and cross-context invariant has been read and verified.
- Very specific: line 133
MANDATORY TOOL CALL: Read templates/proposal.md (located in this skill's templates/ folder) using read_file.
- Very specific: line 134
Write the proposal file to: docs/product/working-on/active/[change-name]/proposal.md *(Use a kebab-case [change-name] slug matching the git …
- Very specific: line 163
Single-pass changes: Keep one row (S1) in Section 9.
- Very specific: line 178
Do NOT leave [EntityName] or [RealClassOrModule.method()] placeholders in the delivered proposal.md.
- Distinctive: line 179
Do NOT resolve Open Questions in Section 10 on the user's behalf.
- Very specific: line 180
Do NOT proceed to STEP_03 (Implementation Plan) or STEP_04 (Code) in the same turn as STEP_02.
- Very specific: line 188
Run this step whenever proposal.md already exists in working-on/active/[change-name]/ and the user asks to continue work on it.
- Very specific: line 192
Read Section 9 (Delivery Slices) and Section 10 (Open Questions).
- Very specific: line 193
Ask "is this slice still wanted?": before investing in detail.
- Very specific: line 207
Standard Inside-Out Change: Call read_file on templates/implementation-plan.md.
- Very specific: line 208
Parallel Change Variant: If proposal.md Section 4.1 marks a contract as Deprecation with staged coexistence (old and new versions live …
- Very specific: line 209
Write the plan alongside proposal.md:
- Very specific: line 227
Do NOT invent generic architecture layers (e.g.
- Distinctive: line 228
Do NOT start modifying production or test code in the same turn that you generate the implementation plan.
- Very specific: line 241
Check off ([x]) tasks in the implementation plan as each phase completes.
- Very specific: line 242
After each phase, run the repo's full unit test suite and architecture test suite (found in STEP_00), not only the test file you touched — …
- Distinctive: line 243
Run the full integration/acceptance test suite and linter/typecheck before declaring implementation complete.
- Distinctive: line 245
Do NOT implement features belonging to future slices.
- Distinctive: line 246
Do NOT leave commented-out dead code or orphaned feature flags (unless in Phase 1/2 of a Parallel Change plan).
- Distinctive: line 247
PASS CONDITION: All phases for the active slice are checked off and the full unit, architecture, integration, and lint suites pass.
- Very specific: line 257
Scope strictly to the shipped slice: Only update Section 8 rows tagged with the slice that just shipped.
- Distinctive: line 263
Leave frozen historical brainstorming/scoping artifacts untouched.
- Very specific: line 266
Keep each rule doc's Enforced by table complete across layers (contract, application, domain, database, UI) with honest status (✅ Verified …
- Distinctive: line 267
Update the root flow/documentation index if any summary/status row changed.
- Distinctive: line 269
PASS CONDITION: All living docs for the shipped slice match the code, all bidirectional traceability links are verified via grep, and no …
- Very specific: line 277
Delete its features/ specs and drafts/ files (and remove entries from drafts/README.md).
- Distinctive: line 278
Remove its row from any domain-service doc's *Pending Changes* (Part A4) table.
- Very specific: line 280
If all remaining slices are Shipped or Discarded, proceed to STEP_06.
- Very specific: line 298
Safe Purge: Delete docs/product/working-on/grace-period/[change-name] once no longer needed for hotfix reference.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PROTOCOL: MODIFY-FLOW (EXECUTION LEVEL 3)
<state_machine> CURRENT_STEP -> REQUIRED_TOOL -> REQUIRED_OUTPUT -> MANDATORY_HALT STEP_00: Discover -> grep / find / read_file -> Repo conventions, commands, cross-repo map -> Continue to STEP_00B STEP_00B: Triage -> evaluate 4 criteria -> Tier decision (Light / Standard / Full) -> Continue to STEP_01 STEP_01: Ground -> grep / read_file -> Code truth, INV-* cross-check, boundaries -> Continue to STEP_02 STEP_02: Propose -> read_file(templates/proposal.md) -> working-on/active/[change]/proposal.md -> 🛑 HALT TURN (Wait for user) STEP_02B: Resume -> git log / read_file -> Re-grounded slice against HEAD -> Continue to STEP_03 STEP_03: Plan -> read_file(templates/-plan.md) -> working-on/active/[change]/-plan*.md -> 🛑 HALT TURN (Wait for user) STEP_04: Implement -> edit_file / run_command -> Verified code + full test/arch suites -> Continue to STEP_05 STEP_05: Living Docs -> edit_file / grep -> In-place doc updates + closed trace edges -> Continue to STEP_06 STEP_06: Grace/Purge -> mv / rm -> Grace-period lifecycle transition -> END </state_machine>
<execution_invariants>
- WORKFLOW IMMUTABILITY: You are free to reason deeply INSIDE each step, but you are strictly forbidden from skipping, merging, reordering, or replacing steps (
workflow structure = immutable | step reasoning = flexible). - STOP GATES ARE ABSOLUTE (WITH LIGHT-TIER / EXPLICIT BATCH OVERRIDE): In
StandardandFulltiers, you are strictly forbidden from executingSTEP_03(Plan) orSTEP_04(Code) in the same turn asSTEP_02(Proposal) — unless the user explicitly confirmedLighttier inSTEP_00Bor requested unattended batch execution in their prompt. - TEMPLATE LOCK: Reconstructing template headers or tables from internal memory or prose rules is strictly forbidden. You MUST call
read_fileontemplates/proposal.mdbeforeSTEP_02, andread_fileontemplates/implementation-plan.md(ortemplates/parallel-change-plan.md) beforeSTEP_03. - NO PROACTIVE BUSINESS DECISIONS: If an open question exists, record it in Section 10 (
Open Questions) ofproposal.md, stop, and wait. Never resolve open questions or self-selectLighttier without explicit user confirmation. - NEVER CREATE PARALLEL LIVING DOCS: Living docs under
bounded-contexts/describe currently shipped code only. UntilSTEP_04ships, all proposals, slice specs, drafts, and plans live exclusively underdocs/product/working-on/active/[change-name]/. - ESCAPE HATCH: If the situation does not fit the contract, do not silently improvise and do not force-fit: declare the deviation in one line and ask. </execution_invariants>
<output_contract>
- PROPOSAL ARTIFACT (
STEP_02):- TARGET_PATH:
docs/product/working-on/active/[change-name]/proposal.md(or.sdlc/config.jsonoverride) - SOURCE_TEMPLATE:
templates/proposal.md(MUST callread_filefirst) - SCHEMA_INVARIANCE: Preserve all metadata bullets and numbered sections (
## 1. Product Rationalethrough## 10. Open Questions+## 🔗 Related Documentation) and exact Markdown table column schemas verbatim.
- TARGET_PATH:
- IMPLEMENTATION PLAN ARTIFACT (
STEP_03):- TARGET_PATH:
docs/product/working-on/active/[change-name]/implementation-plan.md(orimplementation-plan-sN.md) - SOURCE_TEMPLATE:
templates/implementation-plan.md(ortemplates/parallel-change-plan.mdwhen Section 4.1 marks a contract asDeprecationwith staged coexistence; MUST callread_filefirst) - SCHEMA_INVARIANCE: Preserve
### Resolved Open Questions,## 0. Cross-Repo Dependencies,## 1. Pre-Implementation Checklist,## 2. Phases,## 3. Validation,## 4. Documentation Update,## 5. Rollout Notes, and## 🔗 Related Documentationverbatim.
- TARGET_PATH:
- ESCAPE_HATCH: Never silently omit or invent template sections. If a section or subsection genuinely does not apply to this change (e.g.,
4.3 Feature Flagswhen no flag is needed), preserve the heading and write"N/A — [1-line rationale]", or halt and ask the user before deviating. </output_contract>
STEP_00 — Discover This Repo's Conventions
- INPUT: Target repository workspace and
.sdlc/config.json(if present, honour itsdocsRoot/productDocsDiroverrides; default isdocs/product/). - ACTION: Execute tool searches to discover (never assume):
- Docs location & shape: Find where flow/entity/business-rule documentation lives (grep for
"flow","business rule","bounded context","entity lifecycle"across docs directories). Note exact folder structure and naming conventions. - Language & source layout: Identify implementation language(s) and how source is organized (e.g. layered
domain/application/infrastructure, feature-first modules, monorepo packages). - Test/build/lint commands: Read the repo's
README.md,CLAUDE.md,AGENTS.md,CONTRIBUTING.md, or build config to find real verification commands. - Feature-flag system: Check whether the repo already uses one (Unleash, LaunchDarkly, config toggle, env var convention).
- Cross-repo dependencies: Read
CLAUDE.mdorAGENTS.mdfor a Cross-Repo Dependencies section. Note which other repos this change may touch, what changes there, and any required deploy order (feeds Section 7 ofproposal.mdand Section 0 ofimplementation-plan.md).
- Docs location & shape: Find where flow/entity/business-rule documentation lives (grep for
- REQUIRED OUTPUT: Internal discovery findings used to populate subsequent steps with real paths and commands.
- DO NOT:
- Do NOT guess file paths, test commands (
npm test,./gradlew), or module layouts without checking the repo. - Do NOT skip
templates/proposal.mdin Step 2 unless the user explicitly instructs you to use a different template file.
- Do NOT guess file paths, test commands (
- PASS CONDITION: All 5 repository dimensions above are verified from real files.
STEP_00B — Triage Ceremony Tier
- INPUT: User request and STEP_00 findings.
- ACTION: Evaluate the 4 triage criteria:
- Does it need more than one PR?
- Does it touch an invariant, a data migration, or another repository?
- Are there open business questions?
- Will it be paused and resumed later?
| Tier | Trigger Condition | Mandatory Execution Path |
| Light | All 4 answers are strictly "no" (a single behaviour tweak such as a threshold, validation, or window length) AND the user confirms Light tier | Do not create a proposal folder. Run STEP_01.10 (boundary-values check) for any new or reused input and put the result in a short PR change note, implement test-first, and edit the affected flow/entity/BR doc in the same PR (updating its Enforced by / Verified by rows). Stop after verification. |
| Standard (Default) | One PR-sized slice, with a design choice, invariant, or migration | Execute STEP_01 $\rightarrow$ STEP_02 (Proposal with a single slice S1), stop at HARD GATE 1, then STEP_03 $\rightarrow$ STEP_06. No separate feature specs. |
| Full | Several slices, several repos, or a long pause expected | Execute STEP_01 $\rightarrow$ STEP_06 in full, including feature specs (/create-features) saved inside docs/product/working-on/active/[change-name]/features/ for active slices. |
- REQUIRED OUTPUT: Explicit statement of which Tier applies and why.
- DO NOT:
- Do NOT silently self-select Light tier to avoid writing
proposal.md. If any criterion is "yes" or uncertain, you MUST use Standard or Full tier. - Even in Light tier, you MUST NOT skip STEP_01.10 (boundary-values check).
- Do NOT silently self-select Light tier to avoid writing
- PASS CONDITION: Tier is explicitly determined; if Standard or Full, proceed immediately to
STEP_01.
STEP_01 — Ground the Change in Reality Before Writing Anything
- INPUT: Target change description and STEP_00 discovery results.
- ACTION: Perform all 10 grounding checks using file-reading and search tools:
- Read root flow/documentation index: Identify every flow this change affects.
- Read affected derived docs: Read the affected flow doc(s), entity doc(s), domain-service doc(s) (
bounded-contexts/{ctx}/domain-services/— check every service whose behaviour the change touches), and business rule doc(s). - Verify against real source code (Code is Truth): Grep and read the actual source files the docs point to. Docs can be stale; report the actual current logic in code, not just what the doc claims.
- Trace every derived doc back to its upstream source for staleness: Read every upstream doc (journeys, personas, brainstorming/feature-scoping docs) that a derived doc links back to and check line-by-line whether it states the pre-change behaviour as present-tense fact. Classify each upstream doc into one of two buckets:
- Bucket A — Living upstream doc stating current behaviour as present-tense fact (e.g. a journey's step-by-step table) $\rightarrow$ goes stale; must be listed in
proposal.mdSection 8.2 for editing. - Bucket B — Frozen historical record of a past decision (e.g. a workshop/brainstorming artifact scoping the original feature) $\rightarrow$ do NOT rewrite; list it in
proposal.mdSection 8.2 as "Do not rewrite — frozen record", and plan a dated History & Evolution forward-link in the derived doc (Section 8.1).
- Bucket A — Living upstream doc stating current behaviour as present-tense fact (e.g. a journey's step-by-step table) $\rightarrow$ goes stale; must be listed in
- Identify affected personas & feature reversals: Note who is affected (personas) and whether this reverses or extends an already-scoped feature (feeds Section 1 and Section 8).
- Perform Concurrency, TOCTOU, Idempotency & Active Invariant Cross-Check:
- Search
docs/product/bounded-contexts/**/invariants/INV-*.mdanddocs/product/discovered/invariants/INV-RAW-*.mdacross all bounded contexts for any invariant constraining the operations being modified, extended, or newly called. - Verify whether the change preserves enforcement or introduces an unconstrained code path. List every relevant
INV-*in the proposal's scope and implementation plan. - Evaluate race conditions, check-then-act vulnerabilities, duplicate replay side-effects, database unique indexes, optimistic locking versioning, aggregate consistency boundaries, transactional outbox atomicity, and transaction isolation.
- Search
- Evaluate Migration & Backward Compatibility: Determine if modifying data schemas, contracts, or business rules requires DB column defaults, data backfill scripts, or API contract versioning / staged parallel-change deprecation.
- Read the rule/invariant document's own Traceability section before grepping: Follow ../guidelines/traceability.md. Start from the rule doc's
Traceability/Enforced by/Verified bytable (the pre-computed blast radius), then grep the rule ID across the codebase to catch unlinked enforcement. Respect row statuses strictly:✅ Verified: confirmed guard in code.⚠️ Unverified: lead that you must open the file to confirm or reject in the proposal.⏳ Planned: does not exist yet.- Never promote a status silently.
- Verify the existing tests: For each
Verified bytest, confirm the file and test title still exist (grep -n "<title>" <test-file>). These are the tests that will fail when a guard is altered and must be listed in Section 6 (Scope of Change). - Boundary-values check for every new or reused input: For each new parameter, flag, config value, or field added, and each existing one fed from a new source:
- List every place it is consumed through the full call chain (watch for hidden coupling where one value is reused for two calculations, e.g. a date used both as "has started" and as the start of a counting window).
- Test values on both sides of every boundary: past / present / future, same / next period (month, year), empty / one / many, and mixed states in a single call (some records started, some not; some at limit, some not).
- Ask what a caller gains by passing an unusual value (can it bypass a limit, permission, or uniqueness rule?).
- Record findings in
proposal.mdSection 4 (or in the change note for Light tier). Every risky boundary value becomes a required test.
- REQUIRED OUTPUT: Complete evidence set of real file paths, method names, upstream docs, invariants, test titles, and boundary cases.
- DO NOT:
- Do NOT trust markdown documentation without reading the underlying source code files.
- Do NOT declare a side effect "intended" before completing check
10(boundary-values check).
- PASS CONDITION: Every affected doc, source file, test file, and cross-context invariant has been read and verified.
STEP_02 — Write the Proposal (OUTPUT CONTRACT)
- INPUT: Grounded findings from
STEP_00andSTEP_01, plus the exact contents oftemplates/proposal.md. - ACTION:
- MANDATORY TOOL CALL: Read
templates/proposal.md(located in this skill'stemplates/folder) usingread_file. - Write the proposal file to:
docs/product/working-on/active/[change-name]/proposal.md(Use a kebab-case[change-name]slug matching the git branch name where possible. Never write directly inworking-on/root orgrace-period/.) - If the proposal's Migration & Backward Compatibility table (
Section 4.1) marks a contract as Deprecation with a staged rollout where old and new versions coexist, also readtemplates/parallel-change-plan.mdand copy the two Mermaid diagram skeletons from its Appendix (A. Before and afterandB. Old and new surfaces coexisting) to the top ofSection 3 (Desired Behaviour)inproposal.md.
- MANDATORY TOOL CALL: Read
OUTPUT CONTRACT for proposal.md
Your generated proposal.md MUST conform strictly to templates/proposal.md:
- Required Header Metadata:
* **Status:**,* **Shipped Date:**,* **Last checked against code:**(with date + git commit SHA),* **Branch:**,* **Bounded Context:**,* **Affects:**. - Required Section Structure (Exact Order & Headings — Do Not Rename or Reorder):
## 1. Product Rationale**As a:**/**I want to:**/**So that:**(always 3 bullets, never a table)### Personas Affected(table:Persona | Current Experience | Experience After This Change)### Business Value & Why It Matters(table:Aspect | Detail)### Known Gaps Introduced(bullets; omit this H3 subsection only if there are zero gaps)
## 2. Current Behaviour(table:Step | Method / Component | Behaviourciting real classes/methods + link to enforced BR/INV doc and feature-flag check)## 3. Desired Behaviour(table:Aspect | Today | After This Change; preceded by the two Appendix Mermaid diagrams if Parallel Change applies)## 4. 🛡️ Concurrency, TOCTOU & Invariant Integrity Analysis(table:Concurrency / Invariant Scenario (TOCTOU) | Potential Risk in Modified Flow | Guard / Mitigation Strategy | Enforcement Mechanism+ boundary-value findings fromSTEP_01.10)### 4.1 Migration & Backward Compatibility Assessment(table:Dimension | Risk / Impact | Mitigation / Strategy)
## 5. Why(table:Driver | Detail)## 6. Scope of Change(table:File | In/Out | Change— every real source file, test file, undecided dependency, and feature flag)## 7. Cross-Repo Dependencies(table:# | Repo | Role in this change | Deploy first?+ deploy order note; remove this section only for single-repo changes)## 8. Impact on Existing Documentation### 8.1 Derived Bounded-Context / Flow Docs(table:Doc (destination) | Draft | Slice | Change)### 8.2 Upstream Product Docs(table:Doc | Stale Content | Change— explicitly separating living upstream docs to edit vs. frozen historical docs left untouched)
## 9. Delivery Slices(table:Slice | Features / Scope | Blocked by (Open Question #) | Detail | Status | Shipped | Ticket / PR)## 10. Open Questions(table:# | Question | Blocks slice)## 🔗 Related Documentation(relative links to journeys, flows, BRs, entities)
Multi-Slice & Draft Rules (Section 8 & Section 9)
- Single-pass changes: Keep one row (
S1) in Section 9. - Multi-slice or parked changes: Group scope into independently shippable slices (
S1,S2, ...) and tag each Open Question in Section 10 with the slice it blocks. - Plan light, detail just in time: Set each slice's
Detailcolumn in Section 9 toOutline$\rightarrow$Specified(detailed spec infeatures/) $\rightarrow$In progress$\rightarrow$Shipped(orDiscarded / Superseded). Only specify the slice about to start. - Not-yet-implemented docs live in
working-on/active/<change>/drafts/, NEVER in living docs:working-on/active/<change>/ ├── proposal.md roadmap: slices, decisions, blockers, ticket keys ├── features/ detailed specs (specified slices only) ├── drafts/ planned text of living docs (+ README mapping draft → destination/slice) └── implementation-plan-sN.md written when slice N starts (or implementation-plan.md for single-slice)- While parked (
⏸ Parked) or in progress, do not edit living docs (except a single pointer row in a domain-service doc's Part A4 Pending Changes table). - Once a slice is
In progress, freeze its spec and record changes only via a dated amendment line inproposal.md.
- While parked (
- DO NOT:
- Do NOT leave
[EntityName]or[RealClassOrModule.method()]placeholders in the deliveredproposal.md. - Do NOT resolve Open Questions in Section 10 on the user's behalf.
- Do NOT proceed to
STEP_03(Implementation Plan) orSTEP_04(Code) in the same turn asSTEP_02.
- Do NOT leave
- PASS CONDITION (🛑 HARD GATE 1):
proposal.mdis written to disk, passes the Gate 1 Validation Checklist at the bottom of this skill, and you STOP your turn to ask the user to reviewproposal.mdand resolve Section 10 Open Questions.
STEP_02B — Resume a Parked or Partially Shipped Proposal
Run this step whenever proposal.md already exists in working-on/active/[change-name]/ and the user asks to continue work on it.
- INPUT: Existing
proposal.mdand current gitHEAD. - ACTION:
- Read Section 9 (Delivery Slices) and Section 10 (Open Questions). Identify the next
📋 Plannedslice whose blocking questions are all resolved. If any blocking question is still open, STOP and ask the user. - Ask "is this slice still wanted?" before investing in detail. If no longer wanted, execute
STEP_05B(Discard). If wanted and currently atOutlinedetail in a Full-tier change, generate its detailed spec infeatures/(/create-features) before continuing. - Re-ground against current code: Compare the
"Last checked against code"commit SHA inproposal.mdwithHEAD(git log <commit>..HEAD -- <files in Section 6>), re-read the real files in Section 6, and re-runSTEP_01.6(invariant cross-check). - Report any code drift to the user and update
proposal.md/ slice specs where affected. Update"Last checked against code"with today's date andHEADcommit SHA, and set Status to🔄 In Progress.
- Read Section 9 (Delivery Slices) and Section 10 (Open Questions). Identify the next
- PASS CONDITION: Target slice is unblocked, re-grounded against
HEAD, and ready forSTEP_03.
STEP_03 — Write the Implementation Plan (OUTPUT CONTRACT)
Execute only after the user has approved proposal.md and resolved all Open Questions blocking the target slice. Plan one slice at a time.
- INPUT: Approved
proposal.md(with resolved Open Questions) and the plan template intemplates/. - ACTION:
- Select & Read Template (
MANDATORY TOOL CALL):- Standard Inside-Out Change: Call
read_fileontemplates/implementation-plan.md. - Parallel Change Variant: If
proposal.mdSection 4.1 marks a contract as Deprecation with staged coexistence (old and new versions live side-by-side while consumers migrate), callread_fileontemplates/parallel-change-plan.mdinstead.
- Standard Inside-Out Change: Call
- Write the plan alongside
proposal.md:- Single-slice:
docs/product/working-on/active/[change-name]/implementation-plan.md - Multi-slice (slice
N):docs/product/working-on/active/[change-name]/implementation-plan-sN.md
- Single-slice:
- Select & Read Template (
OUTPUT CONTRACT for implementation-plan.md / parallel-change-plan.md
- Preserve all template headings and sections in exact order:
- Header Metadata (
Status,Proposallink) +### Resolved Open Questionstable (# | Question | Resolution) ## 0. Cross-Repo Dependencies(carried forward verbatim fromproposal.mdSection 7; external repo phases precede this repo's phases when deploy order requires it)## 1. Pre-Implementation Checklist## 2. Phases:- If Standard (
templates/implementation-plan.md): Derive phases directly fromproposal.mdSection 6 (Scope of Change), ordered inside-out matching this codebase's actual layering discovered inSTEP_00. Each phase is test-first (or matches repo test convention), implements the change, and removes dead code. Include dedicated integration/acceptance test tasks for concurrency/TOCTOU, idempotency replays, migration compatibility, and invariant guards. - If Parallel Change (
templates/parallel-change-plan.md): Keep the Mermaid lifecycle gates diagram at the top of## 2. Phasesand structure phases strictly as Phase 1: Expand (baseline metrics on old surface first + dark new surface) $\rightarrow$ Phase 2: Migrate (consumers one at a time + deprecation signals) $\rightarrow$ Phase 3: Contract (remove old routes, code, flags).
- If Standard (
## 3. Validation(populated with this repo's real unit, integration, architecture, and lint commands fromSTEP_00)## 4. Documentation Update(table mapping every doc fromproposal.mdSection 8 for the active slice to its update mechanism)## 5. Rollout Notes(for Parallel Change, include the mandatory### Flags,### Per-consumer migration table,### How to confirm the rollout worked, and### Risks to watchtables)## 🔗 Related Documentation
- Header Metadata (
- DO NOT:
- Do NOT invent generic architecture layers (e.g. CQRS/Hexagonal) if
STEP_00showed a different codebase structure. - Do NOT start modifying production or test code in the same turn that you generate the implementation plan.
- Do NOT invent generic architecture layers (e.g. CQRS/Hexagonal) if
- PASS CONDITION (🛑 HARD GATE 2): The implementation plan is written to disk, verified against the Gate 2 Validation Checklist, and presented to the user for approval before coding begins.
STEP_04 — Implement the Slice
Execute only after user approval at HARD GATE 2.
- INPUT: Approved
implementation-plan.md(orimplementation-plan-sN.md). - ACTION:
- Implement only the current slice's scope phase by phase, following the repo's documented conventions (
CLAUDE.md/AGENTS.md). - Check off (
[x]) tasks in the implementation plan as each phase completes. - After each phase, run the repo's full unit test suite and architecture test suite (found in
STEP_00), not only the test file you touched — signature changes break mocks in untouched test files. - Run the full integration/acceptance test suite and linter/typecheck before declaring implementation complete.
- Implement only the current slice's scope phase by phase, following the repo's documented conventions (
- DO NOT:
- Do NOT implement features belonging to future slices.
- Do NOT leave commented-out dead code or orphaned feature flags (unless in Phase 1/2 of a Parallel Change plan).
- PASS CONDITION: All phases for the active slice are checked off and the full unit, architecture, integration, and lint suites pass.
STEP_05 — Update the Original Living Docs In-Place (Post-Implementation)
Execute once STEP_04 is complete and verified for the active slice.
- INPUT: Shipped code for the slice,
proposal.mdSection 8, anddrafts/(if used). - ACTION:
- Scope strictly to the shipped slice: Only update Section 8 rows tagged with the slice that just shipped. Copy matching files from
drafts/into their living destination, fix relative links, verify against shipped code, and delete the consumed drafts. Leave docs for unshipped slices untouched. - Domain-service docs (
Part A4 Pending Changes): When a slice ships, copy its draft over the living domain-service doc, retainPart A4rows for slices not yet shipped, remove the shipped slice's row, flip⏳to✅only after verifying the code guard, and populateVerified bywith real test titles. - Update in place using the repo's convention: If the repo uses paired skills (
create-entity-lifecycle,create-flow-documentation), follow their exact structure on the existing file. Never create a duplicate file or new rule/invariant ID when replacing an existing rule's formula — keep the existing ID and add a dated entry in itsHistory & Evolution/ changelog section. - Update BOTH documentation layers from Section 8:
- 8.1 Derived Bounded-Context / Flow Docs AND
- 8.2 Living Upstream Docs (journeys/personas that stated the old behaviour as present-tense fact).
- Leave frozen historical brainstorming/scoping artifacts untouched.
- Close every traceability edge at both ends (../guidelines/traceability.md):
- For every link added or removed (rule $\leftrightarrow$ entity, flow, feature, journey, test), write both sides in the same commit and grep the rule ID across the docs tree to verify bidirectional links.
- Keep each rule doc's
Enforced bytable complete across layers (contract, application, domain, database, UI) with honest status (✅ Verifiedor⚠️ Unverified, never an unearned✅).
- Update the root flow/documentation index if any summary/status row changed.
- Mark the slice
✅ Shippedinproposal.mdSection 9 (with date and PR/ticket), updateproposal.mdStatus (🔄 Partially Shipped (slice N/M)if slices remain), and mark Section 4 of the implementation plan complete.
- Scope strictly to the shipped slice: Only update Section 8 rows tagged with the slice that just shipped. Copy matching files from
- PASS CONDITION: All living docs for the shipped slice match the code, all bidirectional traceability links are verified via grep, and no unshipped slice behaviour leaks into living docs.
STEP_05B — Discard or Supersede a Slice
Execute when a planned slice is dropped or replaced:
- In
proposal.mdSection 9, set the slice's Status to🗑 Discarded(orSuperseded by S#) with a one-line reason and date. Keep the table row as the decision record. - Delete its
features/specs anddrafts/files (and remove entries fromdrafts/README.md). - Remove its row from any domain-service doc's Pending Changes (Part A4) table.
- Drop Open Questions in Section 10 that only blocked the discarded slice.
- If all remaining slices are
ShippedorDiscarded, proceed toSTEP_06.
STEP_06 — Grace Period & Purge Lifecycle (working-on/)
Execute only after STEP_05 is complete for the last slice of the proposal. (While any slice remains 📋 Planned or 🔄 In Progress, keep the folder in working-on/active/.)
- Move to Grace Period: Move the change folder out of
active/to prevent LLM context bleeding across branches/worktrees:
Updatemv docs/product/working-on/active/[change-name] docs/product/working-on/grace-period/proposal.mdmetadata:* **Status:** 🚀 Implemented (Grace Period) * **Shipped Date:** YYYY-MM-DD - Mark Ready to Purge: Once verified stable in production, set
* **Status:** 🧹 Ready to Purge. - Safe Purge: Delete
docs/product/working-on/grace-period/[change-name]once no longer needed for hotfix reference.
<self_validation_gate> Before producing your final response at ANY turn, verify every applicable item below with concrete evidence (not just a checkmark). If any item for your current gate cannot be cited with real evidence from this turn, DO NOT end your turn — return to the failed step and fix the violation first:
Gate 1 Validation (End of Turn 1 — Proposal Phase)
STEP_00&STEP_00BEvidence: Discovered docs/source paths + selected Triage tier (Light/Standard/Full) with rationale:<paths, tier>STEP_01Grounding Evidence: List the exact source files (file:line),INV-*invariants across bounded contexts, and tests opened viaread_file:<files>- Template Read Evidence: Exact path passed to
read_file(templates/proposal.md):<path> - Output & Schema Evidence: Exact path written (
docs/product/working-on/active/[change-name]/proposal.md) with all sections1–10present (noting any"N/A — [rationale]"section):<path, 10/10 sections> - Halt Gate Evidence: Confirm 0
implementation-plan.mdfiles written and 0 production/test files modified in Turn 1:<0 code/plan edits>
Gate 2 Validation (End of Turn 2 — Implementation Plan Phase)
- Template Read Evidence: Exact path passed to
read_file(templates/implementation-plan.mdortemplates/parallel-change-plan.md):<path> - Output & Schema Evidence: Exact plan path written (
working-on/active/[change-name]/*-plan*.md) containingResolved Open Questionsand Sections0–5:<path, 0-5 sections> - Halt Gate Evidence: Confirm 0 production/test files modified before user approves the plan:
<0 code edits>
Gate 3 Validation (Post-Implementation & Living Docs Phase)
- Verification Suite Evidence: Exact test, arch, and lint commands executed and exit codes (
0):<commands> - Living Docs & Traceability Evidence: List the exact
bounded-contexts/files (8.1derived +8.2upstream) updated in place and verified viagrep:<paths></self_validation_gate>
📚 Bundled Resources & Related Skills
| Resource / Guideline | Purpose |
templates/proposal.md | Mandatory OUTPUT CONTRACT for STEP_02 modification proposals |
templates/implementation-plan.md | Mandatory OUTPUT CONTRACT for STEP_03 standard inside-out implementation plans |
templates/parallel-change-plan.md | Mandatory OUTPUT CONTRACT for STEP_03 staged Expand $\rightarrow$ Migrate $\rightarrow$ Contract migrations |
../guidelines/traceability.md | Binding traceability convention for STEP_01.8 and STEP_05.5 |
Version: 2.0 — Upgraded to a Level 3 Execution Protocol (explicit state machine, non-negotiable OUTPUT CONTRACT template locks, turn-termination gates, and mandatory self-audit checklists for reasoning models). 1.3 — added parallel change plan variant (templates/parallel-change-plan.md). 1.2 — added boundary-values check and full-suite run. 1.1 — generalized to be language- and framework-agnostic.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

