From 25568e1ebd41ff1e92554c62b9955c6127778dce Mon Sep 17 00:00:00 2001 From: darthsharp <48331467+darthsharp@users.noreply.github.com> Date: Wed, 11 Nov 2026 19:37:38 +0100 Subject: [PATCH] feat: implement next phase skill - skills: flesh out `shade-kit-next-phase` flow and version handshake - skills: clarify `shade-kit-next-steps` use of passed `phase next` results - docs: mark package 06-6 implemented and update skill foundation status --- .../06-2-skill-conventions-and-version.md | 2 +- .../feature-packages/06-3-next-steps-skill.md | 5 +- .../feature-packages/06-6-next-phase-skill.md | 60 +++++++++--- docs/feature-packages/06-skill-foundation.md | 2 +- docs/feature-packages/README.md | 5 +- skills/shade-kit-next-phase/SKILL.md | 97 ++++++++++++++++--- skills/shade-kit-next-steps/SKILL.md | 8 +- 7 files changed, 142 insertions(+), 37 deletions(-) diff --git a/docs/feature-packages/06-2-skill-conventions-and-version.md b/docs/feature-packages/06-2-skill-conventions-and-version.md index 423650b..4657cc1 100644 --- a/docs/feature-packages/06-2-skill-conventions-and-version.md +++ b/docs/feature-packages/06-2-skill-conventions-and-version.md @@ -86,7 +86,7 @@ Status as of 2026-11-06. There are no automated tests of the skill texts (skill - **FP06-2-AC1** Every skill under `skills/` has `metadata.version` in its frontmatter, and all skills have the same SemVer value. **Implemented**: all 17 skills carry `metadata.version: 0.7.0`. Proven by a one-off check that all values are equal, are strings, and are a plain `x.y.z`; no automated test, by the rule of this package. Skill-creator's `quick_validate.py` (17 of 17 valid) shows that the frontmatter stays valid; it does not read `metadata`. - **FP06-2-AC2** The result of the visibility check for Claude Code is recorded in this package with the date and how it was checked. **Implemented**: recorded under Frontmatter visibility (2026-11-06, Claude Code 2.1.318). -- **FP06-2-AC3** If the check finds that the model does not see the frontmatter, every skill that calls `version --expect` states the same version in the text of its handshake step. Rule and wording **Decided** on 2026-11-06 (Frontmatter visibility). `shade-kit-phase-entry` (06-5) applies it since 2026-11-10 (`--expect 0.7.0` in the text of its handshake step); the skeletons still call `shade-kit version --json` without it until 06-6 and 06-9 write their handshake steps. +- **FP06-2-AC3** If the check finds that the model does not see the frontmatter, every skill that calls `version --expect` states the same version in the text of its handshake step. Rule and wording **Decided** on 2026-11-06 (Frontmatter visibility). `shade-kit-phase-entry` (06-5) applies it since 2026-11-10 and `shade-kit-next-phase` (06-6) since 2026-11-11 (`--expect 0.7.0` in the text of their handshake steps); the other skeletons still call `shade-kit version --json` without it until 06-9 writes their handshake steps. ## Open points diff --git a/docs/feature-packages/06-3-next-steps-skill.md b/docs/feature-packages/06-3-next-steps-skill.md index a096ec7..75d4695 100644 --- a/docs/feature-packages/06-3-next-steps-skill.md +++ b/docs/feature-packages/06-3-next-steps-skill.md @@ -2,7 +2,7 @@ | | | |---|---| -| Status | Draft, 2026-11-04 (split from package 06), updated 2026-11-08 (implementation: `skills/shade-kit-next-steps/SKILL.md`; the steps of a pending transition and of a `done` feature, the refusal table keyed by error code, a missing `shade-kit`, a failing `phase next`, repeated warnings, the closing line of a refusal). AC1 to AC4 implemented; loading the skill from other skills follows in 06-5, 06-6, and 06-9. | +| Status | Draft, 2026-11-04 (split from package 06), updated 2026-11-08 (implementation: `skills/shade-kit-next-steps/SKILL.md`; the steps of a pending transition and of a `done` feature, the refusal table keyed by error code, a missing `shade-kit`, a failing `phase next`, repeated warnings, the closing line of a refusal), 2026-11-11 (06-6: a `phase next` result passed by the calling skill replaces the skill's own call, stated once in flow step 3). AC1 to AC4 implemented; loading the skill from other skills follows in 06-5, 06-6, and 06-9. | | Source | [06 Skill foundation](06-skill-foundation.md) (next-steps message), [phase start analysis](../../research/shade-kit-phase-start-analysis.md) | | Kind | Skill (new general skill) | | Depends on | 06-2 | @@ -30,6 +30,7 @@ Every kit skill ends the same way: the human sees what they can do now and which - Why the skill ends: end of its work, a "no" (with the reported gaps), or a refusal (the failure envelope). - The warnings of the CLI calls of the calling skill. +- Optionally the result of a `phase next --json` that the calling skill ran in this run (for example `shade-kit-next-phase`, 06-6). The skill then uses it and does not run `phase next` itself: a second call reads the same state and only repeats the warnings. Without one, the skill runs `phase next` once where it needs the steps. **Decided** on 2026-11-11 (06-6 implementation). **Implemented**. ### Message @@ -79,6 +80,8 @@ Status as of 2026-11-08. There are no automated tests of the skill texts (06-2), - **FP06-3-AC1** With a current feature, the message shows exactly the steps `phase next --json` returns, each with the skill to call, plus `/shade-kit-discuss` and `/shade-kit-drop`. **Implemented.** Two additions to "exactly" were decided on 2026-11-08: the step that discards a pending transition and the options of a `done` feature (functional description). Proven in the scenarios: in progress, pending, done, and 42. - **FP06-3-AC2** After a refusal, the message names the reason from the failure envelope and the options of its row in the refusal table; for a code without a row it shows the message of the failure envelope. **Implemented.** Proven in the scenarios: 37, 42, 47, the unknown code `git-unavailable`, and the failing `phase next` after `drop`. - **FP06-3-AC3** Every warning of `phase start` and `phase next` that the calling skill passes or the skill receives is shown. **Implemented.** Proven in the scenarios: a warning that is both passed in and received is shown once, and a passed warning is shown when `phase next` fails. +Re-checked on 2026-11-11 after the change to flow step 3 (06-6, iteration 3): with a passed `phase next` result the skill ran no `phase next` (five scenarios of `shade-kit-next-phase`); without one it ran `phase next` exactly once (the end of work in `refine`, a refused `phase start` with `transition-not-allowed`, and two endings of `shade-kit-next-phase` without a feature). All 70 checks passed. + - **FP06-3-AC4** The skill starts no skill and calls no command that changes the state (`phase start`, `phase approve`, `phase reject`, `phase complete`, `feature set`). **Implemented.** The rules of the skill allow only `shade-kit phase next --json`. In every scenario no command other than that one was run. ## Open points diff --git a/docs/feature-packages/06-6-next-phase-skill.md b/docs/feature-packages/06-6-next-phase-skill.md index a71ec83..1c04a2f 100644 --- a/docs/feature-packages/06-6-next-phase-skill.md +++ b/docs/feature-packages/06-6-next-phase-skill.md @@ -2,9 +2,9 @@ | | | |---|---| -| Status | Draft, 2026-11-04 (split from package 06) | +| Status | Implemented (AC1 to AC5), 2026-11-11: `skills/shade-kit-next-phase/SKILL.md`. Draft of 2026-11-04 (split from package 06). | | Source | [06 Skill foundation](06-skill-foundation.md) (`shade-kit-next-phase`), [phase start analysis](../../research/shade-kit-phase-start-analysis.md) | -| Kind | Skill (skeleton exists) | +| Kind | Skill (skeleton worked out) | | Depends on | 06-1, 06-3 | | Enables | 06-9, package 07 (FP07-AC1 loads this skill) | @@ -24,11 +24,11 @@ When the developer does not know where a feature stands, `shade-kit-next-phase` ## Functional description -Shows the human where a feature stands and which skill to call next. It is advisory: it starts no phase skill, never runs a gate check, and never calls `phase start`, `phase approve`, or `phase reject`. **Decided** on 2026-10-30 ([phase start analysis](../../research/shade-kit-phase-start-analysis.md)), replacing "starts the phase skill the human chooses" from the skills interview on 2026-10-17. +Shows the human where a feature stands and which skill to call next. It is advisory: it starts no phase skill, never runs a gate check, and never calls `phase start`, `phase approve`, or `phase reject`. **Decided** on 2026-10-30 ([phase start analysis](../../research/shade-kit-phase-start-analysis.md)), replacing "starts the phase skill the human chooses" from the skills interview on 2026-10-17. **Implemented**. -1. Version handshake: `shade-kit version --json --expect ` with the version stated in the text of the step, as 06-2 sets out; the frontmatter is the source, but the model does not see it (06-1, 06-2). **Decided** on 2026-11-04, the version in the text on 2026-11-06. On a mismatch, or if `shade-kit` is not found, end with the next-steps message (06-3). -2. `shade-kit feature current --json`. If not resolved: list the features (`feature list --json`) and ask which one to use; after the human picks one, the skill may call `feature set `, which starts no phase. Otherwise name `/shade-kit-new` and end. -3. `shade-kit phase next --json` (package 04). The skill does not derive the steps from the profile. +1. Version handshake: `shade-kit version --json --expect ` with the version stated in the text of the step, as 06-2 sets out; the frontmatter is the source, but the model does not see it (06-1, 06-2). **Decided** on 2026-11-04, the version in the text on 2026-11-06. On a mismatch, or if `shade-kit` is not found, end with the next-steps message (06-3). **Implemented** (`--expect 0.7.0`, the same wording as `shade-kit-phase-entry`). +2. `shade-kit feature current --json`. If not resolved: list the features (`feature list --json`) and ask which one to use; after the human picks one, the skill may call `feature set `, which starts no phase. Otherwise name `/shade-kit-new` and end. **Implemented**. +3. `shade-kit phase next --json` (package 04). The skill does not derive the steps from the profile. **Implemented**. | State | `phase next` returns | Shown | |---|---|---| @@ -40,16 +40,50 @@ Shows the human where a feature stands and which skill to call next. It is advis Only `pending` and `forward` have a gate. -4. End with these steps through `shade-kit-next-steps` (06-3), including the warnings of `phase next`. The human chooses by calling the skill. +4. End with these steps through `shade-kit-next-steps` (06-3), including the warnings of `phase next`. The human chooses by calling the skill. **Implemented**: the skill passes the result of `phase next` and the warnings of all its CLI calls, and `shade-kit-next-steps` writes the message from them without running `phase next` again. + +### Decisions and defaults of the implementation + +- **A feature named in the call while none is resolved**: the skill still lists the features and asks; the named feature is offered first. `feature set` changes the current feature, so the human confirms it. **Decided** on 2026-11-11 (implementation clarification). **Implemented**. +- **A question about another feature than the resolved one**: the skill does not switch. It shows the current feature and says how to switch: `shade-kit feature set ` when the override selected the current feature, or a branch whose name ends in `/` (`feature new` suggests `feature/`) when the branch selected it, because the branch wins over the override (03). **Decided** on 2026-11-11 (implementation clarification). **Implemented**. +- **Only active features are offered** for the pick; a finished feature has no next step. Without an active feature the skill asks nothing and ends. **Decided** on 2026-11-11 (implementation clarification). **Implemented**. +- **Proof** by scenario runs with the skeleton as the baseline, checked by a script, as in 06-4 and 06-5. **Decided** on 2026-11-11. +- **Ending without a feature** (no active feature, a new feature chosen, no pick, no answer): reason end of work; `shade-kit-next-steps` runs `phase next`, which fails with `no-current-feature`, and its refusal row names `/shade-kit-new`, `shade-kit feature list`, and `shade-kit feature set `. The skill writes no message of its own. **Proposed**. +- **An answer that names no listed feature**: ask once more, then end without a pick. **Proposed**. +- **The "what happened" line** passed to `shade-kit-next-steps` is "Status of ``.", plus, where it applies, that `` is now the current feature (after `feature set`), the line about another feature, and that an approval or phase start asked for in the call is not recorded and the phase skill asks for it. The last one was added after iteration 1: a runner noted that a human who approved in the call may believe the transition went through. **Proposed**. +- **Warnings**: the skill keeps the warnings of every CLI call and passes them on; the closing message shows each one once. **Proposed** (as in 06-5). +- **The passed `phase next` result in `shade-kit-next-steps`** (06-3): its input section said to use a passed result, while its flow steps 1 and 2 said to run `phase next`. Runners of three scenarios noted the contradiction, though all followed the input section. Flow step 3 of `shade-kit-next-steps` now states the rule once (use a passed result, otherwise run `phase next` once), and steps 1 and 2 refer to it. **Decided** on 2026-11-11. **Implemented**; proven in iteration 3 (below). +- The skill runs only `shade-kit version --json --expect 0.7.0`, `feature current`, `feature list`, `feature set ` (only after the human picked that feature), and `phase next`, each with `--json`; loads only `shade-kit-next-steps`; reads or writes no file. **Implemented**. ## Acceptance criteria -- **FP06-6-AC1** With an engine whose minor version differs from the skill's, or without `shade-kit`, the skill stops before any other CLI call and names what to update. -- **FP06-6-AC2** With no resolvable current feature, the skill lists the features and names `/shade-kit-new`; it starts no skill. -- **FP06-6-AC3** For a feature whose current phase is `in-progress`, the skill names the phase skill of the current phase. -- **FP06-6-AC4** The skill never runs a gate check and never calls `phase approve`. -- **FP06-6-AC5** The skill shows exactly the steps `phase next --json` returns, plus `shade-kit-discuss` and `shade-kit-drop`, each with the skill to call, and starts no skill. +Status as of 2026-11-11. Skill texts have no automated tests, so each criterion names how it is proven: scenario runs in which a fresh subagent loaded the skill as if the human had called it, and followed it and `shade-kit-next-steps` with canned CLI envelopes and canned answers of the human. The subagent was not told the expected result and recorded every command, question, loaded skill, and its closing message, and a script checked every run. The baseline was the skeleton of the skill. Iteration 1 ran the first text, iteration 2 the text after three fixes found in iteration 1 (an approval in the call is not recorded and the message says so; the message says when `feature set` changed the current feature; the branch is named by its `/` ending). Each scenario ran once per text and configuration, so the variance is not measured. The scenarios, fixtures, outputs, and the checker stay outside the repository, as in 06-4 (D-28). + +| # | Scenario | Iteration 1 | Iteration 2 | Skeleton baseline (iteration 2 checks) | +|---|---|---|---|---| +| 1 | Version mismatch (`version-mismatch`) | 9 of 9 | 9 of 9 | 6 of 9: `version --json` without `--expect` cannot detect a mismatch | +| 2 | Resolved, `map` `in-progress`, `gates-defaults-used` | 12 of 12 | 12 of 12 | 8 of 12: the warning not shown | +| 3 | Not resolved, feature named in the call, the human picks it | 14 of 15 | 15 of 15 | 11 of 15: offers the done feature, `feature set` without `--json` | +| 4 | Not resolved, the human wants a new feature | 10 of 10 | 10 of 10 | 7 of 10 | +| 5 | `awaiting-approval`, the human approves in the call | 11 of 12 | 12 of 12 | 9 of 12 | +| 6 | Resolved by the branch, the human asks about another feature | 10 of 11 | 11 of 11 | 8 of 11 | +| 7 | Not resolved, only a done feature | 9 of 9 | 9 of 9 | 4 of 9: asks and sets the done feature | +| 8 | Resolved feature is `done` | 11 of 11 | 11 of 11 | 8 of 11 | +| | Total | 86 of 89 (iteration 1 checks: 86 of 86) | 89 of 89 | 61 of 89 (iteration 1 checks: 60 of 86) | + +The baseline ran once, in iteration 1, and was checked again with the checks of iteration 2. + +Iteration 3 ran after the change to flow step 3 of `shade-kit-next-steps` (decisions above), with the text of iteration 2 of this skill: scenarios 2, 5, and 8 (a `phase next` result passed) and 4 and 7 (none passed) again, 54 of 54, `phase next` run exactly once in each; and two new scenarios of `shade-kit-next-steps` alone, loaded by `shade-kit-refine` without a `phase next` result: the end of work in `refine` (7 of 7) and a refused `phase start implement` with `transition-not-allowed` (9 of 9), in each `phase next` run exactly once and no other command. The runners of scenarios 4 and 7 noted that `shade-kit-next-steps` runs a `phase next` there that can only fail with `no-current-feature`; that is the **Proposed** ending without a feature above. + +Six checks run in every scenario: the first command is the handshake with `--expect 0.7.0`; `--json` on every command; no `phase start`, `phase approve`, `phase reject`, `phase complete`, `gate info`, `feature new`, `feature drop`, or `init`; no file read or written; `shade-kit-next-steps` loaded; neither `shade-kit-gate-check` nor a phase skill loaded. The runners of iteration 2 still noted points of wording that the text leaves to the agent (where the added sentences go in the "what happened" line, whether to suggest calling the skill again after switching the branch); none changed a decision. + +- **FP06-6-AC1** With an engine whose minor version differs from the skill's, or without `shade-kit`, the skill stops before any other CLI call and names what to update. **Implemented.** Proven in scenario 1: only `shade-kit version --json --expect 0.7.0` ran, `shade-kit-next-steps` was loaded with reason refusal and the `version-mismatch` envelope, and the message names the update to 0.7. A missing `shade-kit` takes the same ending ("`shade-kit` not found"); it has no scenario run. +- **FP06-6-AC2** With no resolvable current feature, the skill lists the features and names `/shade-kit-new`; it starts no skill. **Implemented.** Proven in scenarios 3, 4, and 7: `feature list --json` after the unresolved `feature current`; in 3 and 4 one question with both active features, the new feature, and no pick (in 3 the named feature first), never the done feature; in 4 and 7 no `feature set`, no skill but `shade-kit-next-steps` loaded, and `/shade-kit-new` in the message; in 7 no question. +- **FP06-6-AC3** For a feature whose current phase is `in-progress`, the skill names the phase skill of the current phase. **Implemented.** Proven in scenarios 2 (`/shade-kit-map`), 3 (`/shade-kit-diagnose`, after `feature set gh-150-fix-crash --json`), and 6 (`/shade-kit-map` of the branch's feature). +- **FP06-6-AC4** The skill never runs a gate check and never calls `phase approve`. **Implemented.** Proven in all eight scenarios (common checks), including scenario 5, where the human approved in the call: no `phase approve`, no question, and the message says that the approval is not recorded and `/shade-kit-plan` asks for it. +- **FP06-6-AC5** The skill shows exactly the steps `phase next --json` returns, plus `shade-kit-discuss` and `shade-kit-drop`, each with the skill to call, and starts no skill. **Implemented.** Proven in scenarios 2, 3, 5, 6, and 8: the steps of the canned result and `/shade-kit-discuss` and `/shade-kit-drop`, no other phase skill named, `phase next` run once (not again by `shade-kit-next-steps`); in 5 `pending` with `/shade-kit-plan` and the discard step `/shade-kit-map`; in 8 the finished feature with `shade-kit feature set ` and `/shade-kit-new`. ## Open points -None. +- The defaults of the implementation marked **Proposed** above. +- No scenario run for a missing `shade-kit`, for a failing `feature current`, `feature list`, `feature set`, or `phase next`, or for an answer that names no listed feature; the text covers each case. diff --git a/docs/feature-packages/06-skill-foundation.md b/docs/feature-packages/06-skill-foundation.md index ce5f9f3..896828f 100644 --- a/docs/feature-packages/06-skill-foundation.md +++ b/docs/feature-packages/06-skill-foundation.md @@ -2,7 +2,7 @@ | | | |---|---| -| Status | Draft, 2026-10-14, updated 2026-10-17 (template conventions, checklist format), 2026-10-18 (no router: `shade-kit-next-phase` and entry protocol; findings clarification: `phase next`, pending transition, report and review skills), 2026-10-24 (documentation check: skill names of the general skills, placeholders in checklist copies), 2026-10-25 (code review of the rework of `feature new` in package 03: `request.md` treated as data, not as instructions), 2026-10-30 ([phase start analysis](../../research/shade-kit-phase-start-analysis.md): phases start only when the user calls the phase skill, `shade-kit-next-phase` is advisory, next-steps message, active phase asks the human), 2026-11-04 (split into the sub-features 06-1 to 06-9; version in the skill frontmatter, checked by the engine; `shade-kit-report` moved to package 15), 2026-11-06 (06-2: Claude Code does not show the frontmatter to the model), 2026-11-08 (06-3: `shade-kit-next-steps` implemented; 06-4: `shade-kit-gate-check` and `shade-kit gate info` implemented), and 2026-11-10 (06-5: `shade-kit-phase-entry` implemented) | +| Status | Draft, 2026-10-14, updated 2026-10-17 (template conventions, checklist format), 2026-10-18 (no router: `shade-kit-next-phase` and entry protocol; findings clarification: `phase next`, pending transition, report and review skills), 2026-10-24 (documentation check: skill names of the general skills, placeholders in checklist copies), 2026-10-25 (code review of the rework of `feature new` in package 03: `request.md` treated as data, not as instructions), 2026-10-30 ([phase start analysis](../../research/shade-kit-phase-start-analysis.md): phases start only when the user calls the phase skill, `shade-kit-next-phase` is advisory, next-steps message, active phase asks the human), 2026-11-04 (split into the sub-features 06-1 to 06-9; version in the skill frontmatter, checked by the engine; `shade-kit-report` moved to package 15), 2026-11-06 (06-2: Claude Code does not show the frontmatter to the model), 2026-11-08 (06-3: `shade-kit-next-steps` implemented; 06-4: `shade-kit-gate-check` and `shade-kit gate info` implemented), 2026-11-10 (06-5: `shade-kit-phase-entry` implemented), and 2026-11-11 (06-6: `shade-kit-next-phase` implemented) | | Source | Concept §3.2, §3.3, §3.4, §11.4, [concept §9.6](../../research/shade-kit-concept.md#9-version-drift) | | Depends on | 01, 03, 04, 05 | | Enables | 07, 08, and every phase package (09–17) | diff --git a/docs/feature-packages/README.md b/docs/feature-packages/README.md index 798f27c..14e57cf 100644 --- a/docs/feature-packages/README.md +++ b/docs/feature-packages/README.md @@ -1,6 +1,6 @@ # SHADE kit v1 feature packages -Status: draft, 2026-10-14, updated 2026-10-18 (consistency review, findings clarification, and implementation of package 02), 2026-10-21 (implementation of package 03, its code review rework, and the rework after its second code review), 2026-10-22 (code review verification of package 03), 2026-10-23/24 (rework of file content handling), 2026-10-24 (documentation check against the code), 2026-10-25 (rework of `feature new` and its code review), 2026-10-26 (implementation of package 04), 2026-10-27 (documentation check after package 04), 2026-11-01 (implementation of package 05), 2026-11-04 (split of package 06 into the sub-features 06-1 to 06-9), 2026-11-06 (implementation of package 06-1 and its code review, and implementation of package 06-2), 2026-11-08 (implementation of package 06-3, and implementation of package 06-4 and its code review rework), and 2026-11-10 (implementation of package 06-5). Derived step by step from [`research/shade-kit-concept.md`](../../research/shade-kit-concept.md); its [section 9](../../research/shade-kit-concept.md#9-version-drift) holds the version-drift decisions of the former ADR 0001. Parts that exist in the code are labelled **Implemented**. +Status: draft, 2026-10-14, updated 2026-10-18 (consistency review, findings clarification, and implementation of package 02), 2026-10-21 (implementation of package 03, its code review rework, and the rework after its second code review), 2026-10-22 (code review verification of package 03), 2026-10-23/24 (rework of file content handling), 2026-10-24 (documentation check against the code), 2026-10-25 (rework of `feature new` and its code review), 2026-10-26 (implementation of package 04), 2026-10-27 (documentation check after package 04), 2026-11-01 (implementation of package 05), 2026-11-04 (split of package 06 into the sub-features 06-1 to 06-9), 2026-11-06 (implementation of package 06-1 and its code review, and implementation of package 06-2), 2026-11-08 (implementation of package 06-3, and implementation of package 06-4 and its code review rework), 2026-11-10 (implementation of package 06-5), and 2026-11-11 (implementation of package 06-6). Derived step by step from [`research/shade-kit-concept.md`](../../research/shade-kit-concept.md); its [section 9](../../research/shade-kit-concept.md#9-version-drift) holds the version-drift decisions of the former ADR 0001. Parts that exist in the code are labelled **Implemented**. Each package describes the functional behaviour of one clearly bounded piece of v1, with its benefit, scope, acceptance criteria (`FPnn-ACm`), and open points. The number prefix is the implementation order: every package depends only on packages with a lower number. @@ -117,7 +117,7 @@ New open points from the packages: - Changing the profile of an existing feature (04). - The `report` setting in the result of `phase start finish`, which the `shade-kit-finish` skeleton expects (04, owned by 15). - History timestamps `at` with fractional seconds, while `createdAt` has whole seconds (04). -- Skill skeletons not yet aligned with the built `phase` commands (04, 05, 06): 13 skeletons still say in their source comment that every command other than `version`, `init`, and `feature …` is planned; `shade-kit-finish` expects the `report` setting in the result of `phase start finish`; no phase skill and not `shade-kit-next-phase` says to show the `warnings` of `phase start` and `phase next` (`gates-defaults-used`, `gate-entry-ignored`); the refusal table of 06 has no row for exit code 47 (`checklist-template-not-found`) and none for 17 (`kit-file-write-failed`, since 2026-11-04). (`shade-kit-next-phase` now says that only `pending` and `forward` have a gate, 2026-10-30.) Assigned on 2026-11-04: the rows for 17 and 47, a fallback row, and the warnings to 06-3; the skeletons to 06-9; the `report` setting to 15. +- Skill skeletons not yet aligned with the built `phase` commands (04, 05, 06): 13 skeletons still say in their source comment that every command other than `version`, `init`, and `feature …` is planned; `shade-kit-finish` expects the `report` setting in the result of `phase start finish`; no phase skill says to show the `warnings` of `phase start` (`shade-kit-next-phase` does for `phase next` since 2026-11-11, 06-6) (`gates-defaults-used`, `gate-entry-ignored`); the refusal table of 06 has no row for exit code 47 (`checklist-template-not-found`) and none for 17 (`kit-file-write-failed`, since 2026-11-04). (`shade-kit-next-phase` now says that only `pending` and `forward` have a gate, 2026-10-30.) Assigned on 2026-11-04: the rows for 17 and 47, a fallback row, and the warnings to 06-3; the skeletons to 06-9; the `report` setting to 15. - Skill version (06-2, 2026-11-04): every skill carries its kit version hardcoded in its frontmatter (`metadata.version`), initial value `0.7.0` (2026-11-06); its alignment with the GitVersion version and the release tag is skipped for now, which breaks the rule in `GitVersion.yml` that no version is maintained by hand (06-2, 07, 19). Claude Code does not show the frontmatter to the model (checked on 2026-11-06 with Claude Code 2.1.318 on project-level skills, 06-2), so the handshake step states the version in its text. **Unverified:** whether Copilot and Codex show the frontmatter to the model (08). - Phase skills are restricted to user invocation only by convention (06-2, 08): a technical restriction such as Claude Code's `disable-model-invocation` is a possible later addition; whether Copilot and Codex offer one is part of the research of 08. - Skill reactions to a refused start, the refusal table of the next-steps message, and the active-feature check of `new` are **Proposed** (06-3, 09). The next-steps skill is built (06-3, 2026-11-08); its defaults are also **Proposed**: the table is keyed by error code, a failing `phase next` goes through the table, repeated warnings are shown once, and a refusal ends with calling the skill again. Rows 20–22 and 47 name `shade-kit upgrade`, which comes only with package 18. @@ -177,3 +177,4 @@ After each package, the whole draft was checked against the concept, ADR 0001 (n | 06-4 implementation (2026-11-08) | 06-4 gave the skill the path of the copy and the profile as input, but the n/a rule needs the phases of the profile, DOD-02 the `coverageThreshold` of `config.json`, and skills may not read `feature.json`, `gates.json`, or `config.json` (06-2). It did not say how DOD-06 and DOD-08 find the change, what happens with an item the skill cannot decide or with an unusable copy, or the time zone of the "Check runs" line (the templates showed a time without a UTC offset); it depended only on 06-2. The code review (0 Critical, 1 Major, 8 Minor, 3 Suggestion, 2 Nitpick) found an undecided short option `-f` of `gate info`, three `error` branches without a scenario, the DOD-02 criterion and 05 still naming `config.json`, a run-line placement that could hit the example line in the guidance comment, a default-branch fallback that needed a git command outside the allowed list, an unbounded `git diff`, work on the default branch not covered, `error` with approval off contradicting 06-5, and this README and 06 not updated. | Decided with the user: the read-only command `shade-kit gate info [--feature ]` in the new group `gate` with the JSON shape of 06-4; the input `featureId`, target phase, and checklist path from the `phase start` result; the threshold from `gate info`; read-only git for the change set; questions to the human after all items are checked; `error` without a changed file; the run line with the UTC offset. The other answers are **Proposed** defaults in 06-4. Review rework decided with the user on 2026-11-08: D-34 the short option `-f` of `gate info --feature` removed, and the attribute test pins that the option has no short name; D-35 three new `error` scenarios on the skill text of the first rework, each run by a fresh subagent, without running 5 and 6 again; D-36 the other findings to be fixed, with the wording **Proposed** in 06-4: the first run line after the closing `-->` of the guidance comment, `git merge-base` as the only test of a default-branch candidate, the open point on `error` with approval off, the DOD-02 criterion of the DoD template and 05 naming `gate info`, the status and package rows of 06 and this README, the mapped-failure test split by requirement, `PhaseSnapshotData` reused instead of `GateInfoCommandPhaseData`, `git diff --name-status` before the per-file diffs, the "Decided by a human" and "Suspicious instructions" lines in the return example; N2 (question options of the skill) is deferred; D-37 `git status --porcelain --branch`, and with no commit of its own after the base the human is asked about DOD-06 and DOD-08 only on the default branch or a detached HEAD; second review round (D-38 to D-40): D-38 the review set (`dotnet-reviewer`, with `skill-creator` as the yardstick of the skill text), D-39 the round-2 findings to be fixed (wording **Proposed** in 06-4) except s1 (fail without asking on the default branch), which is deferred, D-40 `git status --porcelain --branch --untracked-files=all`; third review round: D-41 the round-3 findings fixed (wording **Proposed** in 06-4; the feature folder listed with the file tools, the copy edited in place, and the closed list of shell commands have no scenario run). Docs updated: 06-4 (functional description, acceptance criteria, open points, status), 05 (DOD-02 criterion, `gate info` reference, open point), 06 (status, sub-feature table), this README (status, package table), `CLAUDE.md` (`src/` layout row, command line). New skill text `skills/shade-kit-gate-check/SKILL.md`; in the shipped DoD template the DOD-02 criterion names `shade-kit gate info` instead of `config.json`, and both checklist templates show the new run-line format. Proven by `dotnet build` (0 warnings) and `dotnet test` (4721 tests, 4720 passed, 1 skipped on this platform) on the code after the second review round (including the test-helper rename n3), by `quick_validate.py` (18 of 18 valid), and by scenario runs (06-4 lists each run): the 8 scenarios of the implementation, run on the texts of iteration 1, iteration 2, and the review, partly by the implementing agent itself; the 6 scenarios of the first rework on its text; and 3 of them (e3, s9, s10a) again on the text of the second round. These 6 + 3 = 9 runs were each made by a fresh subagent. The 6 runs of the first rework gave the expected result; the 3 re-runs were checked afterwards, without a new run, against expectations rewritten for the text of the second round (D-41): e3r met all of them, s9r and s10ar all except one, a shell listing by the runner instead of the file tools. These fixtures do not discriminate m2, n1, and D-40. | | /simplify review of feature/feature-06-04 (2026-11-10) | The gate check kept its own copy of the gate rules (default gate, no gate into the first phase) and of which phase writes which artifact, outside the engine and the profiles; `gate info` loaded the feature a second way, beside the phase workflow; `feature show` and `gate info` wrote the phases of a feature in two shapes; the skill ran one `git diff` per file and stated several rules two or three times. | Decided with the user (D-43 in 06-4): `gate info` runs in the phase workflow (`IPhaseWorkflow.GetGateInfoAsync`) on the engine's gate rule (`IPhaseEngine.HasGate`, `TransitionGate.ForPhase`); each phase of a built-in profile lists its artifacts with an `onDemand` flag (04), and `feature show` (03) and `gate info` (06-4) write the phases as one array `[ { name, state, artifacts } ]`; `gate info` keeps the configured approval while a transition is pending; the skill decides n/a on the artifacts, uses `git log --oneline` and one multi-path `git diff` per item, edits the copy once per row, and states each rule once. Docs updated: 03, 04, 06-4, the implementation report of 06-4, this README, `CLAUDE.md`. Proven by `dotnet test` (Core 3 750, CLI 997, all passed, 1 skipped on this platform) and by four scenario runs on the new and the old skill text (06-4). | | 06-5 implementation (2026-11-10) | 06-5 did not say what the entry protocol does when the gate check returns `error` while approval is off (left open by 06-4), which options the approval question offers after a failed check, how the phase skill learns whether to run its phase, where the warnings of the run are shown, or whether an approval written before the result counts. Scenario runs of the first text found that a warning could be shown twice, that a runner listed the later phases of a reopen from memory (`phase start` does not return them), that the approval-off warning left out suspicious instructions in `request.md`, and that an advance approval was ignored without a word. | Decided with the user: an `error` with approval off is a warning and the phase continues; the approval question offers approve, reject, and keep pending (the human may approve despite a failed check); proof by scenario runs with the skeleton entry step as the baseline. The other answers are **Proposed** defaults in 06-5 (keep pending also after a passed check, reject first and recommended after a failed check, the note of `phase reject`, warnings shown once by the closing message, the return format for 06-9). Docs updated: 06-5 (functional description, decisions, AC status with the scenario table, open points, status), 06-4 (the `error` case with approval off, open point removed, status), 06-2 (AC3 note), 06 (status), and this README (status). New skill `skills/shade-kit-phase-entry/SKILL.md` (`metadata.version: 0.7.0`, handshake with `--expect 0.7.0` in its text). Proven by `quick_validate.py` and by 9 scenario runs per text, checked by a script: iteration 1 88 of 88, iteration 2 (after five fixes) 92 of 92, the skeleton entry step 71 of 92. | +| 06-6 implementation (2026-11-11) | 06-6 did not say what the skill does when the human names a feature in the call while none is resolved, or asks about another feature than the resolved one, whether finished features are offered for the pick, or how the closing message gets the steps without a second `phase next`. Scenario runs of the first text found that a human who approved a transition in the call was not told that the approval is not recorded, that the message did not say when `feature set` changed the current feature, and that the branch to switch to was not named. A runner also noted that flow step 2 of `shade-kit-next-steps` (06-3) does not repeat the exception of its input section for a passed `phase next` result. | Decided with the user: a named feature is still confirmed by the human (offered first); a question about another feature switches nothing and names how to switch (`feature set` for the override, a branch ending in `/` for the branch); only active features are offered; proof by scenario runs with the skeleton as the baseline. The other answers are **Proposed** defaults in 06-6 (ending without a feature through the `no-current-feature` row, asking once more, the "what happened" line, the warnings). Afterwards, with the user: flow step 3 of `shade-kit-next-steps` states once that a passed `phase next` result replaces its own call (06-3 updated). Docs updated: 06-6 (functional description, decisions, AC status with the scenario table, open points, status), 06-3 (status, input), 06-2 (AC3 note), 06 (status), and this README (status, the skeleton item). Skill `skills/shade-kit-next-phase/SKILL.md` worked out (`metadata.version: 0.7.0`, handshake with `--expect 0.7.0` in its text). Proven by `quick_validate.py` and by 8 scenario runs per text, checked by a script: iteration 1 86 of 86, iteration 2 (after three fixes) 89 of 89, the skeleton 61 of 89; after the next-steps change, iteration 3 (five of these scenarios and two new scenarios of `shade-kit-next-steps` alone) 70 of 70. | diff --git a/skills/shade-kit-next-phase/SKILL.md b/skills/shade-kit-next-phase/SKILL.md index 0cb96b5..01c5bbe 100644 --- a/skills/shade-kit-next-phase/SKILL.md +++ b/skills/shade-kit-next-phase/SKILL.md @@ -1,32 +1,97 @@ --- name: shade-kit-next-phase -description: SHADE kit status and next steps. Finds the current feature and its phase and shows the possible next steps, each with the SHADE kit phase skill the user calls for it. Starts no skill. Use when the user says "continue", "next phase", "what's next", or asks where a SHADE kit feature stands. +description: "SHADE kit status and next steps. Finds the current feature, or lets the human pick one, and shows its phase and state and every possible next step with the SHADE kit skill to call for it. Advisory: starts no phase and no skill. Use when the human says 'continue', 'next phase', or 'what's next', or asks where a SHADE kit feature stands or what to do with it now." metadata: version: 0.7.0 --- # shade-kit-next-phase - - ## Purpose -Shows where a feature stands and what the user can do next, without the user having to know its state. This skill is advisory: a phase starts only when the user calls its phase skill (`/shade-kit-`). It never starts a phase skill, never runs a gate check, and never calls `shade-kit phase start`, `phase approve`, or `phase reject`. +Shows the human where a feature stands and which skill to call for each possible next step, so they do not have to know its state. The skill is advisory: a phase starts only when the human calls its phase skill (`/shade-kit-`), so that no phase starts behind their back and every approval is asked in the phase skill itself. Even when the human says "continue", this skill shows the steps and ends; it never starts a phase skill. + +The engine knows the profile, the gates, and which phases can be reopened, and `shade-kit phase next` returns the steps. This skill does not derive any step itself, and it does not write the closing message itself: `shade-kit-next-steps` turns the result of `phase next` into the message, the same way for every kit skill. + +Keep every `warnings` entry (`{ code, message }`) of every CLI call of this run. Do not show them on the way; the closing message shows each one once. ## Flow -1. **Version handshake:** `shade-kit version --json`. Stop and tell the user what to update if the engine and kit versions do not match. -2. **Current feature:** `shade-kit feature current --json`. - - Not resolved: list the features (`shade-kit feature list --json`) and ask which one to use. After the user picks one, call `shade-kit feature set ` (this starts no phase) and go on with step 3. If the user wants a new feature, name `/shade-kit-new` and end. -3. **Next steps:** `shade-kit phase next --json`. It returns the current phase and state and the possible steps, each with its skill; `pending` and `forward` also with their gate: - - Feature `done`: only the status. Report that it is finished; name `shade-kit feature set ` for another feature and `/shade-kit-new`. - - `continue` (current phase `in-progress`): continue it with `/shade-kit-`. - - `pending` (current phase `awaiting-approval`): decide on the pending transition with `/shade-kit-`, or discard it and continue the current phase with `/shade-kit-`. - - `forward`: move on to the next phase with `/shade-kit-`. - - `reopen[]`: reopen an earlier phase with `/shade-kit-` (always needs approval). -4. **Show** these steps, and always `/shade-kit-discuss` and `/shade-kit-drop` as well, then end. The user chooses by calling the skill. +### 1. Version handshake + +Version handshake: run `shade-kit version --json --expect 0.7.0`; 0.7.0 is the kit version of this skill (`metadata.version` in its frontmatter). + +- `ok` is `true`: continue. A warning `engine-prerelease-version-mismatch` means that a prerelease engine is used although its major or minor version differs; keep it like every warning and continue. +- `ok` is `false` (for example `version-mismatch`), or the shell reports that `shade-kit` is not found: stop before any other CLI call. End ([Ending](#ending)) with **refusal** and the failure envelope, or with "`shade-kit` not found". + +### 2. Current feature + +Run `shade-kit feature current --json`. A failure envelope (for example `kit-root-not-found`): end with **refusal** and the envelope. + +**Resolved** (`data.resolved` is `true`): `data.feature` is the current feature, `data.resolvedFrom` says whether the branch or the local override selected it. Go on with step 3, also when its `status` is `done`; `phase next` reports that. + +If the human asked about another feature than the current one (named by id or title), do not switch: changing the current feature is the human's decision. Show the current feature, and in the closing message say that it is not the one they asked about and how to switch: + +- `resolvedFrom` is `override`: `shade-kit feature set `. +- `resolvedFrom` is `branch`: switch to the branch of that feature, a branch whose name ends in `/` (`feature new` suggests `feature/`). The branch wins over the override, so `feature set` alone would not change the current feature. + +**Not resolved** (`data.resolved` is `false`): run `shade-kit feature list --json`. A failure envelope: end with **refusal**. Otherwise take the features of `data.features` whose `status` is `active`; a finished feature has no next step, so it is not offered. + +- No active feature: end with **end of work** and the line "No current feature, and no active feature to pick." The closing message names `/shade-kit-new`. +- Active features: ask the human which one to use. Show each one with its `id`, `title`, `profile`, and `currentPhase`. If the human named a feature in the call, offer that one first, but still ask: `feature set` changes the current feature, so the human confirms it. Also offer a new feature (`/shade-kit-new`) and ending without a pick. When a question tool allows fewer options than there are features, list the features in the question text and let the human answer with the id. + - The human picks a listed feature: run `shade-kit feature set --json` with exactly that `id`. It starts no phase. A failure envelope: end with **refusal**. Otherwise go on with step 3. + - The answer names no listed feature: ask once more. Then, or when the human chooses a new feature or no pick, or the question gets no answer, end with **end of work** and the line "No feature selected." The closing message names `/shade-kit-new`. + +### 3. Next steps + +Run `shade-kit phase next --json`. + +- Success: end with **end of work**, the line "Status of ``.", and the whole result of `phase next`. `shade-kit-next-steps` takes the steps from this result and does not run `phase next` again. Add to the line, where it applies: + - after `feature set` in step 2: that `` is now the current feature; + - the line about another feature from step 2; + - when the human approved, rejected, or asked to start a phase in the call (for example "continue with plan, I approve it"): that this skill records no approval and starts no phase, and that the phase skill asks for the approval when they call it. Otherwise the human may believe the transition went through. +- Failure envelope: end with **refusal** and the envelope. + +For reference, what `phase next` returns and what the closing message makes of it (each `skill` field is the skill to call, `/`): + +| `phase next` returns | Step shown | +|---|---| +| `current.status` `done` (every other field `null`) | The feature is finished; `shade-kit feature set ` for another feature, `/shade-kit-new` for a new one. | +| `continue` (current phase `in-progress`) | Continue the current phase. | +| `pending` (current phase `awaiting-approval`) | Decide on the pending transition with its skill, or discard it and continue the current phase with `/shade-kit-`. | +| `forward` (current phase `in-progress`, not the last one) | Move on to the next phase, marked "needs approval" when `gate.approval` is `true`. | +| `reopen` entries | Reopen that earlier phase, always marked "needs approval". | +| any success, `done` included | Also `/shade-kit-discuss` and `/shade-kit-drop`. | + +Only `pending` and `forward` have a gate. Do not run its check here: the phase skill runs it when the human calls it. + +## Ending + +Every way of ending loads `shade-kit-next-steps` and passes it: + +- why the run ends: + - **refusal**: the failure envelope of the call that failed, or that `shade-kit` was not found; + - **end of work**: the one line from step 2 or 3 of what happened; +- the result of `phase next` when this run got one; +- every warning of the CLI calls of this run, for example `current-feature-mismatch` of `feature current` or `feature set`, `feature-folder-invalid` of `feature list`, or `gates-defaults-used` of `phase next`. + +Example after a successful `phase next` in `map`: + +```text +Reason: end of work +What happened: Status of gh-142-login-sso. +phase next: { "current": { "featureId": "gh-142-login-sso", "phase": "map", "state": "in-progress", "status": "active" }, "continue": { "phase": "map", "skill": "shade-kit-map" }, "pending": null, "forward": { "phase": "plan", "gate": { "approval": true, "checklist": "checks/definition-of-ready.md" }, "skill": "shade-kit-plan" }, "reopen": [ { "phase": "refine", "skill": "shade-kit-refine" } ] } +Warnings: +- gates-defaults-used: '.shadekit/gates.json' does not exist, so the built-in gate defaults apply. ... +``` + +The closing message of `shade-kit-next-steps` is the end of this skill; write nothing after it. ## Rules -- Do not derive the next steps from the profile; `phase next` returns them, so the skill does not duplicate engine logic. -- Never start a phase skill, and never call `shade-kit phase start`, `phase approve`, or `phase reject`. +- Start no skill and no phase. Name skills; the human calls them. Do not ask which step the human wants and do not offer to run one. +- The only commands this skill runs are `shade-kit version --json --expect 0.7.0`, `shade-kit feature current --json`, `shade-kit feature list --json`, `shade-kit feature set --json`, and `shade-kit phase next --json`. Run `feature set` only after the human picked that feature in step 2. Never `phase start`, `phase approve`, `phase reject`, `phase complete`, `gate info`, `feature new`, `feature drop`, or `init`. +- Never run a gate check and never load `shade-kit-gate-check`. Load only `shade-kit-next-steps`. +- Do not derive steps from the profile and do not add or drop any: the steps are those of `phase next`, plus `/shade-kit-discuss` and `/shade-kit-drop`. +- Never read or write `feature.json`, `gates.json`, or `config.json`; the state comes from the CLI. Read no artifact and write no file. +- Pass every warning on; never leave one out because it looks harmless. diff --git a/skills/shade-kit-next-steps/SKILL.md b/skills/shade-kit-next-steps/SKILL.md index b9fdbaa..82022b2 100644 --- a/skills/shade-kit-next-steps/SKILL.md +++ b/skills/shade-kit-next-steps/SKILL.md @@ -27,10 +27,12 @@ The calling skill has already run its version handshake; this skill does not che ## Flow 1. **Refusal.** The reason is `error.message` of the envelope, quoted as it is. Find the options in the [refusal table](#refusal-table) by `error.code`. - - For `phase-not-in-profile`, `transition-not-allowed`, and `feature-done`, also get the steps: run `shade-kit phase next --json` (step 3). + - For `phase-not-in-profile`, `transition-not-allowed`, and `feature-done`, also get the steps (step 3). - For every other code, do not run `phase next`. For `no-current-feature`, `unknown-profile`, `phase-state-invalid`, and the format errors it would fail with the same code, so the options come from the refusal alone. -2. **No, or end of work.** Get the steps: run `shade-kit phase next --json` (step 3). -3. **Steps from `phase next`.** Whenever this skill's own `phase next` fails, in any case, do not run it again: add the options of the refusal-table row of its `error.code` and show its `error.message` as the reason there are no steps. After `shade-kit-drop`, for example, the drop worked, there is no current feature any more, and `phase next` fails with `no-current-feature`. +2. **No, or end of work.** Get the steps (step 3). +3. **Steps from `phase next`.** If the calling skill passed a result of `phase next` from this run, use it and do not run the command: a second call reads the same state and only repeats the warnings. Otherwise run `shade-kit phase next --json`, once. + + Whenever this skill's own `phase next` fails, in any case, do not run it again: add the options of the refusal-table row of its `error.code` and show its `error.message` as the reason there are no steps. After `shade-kit-drop`, for example, the drop worked, there is no current feature any more, and `phase next` fails with `no-current-feature`. On success, take the steps from the result and do not derive any from the profile: the engine knows the profile, the gates, and which phases can be reopened, and a second copy of that logic in a skill drifts. `phase next` reads the state now; when it does not match what the calling skill expected, the result is right. Use the `skill` field of each step as the skill to call (`/`). - `continue`: continue the current phase with `/`.