diff --git a/CHANGELOG.md b/CHANGELOG.md index bbaee09..2acb6ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to Guided Coding are documented here. ## [Unreleased] +- Let the implement skills check a plan's premises against the code before implementing it, and bound workarounds for wrong plan decisions by a closed list of conditions: evidence shows the error, the Rationale and all other decisions stay unchanged, no public API, scope, or dependency changes beyond the plan, and no weakened or removed tests. Otherwise, `guided-coding-implement` stops the dependent work and reports the problem, and the Guided Learning skills ask the user. Acceptance Criteria met only through a workaround stay unticked for the reviewer. - Keep Plan Deviations documents editable until they are merged into the target branch instead of freezing them once committed, so that Follow-Up Plans from PR/MR reviews can still be recorded. `guided-coding-write-deviations` now rewrites the work item's existing document under a fresh timestamp, keeping one document per work item that sorts after all of its plans. Run `guided-coding-setup` to bring `ai-plans/AGENTS.md` up to date. - Add `guided-coding-plan-and-review`, which writes a plan and refines it through independent reviewers in bounded rounds. Reviewers run `guided-coding-review-plan` in fresh contexts; the planner addresses every finding but never changes a decision the user made explicitly, and reports every finding with its resolution. - Let models invoke `guided-coding-write-plan` and `guided-coding-review-plan`, so other Guided Coding skills can use them. Their descriptions limit them to explicit requests by the user or by another Guided Coding skill. diff --git a/claude-plugin/claude-skills/implement-coach-me/SKILL.md b/claude-plugin/claude-skills/implement-coach-me/SKILL.md index 27cde9d..2fac520 100644 --- a/claude-plugin/claude-skills/implement-coach-me/SKILL.md +++ b/claude-plugin/claude-skills/implement-coach-me/SKILL.md @@ -9,7 +9,7 @@ disable-model-invocation: true Your goal is to teach the user how to implement a Guided Coding Frozen Plan by letting them solve one milestone at a time. This skill is intended for the Advancing stage: describe each milestone, let the user implement it as a whole, review their work, and help them whenever they get stuck. -The user makes every change to the repository: they write the code, run the feedback loops, tick Acceptance Criteria, and commit. +The user makes every lasting change to the repository: they write the code, run the feedback loops, tick Acceptance Criteria, and commit. ## 1. Establish the Target @@ -27,17 +27,19 @@ It holds the user's **Preferences** for how to be taught, such as the language t - **Advancing**: fluent in the fundamentals and able to adapt them to new problems. Does not question the fundamentals. - **Mastering**: able to adapt and transform concepts quickly, and to question or replace the fundamentals themselves. -Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins; technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. +Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins, technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. If you created the profile in this session, ask the user how they like to be taught before you create the roadmap. Otherwise, restate the preferences in one line when you present the roadmap, so that the user can object. ## 3. Create the Milestone Roadmap +Before you create the roadmap, check the plan against the code. Check the plan's premises: the types, members, and files it describes as existing exist, and the current behavior it describes is what the code does. What the plan asks to add is not a missing premise. Create throwaway probes (throwaway tests or throwaway projects) when reading the code is not enough. A probe that only simulates the behavior does not confirm it. Remove all probes before you present the roadmap, since the user makes every lasting change to the repository. Handle what you find as described in section 7. + Present the milestones as a short roadmap without giving away their implementations. Build it from vertical slices: each milestone cuts through the layers the plan touches and delivers behavior that runs end-to-end. At the Advancing stage, the user knows the individual areas and practices fitting them together, and a slice exposes a wrong design decision in the first milestone rather than the last. Keep the first slice thin, just enough to connect the layers, and widen it in the following ones. Give each slice one area in focus, ideally the one the user is least practiced in, so that you can tell what the milestone taught. If the plan does not split into slices, or the preferences ask for something else, choose another split that keeps one area in focus per milestone. -Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. The user writes the milestone's tests as part of it, since they prove it works; add manual tests where needed, for example, for UI changes. A single milestone is fine if the plan is small enough. +Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. The user writes the milestone's tests as part of it, since they prove it works. Add manual tests where needed, for example, for UI changes. A single milestone is fine if the plan is small enough. ## 4. How to Work Through a Single Milestone @@ -51,7 +53,7 @@ Then explain how to run the feedback loops and manual tests, or go through the o ## 5. Reveal Help Progressively -Give the user room to solve the milestone independently, but do not let it turn into unproductive frustration. Answer questions about concepts and existing code directly, even when the answers help with the milestone. Toward the implementation itself, reveal one hint at a time: ask a focused question, restate an important invariant, point to similar code or documentation, teach the missing concept, name relevant APIs or types, describe how responsibilities interact, or give a precise implementation outline. Start at the level that fits the situation and the user's stage in the area, not mechanically with a question. The user can ask for more direct help at any time; after each hint, let them try again. +Give the user room to solve the milestone independently, but do not let it turn into unproductive frustration. Answer questions about concepts and existing code directly, even when the answers help with the milestone. Toward the implementation itself, reveal one hint at a time: ask a focused question, restate an important invariant, point to similar code or documentation, teach the missing concept, name relevant APIs or types, describe how responsibilities interact, or give a precise implementation outline. Start at the level that fits the situation and the user's stage in the area, not mechanically with a question. The user can ask for more direct help at any time. After each hint, let them try again. Provide code only when explanations and outlines are not enough, and then only the smallest fragment that resolves the immediate obstacle, with an explanation. Never hand over the milestone's complete implementation, a patch, or a series of fragments that amounts to one. The goal is productive struggle, not withholding information. @@ -70,14 +72,27 @@ Knowledge that would survive a switch to another technology stack belongs to a d - **Technologies**: `` → `` → ``, for example `.NET` → `EF Core` → `change tracking`. The ecosystem is the one whose package manager distributes the technology, so React belongs to `JavaScript`, which includes TypeScript. A technology outside any ecosystem, such as PostgreSQL, is a root itself. - **Disciplines**: `` → `` → ``, for example `Automated testing` → `Test doubles` → `fakes`. Roots are limited to Algorithms and data structures, Software design and architecture, Automated testing, Data modeling and persistence, Security, Concurrency and distributed systems, Performance, Delivery and operations, and User interface design. Ask the user before you add another one. -After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's; otherwise, list it in the parent's optional `covers`. +After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's. Otherwise, list it in the parent's optional `covers`. Move a stage only on what you observed. Promote at most one step per plan: to Advancing when the user carried a milestone in that area without being handed the implementation, to Mastering when they shaped the design or pushed back on the plan for a reason that held up. Correct a wrong node any distance. Change the node where you saw the evidence, and a parent only when your evidence covers all of it. ## 7. Handle Plan Issues -If a plan decision is wrong or an Acceptance Criterion cannot be met as written, work out a solution or workaround and teach it like any other part of the plan; if you cannot, report it to the user. Ideally, you catch this while creating the roadmap. You decide whether a problem that needs external input interrupts or aborts the Implementing Phase. In the Guiding Phase, the reviewer decides how to proceed with your findings. +A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. + +When a plan decision or a fact the plan states is wrong, or an Acceptance Criterion cannot be met as written, a workaround is allowed only when all of these hold: + +1. Evidence shows the error: a test, a probe, or a compiler error. +2. The plan's Rationale and every other decision of the plan stay unchanged. +3. No public API, scope, or dependency changes beyond what the plan already decided. +4. No test is weakened or removed. + +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. An Acceptance Criterion that is met only through a workaround stays unticked. In the Guiding Phase, the reviewer ticks it when they accept the workaround, or calls for a Follow-Up Plan when they do not. + +Otherwise, do not work around the problem. Tell the user what the plan says, what you observed and how, and the options you see. Ask the user how to proceed, and pause the affected work until they answer. ## 8. After the Last Milestone Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all Acceptance Criteria should be ticked. + +For the reviewer, list each workaround with the decision it departs from, the evidence, what was done instead, and the Acceptance Criteria left unticked because of it, and each problem that was not worked around with what the plan says, what you observed and how, and the options you saw. Reference a decision by the plan's file name and its Decision ID, such as ` D3`, when the plan has Decision IDs. Otherwise, name the plan's file name and section, and quote the decision. diff --git a/claude-plugin/claude-skills/implement-show-me/SKILL.md b/claude-plugin/claude-skills/implement-show-me/SKILL.md index c905f0e..7f7b921 100644 --- a/claude-plugin/claude-skills/implement-show-me/SKILL.md +++ b/claude-plugin/claude-skills/implement-show-me/SKILL.md @@ -7,9 +7,9 @@ disable-model-invocation: true # Show the User How to Implement a Frozen Plan -Your goal is to teach the user how to implement a Guided Coding Frozen Plan by splitting it into teachable milestones. For each milestone, you present and explain the code one fragment at a time; the user enters it, runs the feedback loops and manual tests, and asks about whatever is unclear. This skill is intended for the Beginning stage, so always present complete fragments: the user should not have to figure out any part of the implementation. +Your goal is to teach the user how to implement a Guided Coding Frozen Plan by splitting it into teachable milestones. For each milestone, you present and explain the code one fragment at a time. The user enters it, runs the feedback loops and manual tests, and asks about whatever is unclear. This skill is intended for the Beginning stage, so always present complete fragments: the user should not have to figure out any part of the implementation. -The user makes every change to the repository, including commits. Typing the code by hand is where much of the learning happens, so encourage it over copying and pasting. +The user makes every lasting change to the repository, including commits. Typing the code by hand is where much of the learning happens, so encourage it over copying and pasting. ## 1. Establish the Target @@ -27,17 +27,19 @@ It holds the user's **Preferences** for how to be taught, such as the language t - **Advancing**: fluent in the fundamentals and able to adapt them to new problems. Does not question the fundamentals. - **Mastering**: able to adapt and transform concepts quickly, and to question or replace the fundamentals themselves. -Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins; technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. +Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins, technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. If you created the profile in this session, ask the user how they like to be taught before you create the roadmap. Otherwise, restate the preferences in one line when you present the roadmap, so that the user can object. ## 3. Create the Milestone Roadmap +Before you create the roadmap, check the plan against the code. Check the plan's premises: the types, members, and files it describes as existing exist, and the current behavior it describes is what the code does. What the plan asks to add is not a missing premise. Create throwaway probes (throwaway tests or throwaway projects) when reading the code is not enough. A probe that only simulates the behavior does not confirm it. Remove all probes before you present the roadmap, since the user makes every lasting change to the repository. Handle what you find as described in section 6. + Present the milestones as a short roadmap without any code. Build it layer by layer, each milestone putting one area in focus and building on the previous ones. For a backend feature, this could be the domain model, then database access, a service, and finally the endpoint. Since nothing runs end-to-end before the last layer, explain in the roadmap how the layers will connect, and remind the user where the current layer sits whenever a milestone begins. If the plan has no layers, or the preferences ask for something else, choose another split that keeps one area in focus per milestone. -Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. Its tests are part of the code you present, since they prove the milestone works; add manual tests where needed, for example, for UI changes. A single milestone is fine if that teaches the plan best. +Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. Its tests are part of the code you present, since they prove the milestone works. Add manual tests where needed, for example, for UI changes. A single milestone is fine if that teaches the plan best. ## 4. How to Work Through a Single Milestone @@ -66,14 +68,27 @@ Knowledge that would survive a switch to another technology stack belongs to a d - **Technologies**: `` → `` → ``, for example `.NET` → `EF Core` → `change tracking`. The ecosystem is the one whose package manager distributes the technology, so React belongs to `JavaScript`, which includes TypeScript. A technology outside any ecosystem, such as PostgreSQL, is a root itself. - **Disciplines**: `` → `` → ``, for example `Automated testing` → `Test doubles` → `fakes`. Roots are limited to Algorithms and data structures, Software design and architecture, Automated testing, Data modeling and persistence, Security, Concurrency and distributed systems, Performance, Delivery and operations, and User interface design. Ask the user before you add another one. -After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's; otherwise, list it in the parent's optional `covers`. +After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's. Otherwise, list it in the parent's optional `covers`. Move a stage only on what you observed. Promote at most one step per plan: to Advancing when the user carried a milestone in that area without being handed the implementation, to Mastering when they shaped the design or pushed back on the plan for a reason that held up. Correct a wrong node any distance. This skill never moves a node above Beginning, because it hands over the implementation. Change the node where you saw the evidence, and a parent only when your evidence covers all of it. ## 6. Handle Plan Issues -If a plan decision is wrong or an Acceptance Criterion cannot be met as written, work out a solution or workaround and teach it like any other part of the plan; if you cannot, report it to the user. Ideally, you catch this while creating the roadmap. You decide whether a problem that needs external input interrupts or aborts the Implementing Phase. In the Guiding Phase, the reviewer decides how to proceed with your findings. +A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. + +When a plan decision or a fact the plan states is wrong, or an Acceptance Criterion cannot be met as written, a workaround is allowed only when all of these hold: + +1. Evidence shows the error: a test, a probe, or a compiler error. +2. The plan's Rationale and every other decision of the plan stay unchanged. +3. No public API, scope, or dependency changes beyond what the plan already decided. +4. No test is weakened or removed. + +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. An Acceptance Criterion that is met only through a workaround stays unticked. In the Guiding Phase, the reviewer ticks it when they accept the workaround, or calls for a Follow-Up Plan when they do not. + +Otherwise, do not work around the problem. Tell the user what the plan says, what you observed and how, and the options you see. Ask the user how to proceed, and pause the affected work until they answer. ## 7. After the Last Milestone Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all Acceptance Criteria should be ticked. + +For the reviewer, list each workaround with the decision it departs from, the evidence, what was done instead, and the Acceptance Criteria left unticked because of it, and each problem that was not worked around with what the plan says, what you observed and how, and the options you saw. Reference a decision by the plan's file name and its Decision ID, such as ` D3`, when the plan has Decision IDs. Otherwise, name the plan's file name and section, and quote the decision. diff --git a/claude-plugin/claude-skills/implement/SKILL.md b/claude-plugin/claude-skills/implement/SKILL.md index d06ee4b..3ab1631 100644 --- a/claude-plugin/claude-skills/implement/SKILL.md +++ b/claude-plugin/claude-skills/implement/SKILL.md @@ -15,18 +15,41 @@ Use the plan named by the user. If none is named, proceed only when there is exa Verify that the plan is frozen: its file name has a timestamp, and it has a `*Frozen at ...*` line below its title. If either marker is missing, explain that the Planning Phase is unfinished and stop. -## 2. Implement and Verify +## 2. Check the Plan Against the Code + +Before you write code, check the plan's premises: the types, members, and files it describes as existing exist, and the current behavior it describes is what the code does. What the plan asks you to add is not a missing premise. Create throwaway probes (throwaway tests or throwaway projects) when reading the code is not enough. A probe that only simulates the behavior does not confirm it. Remove all probes before you finish. + +## 3. Implement and Verify Implement the plan, use the feedback loops to verify your code changes. The only allowed plan edit is ticking an Acceptance Criterion from `- [ ]` to `- [x]`. Never check a criterion unless it is genuinely satisfied by a feedback loop. The reviewer would otherwise have to identify the gap later in the Guiding Phase, which is one of the hardest errors to spot. -## 3. Handle Plan Issues +## 4. Handle Plan Issues + +A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: proceed and mention it in your report. + +When a plan decision or a fact the plan states is wrong, or an Acceptance Criterion cannot be met as written, work around it only when all of these hold: + +1. Evidence shows the error: a test, a probe, or a compiler error. +2. The plan's Rationale and every other decision of the plan stay unchanged. +3. No public API, scope, or dependency changes beyond what the plan already decided. +4. No test is weakened or removed. + +An Acceptance Criterion that is met only through a workaround stays unticked. In the Guiding Phase, the reviewer ticks it when they accept the workaround, or calls for a Follow-Up Plan when they do not. + +Otherwise, do not work around the problem and do not ask the user mid-run. Stop the work that depends on the wrong decision or fact, finish the work that does not, and report the problem. That is totally fine: in the Guiding Phase, the reviewer decides how to proceed. + +## 5. Finish -If a plan decision is wrong or an Acceptance Criterion cannot be met as written, try to solve it or find a workaround, and report it. If a problem genuinely cannot be solved, that's totally fine - simply report it. +Report: -In the Guiding Phase, the reviewer can decide how to proceed with your findings. +- What was implemented, which feedback loops ran, and their results. +- Which Acceptance Criteria are checked, and which remain unchecked and why. +- Each workaround: the decision it departs from, the evidence, and what you did instead. +- Each problem you did not work around: what the plan says, what you observed and how, and the options you see. +- The discrepancies that changed nothing. -## 4. Finish +Reference a decision by the plan's file name and its Decision ID, such as ` D3`, when the plan has Decision IDs. Otherwise, name the plan's file name and section, and quote the decision. -Report what was implemented, which feedback loops ran and their results, which Acceptance Criteria are checked, and which remain unchecked and why. Do not create commits, open or update a pull request, publish anything, etc. - unless the user asked you to do so. +Do not create commits, open or update a pull request, publish anything, etc. - unless the user asked you to do so. diff --git a/claude-plugin/claude-skills/plan-and-review/SKILL.md b/claude-plugin/claude-skills/plan-and-review/SKILL.md index b04ed39..f0258c5 100644 --- a/claude-plugin/claude-skills/plan-and-review/SKILL.md +++ b/claude-plugin/claude-skills/plan-and-review/SKILL.md @@ -23,7 +23,7 @@ Model names are harness-specific. If a configured model is unavailable, run that ## 2. Get the Plan Draft -If the user named a plan draft, use it. Otherwise use an uncommitted draft in `ai-plans/` only if it clearly belongs to the work discussed in this conversation; ask the user when several could. Without a draft, invoke `guided-coding-write-plan` to write it, passing on a plan structure the user named. If you cannot invoke it, stop and tell the user to run `guided-coding-write-plan` first and then this skill. Never write the plan without that skill. +If the user named a plan draft, use it. Otherwise use an uncommitted draft in `ai-plans/` only if it clearly belongs to the work discussed in this conversation. Ask the user when several could. Without a draft, invoke `guided-coding-write-plan` to write it, passing on a plan structure the user named. If you cannot invoke it, stop and tell the user to run `guided-coding-write-plan` first and then this skill. Never write the plan without that skill. Record the plan's word count. @@ -35,9 +35,9 @@ A reviewer must not share this conversation: it runs as a subagent, thread, or s In each round, start a fresh reviewer for every configured reviewer and run them in parallel where the harness allows. Never reuse a reviewer from an earlier round. Give each reviewer: -- the instruction to invoke `guided-coding-review-plan` on the plan path, return its findings, and write nothing; -- the paths of the earlier documents for the same work; -- the finding classes below, asking it to classify every finding; +- the instruction to invoke `guided-coding-review-plan` on the plan path, return its findings, and write nothing. +- the paths of the earlier documents for the same work. +- the finding classes below, asking it to classify every finding. - from round 2 on, every earlier finding with its resolution. This is context, not a limit: the reviewer may report anything, but repeats a rejected finding only with a new argument. Never give a reviewer the planning conversation or your reasoning. @@ -64,11 +64,11 @@ Keep the reviewers' classes. Stop when a complete round reports no `blocking` or Report to the user: -- the plan path, the rounds run, and why the run stopped; -- the reviewers and the models actually used, including fallbacks; -- every finding with its round, class, a one-line summary, and its resolution: applied, rejected with the reason, or open for the user; -- a separate list of the decision and scope changes you applied, including those the user approved during a pause, so the user can confirm them without comparing versions; -- the plan's word count before and after review; +- the plan path, the rounds run, and why the run stopped. +- the reviewers and the models actually used, including fallbacks. +- every finding with its round, class, a one-line summary, and its resolution: applied, rejected with the reason, or open for the user. +- a separate list of the decision and scope changes you applied, including those the user approved during a pause, so the user can confirm them without comparing versions. +- the plan's word count before and after review. - whether the plan changed after the last review round. Those changes are unreviewed. Then stop. The user reviews the plan before it is frozen. diff --git a/claude-plugin/claude-skills/review-plan/SKILL.md b/claude-plugin/claude-skills/review-plan/SKILL.md index 3f354aa..2cb409e 100644 --- a/claude-plugin/claude-skills/review-plan/SKILL.md +++ b/claude-plugin/claude-skills/review-plan/SKILL.md @@ -7,7 +7,7 @@ disable-model-invocation: false # Review a Plan -Review the plan named by the user or by the invoking skill. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`; otherwise ask for its path. Report findings only; never edit the plan or any other file. +Review the plan named by the user or by the invoking skill. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`, otherwise ask for its path. Report findings only, never edit the plan or any other file. Read the plan, applicable repository instructions, the code it discusses, and every earlier document for the same issue, including legacy filenames. Verify assertions about existing types, members, files, APIs, and extension points. Do not reject files or types merely because the plan intends to create them. @@ -20,4 +20,4 @@ Amongst other things, check for: - **Omissions:** Judge relevant risks such as error handling, compatibility, migration, performance, security boundaries, and observability against the change at hand. - **History:** A follow-up plan explicitly identifies and explains any earlier decisions it supersedes. -Say explicitly when there are no findings. If the plan is already frozen (timestamp in its file name and a `*Frozen at ...*` line below its title), note that it can no longer be edited; changes are decided in the Guiding Phase and recorded in a Follow-Up Plan. +Say explicitly when there are no findings. If the plan is already frozen (timestamp in its file name and a `*Frozen at ...*` line below its title), note that it can no longer be edited. Changes are decided in the Guiding Phase and recorded in a Follow-Up Plan. diff --git a/claude-plugin/claude-skills/setup/SKILL.md b/claude-plugin/claude-skills/setup/SKILL.md index 72940a4..5a2c737 100644 --- a/claude-plugin/claude-skills/setup/SKILL.md +++ b/claude-plugin/claude-skills/setup/SKILL.md @@ -23,9 +23,9 @@ Read the root `AGENTS.md` and `ai-plans/AGENTS.md` if they exist, plus build man Identify the feedback loops and their exact commands. Look for: -- compilers, type checkers, static analyzers, and linters; -- automated tests, code coverage, and mutation testing tools; -- benchmarks; and +- compilers, type checkers, static analyzers, and linters +- automated tests, code coverage, and mutation testing tools +- benchmarks and - dependency, secret, container, and source-code security scans. Only select commands that are immediately executable in the repository. Do not list tools merely because they are common for the detected language. @@ -37,7 +37,7 @@ Create `AGENTS.md` in the repository root if it does not exist. Otherwise, make Ensure it contains: 1. `## Feedback Loops`: each command and what it verifies. Report to the user when no feedback loops could be found, and warn that `guided-coding-write-plan` refuses to write plans until at least one is listed. -2. `## Guided Coding`: a link to `ai-plans/AGENTS.md`, noting that it holds the file naming conventions and the rules for working with Frozen Plans. Do not restate those rules here; they live next to the plans they govern, and agents pick them up when they read the folder. +2. `## Guided Coding`: a link to `ai-plans/AGENTS.md`, noting that it holds the file naming conventions and the rules for working with Frozen Plans. Do not restate those rules here, they live next to the plans they govern, and agents pick them up when they read the folder. If both sections already exist and are current, leave the file alone. diff --git a/claude-plugin/claude-skills/write-deviations/SKILL.md b/claude-plugin/claude-skills/write-deviations/SKILL.md index c20a57c..d84b6e6 100644 --- a/claude-plugin/claude-skills/write-deviations/SKILL.md +++ b/claude-plugin/claude-skills/write-deviations/SKILL.md @@ -9,7 +9,7 @@ disable-model-invocation: true Your goal is to decide whether the completed implementation needs a Plan Deviations document and, if so, to write it into the `ai-plans/` folder at the repository root or update the existing one. After writing, report the document path and stop. -A Plan Deviations document summarizes how the completed implementation differs from the original plan. Reading the initial plan together with this document should be enough to understand the complete work. A work item has at most one Plan Deviations document. It stays editable until it is merged into the target branch, because reviews of the PR/MR can still lead to Follow-Up Plans; from then on, it is frozen. +A Plan Deviations document summarizes how the completed implementation differs from the original plan. Reading the initial plan together with this document should be enough to understand the complete work. A work item has at most one Plan Deviations document. It stays editable until it is merged into the target branch, because reviews of the PR/MR can still lead to Follow-Up Plans. From then on, it is frozen. ## 1. Inspect the Plans and the Implementation @@ -19,7 +19,7 @@ Determine the target branch and the implementation range. Use the PR/MR if there ## 2. Check for an Existing Plan Deviations Document -Look for an existing Plan Deviations document of the current ticket in `ai-plans/`. Its file name ends with `--plan-deviations.md` or `--plan-deviations.md`, using the same `` or `` as the Initial Plan. If you find more than one, report them and stop; the user decides which one to keep. +Look for an existing Plan Deviations document of the current ticket in `ai-plans/`. Its file name ends with `--plan-deviations.md` or `--plan-deviations.md`, using the same `` or `` as the Initial Plan. If you find more than one, report them and stop. The user decides which one to keep. If there is an existing document, check whether it is already merged into the target branch: @@ -38,7 +38,7 @@ Write a Plan Deviations document in either of these cases: - **Follow-Up Plans exist.** Summarize the changes from the first plan so that the first plan and this document explain the complete work. - **The implementation materially changes or rejects an explicit plan decision.** This applies to decisions about at least one Acceptance Criterion, a public contract or data model, an architectural or component boundary, a security or performance constraint, or another design decision future maintainers need to know about. -Routine choices the plans left open are not deviations. An Acceptance Criterion that is documented but not met remains incomplete; it does not count as a deviation unless an accepted Follow-Up Plan explicitly supersedes it. +Routine choices the plans left open are not deviations. An Acceptance Criterion that is documented but not met remains incomplete. It does not count as a deviation unless an accepted Follow-Up Plan explicitly supersedes it. If there is only one plan and no material deviations, report that conclusion to the user, create nothing, and stop. If an existing, unmerged document is no longer needed, also report this, leave the document unchanged, and let the user decide whether to delete it. @@ -60,7 +60,7 @@ If a plan or another Plan Deviations document with this file name already exists ## 5. Write the Document -When you update an existing document, first move it to the new file name. Use `git mv ` if the old file is tracked by Git, so that Git can detect the rename; otherwise, rename the file. Then rewrite the whole document from the plans and the implementation you inspected in step 1. Do not append to the previous content, and do not mention earlier versions of the document. +When you update an existing document, first move it to the new file name. Use `git mv ` if the old file is tracked by Git, so that Git can detect the rename. Otherwise, rename the file. Then rewrite the whole document from the plans and the implementation you inspected in step 1. Do not append to the previous content, and do not mention earlier versions of the document. Structure the document as follows: diff --git a/claude-plugin/claude-skills/write-plan/SKILL.md b/claude-plugin/claude-skills/write-plan/SKILL.md index 7d679b1..b72230c 100644 --- a/claude-plugin/claude-skills/write-plan/SKILL.md +++ b/claude-plugin/claude-skills/write-plan/SKILL.md @@ -21,7 +21,7 @@ Use the first plan structure that applies: 2. A plan structure that `ai-plans/AGENTS.md` names in the same way or describes itself. 3. `assets/default-plan-structure.md` relative to this skill file. -A bare file name refers to a file in `assets/` relative to this skill file. Resolve other relative paths from the repository root. If the selected file does not exist, stop and report it; do not fall back. +A bare file name refers to a file in `assets/` relative to this skill file. Resolve other relative paths from the repository root. If the selected file does not exist, stop and report it, do not fall back. ## What Happens After Writing a Plan? diff --git a/skills/guided-coding-implement-coach-me/SKILL.md b/skills/guided-coding-implement-coach-me/SKILL.md index a3a7b69..90ae749 100644 --- a/skills/guided-coding-implement-coach-me/SKILL.md +++ b/skills/guided-coding-implement-coach-me/SKILL.md @@ -8,7 +8,7 @@ license: MIT Your goal is to teach the user how to implement a Guided Coding Frozen Plan by letting them solve one milestone at a time. This skill is intended for the Advancing stage: describe each milestone, let the user implement it as a whole, review their work, and help them whenever they get stuck. -The user makes every change to the repository: they write the code, run the feedback loops, tick Acceptance Criteria, and commit. +The user makes every lasting change to the repository: they write the code, run the feedback loops, tick Acceptance Criteria, and commit. ## 1. Establish the Target @@ -26,17 +26,19 @@ It holds the user's **Preferences** for how to be taught, such as the language t - **Advancing**: fluent in the fundamentals and able to adapt them to new problems. Does not question the fundamentals. - **Mastering**: able to adapt and transform concepts quickly, and to question or replace the fundamentals themselves. -Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins; technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. +Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins, technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. If you created the profile in this session, ask the user how they like to be taught before you create the roadmap. Otherwise, restate the preferences in one line when you present the roadmap, so that the user can object. ## 3. Create the Milestone Roadmap +Before you create the roadmap, check the plan against the code. Check the plan's premises: the types, members, and files it describes as existing exist, and the current behavior it describes is what the code does. What the plan asks to add is not a missing premise. Create throwaway probes (throwaway tests or throwaway projects) when reading the code is not enough. A probe that only simulates the behavior does not confirm it. Remove all probes before you present the roadmap, since the user makes every lasting change to the repository. Handle what you find as described in section 7. + Present the milestones as a short roadmap without giving away their implementations. Build it from vertical slices: each milestone cuts through the layers the plan touches and delivers behavior that runs end-to-end. At the Advancing stage, the user knows the individual areas and practices fitting them together, and a slice exposes a wrong design decision in the first milestone rather than the last. Keep the first slice thin, just enough to connect the layers, and widen it in the following ones. Give each slice one area in focus, ideally the one the user is least practiced in, so that you can tell what the milestone taught. If the plan does not split into slices, or the preferences ask for something else, choose another split that keeps one area in focus per milestone. -Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. The user writes the milestone's tests as part of it, since they prove it works; add manual tests where needed, for example, for UI changes. A single milestone is fine if the plan is small enough. +Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. The user writes the milestone's tests as part of it, since they prove it works. Add manual tests where needed, for example, for UI changes. A single milestone is fine if the plan is small enough. ## 4. How to Work Through a Single Milestone @@ -50,7 +52,7 @@ Then explain how to run the feedback loops and manual tests, or go through the o ## 5. Reveal Help Progressively -Give the user room to solve the milestone independently, but do not let it turn into unproductive frustration. Answer questions about concepts and existing code directly, even when the answers help with the milestone. Toward the implementation itself, reveal one hint at a time: ask a focused question, restate an important invariant, point to similar code or documentation, teach the missing concept, name relevant APIs or types, describe how responsibilities interact, or give a precise implementation outline. Start at the level that fits the situation and the user's stage in the area, not mechanically with a question. The user can ask for more direct help at any time; after each hint, let them try again. +Give the user room to solve the milestone independently, but do not let it turn into unproductive frustration. Answer questions about concepts and existing code directly, even when the answers help with the milestone. Toward the implementation itself, reveal one hint at a time: ask a focused question, restate an important invariant, point to similar code or documentation, teach the missing concept, name relevant APIs or types, describe how responsibilities interact, or give a precise implementation outline. Start at the level that fits the situation and the user's stage in the area, not mechanically with a question. The user can ask for more direct help at any time. After each hint, let them try again. Provide code only when explanations and outlines are not enough, and then only the smallest fragment that resolves the immediate obstacle, with an explanation. Never hand over the milestone's complete implementation, a patch, or a series of fragments that amounts to one. The goal is productive struggle, not withholding information. @@ -69,14 +71,27 @@ Knowledge that would survive a switch to another technology stack belongs to a d - **Technologies**: `` → `` → ``, for example `.NET` → `EF Core` → `change tracking`. The ecosystem is the one whose package manager distributes the technology, so React belongs to `JavaScript`, which includes TypeScript. A technology outside any ecosystem, such as PostgreSQL, is a root itself. - **Disciplines**: `` → `` → ``, for example `Automated testing` → `Test doubles` → `fakes`. Roots are limited to Algorithms and data structures, Software design and architecture, Automated testing, Data modeling and persistence, Security, Concurrency and distributed systems, Performance, Delivery and operations, and User interface design. Ask the user before you add another one. -After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's; otherwise, list it in the parent's optional `covers`. +After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's. Otherwise, list it in the parent's optional `covers`. Move a stage only on what you observed. Promote at most one step per plan: to Advancing when the user carried a milestone in that area without being handed the implementation, to Mastering when they shaped the design or pushed back on the plan for a reason that held up. Correct a wrong node any distance. Change the node where you saw the evidence, and a parent only when your evidence covers all of it. ## 7. Handle Plan Issues -If a plan decision is wrong or an Acceptance Criterion cannot be met as written, work out a solution or workaround and teach it like any other part of the plan; if you cannot, report it to the user. Ideally, you catch this while creating the roadmap. You decide whether a problem that needs external input interrupts or aborts the Implementing Phase. In the Guiding Phase, the reviewer decides how to proceed with your findings. +A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. + +When a plan decision or a fact the plan states is wrong, or an Acceptance Criterion cannot be met as written, a workaround is allowed only when all of these hold: + +1. Evidence shows the error: a test, a probe, or a compiler error. +2. The plan's Rationale and every other decision of the plan stay unchanged. +3. No public API, scope, or dependency changes beyond what the plan already decided. +4. No test is weakened or removed. + +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. An Acceptance Criterion that is met only through a workaround stays unticked. In the Guiding Phase, the reviewer ticks it when they accept the workaround, or calls for a Follow-Up Plan when they do not. + +Otherwise, do not work around the problem. Tell the user what the plan says, what you observed and how, and the options you see. Ask the user how to proceed, and pause the affected work until they answer. ## 8. After the Last Milestone Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all Acceptance Criteria should be ticked. + +For the reviewer, list each workaround with the decision it departs from, the evidence, what was done instead, and the Acceptance Criteria left unticked because of it, and each problem that was not worked around with what the plan says, what you observed and how, and the options you saw. Reference a decision by the plan's file name and its Decision ID, such as ` D3`, when the plan has Decision IDs. Otherwise, name the plan's file name and section, and quote the decision. diff --git a/skills/guided-coding-implement-show-me/SKILL.md b/skills/guided-coding-implement-show-me/SKILL.md index 7dde13a..fcde3e2 100644 --- a/skills/guided-coding-implement-show-me/SKILL.md +++ b/skills/guided-coding-implement-show-me/SKILL.md @@ -6,9 +6,9 @@ license: MIT # Show the User How to Implement a Frozen Plan -Your goal is to teach the user how to implement a Guided Coding Frozen Plan by splitting it into teachable milestones. For each milestone, you present and explain the code one fragment at a time; the user enters it, runs the feedback loops and manual tests, and asks about whatever is unclear. This skill is intended for the Beginning stage, so always present complete fragments: the user should not have to figure out any part of the implementation. +Your goal is to teach the user how to implement a Guided Coding Frozen Plan by splitting it into teachable milestones. For each milestone, you present and explain the code one fragment at a time. The user enters it, runs the feedback loops and manual tests, and asks about whatever is unclear. This skill is intended for the Beginning stage, so always present complete fragments: the user should not have to figure out any part of the implementation. -The user makes every change to the repository, including commits. Typing the code by hand is where much of the learning happens, so encourage it over copying and pasting. +The user makes every lasting change to the repository, including commits. Typing the code by hand is where much of the learning happens, so encourage it over copying and pasting. ## 1. Establish the Target @@ -26,17 +26,19 @@ It holds the user's **Preferences** for how to be taught, such as the language t - **Advancing**: fluent in the fundamentals and able to adapt them to new problems. Does not question the fundamentals. - **Mastering**: able to adapt and transform concepts quickly, and to question or replace the fundamentals themselves. -Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins; technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. +Teach the way the preferences ask. Let the stages of the areas the plan draws on decide how large you make the milestones, how much you explain, and how much help you offer at the start. The deepest node covering an area wins, technology and discipline nodes each apply to their own part of the work. Treat areas the profile does not cover as being at the stage this skill is intended for. What you observe always takes precedence over the profile. If you created the profile in this session, ask the user how they like to be taught before you create the roadmap. Otherwise, restate the preferences in one line when you present the roadmap, so that the user can object. ## 3. Create the Milestone Roadmap +Before you create the roadmap, check the plan against the code. Check the plan's premises: the types, members, and files it describes as existing exist, and the current behavior it describes is what the code does. What the plan asks to add is not a missing premise. Create throwaway probes (throwaway tests or throwaway projects) when reading the code is not enough. A probe that only simulates the behavior does not confirm it. Remove all probes before you present the roadmap, since the user makes every lasting change to the repository. Handle what you find as described in section 6. + Present the milestones as a short roadmap without any code. Build it layer by layer, each milestone putting one area in focus and building on the previous ones. For a backend feature, this could be the domain model, then database access, a service, and finally the endpoint. Since nothing runs end-to-end before the last layer, explain in the roadmap how the layers will connect, and remind the user where the current layer sits whenever a milestone begins. If the plan has no layers, or the preferences ask for something else, choose another split that keeps one area in focus per milestone. -Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. Its tests are part of the code you present, since they prove the milestone works; add manual tests where needed, for example, for UI changes. A single milestone is fine if that teaches the plan best. +Each milestone leaves a compilable codebase whose feedback loops pass and that can be committed. Its tests are part of the code you present, since they prove the milestone works. Add manual tests where needed, for example, for UI changes. A single milestone is fine if that teaches the plan best. ## 4. How to Work Through a Single Milestone @@ -65,14 +67,27 @@ Knowledge that would survive a switch to another technology stack belongs to a d - **Technologies**: `` → `` → ``, for example `.NET` → `EF Core` → `change tracking`. The ecosystem is the one whose package manager distributes the technology, so React belongs to `JavaScript`, which includes TypeScript. A technology outside any ecosystem, such as PostgreSQL, is a root itself. - **Disciplines**: `` → `` → ``, for example `Automated testing` → `Test doubles` → `fakes`. Roots are limited to Algorithms and data structures, Software design and architecture, Automated testing, Data modeling and persistence, Security, Concurrency and distributed systems, Performance, Delivery and operations, and User interface design. Ask the user before you add another one. -After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's; otherwise, list it in the parent's optional `covers`. +After each milestone, add a node for every area it drew on that the profile does not cover yet. Reuse existing nodes, and name technologies the way their official documentation does. Add a child only when its stage differs from its parent's. Otherwise, list it in the parent's optional `covers`. Move a stage only on what you observed. Promote at most one step per plan: to Advancing when the user carried a milestone in that area without being handed the implementation, to Mastering when they shaped the design or pushed back on the plan for a reason that held up. Correct a wrong node any distance. This skill never moves a node above Beginning, because it hands over the implementation. Change the node where you saw the evidence, and a parent only when your evidence covers all of it. ## 6. Handle Plan Issues -If a plan decision is wrong or an Acceptance Criterion cannot be met as written, work out a solution or workaround and teach it like any other part of the plan; if you cannot, report it to the user. Ideally, you catch this while creating the roadmap. You decide whether a problem that needs external input interrupts or aborts the Implementing Phase. In the Guiding Phase, the reviewer decides how to proceed with your findings. +A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. + +When a plan decision or a fact the plan states is wrong, or an Acceptance Criterion cannot be met as written, a workaround is allowed only when all of these hold: + +1. Evidence shows the error: a test, a probe, or a compiler error. +2. The plan's Rationale and every other decision of the plan stay unchanged. +3. No public API, scope, or dependency changes beyond what the plan already decided. +4. No test is weakened or removed. + +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. An Acceptance Criterion that is met only through a workaround stays unticked. In the Guiding Phase, the reviewer ticks it when they accept the workaround, or calls for a Follow-Up Plan when they do not. + +Otherwise, do not work around the problem. Tell the user what the plan says, what you observed and how, and the options you see. Ask the user how to proceed, and pause the affected work until they answer. ## 7. After the Last Milestone Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all Acceptance Criteria should be ticked. + +For the reviewer, list each workaround with the decision it departs from, the evidence, what was done instead, and the Acceptance Criteria left unticked because of it, and each problem that was not worked around with what the plan says, what you observed and how, and the options you saw. Reference a decision by the plan's file name and its Decision ID, such as ` D3`, when the plan has Decision IDs. Otherwise, name the plan's file name and section, and quote the decision. diff --git a/skills/guided-coding-implement/SKILL.md b/skills/guided-coding-implement/SKILL.md index 2330b11..5c36d95 100644 --- a/skills/guided-coding-implement/SKILL.md +++ b/skills/guided-coding-implement/SKILL.md @@ -14,18 +14,41 @@ Use the plan named by the user. If none is named, proceed only when there is exa Verify that the plan is frozen: its file name has a timestamp, and it has a `*Frozen at ...*` line below its title. If either marker is missing, explain that the Planning Phase is unfinished and stop. -## 2. Implement and Verify +## 2. Check the Plan Against the Code + +Before you write code, check the plan's premises: the types, members, and files it describes as existing exist, and the current behavior it describes is what the code does. What the plan asks you to add is not a missing premise. Create throwaway probes (throwaway tests or throwaway projects) when reading the code is not enough. A probe that only simulates the behavior does not confirm it. Remove all probes before you finish. + +## 3. Implement and Verify Implement the plan, use the feedback loops to verify your code changes. The only allowed plan edit is ticking an Acceptance Criterion from `- [ ]` to `- [x]`. Never check a criterion unless it is genuinely satisfied by a feedback loop. The reviewer would otherwise have to identify the gap later in the Guiding Phase, which is one of the hardest errors to spot. -## 3. Handle Plan Issues +## 4. Handle Plan Issues + +A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: proceed and mention it in your report. + +When a plan decision or a fact the plan states is wrong, or an Acceptance Criterion cannot be met as written, work around it only when all of these hold: + +1. Evidence shows the error: a test, a probe, or a compiler error. +2. The plan's Rationale and every other decision of the plan stay unchanged. +3. No public API, scope, or dependency changes beyond what the plan already decided. +4. No test is weakened or removed. + +An Acceptance Criterion that is met only through a workaround stays unticked. In the Guiding Phase, the reviewer ticks it when they accept the workaround, or calls for a Follow-Up Plan when they do not. + +Otherwise, do not work around the problem and do not ask the user mid-run. Stop the work that depends on the wrong decision or fact, finish the work that does not, and report the problem. That is totally fine: in the Guiding Phase, the reviewer decides how to proceed. + +## 5. Finish -If a plan decision is wrong or an Acceptance Criterion cannot be met as written, try to solve it or find a workaround, and report it. If a problem genuinely cannot be solved, that's totally fine - simply report it. +Report: -In the Guiding Phase, the reviewer can decide how to proceed with your findings. +- What was implemented, which feedback loops ran, and their results. +- Which Acceptance Criteria are checked, and which remain unchecked and why. +- Each workaround: the decision it departs from, the evidence, and what you did instead. +- Each problem you did not work around: what the plan says, what you observed and how, and the options you see. +- The discrepancies that changed nothing. -## 4. Finish +Reference a decision by the plan's file name and its Decision ID, such as ` D3`, when the plan has Decision IDs. Otherwise, name the plan's file name and section, and quote the decision. -Report what was implemented, which feedback loops ran and their results, which Acceptance Criteria are checked, and which remain unchecked and why. Do not create commits, open or update a pull request, publish anything, etc. - unless the user asked you to do so. +Do not create commits, open or update a pull request, publish anything, etc. - unless the user asked you to do so. diff --git a/skills/guided-coding-plan-and-review/SKILL.md b/skills/guided-coding-plan-and-review/SKILL.md index a72c418..f3a7907 100644 --- a/skills/guided-coding-plan-and-review/SKILL.md +++ b/skills/guided-coding-plan-and-review/SKILL.md @@ -22,7 +22,7 @@ Model names are harness-specific. If a configured model is unavailable, run that ## 2. Get the Plan Draft -If the user named a plan draft, use it. Otherwise use an uncommitted draft in `ai-plans/` only if it clearly belongs to the work discussed in this conversation; ask the user when several could. Without a draft, invoke `guided-coding-write-plan` to write it, passing on a plan structure the user named. If you cannot invoke it, stop and tell the user to run `guided-coding-write-plan` first and then this skill. Never write the plan without that skill. +If the user named a plan draft, use it. Otherwise use an uncommitted draft in `ai-plans/` only if it clearly belongs to the work discussed in this conversation. Ask the user when several could. Without a draft, invoke `guided-coding-write-plan` to write it, passing on a plan structure the user named. If you cannot invoke it, stop and tell the user to run `guided-coding-write-plan` first and then this skill. Never write the plan without that skill. Record the plan's word count. @@ -34,9 +34,9 @@ A reviewer must not share this conversation: it runs as a subagent, thread, or s In each round, start a fresh reviewer for every configured reviewer and run them in parallel where the harness allows. Never reuse a reviewer from an earlier round. Give each reviewer: -- the instruction to invoke `guided-coding-review-plan` on the plan path, return its findings, and write nothing; -- the paths of the earlier documents for the same work; -- the finding classes below, asking it to classify every finding; +- the instruction to invoke `guided-coding-review-plan` on the plan path, return its findings, and write nothing. +- the paths of the earlier documents for the same work. +- the finding classes below, asking it to classify every finding. - from round 2 on, every earlier finding with its resolution. This is context, not a limit: the reviewer may report anything, but repeats a rejected finding only with a new argument. Never give a reviewer the planning conversation or your reasoning. @@ -63,11 +63,11 @@ Keep the reviewers' classes. Stop when a complete round reports no `blocking` or Report to the user: -- the plan path, the rounds run, and why the run stopped; -- the reviewers and the models actually used, including fallbacks; -- every finding with its round, class, a one-line summary, and its resolution: applied, rejected with the reason, or open for the user; -- a separate list of the decision and scope changes you applied, including those the user approved during a pause, so the user can confirm them without comparing versions; -- the plan's word count before and after review; +- the plan path, the rounds run, and why the run stopped. +- the reviewers and the models actually used, including fallbacks. +- every finding with its round, class, a one-line summary, and its resolution: applied, rejected with the reason, or open for the user. +- a separate list of the decision and scope changes you applied, including those the user approved during a pause, so the user can confirm them without comparing versions. +- the plan's word count before and after review. - whether the plan changed after the last review round. Those changes are unreviewed. Then stop. The user reviews the plan before it is frozen. diff --git a/skills/guided-coding-review-plan/SKILL.md b/skills/guided-coding-review-plan/SKILL.md index 36efb38..4efe6c5 100644 --- a/skills/guided-coding-review-plan/SKILL.md +++ b/skills/guided-coding-review-plan/SKILL.md @@ -6,7 +6,7 @@ license: MIT # Review a Plan -Review the plan named by the user or by the invoking skill. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`; otherwise ask for its path. Report findings only; never edit the plan or any other file. +Review the plan named by the user or by the invoking skill. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`, otherwise ask for its path. Report findings only, never edit the plan or any other file. Read the plan, applicable repository instructions, the code it discusses, and every earlier document for the same issue, including legacy filenames. Verify assertions about existing types, members, files, APIs, and extension points. Do not reject files or types merely because the plan intends to create them. @@ -19,4 +19,4 @@ Amongst other things, check for: - **Omissions:** Judge relevant risks such as error handling, compatibility, migration, performance, security boundaries, and observability against the change at hand. - **History:** A follow-up plan explicitly identifies and explains any earlier decisions it supersedes. -Say explicitly when there are no findings. If the plan is already frozen (timestamp in its file name and a `*Frozen at ...*` line below its title), note that it can no longer be edited; changes are decided in the Guiding Phase and recorded in a Follow-Up Plan. +Say explicitly when there are no findings. If the plan is already frozen (timestamp in its file name and a `*Frozen at ...*` line below its title), note that it can no longer be edited. Changes are decided in the Guiding Phase and recorded in a Follow-Up Plan. diff --git a/skills/guided-coding-setup/SKILL.md b/skills/guided-coding-setup/SKILL.md index d5a906c..a3177be 100644 --- a/skills/guided-coding-setup/SKILL.md +++ b/skills/guided-coding-setup/SKILL.md @@ -22,9 +22,9 @@ Read the root `AGENTS.md` and `ai-plans/AGENTS.md` if they exist, plus build man Identify the feedback loops and their exact commands. Look for: -- compilers, type checkers, static analyzers, and linters; -- automated tests, code coverage, and mutation testing tools; -- benchmarks; and +- compilers, type checkers, static analyzers, and linters +- automated tests, code coverage, and mutation testing tools +- benchmarks and - dependency, secret, container, and source-code security scans. Only select commands that are immediately executable in the repository. Do not list tools merely because they are common for the detected language. @@ -36,7 +36,7 @@ Create `AGENTS.md` in the repository root if it does not exist. Otherwise, make Ensure it contains: 1. `## Feedback Loops`: each command and what it verifies. Report to the user when no feedback loops could be found, and warn that `guided-coding-write-plan` refuses to write plans until at least one is listed. -2. `## Guided Coding`: a link to `ai-plans/AGENTS.md`, noting that it holds the file naming conventions and the rules for working with Frozen Plans. Do not restate those rules here; they live next to the plans they govern, and agents pick them up when they read the folder. +2. `## Guided Coding`: a link to `ai-plans/AGENTS.md`, noting that it holds the file naming conventions and the rules for working with Frozen Plans. Do not restate those rules here, they live next to the plans they govern, and agents pick them up when they read the folder. If both sections already exist and are current, leave the file alone. diff --git a/skills/guided-coding-write-deviations/SKILL.md b/skills/guided-coding-write-deviations/SKILL.md index 067c838..f409704 100644 --- a/skills/guided-coding-write-deviations/SKILL.md +++ b/skills/guided-coding-write-deviations/SKILL.md @@ -8,7 +8,7 @@ license: MIT Your goal is to decide whether the completed implementation needs a Plan Deviations document and, if so, to write it into the `ai-plans/` folder at the repository root or update the existing one. After writing, report the document path and stop. -A Plan Deviations document summarizes how the completed implementation differs from the original plan. Reading the initial plan together with this document should be enough to understand the complete work. A work item has at most one Plan Deviations document. It stays editable until it is merged into the target branch, because reviews of the PR/MR can still lead to Follow-Up Plans; from then on, it is frozen. +A Plan Deviations document summarizes how the completed implementation differs from the original plan. Reading the initial plan together with this document should be enough to understand the complete work. A work item has at most one Plan Deviations document. It stays editable until it is merged into the target branch, because reviews of the PR/MR can still lead to Follow-Up Plans. From then on, it is frozen. ## 1. Inspect the Plans and the Implementation @@ -18,7 +18,7 @@ Determine the target branch and the implementation range. Use the PR/MR if there ## 2. Check for an Existing Plan Deviations Document -Look for an existing Plan Deviations document of the current ticket in `ai-plans/`. Its file name ends with `--plan-deviations.md` or `--plan-deviations.md`, using the same `` or `` as the Initial Plan. If you find more than one, report them and stop; the user decides which one to keep. +Look for an existing Plan Deviations document of the current ticket in `ai-plans/`. Its file name ends with `--plan-deviations.md` or `--plan-deviations.md`, using the same `` or `` as the Initial Plan. If you find more than one, report them and stop. The user decides which one to keep. If there is an existing document, check whether it is already merged into the target branch: @@ -37,7 +37,7 @@ Write a Plan Deviations document in either of these cases: - **Follow-Up Plans exist.** Summarize the changes from the first plan so that the first plan and this document explain the complete work. - **The implementation materially changes or rejects an explicit plan decision.** This applies to decisions about at least one Acceptance Criterion, a public contract or data model, an architectural or component boundary, a security or performance constraint, or another design decision future maintainers need to know about. -Routine choices the plans left open are not deviations. An Acceptance Criterion that is documented but not met remains incomplete; it does not count as a deviation unless an accepted Follow-Up Plan explicitly supersedes it. +Routine choices the plans left open are not deviations. An Acceptance Criterion that is documented but not met remains incomplete. It does not count as a deviation unless an accepted Follow-Up Plan explicitly supersedes it. If there is only one plan and no material deviations, report that conclusion to the user, create nothing, and stop. If an existing, unmerged document is no longer needed, also report this, leave the document unchanged, and let the user decide whether to delete it. @@ -59,7 +59,7 @@ If a plan or another Plan Deviations document with this file name already exists ## 5. Write the Document -When you update an existing document, first move it to the new file name. Use `git mv ` if the old file is tracked by Git, so that Git can detect the rename; otherwise, rename the file. Then rewrite the whole document from the plans and the implementation you inspected in step 1. Do not append to the previous content, and do not mention earlier versions of the document. +When you update an existing document, first move it to the new file name. Use `git mv ` if the old file is tracked by Git, so that Git can detect the rename. Otherwise, rename the file. Then rewrite the whole document from the plans and the implementation you inspected in step 1. Do not append to the previous content, and do not mention earlier versions of the document. Structure the document as follows: diff --git a/skills/guided-coding-write-plan/SKILL.md b/skills/guided-coding-write-plan/SKILL.md index 1cfce28..98dac65 100644 --- a/skills/guided-coding-write-plan/SKILL.md +++ b/skills/guided-coding-write-plan/SKILL.md @@ -20,7 +20,7 @@ Use the first plan structure that applies: 2. A plan structure that `ai-plans/AGENTS.md` names in the same way or describes itself. 3. `assets/default-plan-structure.md` relative to this skill file. -A bare file name refers to a file in `assets/` relative to this skill file. Resolve other relative paths from the repository root. If the selected file does not exist, stop and report it; do not fall back. +A bare file name refers to a file in `assets/` relative to this skill file. Resolve other relative paths from the repository root. If the selected file does not exist, stop and report it, do not fall back. ## What Happens After Writing a Plan?