diff --git a/CHANGELOG.md b/CHANGELOG.md index 98f7ade..902102a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to Guided Coding are documented here. ## [Unreleased] +- 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. +- 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. + ## [2.0.0] - 2026-09-27 - Add UTC timestamps to plan and Plan Deviations filenames. diff --git a/README.md b/README.md index 4adf000..ba43251 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,16 @@ The full method is documented at In most Agent Harnesses, these workflows must be invoked explicitly. All workflows set `allow_implicit_invocation: false` for Agent Plugins and `disable-model-invocation: true` for Claude Plugins, respectively. +## Plan Structures + +`guided-coding-write-plan` ships two plan structures: + +- `default-plan-structure.md` (the default): Rationale, Acceptance Criteria, Technical Details. +- `rdat-plan-structure.md` (RDAT): Rationale, Decisions, Acceptance Criteria, Technical Details. The numbered Decisions summarize what the reviewer approves, and each section adds information instead of repeating earlier ones. This is intended as an improvement over the default plan structure, available as of version 2.1.0. + +To choose a structure for one plan, name its file when invoking the skill, e.g. `/guided-coding-write-plan rdat-plan-structure.md`. To choose it for a repository, name it in `ai-plans/AGENTS.md`, e.g. "Use the RDAT plan structure (`rdat-plan-structure.md`)." You can also describe your own str +ucture there or pass a path to your own structure file. + ## Guided Learning Guided Learning is a variation of Guided Coding where the agent does not implement the plan itself but teaches you how to implement it. The `guided-coding-implement-show-me` and `guided-coding-implement-coach-me` skills give you two approaches for Beginning and Advanced developers that want to increase their capabilities. The regular `guided-coding-implement` skill should be used for regular Guided Coding. diff --git a/claude-plugin/claude-skills/setup/SKILL.md b/claude-plugin/claude-skills/setup/SKILL.md index 75f132c..a4bc35f 100644 --- a/claude-plugin/claude-skills/setup/SKILL.md +++ b/claude-plugin/claude-skills/setup/SKILL.md @@ -54,7 +54,7 @@ List the files you created, updated, or left unchanged, the feedback loops you d 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`. Describing a different structure in `ai-plans/AGENTS.md` overrides the default. +- **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. - **Deviations:** the threshold for what counts as a material deviation can be tightened or relaxed in `ai-plans/AGENTS.md`. diff --git a/claude-plugin/claude-skills/write-plan/SKILL.md b/claude-plugin/claude-skills/write-plan/SKILL.md index 9effee8..223451d 100644 --- a/claude-plugin/claude-skills/write-plan/SKILL.md +++ b/claude-plugin/claude-skills/write-plan/SKILL.md @@ -15,7 +15,13 @@ The initial file name of the new plan file is `.md`. ` ## Plan Structure -Check whether `ai-plans/AGENTS.md` contains the plan structure. If not, fall back to `assets/default-plan-structure.md` relative to this skill file. +Use the first plan structure that applies: + +1. A plan structure the user names when invoking this skill: a path to a Markdown file, or the name of a file in `assets/` relative to this skill file, such as `rdat-plan-structure.md`. +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. ## What Happens After Writing a Plan? @@ -25,7 +31,7 @@ The user reviews the plan. They will provide feedback, aspects of the plan might 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. -Use the same format and file naming convention. Read every earlier document for the ticket. In the opening section of the plan (`## Rationale` in the default structure), name the plans this one follows by exact filename. +Use the plan structure selected above and the same file naming convention. Read every earlier document for the ticket. In the opening section of the plan (`## Rationale` in the default structure), name the plans this one follows by exact filename. Record only the changed decisions and outcomes. State exactly which earlier decisions this plan supersedes and why. Do not repeat unchanged decisions or contradict earlier plans silently. 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 new file mode 100644 index 0000000..9091a88 --- /dev/null +++ b/claude-plugin/claude-skills/write-plan/assets/rdat-plan-structure.md @@ -0,0 +1,54 @@ +# RDAT Guided Coding Plan Structure + +RDAT stands for Rationale, Decisions, Acceptance Criteria, and Technical Details. + +## Plan Structure + +Start with `# Title`, followed by these four sections in order. Only the optional `## Notes for the Guided Learning Teacher` section described at the end may follow them. + +### 1. `## Rationale` + +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 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. + +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. + +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. + +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. + +- 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. +- 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. + +### 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. + +## 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. + +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. + +## One Additional Section: `## Notes for the Guided Learning Teacher` + +When a plan will be implemented using the `guided-coding-implement-show-me` or the `guided-coding-implement-coach-me` skill, it may include this additional section. Use it for further topics to teach during the Implementing Phase, such as SOLID, TDD, or technology internals. diff --git a/skills/guided-coding-setup/SKILL.md b/skills/guided-coding-setup/SKILL.md index 4d97f5d..3d8ca43 100644 --- a/skills/guided-coding-setup/SKILL.md +++ b/skills/guided-coding-setup/SKILL.md @@ -53,7 +53,7 @@ List the files you created, updated, or left unchanged, the feedback loops you d 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`. Describing a different structure in `ai-plans/AGENTS.md` overrides the default. +- **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. - **Deviations:** the threshold for what counts as a material deviation can be tightened or relaxed in `ai-plans/AGENTS.md`. diff --git a/skills/guided-coding-write-plan/SKILL.md b/skills/guided-coding-write-plan/SKILL.md index d8b9756..c833a97 100644 --- a/skills/guided-coding-write-plan/SKILL.md +++ b/skills/guided-coding-write-plan/SKILL.md @@ -14,7 +14,13 @@ The initial file name of the new plan file is `.md`. ` ## Plan Structure -Check whether `ai-plans/AGENTS.md` contains the plan structure. If not, fall back to `assets/default-plan-structure.md` relative to this skill file. +Use the first plan structure that applies: + +1. A plan structure the user names when invoking this skill: a path to a Markdown file, or the name of a file in `assets/` relative to this skill file, such as `rdat-plan-structure.md`. +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. ## What Happens After Writing a Plan? @@ -24,7 +30,7 @@ The user reviews the plan. They will provide feedback, aspects of the plan might 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. -Use the same format and file naming convention. Read every earlier document for the ticket. In the opening section of the plan (`## Rationale` in the default structure), name the plans this one follows by exact filename. +Use the plan structure selected above and the same file naming convention. Read every earlier document for the ticket. In the opening section of the plan (`## Rationale` in the default structure), name the plans this one follows by exact filename. Record only the changed decisions and outcomes. State exactly which earlier decisions this plan supersedes and why. Do not repeat unchanged decisions or contradict earlier plans silently. diff --git a/skills/guided-coding-write-plan/assets/rdat-plan-structure.md b/skills/guided-coding-write-plan/assets/rdat-plan-structure.md new file mode 100644 index 0000000..9091a88 --- /dev/null +++ b/skills/guided-coding-write-plan/assets/rdat-plan-structure.md @@ -0,0 +1,54 @@ +# RDAT Guided Coding Plan Structure + +RDAT stands for Rationale, Decisions, Acceptance Criteria, and Technical Details. + +## Plan Structure + +Start with `# Title`, followed by these four sections in order. Only the optional `## Notes for the Guided Learning Teacher` section described at the end may follow them. + +### 1. `## Rationale` + +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 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. + +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. + +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. + +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. + +- 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. +- 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. + +### 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. + +## 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. + +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. + +## One Additional Section: `## Notes for the Guided Learning Teacher` + +When a plan will be implemented using the `guided-coding-implement-show-me` or the `guided-coding-implement-coach-me` skill, it may include this additional section. Use it for further topics to teach during the Implementing Phase, such as SOLID, TDD, or technology internals.