diff --git a/CHANGELOG.md b/CHANGELOG.md index 2acb6ed..991ebdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,28 @@ 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. +- Make the implementation skills verify a plan's assumptions against the code before implementing it. +- Allow workarounds for incorrect plan decisions or factual claims, or acceptance criteria that cannot be met as written. All of these conditions must be met: + + - Evidence confirms the error. + - The Rationale and all other decisions remain unchanged. + - No public API, scope, or dependency changes go beyond the plan. + - No tests are weakened or removed. + +- When a workaround is not allowed, `guided-coding-implement` stops the affected work and reports the problem. The Guided Learning skills ask the user how to proceed. Acceptance criteria met only through a workaround remain unchecked for the reviewer. +- Keep Plan Deviations documents editable until they are merged into the target branch, instead of freezing them once committed, so Follow-Up Plans from PR/MR reviews can still be recorded. When updating a document, `guided-coding-write-deviations` renames it with a new timestamp and rewrites its contents. Each work item keeps one document whose filename sorts after all its plans. Run `guided-coding-setup` to update `ai-plans/AGENTS.md`. +- Add `guided-coding-plan-and-review`, which writes a plan and improves it through independent reviews, up to a configured round limit. Reviewers run `guided-coding-review-plan` in fresh contexts. The planner addresses every finding, preserves the user's explicit decisions unless the user approves a change, and reports each 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. -- Add RDAT (Rationale, Decisions, Acceptance Criteria, Technical Details), an opt-in plan structure next to the default one: numbered Decisions summarize what a reviewer approves, and each section adds information instead of repeating earlier ones. +- Add RDAT (Rationale, Decisions, Acceptance Criteria, Technical Details) as an optional alternative to the default plan structure. Numbered Decisions summarize what a reviewer approves. Each section adds information instead of repeating earlier ones. - Let `guided-coding-write-plan` take a plan structure when invoked, either a path to a Markdown file or the name of a bundled structure such as `rdat-plan-structure.md`. `ai-plans/AGENTS.md` can name one the same way. +- Rewrite the skill instructions and plan templates in plain English. Split dense rules into shorter instructions and use consistent terms without changing the workflows. ## [2.0.0] - 2026-09-27 - Add UTC timestamps to plan and Plan Deviations filenames. -- Treat `ai-plans/` as an append-only, event-sourced decision record. -- Freeze plans when their Planning Phase ends, except for checking acceptance criteria. +- Use `ai-plans/` to keep a history of planning decisions that preserves frozen plans and records later decisions in new plans. +- Freeze plans when their Planning Phase ends, except for checking off acceptance criteria. - Require Plan Deviations documents for material departures from frozen plans. - Distribute Guided Coding as portable Agent Skills and an Agent Plugin. - Generate a Claude Code adapter with concise, manually invoked skill names. -- Add Guided Learning skills for Beginners and Advanced devs, track learning progress across sessions in a private, git-backed Guided Learning profile located at `$HOME/.guided-learning/profile.md`. +- Add Guided Learning skills for beginners and more experienced developers. Track learning progress across sessions in a private Git repository, with the profile at `$HOME/.guided-learning/profile.md`. diff --git a/claude-plugin/claude-skills/freeze-plan/SKILL.md b/claude-plugin/claude-skills/freeze-plan/SKILL.md index 7f7f6e7..9a377a7 100644 --- a/claude-plugin/claude-skills/freeze-plan/SKILL.md +++ b/claude-plugin/claude-skills/freeze-plan/SKILL.md @@ -7,13 +7,13 @@ disable-model-invocation: true # Freeze a Plan -Freezing a plan means providing a timestamp, both at the beginning of its file name and directly after its title. An optional `` is also inserted into the file name after the timestamp. +Freezing a plan means providing a timestamp, both at the beginning of its filename and directly after its title. An optional `` is also inserted into the filename after the timestamp. -The plan is then considered ready for implementation, only its acceptance criteria are allowed to be checked off by the implementer. +The plan is now ready for implementation. The only permitted edits are checking off acceptance criteria after verifying them. -The target plan should be already mentioned in the conversation, typically in the format `.md`. If not, first inspect the `ai-plans/` folder for a single plan Markdown file which is untracked or has changes. Otherwise, ask the user to provide the path to the plan file. +Use the plan named in the conversation, typically `.md`. If none is named, use a plan in `ai-plans/` only if exactly one Markdown plan is untracked or modified. Otherwise, ask the user for its path. -If the plan already carries a timestamp in its file name or a `*Frozen at ...*` line below its title, it is frozen. Report this to the user and stop. +If the plan already carries a timestamp in its filename or a `*Frozen at ...*` line below its title, it is frozen. Report this to the user and stop. ## 1. Determine the Timestamp @@ -24,7 +24,7 @@ The `` is UTC in the format `YYYY-MM-DD-HHMM`. Use these commands to ## 2. Determine an Optional Ticket ID -Plans are typically associated with a ``. This is the ID of a work item such as a GitHub issue or a Jira task. If you don't know it from the conversation yet, ask the user to provide it. Note that not each plan needs to be associated with a ``. +Plans are typically associated with a ``. This is the ID of a work item such as a GitHub issue or a Jira task. If you don't know it from the conversation yet, ask the user to provide it. A ticket ID is optional. ## 3. Change the Plan File Name @@ -35,4 +35,4 @@ If a file with this name already exists in `ai-plans/`, report the collision and ## 4. Stamp the Plan Content -Right beneath the `# Title`, insert the following line: `*Frozen at *`, where `` is an ISO 8601 timestamp of the existing `` used for the file, precise to the minute. E.g., the `` `2026-09-17-0231` for the file name becomes `2026-09-17T02:31Z`. +Directly below `# Title`, insert `*Frozen at *`, where `` is the filename's timestamp in ISO 8601 format, to the minute. For example, `2026-09-17-0231` becomes `2026-09-17T02:31Z`. diff --git a/claude-plugin/claude-skills/implement-coach-me/SKILL.md b/claude-plugin/claude-skills/implement-coach-me/SKILL.md index 2fac520..6c6c873 100644 --- a/claude-plugin/claude-skills/implement-coach-me/SKILL.md +++ b/claude-plugin/claude-skills/implement-coach-me/SKILL.md @@ -9,37 +9,41 @@ 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 lasting 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, check off acceptance criteria, and commit. ## 1. Establish the Target -Use the plan named by the user. If none is named, proceed only when there is exactly one plan in `ai-plans/` that has all its Acceptance Criteria unchecked, and it has the latest timestamp of all plans. Otherwise, ask for its path. +Use the plan named by the user. If none is named, proceed only if exactly one plan in `ai-plans/` has all acceptance criteria unchecked and that plan also has the latest timestamp. Otherwise, ask for its path. -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. +Verify that the plan is frozen: its filename 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. Read the Learning Profile -`~/.guided-learning/profile.md` is the memory of Guided Learning across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder already is a git repository, copy `assets/profile.md` relative to this skill file there, and commit it. +`~/.guided-learning/profile.md` stores the user's learning preferences and progress across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder is already a Git repository. Copy this skill's `assets/profile.md` into that folder and commit it. -It holds the user's **Preferences** for how to be taught, such as the language to speak or explanation before code, and their **Knowledge**: a tree of areas, each at one of three stages: +The profile holds the user's **Preferences**, such as the language to teach in and whether to explain concepts before showing code. It also records their **Knowledge** as a tree of areas, each at one of three stages: -- **Beginning**: new to a domain, needs to learn the fundamental concepts and mechanisms, mostly by copying information. Adaptation and transformation of these do not happen yet. +- **Beginning**: new to a domain. Learns fundamental concepts and mechanisms mainly by following examples and cannot yet adapt them independently. - **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. +Follow the user's teaching preferences. Use their stage in each relevant area to choose milestone size, explanation depth, and initial support. Use the most specific profile entry that covers the area. Technology and discipline entries each apply to their own part of the work. For areas the profile does not cover, use this skill's intended stage. Your observations take 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. +Before you create the roadmap, verify that the types, members, and files the plan describes as existing are present and that its claims about existing behavior match what the code currently does. Do not treat planned additions or behavior changes as missing prerequisites. + +If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. Remove these temporary tests or projects before presenting 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. +Make each milestone a small, end-to-end change across the relevant layers (a vertical slice). Keep the first slice just large enough to connect the layers, then expand it in later milestones. This lets the user practice connecting familiar areas and exposes design mistakes early. + +Focus each slice on one area, ideally the one the user has practiced least, so you can assess what they learned. If vertical slices do not suit the plan or the user's preferences, choose another split with one 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. +At the end of each milestone, the code must compile, pass the feedback loops, and be ready to commit. 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 @@ -49,11 +53,21 @@ While they work, answer questions about the codebase, language, framework, desig When the user signals completion, inspect what they actually changed. Explain what works and why, what does not yet satisfy the milestone or plan, and what to reconsider. Take valid solutions on their own terms, even when they differ from what you expected, and let the user revise until the milestone behaves as described. -Then explain how to run the feedback loops and manual tests, or go through the output the user brings. When something fails, let them read the error first and teach them how to extract what matters from it. Once you verified the milestone, let the user tick the Acceptance Criteria it fully satisfies, if any, and commit them together with the milestone. Then update the learning profile and move on. +Then explain how to run the feedback loops and manual tests, or go through the output the user brings. When something fails, let them read the error first and teach them how to extract what matters from it. Once you have verified that the milestone behaves as described, let the user check off any acceptance criteria it fully satisfies, from `- [ ]` to `- [x]`, and commit those updates with the milestone. Then update the learning profile and move on. ## 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. When helping with the implementation, give one hint at a time. Hints range from least to most direct: + +1. Ask a focused question. +2. Restate an important invariant. +3. Point to similar code or documentation. +4. Teach a missing concept. +5. Name relevant APIs or types. +6. Describe how responsibilities interact. +7. Give a precise implementation outline. + +Choose the starting level that fits the situation and the user's stage in the area. You do not have to start 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. @@ -61,38 +75,48 @@ Provide code only when explanations and outlines are not enough, and then only t Update the profile whenever something changed: when the user expresses a preference, after each milestone once the user committed it, and when the user stops early. Re-read the file right before you edit it, and commit to `main` using `git -C "$HOME/.guided-learning"` with a Conventional Commits message whose body states what you observed. Never create branches or push, and keep learning notes out of the repository you are working in. -Change preferences only as the user says. Write knowledge nodes as nested list items: +Change preferences only as the user says. Write knowledge entries as nested list items: ```markdown -- **** `` — covers , +- **** ``: covers , ``` -Knowledge that would survive a switch to another technology stack belongs to a discipline, anything else to a technology. Nest at most three levels: +Record knowledge that applies across technology stacks under a discipline. Record other knowledge under a technology. Nest at most three levels: - **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 an entry for every area it drew on that the profile does not cover yet. Reuse existing entries, and name technologies the way their official documentation does. Add a child entry 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. +Change a stage only when supported by your observations. Advance it by at most one stage per plan: + +- To Advancing when the user completed a milestone in that area without being given the implementation. +- To Mastering when they shaped the design or challenged the plan with a valid reason. + +When correcting an inaccurate stage, you may move the entry by more than one stage. Change the entry where you observed the evidence. Change a parent entry only when the evidence covers its whole area. ## 7. Handle Plan Issues -A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. +If a discrepancy does not affect the plan's decisions or intended behavior, such as a moved file or renamed private member, 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: +If the plan contains an incorrect decision or factual claim, or an acceptance criterion cannot be met as written, a workaround is allowed only when all of these conditions are met: -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. +1. Evidence from a test, temporary project, or compiler error confirms the error. +2. The plan's Rationale and all its other decisions remain unchanged. +3. The workaround makes no public API, scope, or dependency changes beyond those in the plan. 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. +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. Leave an acceptance criterion unchecked if it is met only through a workaround. During the Guiding Phase, the reviewer checks it off if they accept the workaround. If they reject it, they call for a Follow-Up Plan. -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. +If any of these four conditions is not met, 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. +Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all acceptance criteria should be checked off. + +In the summary, list for the reviewer: + +- Each workaround: the decision it departs from, the evidence, what was done instead, and the acceptance criteria left unchecked because of it. +- Each problem that was not worked around: what the plan says, what you observed and how, the options you considered, and what the user decided. -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. +Reference decisions by the plan's filename and Decision ID, such as ` D3`. If the plan has no Decision IDs, name its filename 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 7f7b921..bec6e3e 100644 --- a/claude-plugin/claude-skills/implement-show-me/SKILL.md +++ b/claude-plugin/claude-skills/implement-show-me/SKILL.md @@ -13,33 +13,35 @@ The user makes every lasting change to the repository, including commits. Typing ## 1. Establish the Target -Use the plan named by the user. If none is named, proceed only when there is exactly one plan in `ai-plans/` that has all its Acceptance Criteria unchecked, and it has the latest timestamp of all plans. Otherwise, ask for its path. +Use the plan named by the user. If none is named, proceed only if exactly one plan in `ai-plans/` has all acceptance criteria unchecked and that plan also has the latest timestamp. Otherwise, ask for its path. -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. +Verify that the plan is frozen: its filename 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. Read the Learning Profile -`~/.guided-learning/profile.md` is the memory of Guided Learning across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder already is a git repository, copy `assets/profile.md` relative to this skill file there, and commit it. +`~/.guided-learning/profile.md` stores the user's learning preferences and progress across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder is already a Git repository. Copy this skill's `assets/profile.md` into that folder and commit it. -It holds the user's **Preferences** for how to be taught, such as the language to speak or explanation before code, and their **Knowledge**: a tree of areas, each at one of three stages: +The profile holds the user's **Preferences**, such as the language to teach in and whether to explain concepts before showing code. It also records their **Knowledge** as a tree of areas, each at one of three stages: -- **Beginning**: new to a domain, needs to learn the fundamental concepts and mechanisms, mostly by copying information. Adaptation and transformation of these do not happen yet. +- **Beginning**: new to a domain. Learns fundamental concepts and mechanisms mainly by following examples and cannot yet adapt them independently. - **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. +Follow the user's teaching preferences. Use their stage in each relevant area to choose milestone size, explanation depth, and initial support. Use the most specific profile entry that covers the area. Technology and discipline entries each apply to their own part of the work. For areas the profile does not cover, use this skill's intended stage. Your observations take 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. +Before you create the roadmap, verify that the types, members, and files the plan describes as existing are present and that its claims about existing behavior match what the code currently does. Do not treat planned additions or behavior changes as missing prerequisites. + +If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. Remove these temporary tests or projects before presenting 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. +At the end of each milestone, the code must compile, pass the feedback loops, and be ready to commit. 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 @@ -51,44 +53,54 @@ When all fragments are in place, explain how to run the feedback loops or manual Answer questions about the code at any point. When something does not compile or a test fails, let the user read the error first, then point out what to focus on, for example, the information an exception carries. -Once the milestone behaves as described and you verified it, let the user tick the Acceptance Criteria it fully satisfies, if any, from `- [ ]` to `- [x]`, and commit them together with the milestone. Then update the learning profile and move on. +Once you have verified that the milestone behaves as described, let the user check off any acceptance criteria it fully satisfies, from `- [ ]` to `- [x]`, and commit those updates with the milestone. Then update the learning profile and move on. ## 5. Update the Learning Profile Update the profile whenever something changed: when the user expresses a preference, after each milestone once the user committed it, and when the user stops early. Re-read the file right before you edit it, and commit to `main` using `git -C "$HOME/.guided-learning"` with a Conventional Commits message whose body states what you observed. Never create branches or push, and keep learning notes out of the repository you are working in. -Change preferences only as the user says. Write knowledge nodes as nested list items: +Change preferences only as the user says. Write knowledge entries as nested list items: ```markdown -- **** `` — covers , +- **** ``: covers , ``` -Knowledge that would survive a switch to another technology stack belongs to a discipline, anything else to a technology. Nest at most three levels: +Record knowledge that applies across technology stacks under a discipline. Record other knowledge under a technology. Nest at most three levels: - **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 an entry for every area it drew on that the profile does not cover yet. Reuse existing entries, and name technologies the way their official documentation does. Add a child entry only when its stage differs from its parent's. Otherwise, list it in the parent's optional `covers`. + +Change a stage only when supported by your observations. Advance it by at most one stage per plan: + +- To Advancing when the user completed a milestone in that area without being given the implementation. +- To Mastering when they shaped the design or challenged the plan with a valid reason. -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. +When correcting an inaccurate stage, you may move the entry by more than one stage. This skill never moves an entry above Beginning, because it provides the implementation. Change the entry where you observed the evidence. Change a parent entry only when the evidence covers its whole area. ## 6. Handle Plan Issues -A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. +If a discrepancy does not affect the plan's decisions or intended behavior, such as a moved file or renamed private member, 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: +If the plan contains an incorrect decision or factual claim, or an acceptance criterion cannot be met as written, a workaround is allowed only when all of these conditions are met: -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. +1. Evidence from a test, temporary project, or compiler error confirms the error. +2. The plan's Rationale and all its other decisions remain unchanged. +3. The workaround makes no public API, scope, or dependency changes beyond those in the plan. 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. +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. Leave an acceptance criterion unchecked if it is met only through a workaround. During the Guiding Phase, the reviewer checks it off if they accept the workaround. If they reject it, they call for a Follow-Up Plan. -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. +If any of these four conditions is not met, 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. +Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all acceptance criteria should be checked off. + +In the summary, list for the reviewer: + +- Each workaround: the decision it departs from, the evidence, what was done instead, and the acceptance criteria left unchecked because of it. +- Each problem that was not worked around: what the plan says, what you observed and how, the options you considered, and what the user decided. -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. +Reference decisions by the plan's filename and Decision ID, such as ` D3`. If the plan has no Decision IDs, name its filename 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 3ab1631..a308cde 100644 --- a/claude-plugin/claude-skills/implement/SKILL.md +++ b/claude-plugin/claude-skills/implement/SKILL.md @@ -11,45 +11,47 @@ Your goal is to implement a Frozen Plan created in the Planning Phase of Guided ## 1. Establish the Target -Use the plan named by the user. If none is named, proceed only when there is exactly one plan in `ai-plans/` that has all its Acceptance Criteria unchecked, and it has the latest timestamp of all plans. Otherwise, ask for its path. +Use the plan named by the user. If none is named, proceed only if exactly one plan in `ai-plans/` has all acceptance criteria unchecked and that plan also has the latest timestamp. Otherwise, ask for its path. -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. +Verify that the plan is frozen: its filename 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. 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. +Before you write code, verify that the types, members, and files the plan describes as existing are present and that its claims about existing behavior match what the code currently does. Do not treat planned additions or behavior changes as missing prerequisites. + +If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. Remove these temporary tests or projects before you finish. ## 3. Implement and Verify -Implement the plan, use the feedback loops to verify your code changes. +Implement the plan and use the feedback loops to verify your 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. +The only permitted plan edit is checking off an acceptance criterion from `- [ ]` to `- [x]`. Do so only after a feedback loop verifies it. The reviewer would otherwise have to identify the gap later in the Guiding Phase, which is one of the hardest errors to spot. ## 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. +If a discrepancy does not affect the plan's decisions or intended behavior, such as a moved file or renamed private member, 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: +If the plan contains an incorrect decision or factual claim, or an acceptance criterion cannot be met as written, use a workaround only when all of these conditions are met: -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. +1. Evidence from a test, temporary project, or compiler error confirms the error. +2. The plan's Rationale and all its other decisions remain unchanged. +3. The workaround makes no public API, scope, or dependency changes beyond those in the plan. 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. +Leave an acceptance criterion unchecked if it is met only through a workaround. During the Guiding Phase, the reviewer checks it off if they accept the workaround. If they reject it, they call for a Follow-Up Plan. -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. +If any of these four conditions is not met, do not work around the problem and do not ask the user mid-run. Stop the work that depends on the incorrect decision, claim, or acceptance criterion, finish the work that does not, and report the problem. The reviewer decides how to proceed during the Guiding Phase. ## 5. Finish Report: - What was implemented, which feedback loops ran, and their results. -- Which Acceptance Criteria are checked, and which remain unchecked and why. +- 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. +- Any discrepancies that did not affect the plan's decisions or intended behavior. -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. +Reference decisions by the plan's filename and Decision ID, such as ` D3`. If the plan has no Decision IDs, name its filename and section, and quote the decision. -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, push, open or update pull requests, or publish anything unless the user requested those actions. diff --git a/claude-plugin/claude-skills/plan-and-review/SKILL.md b/claude-plugin/claude-skills/plan-and-review/SKILL.md index f0258c5..87696fe 100644 --- a/claude-plugin/claude-skills/plan-and-review/SKILL.md +++ b/claude-plugin/claude-skills/plan-and-review/SKILL.md @@ -1,29 +1,34 @@ --- name: plan-and-review -description: "Write a Guided Coding plan and refine it through independent reviewers in bounded rounds before presenting it to the user. Run only when explicitly requested by the user." +description: "Write a Guided Coding plan, improve it through independent reviews within a round limit, and present it to the user. Run only when explicitly requested by the user." license: "MIT" disable-model-invocation: true --- # Plan and Review -Your goal is to write a plan draft into `ai-plans/`, refine it through independent reviewers in rounds, report the result, and stop. You are the planner: you keep the planning conversation, the reviewers never see it. Never freeze the plan. +Write a plan draft in `ai-plans/`, improve it through independent review rounds, report the result, and stop. You are the planner. Only you have access to the planning conversation. Reviewers must not see it. Never freeze the plan. Harnesses may shorten or namespace skill names, e.g., `guided-coding:write-plan` in Claude Code. Use the name under which each skill is installed. ## 1. Read the Configuration -Read the `## Plan Review` section of `ai-plans/AGENTS.md` if it exists. Arguments given when invoking this skill override the corresponding configured values. Use the defaults for values that neither sets: +Read the `## Plan Review` section of `ai-plans/AGENTS.md` if it exists. Options supplied when invoking this skill override the configuration. Use these defaults for values absent from both the invocation options and the configuration: - **Reviewers:** one reviewer on the harness default model. The configuration can name several, each with a model preference. - **Round limit:** 3. -- **User decisions:** findings against a decision the user made explicitly in the conversation are never applied without the user. `collect`: continue, and report the finding as open for the user. `pause`: stop the round, ask the user, and continue with the answer. The default is `collect`. +- **User decisions:** do not change a decision the user explicitly made in the conversation without their approval. Use the policy set by the invocation options or configuration: + + - `collect` (default): continue and report the finding as open for the user. + - `pause`: stop the round, ask the user, and continue after they answer. Model names are harness-specific. If a configured model is unavailable, run that reviewer on the harness default and say so in the report. ## 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. If several drafts could match the current work, ask the user which one to use. + +Without a draft, invoke `guided-coding-write-plan` to write it, passing on any 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. @@ -48,17 +53,17 @@ The finding classes are: - `gap`: a missing scenario or fact. - `nit`: everything else. -A round is complete when every reviewer has returned its findings. Replace a reviewer that fails or times out once with a fresh one. If the replacement fails too, address the findings already returned, then report the incomplete round and stop. +A round is complete when every reviewer has returned its findings. If a reviewer fails or times out, start one replacement reviewer. If the replacement also fails or times out, do not retry. Address the findings already returned, then report the incomplete round and stop. Then address every finding of every class: - Handle a finding against a decision the user made explicitly as configured under **User decisions**. -- Apply every other finding or reject it with a one-line reason. You may change anything else in the plan, including decisions you made alone and the scope. +- Address every other finding by changing the plan or rejecting the finding with a one-line reason. You may change anything else in the plan, including decisions you made alone and the scope. - When findings contradict each other, apply at most one and reject the others with a reason. Treat findings that say the same thing as one, with the highest class among them. -- A fix corrects a decision, criterion, or fact. It adds only the explanation the plan structure requires for a changed decision, never review commentary, and never turns a `nit` into a new rule. +- When revising the plan, correct the decision, criterion, or fact and include only the explanation the plan structure requires for a changed decision. Keep review commentary out of the plan. Do not turn a `nit` into a new rule. - The plan keeps following the rules of `guided-coding-write-plan` and the plan structure it selected. -Keep the reviewers' classes. Stop when a complete round reports no `blocking` or `gap` findings, after addressing its `nit` findings, or when the round limit is reached. +Keep the reviewers' classifications. After addressing all findings, stop if the completed round reported no `blocking` or `gap` findings. Otherwise, start another round unless the round limit has been reached. ## 5. Report diff --git a/claude-plugin/claude-skills/review-plan/SKILL.md b/claude-plugin/claude-skills/review-plan/SKILL.md index 2cb409e..6cf6e29 100644 --- a/claude-plugin/claude-skills/review-plan/SKILL.md +++ b/claude-plugin/claude-skills/review-plan/SKILL.md @@ -7,17 +7,17 @@ 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. -Amongst other things, check for: +Check at least the following: - **Acceptance criteria:** Each criterion describes an observable, verifiable outcome rather than an implementation step. Behavior changes require appropriate automated test coverage. - **Verifiability:** The required feedback loops exist in repository instructions, build files, scripts, or CI configuration. - **Technical decisions:** Data structures, abstractions, and framework mechanisms fit the surrounding architecture without unnecessary indirection. - **Level of detail:** The plan records non-obvious decisions and interactions without prescribing routine implementation. -- **Omissions:** Judge relevant risks such as error handling, compatibility, migration, performance, security boundaries, and observability against the change at hand. +- **Omissions:** Check whether the plan addresses risks relevant to the change, including error handling, compatibility, migration, performance, security boundaries, and observability. - **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 filename 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 5a2c737..e5fa246 100644 --- a/claude-plugin/claude-skills/setup/SKILL.md +++ b/claude-plugin/claude-skills/setup/SKILL.md @@ -15,7 +15,7 @@ Guided Coding needs these artifacts: - `ai-plans/`, the folder holding all plans and Plan Deviations documents. - `ai-plans/AGENTS.md`, describing the folder, its file naming rules, and how Frozen Plans are treated. -The outcome must be idempotent. Running this skill on a repository sets the artifacts up from scratch, brings outdated ones up to date, or leaves current ones untouched. Content unrelated to Guided Coding, such as project-specific instructions or user-authored notes, is never changed. +Create missing files and folders, update outdated Guided Coding instructions, and leave current content unchanged. Preserve unrelated content, including project-specific instructions and user-authored notes. ## 1. Inspect the Repository @@ -25,8 +25,8 @@ 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 -- dependency, secret, container, and source-code security scans. +- benchmarks +- 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. Link to those rules instead of repeating them in the root file. If both sections already exist and are current, leave the file alone. @@ -46,18 +46,21 @@ If both sections already exist and are current, leave the file alone. Create `ai-plans/` if it is missing. Compare `ai-plans/AGENTS.md` with `assets/ai-plans-AGENTS.md` relative to this skill file. - If the file is missing, copy the asset. -- If the file exists with an older `guided-coding-version` marker or without one, update the Guided Coding paragraphs and the marker. Keep every repository-specific addition, such as a custom plan structure, naming conventions, or notes about legacy file names. +- If the file exists with an older `guided-coding-version` marker or without one, update the Guided Coding paragraphs and the marker. Keep every repository-specific addition, such as a custom plan structure, naming conventions, or notes about legacy filenames. ## 4. Report and Give Customization Tips -List the files you created, updated, or left unchanged, the feedback loops you documented, and which commands you ran. Report to the user that they should verify the changes. +List the files you created, updated, or left unchanged, the feedback loops you documented, and which commands you ran. Ask the user to verify the changes. Then explain how Guided Coding can be customized, so the user knows the defaults are only a starting point: - **Plan structure:** `guided-coding-write-plan` uses a default structure with `## Rationale`, `## Acceptance Criteria`, and `## Technical Details`. It also ships the RDAT structure (`rdat-plan-structure.md`), which adds a `## Decisions` section with numbered Decisions as a summary for the reviewer. Name a structure file when invoking `guided-coding-write-plan`, or name it or describe your own structure in `ai-plans/AGENTS.md` to override the default. -- **File names:** the skills use the placeholders `` (UTC, `YYYY-MM-DD-HHMM`), ``, and `` (kebab-case, shortened ticket title). Conventions for these, e.g., a `` format or a maximum length for ``, belong in `ai-plans/AGENTS.md`. -- **Feedback loops:** plans should reference the feedback loops in the root `AGENTS.md` to make Acceptance Criteria verifiable. Adding or removing a feedback loop later only requires updating that list. -- **Plan review:** `guided-coding-plan-and-review` reads an optional `## Plan Review` section in `ai-plans/AGENTS.md`: the number of reviewers and a model preference for each, the round limit (default 3), and how findings against the user's decisions are handled: `collect` (default) reports them as open for the user, `pause` stops the round and asks the user. Each round starts one subagent per reviewer, so a run costs reviewers × rounds subagent runs at most, plus one replacement for each reviewer that fails. +- **Filenames:** the skills use the placeholders `` (UTC, `YYYY-MM-DD-HHMM`), ``, and `` (kebab-case, shortened ticket title). Conventions for these, e.g., a `` format or a maximum length for ``, belong in `ai-plans/AGENTS.md`. +- **Feedback loops:** plans should reference the feedback loops in the root `AGENTS.md` to make acceptance criteria verifiable. Adding or removing a feedback loop later only requires updating that list. +- **Plan review:** configure `guided-coding-plan-and-review` in an optional `## Plan Review` section in `ai-plans/AGENTS.md`. It supports a reviewer list with a model preference for each, a round limit (default 3), and a policy for findings that challenge the user's explicit decisions. `collect` (default) reports them as open for the user. `pause` stops the round and asks the user. + + Each round starts one subagent per reviewer. The maximum number of subagent runs is the number of reviewers multiplied by the round limit, plus one replacement for each reviewer that fails. + - **Deviations:** the threshold for what counts as a material deviation can be tightened or relaxed in `ai-plans/AGENTS.md`. Repository-specific conventions in `AGENTS.md` files take precedence over the skills' defaults. diff --git a/claude-plugin/claude-skills/setup/assets/ai-plans-AGENTS.md b/claude-plugin/claude-skills/setup/assets/ai-plans-AGENTS.md index 23b839b..fb947b7 100644 --- a/claude-plugin/claude-skills/setup/assets/ai-plans-AGENTS.md +++ b/claude-plugin/claude-skills/setup/assets/ai-plans-AGENTS.md @@ -2,11 +2,11 @@ -This directory is the append-only record of how work in this repository was planned and how it turned out, similar to Event Sourcing. It follows the [Guided Coding](https://kenny-codes.net/docs/guided-coding/) approach. +This directory records how work in this repository was planned and how it turned out. Preserve frozen documents and record later decisions in new plans. It follows the [Guided Coding](https://kenny-codes.net/docs/guided-coding/) approach. -Frozen Plan file names use `YYYY-MM-DD-HHMM--.md`, timestamped in UTC. The `` is omitted when work has no ticket. It also carries a `*Frozen at ` line directly below its title. When a plan is not frozen yet, its file name is typically `.md`. Plan Deviations filenames use `YYYY-MM-DD-HHMM--plan-deviations.md` or `YYYY-MM-DD-HHMM--plan-deviations.md`. +Frozen Plan filenames use `YYYY-MM-DD-HHMM--.md`, timestamped in UTC. The `` is omitted when work has no ticket. Each frozen plan also contains a `*Frozen at *` line directly below its title. When a plan is not frozen yet, its filename is typically `.md`. Plan Deviations filenames use `YYYY-MM-DD-HHMM--plan-deviations.md` or `YYYY-MM-DD-HHMM--plan-deviations.md`. -Plans are frozen when their Planning Phase ends. From then on, the only permitted edit is checking an acceptance criterion (`- [ ]` to `- [x]`) after the implementation and relevant feedback loops verify it. Never reword, add, remove, or reorder criteria in a frozen plan. Plan Deviations documents are frozen once they are merged into the target branch. Until then, it is rewritten under a fresh timestamp whenever it needs to change, e.g., when a review of the PR/MR leads to another Follow-Up Plan, so that it always sorts after all plans of its work item. +Plans are frozen when their Planning Phase ends. From then on, the only permitted edit is checking off an acceptance criterion (`- [ ]` to `- [x]`) after the implementation and relevant feedback loops verify it. Never reword, add, remove, or reorder criteria in a frozen plan. Plan Deviations documents are frozen when merged into the target branch. Until then, rename and rewrite the document with a new timestamp whenever it changes, for example, when a PR/MR review leads to another Follow-Up Plan. Its filename must sort after all plans for the work item. A Follow-Up Plan supersedes decisions of a Frozen Plan. The decision to write one is made in the Guiding Phase, when the review of the implementation calls for larger changes. diff --git a/claude-plugin/claude-skills/write-deviations/SKILL.md b/claude-plugin/claude-skills/write-deviations/SKILL.md index d84b6e6..8f840ec 100644 --- a/claude-plugin/claude-skills/write-deviations/SKILL.md +++ b/claude-plugin/claude-skills/write-deviations/SKILL.md @@ -13,17 +13,19 @@ A Plan Deviations document summarizes how the completed implementation differs f ## 1. Inspect the Plans and the Implementation -Read all plans for the current ticket in `ai-plans/`, oldest first. Identify them by the `` or `` in their file names, or by the plans mentioned in the conversation. Ask the user if the set of plans is unclear. +Read all plans for the current ticket in `ai-plans/`, oldest first. Identify them by the `` or `` in their filenames, or by the plans mentioned in the conversation. Ask the user if the set of plans is unclear. Determine the target branch and the implementation range. Use the PR/MR if there is one. Otherwise, use the merge base between the target branch and the implementation branch. Ask the user if the target branch is unclear. Inspect the commits in that range, all committed, staged, and unstaged changes, and any relevant earlier history. Verify every document and source-file reference you rely on. ## 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 filename 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: -1. Fetch the target branch from its remote into its remote-tracking branch with an explicit refspec, e.g., `git fetch origin +refs/heads/main:refs/remotes/origin/main`, and use that remote-tracking branch, e.g., `origin/main`. The explicit refspec updates it regardless of the remote's configured fetch mappings. Only if the repository has no remote at all, use the local target branch. If fetching fails, report the error and stop without changing anything: a stale local branch cannot prove that the document is unmerged. +1. Fetch the target branch into its remote-tracking branch using an explicit refspec, for example, `git fetch origin +refs/heads/main:refs/remotes/origin/main`. Use that remote-tracking branch (`origin/main` in this example) for the checks below. + + The explicit refspec updates it regardless of the remote's configured fetch mappings. Use the local target branch only if the repository has no remote. If the fetch fails, report the error and stop without changing anything. A stale local branch cannot prove that the document is unmerged. 2. Verify that the target branch resolves, e.g., `git rev-parse --verify origin/main`. If it does not, report this and stop without changing anything. 3. Check whether the document's path exists on the target branch, e.g., `git cat-file -e origin/main:ai-plans/`. Check the path, not whether commits are ancestors of the target branch: squash and rebase merges rewrite commits but keep the file. @@ -36,39 +38,39 @@ Otherwise, you update the existing document in the following steps. 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. +- **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. ## 4. Determine the File Name -The file name is: +The filename is: - `--plan-deviations.md` if a `` is present - `--plan-deviations.md` otherwise -Take `` or `` from the file name of the Initial Plan. The `` is the current time in UTC in the format `YYYY-MM-DD-HHMM`, also when you update an existing document. Use these commands to get it: +Take `` or `` from the filename of the Initial Plan. The `` is the current time in UTC in the format `YYYY-MM-DD-HHMM`, also when you update an existing document. Use these commands to get it: - `date -u +%F-%H%M` on Unix-based shells - `(Get-Date).ToUniversalTime().ToString("yyyy-MM-dd-HHmm")` on PowerShell -The Plan Deviations document must sort after all plans of the ticket. Therefore, the `` must be strictly later than the timestamps in the file names of all plans of the ticket and of the existing Plan Deviations document. If it is not, wait until the next minute and get the timestamp again. +Use a timestamp later than the timestamps of all plans for this ticket and of the existing Plan Deviations document. This keeps the document last when filenames are sorted. If the current timestamp is not later, wait until the next minute, get the timestamp again, and repeat the check. -If a plan or another Plan Deviations document with this file name already exists, report the collision and stop. Never overwrite a plan or a frozen Plan Deviations document. +If a plan or another Plan Deviations document with this filename already exists, report the collision and stop. Never overwrite a plan or a frozen Plan Deviations document. ## 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 filename. 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: 1. `# Plan Deviations` as the title. Prefer `` if present. -2. An opening paragraph that names every compared plan by its exact file name, names the implementation branch, and identifies plans that were not implemented. -3. `## Summary`: what held up, and how many material decisions changed. -4. `## Changes Across Follow-Up Plans`, only when Follow-Up Plans exist: one numbered `###` section per superseded decision with **Original decision**, **Superseded by** (exact file name and the replacement decision), **Why**, and **Outcome**. -5. `## Deviations From the Accepted Plans`, only when material deviations exist: one numbered `###` section per deviation with **Plan decision** (exact file name and decision), **Implemented**, **Why** (required), and **Impact** (trade-offs, consequences, or deferred work; omit only if there are none). +2. An opening paragraph that names every compared plan by its exact filename, names the implementation branch, and identifies plans that were not implemented. +3. `## Summary`: briefly, what remained valid overall and how many material decisions changed. +4. `## Changes Across Follow-Up Plans`, only when Follow-Up Plans exist: one numbered `###` section per superseded decision with **Original decision**, **Superseded by** (exact filename and the replacement decision), **Why**, and **Outcome**. +5. `## Deviations From the Accepted Plans`, only when material deviations exist: one numbered `###` section per deviation with **Plan decision** (exact filename and decision), **Implemented**, **Why** (required), and **Impact** (trade-offs, consequences, or deferred work). Omit **Impact** only if there are none. Name the affected types, members, and files. Leave out work that matches the accepted plans. If the implementation matches all Follow-Up Plans, say so in the Summary and omit `## Deviations From the Accepted Plans`. diff --git a/claude-plugin/claude-skills/write-plan/SKILL.md b/claude-plugin/claude-skills/write-plan/SKILL.md index b72230c..99361d8 100644 --- a/claude-plugin/claude-skills/write-plan/SKILL.md +++ b/claude-plugin/claude-skills/write-plan/SKILL.md @@ -11,7 +11,7 @@ Your goal is to write an Initial Plan or Follow-Up Plan into the `ai-plans/` fol ## Plan File Name -The initial file name of the new plan file is `.md`. `` is a shortened kebab-case version of the ticket title. At this point in the conversation, you should be able to derive a full title from the discussion that you can shorten. If not, ask the user to provide one and shorten it. +Name the draft `.md`, using a shortened kebab-case version of the ticket title. If no ticket title is available, derive one from the discussion. Ask the user for a title only if you cannot derive one. ## Plan Structure @@ -21,11 +21,13 @@ 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 filename 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 to another structure. ## What Happens After Writing a Plan? -The user reviews the plan. They will provide feedback, aspects of the plan might change. Once both you and the user agree on the plan being ready for implementation, it is frozen and becomes largely immutable (except for checking off Acceptance Criteria). When a plan is frozen, its file name is changed to `--.md`, or `-.md` (if no `` is present). Also, a `*Frozen at ...*` line is inserted right below the `# Title` of the plan. All this doesn't happen in this step of the conversation. +The user reviews the draft and may request changes. Once you and the user agree it is ready for implementation, it can be frozen. The only permitted edits after freezing are checking off acceptance criteria. + +Freezing renames the file to `--.md`, or `-.md` when there is no ticket ID. It also adds a `*Frozen at ...*` line directly below the title. Do not freeze the plan while running this skill. ## Follow-up Plans @@ -37,4 +39,4 @@ Record only the changed decisions and outcomes. State exactly which earlier deci ## Most Importantly -Try to keep each plan as concise as possible. Simpler language is preferred over elaborate prose. +Keep plans concise. Use plain language. diff --git a/claude-plugin/claude-skills/write-plan/assets/default-plan-structure.md b/claude-plugin/claude-skills/write-plan/assets/default-plan-structure.md index 00a8091..462ed2d 100644 --- a/claude-plugin/claude-skills/write-plan/assets/default-plan-structure.md +++ b/claude-plugin/claude-skills/write-plan/assets/default-plan-structure.md @@ -2,14 +2,14 @@ Start with `# Title`, followed by exactly these sections in order: -1. `## Rationale`: briefly state the problem and overarching goal this issue is solving. -2. `## Acceptance Criteria`: list **observable, verifiable outcomes** as unticked Markdown tasks (`- [ ]`). Describe results, not implementation steps. -3. `## Technical Details`: Provide relevant information which guides the future implementer of the plan in the right direction. For example, references to existing APIs which should be extended, Design Patterns to follow, performance and threading insights, security aspects, how to design automated tests, considerations for automated benchmarks, and links to relevant docs. This list is not complete, you can add or remove elements depending on the context. Avoid step-by-step instructions and exhaustive listings. Assume the implementer is a senior software developer. +1. `## Rationale`: briefly state the problem and the goal of this issue. +2. `## Acceptance Criteria`: list **observable, verifiable outcomes** as unchecked Markdown tasks (`- [ ]`). Describe results, not implementation steps. +3. `## Technical Details`: record the technical guidance the implementer needs, such as APIs to extend, design patterns to follow, testing and benchmark guidance, links to relevant documentation, and any performance, threading, or security constraints. Include only what is relevant. Avoid step-by-step instructions and exhaustive listings. Assume the implementer is a senior software developer. Use minimal code examples only when they clarify an important contract, such as an API signature, interface, or DTO shape. Say whether an example is exact or illustrative. Avoid method bodies, step-by-step instructions, exhaustive file lists, and routine background. When behavior changes, require automated test coverage in the acceptance criteria. Require benchmarks only when performance is a material risk or requirement. -The root AGENTS.md and the referenced docs in it should define feedback loops (such as compilers, static code analyzers, automated tests, test coverage, mutation testing, automated benchmarks, etc.) available in the repository. Use them to make Acceptance Criteria verifiable. If there are no feedback loops listed, stop and report this to the user. +The root `AGENTS.md` and its referenced documents should list the repository's feedback loops, such as compilers, static analyzers, automated tests, code coverage, mutation testing, and benchmarks. Use them to make acceptance criteria verifiable. If there are no feedback loops listed, stop and report this to the user. If the plan requires a missing feedback loop, make adding it explicit in the plan. diff --git a/claude-plugin/claude-skills/write-plan/assets/rdat-plan-structure.md b/claude-plugin/claude-skills/write-plan/assets/rdat-plan-structure.md index 9091a88..5e1a76f 100644 --- a/claude-plugin/claude-skills/write-plan/assets/rdat-plan-structure.md +++ b/claude-plugin/claude-skills/write-plan/assets/rdat-plan-structure.md @@ -12,40 +12,46 @@ In one or two sentences, state the background and the problem this plan solves. ### 2. `## Decisions` -Decisions are the main point for communication with superiors: a reader who reads only this section knows what will be built and why. +A reviewer who reads only this section should know what will be built and why, and be able to approve the plan. -A Decision is a point where another choice was possible and would change the behavior, a public contract, the scope, or the dependencies. State the choice, not options left to the implementer, and give a one-sentence reason when the choice is not obvious. Leave routine implementation choices and what stays unchanged out. +Record a Decision when an alternative choice would affect behavior, public contracts, scope, or dependencies. State the choice, not options left to the implementer, and give a one-sentence reason when the choice is not obvious. Leave routine implementation choices and what stays unchanged out. Each Decision gets a **Decision ID**: `D1`, `D2`, etc. Keep existing Decision IDs when revising the draft. Use as few Decisions as the plan needs. -Check the premises of each Decision against the code, including relevant claims of the ticket and the behavior of existing code you plan to reuse. 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. If a premise that matters remains unverified, state it in the affected Decision, together with its consequence and what would resolve it. If a check invalidates a premise of a Decision you made, refine the Decision. If it invalidates a premise of a Decision the user made, ask the user. +Check the assumptions behind each Decision against the code, including relevant claims made in the ticket and the behavior of existing code you plan to reuse. If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. + +If an important assumption remains unverified, state it in the affected Decision, along with its consequence and what would resolve it. If a check disproves an assumption behind your own Decision, revise that Decision. If it disproves an assumption behind the user's Decision, ask the user. The last Decision may be an `Out-of-Scope` Decision, listing what the ticket or the discussion mentioned and the plan deliberately does not address. Do not invent exclusions. ### 3. `## Acceptance Criteria` -This is a list of **observable, verifiable outcomes** as unticked Markdown tasks (`- [ ]`). Each Decision except the `Out-of-Scope` Decision must be verifiable through at least one AC. ACs must not introduce behavior, contracts, scope, or dependencies that no Decision states. Tests and routine documentation that verify or explain a Decision refer to it and need no Decision of their own. +List **observable, verifiable outcomes** as unchecked Markdown tasks (`- [ ]`). Each Decision, except the `Out-of-Scope` Decision, must have at least one acceptance criterion that verifies it. Criteria must not introduce behavior, contracts, scope, or dependencies absent from the Decisions. + +Tests and routine documentation that verify or explain a Decision should refer to it. They do not need separate Decisions. -Choose the Feedback Loops of AGENTS.md and its referenced documents that actually verify an AC's outcome, such as compilers, static code analyzers, automated tests and code coverage, mutation testing, and automated benchmarks. If no Feedback Loops are listed, stop and report this to the user. +Choose feedback loops listed in `AGENTS.md` or its referenced documents that verify the criterion's outcome, such as compilers, static analyzers, automated tests, code coverage, mutation testing, and benchmarks. If no feedback loops are listed, stop and report this to the user. - When behavior changes, require automated tests and name the cases they must cover, including negative and failure cases. -- Do not add ACs for checks every change must pass anyway, such as building or running the whole test suite. +- Do not add acceptance criteria for checks every change must pass anyway, such as building or running the whole test suite. - Require benchmarks only when performance is a material risk or requirement. -- Consider how long a Feedback Loop runs and weigh it against its benefits. For slow loops such as mutation testing, the corresponding AC should have a high impact to warrant it. -- Some ACs need human review, e.g., the quality of documentation or platform behavior that the available Feedback Loops do not cover. State what is checked and who verifies it. -- If a plan requires a missing Feedback Loop, adding it is a Decision with its own AC. +- Weigh each feedback loop's runtime against its benefits. Reserve slow checks, such as mutation testing, for criteria important enough to justify the time. +- Some acceptance criteria need human review, e.g., the quality of documentation or platform behavior that the available feedback loops do not cover. State what is checked and who verifies it. +- If a plan requires a missing feedback loop, adding it is a Decision with its own acceptance criterion. ### 4. `## Technical Details` Provide only what the implementer, who has not seen the planning conversation, cannot quickly see in the code: where a change goes when it is not obvious, existing code to follow, interactions with other parts of the codebase, pitfalls, performance, threading or security aspects, and how to structure automated tests. Nothing here adds a behavior, a contract, or an exclusion: that is a Decision. -Avoid step-by-step instructions and exhaustive listings. Use minimal code samples only when they clarify an important contract, such as an API signature, interface, or DTO shape. Say whether an example is exact or illustrative; an exact example must compile. Avoid providing finished implementations. +Avoid step-by-step instructions and exhaustive listings. Use minimal code samples only when they clarify an important contract, such as an API signature, interface, or DTO shape. Say whether an example is exact or illustrative. An exact example must compile. Avoid providing finished implementations. ## How to Keep Plans Short and to the Point -State each fact once: a section adds information to the previous sections and avoids duplication. Decisions are not repeated in the Acceptance Criteria or Technical Details; refer to them by their Decision ID instead. An exact contract, such as an error message or a verdict table, appears in one place, and the other sections refer to it. Acceptance Criteria add how an outcome is verified, such as test inputs, expected results, and failure cases; Technical Details add how to implement it. +State each fact once. Each section adds information to the previous sections. In Acceptance Criteria and Technical Details, refer to Decisions by their Decision IDs instead of repeating them. Keep exact contracts, such as error messages or verdict tables, in one place and refer to them from other sections. + +Acceptance Criteria explain how to verify outcomes, including test inputs, expected results, and failure cases. Technical Details explain how to implement them. -The same goes for general guidance in AGENTS.md or its referenced documents. Refer to them by a link to their section or by their rule ID instead of duplicating their information. +The same goes for general guidance in `AGENTS.md` or its referenced documents. Refer to them by a link to their section or by their rule ID instead of duplicating their information. Leave out the history of your investigation and routine details the implementer can quickly find in the code. diff --git a/skills/guided-coding-freeze-plan/SKILL.md b/skills/guided-coding-freeze-plan/SKILL.md index 7f4bd24..f40dead 100644 --- a/skills/guided-coding-freeze-plan/SKILL.md +++ b/skills/guided-coding-freeze-plan/SKILL.md @@ -6,13 +6,13 @@ license: MIT # Freeze a Plan -Freezing a plan means providing a timestamp, both at the beginning of its file name and directly after its title. An optional `` is also inserted into the file name after the timestamp. +Freezing a plan means providing a timestamp, both at the beginning of its filename and directly after its title. An optional `` is also inserted into the filename after the timestamp. -The plan is then considered ready for implementation, only its acceptance criteria are allowed to be checked off by the implementer. +The plan is now ready for implementation. The only permitted edits are checking off acceptance criteria after verifying them. -The target plan should be already mentioned in the conversation, typically in the format `.md`. If not, first inspect the `ai-plans/` folder for a single plan Markdown file which is untracked or has changes. Otherwise, ask the user to provide the path to the plan file. +Use the plan named in the conversation, typically `.md`. If none is named, use a plan in `ai-plans/` only if exactly one Markdown plan is untracked or modified. Otherwise, ask the user for its path. -If the plan already carries a timestamp in its file name or a `*Frozen at ...*` line below its title, it is frozen. Report this to the user and stop. +If the plan already carries a timestamp in its filename or a `*Frozen at ...*` line below its title, it is frozen. Report this to the user and stop. ## 1. Determine the Timestamp @@ -23,7 +23,7 @@ The `` is UTC in the format `YYYY-MM-DD-HHMM`. Use these commands to ## 2. Determine an Optional Ticket ID -Plans are typically associated with a ``. This is the ID of a work item such as a GitHub issue or a Jira task. If you don't know it from the conversation yet, ask the user to provide it. Note that not each plan needs to be associated with a ``. +Plans are typically associated with a ``. This is the ID of a work item such as a GitHub issue or a Jira task. If you don't know it from the conversation yet, ask the user to provide it. A ticket ID is optional. ## 3. Change the Plan File Name @@ -34,4 +34,4 @@ If a file with this name already exists in `ai-plans/`, report the collision and ## 4. Stamp the Plan Content -Right beneath the `# Title`, insert the following line: `*Frozen at *`, where `` is an ISO 8601 timestamp of the existing `` used for the file, precise to the minute. E.g., the `` `2026-09-17-0231` for the file name becomes `2026-09-17T02:31Z`. +Directly below `# Title`, insert `*Frozen at *`, where `` is the filename's timestamp in ISO 8601 format, to the minute. For example, `2026-09-17-0231` becomes `2026-09-17T02:31Z`. diff --git a/skills/guided-coding-implement-coach-me/SKILL.md b/skills/guided-coding-implement-coach-me/SKILL.md index 90ae749..29d9162 100644 --- a/skills/guided-coding-implement-coach-me/SKILL.md +++ b/skills/guided-coding-implement-coach-me/SKILL.md @@ -8,37 +8,41 @@ 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 lasting 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, check off acceptance criteria, and commit. ## 1. Establish the Target -Use the plan named by the user. If none is named, proceed only when there is exactly one plan in `ai-plans/` that has all its Acceptance Criteria unchecked, and it has the latest timestamp of all plans. Otherwise, ask for its path. +Use the plan named by the user. If none is named, proceed only if exactly one plan in `ai-plans/` has all acceptance criteria unchecked and that plan also has the latest timestamp. Otherwise, ask for its path. -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. +Verify that the plan is frozen: its filename 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. Read the Learning Profile -`~/.guided-learning/profile.md` is the memory of Guided Learning across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder already is a git repository, copy `assets/profile.md` relative to this skill file there, and commit it. +`~/.guided-learning/profile.md` stores the user's learning preferences and progress across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder is already a Git repository. Copy this skill's `assets/profile.md` into that folder and commit it. -It holds the user's **Preferences** for how to be taught, such as the language to speak or explanation before code, and their **Knowledge**: a tree of areas, each at one of three stages: +The profile holds the user's **Preferences**, such as the language to teach in and whether to explain concepts before showing code. It also records their **Knowledge** as a tree of areas, each at one of three stages: -- **Beginning**: new to a domain, needs to learn the fundamental concepts and mechanisms, mostly by copying information. Adaptation and transformation of these do not happen yet. +- **Beginning**: new to a domain. Learns fundamental concepts and mechanisms mainly by following examples and cannot yet adapt them independently. - **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. +Follow the user's teaching preferences. Use their stage in each relevant area to choose milestone size, explanation depth, and initial support. Use the most specific profile entry that covers the area. Technology and discipline entries each apply to their own part of the work. For areas the profile does not cover, use this skill's intended stage. Your observations take 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. +Before you create the roadmap, verify that the types, members, and files the plan describes as existing are present and that its claims about existing behavior match what the code currently does. Do not treat planned additions or behavior changes as missing prerequisites. + +If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. Remove these temporary tests or projects before presenting 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. +Make each milestone a small, end-to-end change across the relevant layers (a vertical slice). Keep the first slice just large enough to connect the layers, then expand it in later milestones. This lets the user practice connecting familiar areas and exposes design mistakes early. + +Focus each slice on one area, ideally the one the user has practiced least, so you can assess what they learned. If vertical slices do not suit the plan or the user's preferences, choose another split with one 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. +At the end of each milestone, the code must compile, pass the feedback loops, and be ready to commit. 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 @@ -48,11 +52,21 @@ While they work, answer questions about the codebase, language, framework, desig When the user signals completion, inspect what they actually changed. Explain what works and why, what does not yet satisfy the milestone or plan, and what to reconsider. Take valid solutions on their own terms, even when they differ from what you expected, and let the user revise until the milestone behaves as described. -Then explain how to run the feedback loops and manual tests, or go through the output the user brings. When something fails, let them read the error first and teach them how to extract what matters from it. Once you verified the milestone, let the user tick the Acceptance Criteria it fully satisfies, if any, and commit them together with the milestone. Then update the learning profile and move on. +Then explain how to run the feedback loops and manual tests, or go through the output the user brings. When something fails, let them read the error first and teach them how to extract what matters from it. Once you have verified that the milestone behaves as described, let the user check off any acceptance criteria it fully satisfies, from `- [ ]` to `- [x]`, and commit those updates with the milestone. Then update the learning profile and move on. ## 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. When helping with the implementation, give one hint at a time. Hints range from least to most direct: + +1. Ask a focused question. +2. Restate an important invariant. +3. Point to similar code or documentation. +4. Teach a missing concept. +5. Name relevant APIs or types. +6. Describe how responsibilities interact. +7. Give a precise implementation outline. + +Choose the starting level that fits the situation and the user's stage in the area. You do not have to start 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. @@ -60,38 +74,48 @@ Provide code only when explanations and outlines are not enough, and then only t Update the profile whenever something changed: when the user expresses a preference, after each milestone once the user committed it, and when the user stops early. Re-read the file right before you edit it, and commit to `main` using `git -C "$HOME/.guided-learning"` with a Conventional Commits message whose body states what you observed. Never create branches or push, and keep learning notes out of the repository you are working in. -Change preferences only as the user says. Write knowledge nodes as nested list items: +Change preferences only as the user says. Write knowledge entries as nested list items: ```markdown -- **** `` — covers , +- **** ``: covers , ``` -Knowledge that would survive a switch to another technology stack belongs to a discipline, anything else to a technology. Nest at most three levels: +Record knowledge that applies across technology stacks under a discipline. Record other knowledge under a technology. Nest at most three levels: - **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 an entry for every area it drew on that the profile does not cover yet. Reuse existing entries, and name technologies the way their official documentation does. Add a child entry 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. +Change a stage only when supported by your observations. Advance it by at most one stage per plan: + +- To Advancing when the user completed a milestone in that area without being given the implementation. +- To Mastering when they shaped the design or challenged the plan with a valid reason. + +When correcting an inaccurate stage, you may move the entry by more than one stage. Change the entry where you observed the evidence. Change a parent entry only when the evidence covers its whole area. ## 7. Handle Plan Issues -A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. +If a discrepancy does not affect the plan's decisions or intended behavior, such as a moved file or renamed private member, 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: +If the plan contains an incorrect decision or factual claim, or an acceptance criterion cannot be met as written, a workaround is allowed only when all of these conditions are met: -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. +1. Evidence from a test, temporary project, or compiler error confirms the error. +2. The plan's Rationale and all its other decisions remain unchanged. +3. The workaround makes no public API, scope, or dependency changes beyond those in the plan. 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. +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. Leave an acceptance criterion unchecked if it is met only through a workaround. During the Guiding Phase, the reviewer checks it off if they accept the workaround. If they reject it, they call for a Follow-Up Plan. -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. +If any of these four conditions is not met, 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. +Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all acceptance criteria should be checked off. + +In the summary, list for the reviewer: + +- Each workaround: the decision it departs from, the evidence, what was done instead, and the acceptance criteria left unchecked because of it. +- Each problem that was not worked around: what the plan says, what you observed and how, the options you considered, and what the user decided. -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. +Reference decisions by the plan's filename and Decision ID, such as ` D3`. If the plan has no Decision IDs, name its filename 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 fcde3e2..6098bb7 100644 --- a/skills/guided-coding-implement-show-me/SKILL.md +++ b/skills/guided-coding-implement-show-me/SKILL.md @@ -12,33 +12,35 @@ The user makes every lasting change to the repository, including commits. Typing ## 1. Establish the Target -Use the plan named by the user. If none is named, proceed only when there is exactly one plan in `ai-plans/` that has all its Acceptance Criteria unchecked, and it has the latest timestamp of all plans. Otherwise, ask for its path. +Use the plan named by the user. If none is named, proceed only if exactly one plan in `ai-plans/` has all acceptance criteria unchecked and that plan also has the latest timestamp. Otherwise, ask for its path. -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. +Verify that the plan is frozen: its filename 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. Read the Learning Profile -`~/.guided-learning/profile.md` is the memory of Guided Learning across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder already is a git repository, copy `assets/profile.md` relative to this skill file there, and commit it. +`~/.guided-learning/profile.md` stores the user's learning preferences and progress across sessions. If it is missing, run `git init -b main "$HOME/.guided-learning"` unless that folder is already a Git repository. Copy this skill's `assets/profile.md` into that folder and commit it. -It holds the user's **Preferences** for how to be taught, such as the language to speak or explanation before code, and their **Knowledge**: a tree of areas, each at one of three stages: +The profile holds the user's **Preferences**, such as the language to teach in and whether to explain concepts before showing code. It also records their **Knowledge** as a tree of areas, each at one of three stages: -- **Beginning**: new to a domain, needs to learn the fundamental concepts and mechanisms, mostly by copying information. Adaptation and transformation of these do not happen yet. +- **Beginning**: new to a domain. Learns fundamental concepts and mechanisms mainly by following examples and cannot yet adapt them independently. - **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. +Follow the user's teaching preferences. Use their stage in each relevant area to choose milestone size, explanation depth, and initial support. Use the most specific profile entry that covers the area. Technology and discipline entries each apply to their own part of the work. For areas the profile does not cover, use this skill's intended stage. Your observations take 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. +Before you create the roadmap, verify that the types, members, and files the plan describes as existing are present and that its claims about existing behavior match what the code currently does. Do not treat planned additions or behavior changes as missing prerequisites. + +If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. Remove these temporary tests or projects before presenting 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. +At the end of each milestone, the code must compile, pass the feedback loops, and be ready to commit. 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 @@ -50,44 +52,54 @@ When all fragments are in place, explain how to run the feedback loops or manual Answer questions about the code at any point. When something does not compile or a test fails, let the user read the error first, then point out what to focus on, for example, the information an exception carries. -Once the milestone behaves as described and you verified it, let the user tick the Acceptance Criteria it fully satisfies, if any, from `- [ ]` to `- [x]`, and commit them together with the milestone. Then update the learning profile and move on. +Once you have verified that the milestone behaves as described, let the user check off any acceptance criteria it fully satisfies, from `- [ ]` to `- [x]`, and commit those updates with the milestone. Then update the learning profile and move on. ## 5. Update the Learning Profile Update the profile whenever something changed: when the user expresses a preference, after each milestone once the user committed it, and when the user stops early. Re-read the file right before you edit it, and commit to `main` using `git -C "$HOME/.guided-learning"` with a Conventional Commits message whose body states what you observed. Never create branches or push, and keep learning notes out of the repository you are working in. -Change preferences only as the user says. Write knowledge nodes as nested list items: +Change preferences only as the user says. Write knowledge entries as nested list items: ```markdown -- **** `` — covers , +- **** ``: covers , ``` -Knowledge that would survive a switch to another technology stack belongs to a discipline, anything else to a technology. Nest at most three levels: +Record knowledge that applies across technology stacks under a discipline. Record other knowledge under a technology. Nest at most three levels: - **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 an entry for every area it drew on that the profile does not cover yet. Reuse existing entries, and name technologies the way their official documentation does. Add a child entry only when its stage differs from its parent's. Otherwise, list it in the parent's optional `covers`. + +Change a stage only when supported by your observations. Advance it by at most one stage per plan: + +- To Advancing when the user completed a milestone in that area without being given the implementation. +- To Mastering when they shaped the design or challenged the plan with a valid reason. -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. +When correcting an inaccurate stage, you may move the entry by more than one stage. This skill never moves an entry above Beginning, because it provides the implementation. Change the entry where you observed the evidence. Change a parent entry only when the evidence covers its whole area. ## 6. Handle Plan Issues -A discrepancy that changes nothing, such as a moved file or a renamed private member, is no plan issue: mention it and proceed. +If a discrepancy does not affect the plan's decisions or intended behavior, such as a moved file or renamed private member, 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: +If the plan contains an incorrect decision or factual claim, or an acceptance criterion cannot be met as written, a workaround is allowed only when all of these conditions are met: -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. +1. Evidence from a test, temporary project, or compiler error confirms the error. +2. The plan's Rationale and all its other decisions remain unchanged. +3. The workaround makes no public API, scope, or dependency changes beyond those in the plan. 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. +Discuss the workaround with the user before it goes into the code, then teach it like any other part of the plan. Leave an acceptance criterion unchecked if it is met only through a workaround. During the Guiding Phase, the reviewer checks it off if they accept the workaround. If they reject it, they call for a Follow-Up Plan. -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. +If any of these four conditions is not met, 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. +Summarize what you and the user accomplished and point them to the Guiding Phase. Unless you faced plan issues, all acceptance criteria should be checked off. + +In the summary, list for the reviewer: + +- Each workaround: the decision it departs from, the evidence, what was done instead, and the acceptance criteria left unchecked because of it. +- Each problem that was not worked around: what the plan says, what you observed and how, the options you considered, and what the user decided. -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. +Reference decisions by the plan's filename and Decision ID, such as ` D3`. If the plan has no Decision IDs, name its filename and section, and quote the decision. diff --git a/skills/guided-coding-implement/SKILL.md b/skills/guided-coding-implement/SKILL.md index 5c36d95..5570cf8 100644 --- a/skills/guided-coding-implement/SKILL.md +++ b/skills/guided-coding-implement/SKILL.md @@ -10,45 +10,47 @@ Your goal is to implement a Frozen Plan created in the Planning Phase of Guided ## 1. Establish the Target -Use the plan named by the user. If none is named, proceed only when there is exactly one plan in `ai-plans/` that has all its Acceptance Criteria unchecked, and it has the latest timestamp of all plans. Otherwise, ask for its path. +Use the plan named by the user. If none is named, proceed only if exactly one plan in `ai-plans/` has all acceptance criteria unchecked and that plan also has the latest timestamp. Otherwise, ask for its path. -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. +Verify that the plan is frozen: its filename 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. 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. +Before you write code, verify that the types, members, and files the plan describes as existing are present and that its claims about existing behavior match what the code currently does. Do not treat planned additions or behavior changes as missing prerequisites. + +If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. Remove these temporary tests or projects before you finish. ## 3. Implement and Verify -Implement the plan, use the feedback loops to verify your code changes. +Implement the plan and use the feedback loops to verify your 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. +The only permitted plan edit is checking off an acceptance criterion from `- [ ]` to `- [x]`. Do so only after a feedback loop verifies it. The reviewer would otherwise have to identify the gap later in the Guiding Phase, which is one of the hardest errors to spot. ## 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. +If a discrepancy does not affect the plan's decisions or intended behavior, such as a moved file or renamed private member, 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: +If the plan contains an incorrect decision or factual claim, or an acceptance criterion cannot be met as written, use a workaround only when all of these conditions are met: -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. +1. Evidence from a test, temporary project, or compiler error confirms the error. +2. The plan's Rationale and all its other decisions remain unchanged. +3. The workaround makes no public API, scope, or dependency changes beyond those in the plan. 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. +Leave an acceptance criterion unchecked if it is met only through a workaround. During the Guiding Phase, the reviewer checks it off if they accept the workaround. If they reject it, they call for a Follow-Up Plan. -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. +If any of these four conditions is not met, do not work around the problem and do not ask the user mid-run. Stop the work that depends on the incorrect decision, claim, or acceptance criterion, finish the work that does not, and report the problem. The reviewer decides how to proceed during the Guiding Phase. ## 5. Finish Report: - What was implemented, which feedback loops ran, and their results. -- Which Acceptance Criteria are checked, and which remain unchecked and why. +- 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. +- Any discrepancies that did not affect the plan's decisions or intended behavior. -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. +Reference decisions by the plan's filename and Decision ID, such as ` D3`. If the plan has no Decision IDs, name its filename and section, and quote the decision. -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, push, open or update pull requests, or publish anything unless the user requested those actions. diff --git a/skills/guided-coding-plan-and-review/SKILL.md b/skills/guided-coding-plan-and-review/SKILL.md index f3a7907..245b013 100644 --- a/skills/guided-coding-plan-and-review/SKILL.md +++ b/skills/guided-coding-plan-and-review/SKILL.md @@ -1,28 +1,33 @@ --- name: guided-coding-plan-and-review -description: Write a Guided Coding plan and refine it through independent reviewers in bounded rounds before presenting it to the user. Run only when explicitly requested by the user. +description: Write a Guided Coding plan, improve it through independent reviews within a round limit, and present it to the user. Run only when explicitly requested by the user. license: MIT --- # Plan and Review -Your goal is to write a plan draft into `ai-plans/`, refine it through independent reviewers in rounds, report the result, and stop. You are the planner: you keep the planning conversation, the reviewers never see it. Never freeze the plan. +Write a plan draft in `ai-plans/`, improve it through independent review rounds, report the result, and stop. You are the planner. Only you have access to the planning conversation. Reviewers must not see it. Never freeze the plan. Harnesses may shorten or namespace skill names, e.g., `guided-coding:write-plan` in Claude Code. Use the name under which each skill is installed. ## 1. Read the Configuration -Read the `## Plan Review` section of `ai-plans/AGENTS.md` if it exists. Arguments given when invoking this skill override the corresponding configured values. Use the defaults for values that neither sets: +Read the `## Plan Review` section of `ai-plans/AGENTS.md` if it exists. Options supplied when invoking this skill override the configuration. Use these defaults for values absent from both the invocation options and the configuration: - **Reviewers:** one reviewer on the harness default model. The configuration can name several, each with a model preference. - **Round limit:** 3. -- **User decisions:** findings against a decision the user made explicitly in the conversation are never applied without the user. `collect`: continue, and report the finding as open for the user. `pause`: stop the round, ask the user, and continue with the answer. The default is `collect`. +- **User decisions:** do not change a decision the user explicitly made in the conversation without their approval. Use the policy set by the invocation options or configuration: + + - `collect` (default): continue and report the finding as open for the user. + - `pause`: stop the round, ask the user, and continue after they answer. Model names are harness-specific. If a configured model is unavailable, run that reviewer on the harness default and say so in the report. ## 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. If several drafts could match the current work, ask the user which one to use. + +Without a draft, invoke `guided-coding-write-plan` to write it, passing on any 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. @@ -47,17 +52,17 @@ The finding classes are: - `gap`: a missing scenario or fact. - `nit`: everything else. -A round is complete when every reviewer has returned its findings. Replace a reviewer that fails or times out once with a fresh one. If the replacement fails too, address the findings already returned, then report the incomplete round and stop. +A round is complete when every reviewer has returned its findings. If a reviewer fails or times out, start one replacement reviewer. If the replacement also fails or times out, do not retry. Address the findings already returned, then report the incomplete round and stop. Then address every finding of every class: - Handle a finding against a decision the user made explicitly as configured under **User decisions**. -- Apply every other finding or reject it with a one-line reason. You may change anything else in the plan, including decisions you made alone and the scope. +- Address every other finding by changing the plan or rejecting the finding with a one-line reason. You may change anything else in the plan, including decisions you made alone and the scope. - When findings contradict each other, apply at most one and reject the others with a reason. Treat findings that say the same thing as one, with the highest class among them. -- A fix corrects a decision, criterion, or fact. It adds only the explanation the plan structure requires for a changed decision, never review commentary, and never turns a `nit` into a new rule. +- When revising the plan, correct the decision, criterion, or fact and include only the explanation the plan structure requires for a changed decision. Keep review commentary out of the plan. Do not turn a `nit` into a new rule. - The plan keeps following the rules of `guided-coding-write-plan` and the plan structure it selected. -Keep the reviewers' classes. Stop when a complete round reports no `blocking` or `gap` findings, after addressing its `nit` findings, or when the round limit is reached. +Keep the reviewers' classifications. After addressing all findings, stop if the completed round reported no `blocking` or `gap` findings. Otherwise, start another round unless the round limit has been reached. ## 5. Report diff --git a/skills/guided-coding-review-plan/SKILL.md b/skills/guided-coding-review-plan/SKILL.md index 4efe6c5..351fe6d 100644 --- a/skills/guided-coding-review-plan/SKILL.md +++ b/skills/guided-coding-review-plan/SKILL.md @@ -6,17 +6,17 @@ 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. -Amongst other things, check for: +Check at least the following: - **Acceptance criteria:** Each criterion describes an observable, verifiable outcome rather than an implementation step. Behavior changes require appropriate automated test coverage. - **Verifiability:** The required feedback loops exist in repository instructions, build files, scripts, or CI configuration. - **Technical decisions:** Data structures, abstractions, and framework mechanisms fit the surrounding architecture without unnecessary indirection. - **Level of detail:** The plan records non-obvious decisions and interactions without prescribing routine implementation. -- **Omissions:** Judge relevant risks such as error handling, compatibility, migration, performance, security boundaries, and observability against the change at hand. +- **Omissions:** Check whether the plan addresses risks relevant to the change, including error handling, compatibility, migration, performance, security boundaries, and observability. - **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 filename 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 a3177be..829e603 100644 --- a/skills/guided-coding-setup/SKILL.md +++ b/skills/guided-coding-setup/SKILL.md @@ -14,7 +14,7 @@ Guided Coding needs these artifacts: - `ai-plans/`, the folder holding all plans and Plan Deviations documents. - `ai-plans/AGENTS.md`, describing the folder, its file naming rules, and how Frozen Plans are treated. -The outcome must be idempotent. Running this skill on a repository sets the artifacts up from scratch, brings outdated ones up to date, or leaves current ones untouched. Content unrelated to Guided Coding, such as project-specific instructions or user-authored notes, is never changed. +Create missing files and folders, update outdated Guided Coding instructions, and leave current content unchanged. Preserve unrelated content, including project-specific instructions and user-authored notes. ## 1. Inspect the Repository @@ -24,8 +24,8 @@ 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 -- dependency, secret, container, and source-code security scans. +- benchmarks +- 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. Link to those rules instead of repeating them in the root file. If both sections already exist and are current, leave the file alone. @@ -45,18 +45,21 @@ If both sections already exist and are current, leave the file alone. Create `ai-plans/` if it is missing. Compare `ai-plans/AGENTS.md` with `assets/ai-plans-AGENTS.md` relative to this skill file. - If the file is missing, copy the asset. -- If the file exists with an older `guided-coding-version` marker or without one, update the Guided Coding paragraphs and the marker. Keep every repository-specific addition, such as a custom plan structure, naming conventions, or notes about legacy file names. +- If the file exists with an older `guided-coding-version` marker or without one, update the Guided Coding paragraphs and the marker. Keep every repository-specific addition, such as a custom plan structure, naming conventions, or notes about legacy filenames. ## 4. Report and Give Customization Tips -List the files you created, updated, or left unchanged, the feedback loops you documented, and which commands you ran. Report to the user that they should verify the changes. +List the files you created, updated, or left unchanged, the feedback loops you documented, and which commands you ran. Ask the user to verify the changes. Then explain how Guided Coding can be customized, so the user knows the defaults are only a starting point: - **Plan structure:** `guided-coding-write-plan` uses a default structure with `## Rationale`, `## Acceptance Criteria`, and `## Technical Details`. It also ships the RDAT structure (`rdat-plan-structure.md`), which adds a `## Decisions` section with numbered Decisions as a summary for the reviewer. Name a structure file when invoking `guided-coding-write-plan`, or name it or describe your own structure in `ai-plans/AGENTS.md` to override the default. -- **File names:** the skills use the placeholders `` (UTC, `YYYY-MM-DD-HHMM`), ``, and `` (kebab-case, shortened ticket title). Conventions for these, e.g., a `` format or a maximum length for ``, belong in `ai-plans/AGENTS.md`. -- **Feedback loops:** plans should reference the feedback loops in the root `AGENTS.md` to make Acceptance Criteria verifiable. Adding or removing a feedback loop later only requires updating that list. -- **Plan review:** `guided-coding-plan-and-review` reads an optional `## Plan Review` section in `ai-plans/AGENTS.md`: the number of reviewers and a model preference for each, the round limit (default 3), and how findings against the user's decisions are handled: `collect` (default) reports them as open for the user, `pause` stops the round and asks the user. Each round starts one subagent per reviewer, so a run costs reviewers × rounds subagent runs at most, plus one replacement for each reviewer that fails. +- **Filenames:** the skills use the placeholders `` (UTC, `YYYY-MM-DD-HHMM`), ``, and `` (kebab-case, shortened ticket title). Conventions for these, e.g., a `` format or a maximum length for ``, belong in `ai-plans/AGENTS.md`. +- **Feedback loops:** plans should reference the feedback loops in the root `AGENTS.md` to make acceptance criteria verifiable. Adding or removing a feedback loop later only requires updating that list. +- **Plan review:** configure `guided-coding-plan-and-review` in an optional `## Plan Review` section in `ai-plans/AGENTS.md`. It supports a reviewer list with a model preference for each, a round limit (default 3), and a policy for findings that challenge the user's explicit decisions. `collect` (default) reports them as open for the user. `pause` stops the round and asks the user. + + Each round starts one subagent per reviewer. The maximum number of subagent runs is the number of reviewers multiplied by the round limit, plus one replacement for each reviewer that fails. + - **Deviations:** the threshold for what counts as a material deviation can be tightened or relaxed in `ai-plans/AGENTS.md`. Repository-specific conventions in `AGENTS.md` files take precedence over the skills' defaults. diff --git a/skills/guided-coding-setup/assets/ai-plans-AGENTS.md b/skills/guided-coding-setup/assets/ai-plans-AGENTS.md index 23b839b..fb947b7 100644 --- a/skills/guided-coding-setup/assets/ai-plans-AGENTS.md +++ b/skills/guided-coding-setup/assets/ai-plans-AGENTS.md @@ -2,11 +2,11 @@ -This directory is the append-only record of how work in this repository was planned and how it turned out, similar to Event Sourcing. It follows the [Guided Coding](https://kenny-codes.net/docs/guided-coding/) approach. +This directory records how work in this repository was planned and how it turned out. Preserve frozen documents and record later decisions in new plans. It follows the [Guided Coding](https://kenny-codes.net/docs/guided-coding/) approach. -Frozen Plan file names use `YYYY-MM-DD-HHMM--.md`, timestamped in UTC. The `` is omitted when work has no ticket. It also carries a `*Frozen at ` line directly below its title. When a plan is not frozen yet, its file name is typically `.md`. Plan Deviations filenames use `YYYY-MM-DD-HHMM--plan-deviations.md` or `YYYY-MM-DD-HHMM--plan-deviations.md`. +Frozen Plan filenames use `YYYY-MM-DD-HHMM--.md`, timestamped in UTC. The `` is omitted when work has no ticket. Each frozen plan also contains a `*Frozen at *` line directly below its title. When a plan is not frozen yet, its filename is typically `.md`. Plan Deviations filenames use `YYYY-MM-DD-HHMM--plan-deviations.md` or `YYYY-MM-DD-HHMM--plan-deviations.md`. -Plans are frozen when their Planning Phase ends. From then on, the only permitted edit is checking an acceptance criterion (`- [ ]` to `- [x]`) after the implementation and relevant feedback loops verify it. Never reword, add, remove, or reorder criteria in a frozen plan. Plan Deviations documents are frozen once they are merged into the target branch. Until then, it is rewritten under a fresh timestamp whenever it needs to change, e.g., when a review of the PR/MR leads to another Follow-Up Plan, so that it always sorts after all plans of its work item. +Plans are frozen when their Planning Phase ends. From then on, the only permitted edit is checking off an acceptance criterion (`- [ ]` to `- [x]`) after the implementation and relevant feedback loops verify it. Never reword, add, remove, or reorder criteria in a frozen plan. Plan Deviations documents are frozen when merged into the target branch. Until then, rename and rewrite the document with a new timestamp whenever it changes, for example, when a PR/MR review leads to another Follow-Up Plan. Its filename must sort after all plans for the work item. A Follow-Up Plan supersedes decisions of a Frozen Plan. The decision to write one is made in the Guiding Phase, when the review of the implementation calls for larger changes. diff --git a/skills/guided-coding-write-deviations/SKILL.md b/skills/guided-coding-write-deviations/SKILL.md index f409704..3fed6cb 100644 --- a/skills/guided-coding-write-deviations/SKILL.md +++ b/skills/guided-coding-write-deviations/SKILL.md @@ -12,17 +12,19 @@ A Plan Deviations document summarizes how the completed implementation differs f ## 1. Inspect the Plans and the Implementation -Read all plans for the current ticket in `ai-plans/`, oldest first. Identify them by the `` or `` in their file names, or by the plans mentioned in the conversation. Ask the user if the set of plans is unclear. +Read all plans for the current ticket in `ai-plans/`, oldest first. Identify them by the `` or `` in their filenames, or by the plans mentioned in the conversation. Ask the user if the set of plans is unclear. Determine the target branch and the implementation range. Use the PR/MR if there is one. Otherwise, use the merge base between the target branch and the implementation branch. Ask the user if the target branch is unclear. Inspect the commits in that range, all committed, staged, and unstaged changes, and any relevant earlier history. Verify every document and source-file reference you rely on. ## 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 filename 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: -1. Fetch the target branch from its remote into its remote-tracking branch with an explicit refspec, e.g., `git fetch origin +refs/heads/main:refs/remotes/origin/main`, and use that remote-tracking branch, e.g., `origin/main`. The explicit refspec updates it regardless of the remote's configured fetch mappings. Only if the repository has no remote at all, use the local target branch. If fetching fails, report the error and stop without changing anything: a stale local branch cannot prove that the document is unmerged. +1. Fetch the target branch into its remote-tracking branch using an explicit refspec, for example, `git fetch origin +refs/heads/main:refs/remotes/origin/main`. Use that remote-tracking branch (`origin/main` in this example) for the checks below. + + The explicit refspec updates it regardless of the remote's configured fetch mappings. Use the local target branch only if the repository has no remote. If the fetch fails, report the error and stop without changing anything. A stale local branch cannot prove that the document is unmerged. 2. Verify that the target branch resolves, e.g., `git rev-parse --verify origin/main`. If it does not, report this and stop without changing anything. 3. Check whether the document's path exists on the target branch, e.g., `git cat-file -e origin/main:ai-plans/`. Check the path, not whether commits are ancestors of the target branch: squash and rebase merges rewrite commits but keep the file. @@ -35,39 +37,39 @@ Otherwise, you update the existing document in the following steps. 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. +- **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. ## 4. Determine the File Name -The file name is: +The filename is: - `--plan-deviations.md` if a `` is present - `--plan-deviations.md` otherwise -Take `` or `` from the file name of the Initial Plan. The `` is the current time in UTC in the format `YYYY-MM-DD-HHMM`, also when you update an existing document. Use these commands to get it: +Take `` or `` from the filename of the Initial Plan. The `` is the current time in UTC in the format `YYYY-MM-DD-HHMM`, also when you update an existing document. Use these commands to get it: - `date -u +%F-%H%M` on Unix-based shells - `(Get-Date).ToUniversalTime().ToString("yyyy-MM-dd-HHmm")` on PowerShell -The Plan Deviations document must sort after all plans of the ticket. Therefore, the `` must be strictly later than the timestamps in the file names of all plans of the ticket and of the existing Plan Deviations document. If it is not, wait until the next minute and get the timestamp again. +Use a timestamp later than the timestamps of all plans for this ticket and of the existing Plan Deviations document. This keeps the document last when filenames are sorted. If the current timestamp is not later, wait until the next minute, get the timestamp again, and repeat the check. -If a plan or another Plan Deviations document with this file name already exists, report the collision and stop. Never overwrite a plan or a frozen Plan Deviations document. +If a plan or another Plan Deviations document with this filename already exists, report the collision and stop. Never overwrite a plan or a frozen Plan Deviations document. ## 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 filename. 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: 1. `# Plan Deviations` as the title. Prefer `` if present. -2. An opening paragraph that names every compared plan by its exact file name, names the implementation branch, and identifies plans that were not implemented. -3. `## Summary`: what held up, and how many material decisions changed. -4. `## Changes Across Follow-Up Plans`, only when Follow-Up Plans exist: one numbered `###` section per superseded decision with **Original decision**, **Superseded by** (exact file name and the replacement decision), **Why**, and **Outcome**. -5. `## Deviations From the Accepted Plans`, only when material deviations exist: one numbered `###` section per deviation with **Plan decision** (exact file name and decision), **Implemented**, **Why** (required), and **Impact** (trade-offs, consequences, or deferred work; omit only if there are none). +2. An opening paragraph that names every compared plan by its exact filename, names the implementation branch, and identifies plans that were not implemented. +3. `## Summary`: briefly, what remained valid overall and how many material decisions changed. +4. `## Changes Across Follow-Up Plans`, only when Follow-Up Plans exist: one numbered `###` section per superseded decision with **Original decision**, **Superseded by** (exact filename and the replacement decision), **Why**, and **Outcome**. +5. `## Deviations From the Accepted Plans`, only when material deviations exist: one numbered `###` section per deviation with **Plan decision** (exact filename and decision), **Implemented**, **Why** (required), and **Impact** (trade-offs, consequences, or deferred work). Omit **Impact** only if there are none. Name the affected types, members, and files. Leave out work that matches the accepted plans. If the implementation matches all Follow-Up Plans, say so in the Summary and omit `## Deviations From the Accepted Plans`. diff --git a/skills/guided-coding-write-plan/SKILL.md b/skills/guided-coding-write-plan/SKILL.md index 98dac65..d796d38 100644 --- a/skills/guided-coding-write-plan/SKILL.md +++ b/skills/guided-coding-write-plan/SKILL.md @@ -10,7 +10,7 @@ Your goal is to write an Initial Plan or Follow-Up Plan into the `ai-plans/` fol ## Plan File Name -The initial file name of the new plan file is `.md`. `` is a shortened kebab-case version of the ticket title. At this point in the conversation, you should be able to derive a full title from the discussion that you can shorten. If not, ask the user to provide one and shorten it. +Name the draft `.md`, using a shortened kebab-case version of the ticket title. If no ticket title is available, derive one from the discussion. Ask the user for a title only if you cannot derive one. ## Plan Structure @@ -20,11 +20,13 @@ 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 filename 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 to another structure. ## What Happens After Writing a Plan? -The user reviews the plan. They will provide feedback, aspects of the plan might change. Once both you and the user agree on the plan being ready for implementation, it is frozen and becomes largely immutable (except for checking off Acceptance Criteria). When a plan is frozen, its file name is changed to `--.md`, or `-.md` (if no `` is present). Also, a `*Frozen at ...*` line is inserted right below the `# Title` of the plan. All this doesn't happen in this step of the conversation. +The user reviews the draft and may request changes. Once you and the user agree it is ready for implementation, it can be frozen. The only permitted edits after freezing are checking off acceptance criteria. + +Freezing renames the file to `--.md`, or `-.md` when there is no ticket ID. It also adds a `*Frozen at ...*` line directly below the title. Do not freeze the plan while running this skill. ## Follow-up Plans @@ -36,4 +38,4 @@ Record only the changed decisions and outcomes. State exactly which earlier deci ## Most Importantly -Try to keep each plan as concise as possible. Simpler language is preferred over elaborate prose. +Keep plans concise. Use plain language. diff --git a/skills/guided-coding-write-plan/assets/default-plan-structure.md b/skills/guided-coding-write-plan/assets/default-plan-structure.md index 00a8091..462ed2d 100644 --- a/skills/guided-coding-write-plan/assets/default-plan-structure.md +++ b/skills/guided-coding-write-plan/assets/default-plan-structure.md @@ -2,14 +2,14 @@ Start with `# Title`, followed by exactly these sections in order: -1. `## Rationale`: briefly state the problem and overarching goal this issue is solving. -2. `## Acceptance Criteria`: list **observable, verifiable outcomes** as unticked Markdown tasks (`- [ ]`). Describe results, not implementation steps. -3. `## Technical Details`: Provide relevant information which guides the future implementer of the plan in the right direction. For example, references to existing APIs which should be extended, Design Patterns to follow, performance and threading insights, security aspects, how to design automated tests, considerations for automated benchmarks, and links to relevant docs. This list is not complete, you can add or remove elements depending on the context. Avoid step-by-step instructions and exhaustive listings. Assume the implementer is a senior software developer. +1. `## Rationale`: briefly state the problem and the goal of this issue. +2. `## Acceptance Criteria`: list **observable, verifiable outcomes** as unchecked Markdown tasks (`- [ ]`). Describe results, not implementation steps. +3. `## Technical Details`: record the technical guidance the implementer needs, such as APIs to extend, design patterns to follow, testing and benchmark guidance, links to relevant documentation, and any performance, threading, or security constraints. Include only what is relevant. Avoid step-by-step instructions and exhaustive listings. Assume the implementer is a senior software developer. Use minimal code examples only when they clarify an important contract, such as an API signature, interface, or DTO shape. Say whether an example is exact or illustrative. Avoid method bodies, step-by-step instructions, exhaustive file lists, and routine background. When behavior changes, require automated test coverage in the acceptance criteria. Require benchmarks only when performance is a material risk or requirement. -The root AGENTS.md and the referenced docs in it should define feedback loops (such as compilers, static code analyzers, automated tests, test coverage, mutation testing, automated benchmarks, etc.) available in the repository. Use them to make Acceptance Criteria verifiable. If there are no feedback loops listed, stop and report this to the user. +The root `AGENTS.md` and its referenced documents should list the repository's feedback loops, such as compilers, static analyzers, automated tests, code coverage, mutation testing, and benchmarks. Use them to make acceptance criteria verifiable. If there are no feedback loops listed, stop and report this to the user. If the plan requires a missing feedback loop, make adding it explicit in the plan. diff --git a/skills/guided-coding-write-plan/assets/rdat-plan-structure.md b/skills/guided-coding-write-plan/assets/rdat-plan-structure.md index 9091a88..5e1a76f 100644 --- a/skills/guided-coding-write-plan/assets/rdat-plan-structure.md +++ b/skills/guided-coding-write-plan/assets/rdat-plan-structure.md @@ -12,40 +12,46 @@ In one or two sentences, state the background and the problem this plan solves. ### 2. `## Decisions` -Decisions are the main point for communication with superiors: a reader who reads only this section knows what will be built and why. +A reviewer who reads only this section should know what will be built and why, and be able to approve the plan. -A Decision is a point where another choice was possible and would change the behavior, a public contract, the scope, or the dependencies. State the choice, not options left to the implementer, and give a one-sentence reason when the choice is not obvious. Leave routine implementation choices and what stays unchanged out. +Record a Decision when an alternative choice would affect behavior, public contracts, scope, or dependencies. State the choice, not options left to the implementer, and give a one-sentence reason when the choice is not obvious. Leave routine implementation choices and what stays unchanged out. Each Decision gets a **Decision ID**: `D1`, `D2`, etc. Keep existing Decision IDs when revising the draft. Use as few Decisions as the plan needs. -Check the premises of each Decision against the code, including relevant claims of the ticket and the behavior of existing code you plan to reuse. 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. If a premise that matters remains unverified, state it in the affected Decision, together with its consequence and what would resolve it. If a check invalidates a premise of a Decision you made, refine the Decision. If it invalidates a premise of a Decision the user made, ask the user. +Check the assumptions behind each Decision against the code, including relevant claims made in the ticket and the behavior of existing code you plan to reuse. If reading the code is not enough, use temporary tests or projects to check the actual behavior. A simulation alone does not confirm it. + +If an important assumption remains unverified, state it in the affected Decision, along with its consequence and what would resolve it. If a check disproves an assumption behind your own Decision, revise that Decision. If it disproves an assumption behind the user's Decision, ask the user. The last Decision may be an `Out-of-Scope` Decision, listing what the ticket or the discussion mentioned and the plan deliberately does not address. Do not invent exclusions. ### 3. `## Acceptance Criteria` -This is a list of **observable, verifiable outcomes** as unticked Markdown tasks (`- [ ]`). Each Decision except the `Out-of-Scope` Decision must be verifiable through at least one AC. ACs must not introduce behavior, contracts, scope, or dependencies that no Decision states. Tests and routine documentation that verify or explain a Decision refer to it and need no Decision of their own. +List **observable, verifiable outcomes** as unchecked Markdown tasks (`- [ ]`). Each Decision, except the `Out-of-Scope` Decision, must have at least one acceptance criterion that verifies it. Criteria must not introduce behavior, contracts, scope, or dependencies absent from the Decisions. + +Tests and routine documentation that verify or explain a Decision should refer to it. They do not need separate Decisions. -Choose the Feedback Loops of AGENTS.md and its referenced documents that actually verify an AC's outcome, such as compilers, static code analyzers, automated tests and code coverage, mutation testing, and automated benchmarks. If no Feedback Loops are listed, stop and report this to the user. +Choose feedback loops listed in `AGENTS.md` or its referenced documents that verify the criterion's outcome, such as compilers, static analyzers, automated tests, code coverage, mutation testing, and benchmarks. If no feedback loops are listed, stop and report this to the user. - When behavior changes, require automated tests and name the cases they must cover, including negative and failure cases. -- Do not add ACs for checks every change must pass anyway, such as building or running the whole test suite. +- Do not add acceptance criteria for checks every change must pass anyway, such as building or running the whole test suite. - Require benchmarks only when performance is a material risk or requirement. -- Consider how long a Feedback Loop runs and weigh it against its benefits. For slow loops such as mutation testing, the corresponding AC should have a high impact to warrant it. -- Some ACs need human review, e.g., the quality of documentation or platform behavior that the available Feedback Loops do not cover. State what is checked and who verifies it. -- If a plan requires a missing Feedback Loop, adding it is a Decision with its own AC. +- Weigh each feedback loop's runtime against its benefits. Reserve slow checks, such as mutation testing, for criteria important enough to justify the time. +- Some acceptance criteria need human review, e.g., the quality of documentation or platform behavior that the available feedback loops do not cover. State what is checked and who verifies it. +- If a plan requires a missing feedback loop, adding it is a Decision with its own acceptance criterion. ### 4. `## Technical Details` Provide only what the implementer, who has not seen the planning conversation, cannot quickly see in the code: where a change goes when it is not obvious, existing code to follow, interactions with other parts of the codebase, pitfalls, performance, threading or security aspects, and how to structure automated tests. Nothing here adds a behavior, a contract, or an exclusion: that is a Decision. -Avoid step-by-step instructions and exhaustive listings. Use minimal code samples only when they clarify an important contract, such as an API signature, interface, or DTO shape. Say whether an example is exact or illustrative; an exact example must compile. Avoid providing finished implementations. +Avoid step-by-step instructions and exhaustive listings. Use minimal code samples only when they clarify an important contract, such as an API signature, interface, or DTO shape. Say whether an example is exact or illustrative. An exact example must compile. Avoid providing finished implementations. ## How to Keep Plans Short and to the Point -State each fact once: a section adds information to the previous sections and avoids duplication. Decisions are not repeated in the Acceptance Criteria or Technical Details; refer to them by their Decision ID instead. An exact contract, such as an error message or a verdict table, appears in one place, and the other sections refer to it. Acceptance Criteria add how an outcome is verified, such as test inputs, expected results, and failure cases; Technical Details add how to implement it. +State each fact once. Each section adds information to the previous sections. In Acceptance Criteria and Technical Details, refer to Decisions by their Decision IDs instead of repeating them. Keep exact contracts, such as error messages or verdict tables, in one place and refer to them from other sections. + +Acceptance Criteria explain how to verify outcomes, including test inputs, expected results, and failure cases. Technical Details explain how to implement them. -The same goes for general guidance in AGENTS.md or its referenced documents. Refer to them by a link to their section or by their rule ID instead of duplicating their information. +The same goes for general guidance in `AGENTS.md` or its referenced documents. Refer to them by a link to their section or by their rule ID instead of duplicating their information. Leave out the history of your investigation and routine details the implementer can quickly find in the code.