Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions CLAUDE.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

SHADE kit runs AI coding agents through a gated feature workflow: from a raw requirement to a clarified spec, a plan, the implementation, and a verified result with a report. It is built for small teams of 2–5 developers who work on features in parallel, each on its own branch, with Claude Code, GitHub Copilot, or OpenAI Codex CLI.

> **Status:** in development. Most commands described here are planned; today the CLI provides `shade-kit version`, `shade-kit init`, the feature commands `shade-kit feature new`, `list`, `current`, `set`, `show`, and `drop`, the phase commands `shade-kit phase start`, `approve`, `reject`, `complete`, `skills`, and `next`, `shade-kit gate info`, and `shade-kit integrations install` and `update` for Claude Code.
> **Status:** in development. Most commands described here are planned; today the CLI provides `shade-kit version`, `shade-kit init`, the feature commands `shade-kit feature new`, `list`, `current`, `set`, `show`, and `drop`, the phase commands `shade-kit phase start`, `approve`, `reject`, `complete`, `skills`, and `next`, `shade-kit gate info`, and `shade-kit integrations install` and `update` for Claude Code, GitHub Copilot CLI, and OpenAI Codex CLI.

## How it works

SHADE kit has two parts. The skills are the prompts the agent follows; the `shade-kit` CLI is the memory and the referee.

- **Skills** (`skills/`): one skill per phase plus shared skills for interviews, gate checks, research, and reviews. They are installed once per machine for each agent (`shade-kit integrations install`), never into a repository. For Claude Code this repository is the plugin marketplace: the command installs the plugin `shade-kit` from the release tag of the installed engine, and `shade-kit integrations update` moves it to the tag of a newer engine.
- **Skills** (`skills/`): one skill per phase plus shared skills for interviews, gate checks, research, and reviews. They are installed once per machine for each agent (`shade-kit integrations install`), never into a repository. This repository is the plugin marketplace for all three agents: the command installs the plugin `shade-kit` through the agent's own CLI (`claude`, `copilot`, or `codex`) from the release tag of the installed engine, and `shade-kit integrations update` moves it to the tag of a newer engine.
- **Engine** (`shade-kit`): a .NET CLI that keeps the feature state in `.shadekit/` inside the repository, committed and merged with the code. Agents call it with `--json`.
- **Phases:** `new` → `refine` → `map` → `plan` → `implement` → `verify` → `finish` in the `feature` profile. The `bugfix` profile replaces `refine` and `map` with `diagnose`; the `quick` profile runs `new` → `quick` → `finish` for small changes.
- **Gates:** the human approves every phase transition. The Definition of Ready guards `plan`, the Definition of Done guards `finish`; each gate can be switched off per repository.
Expand Down
17 changes: 13 additions & 4 deletions docs/feature-packages/02-repository-initialisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| | |
|---|---|
| Status | Draft, 2026-10-14, updated 2026-10-17 (template conventions), 2026-10-18 (implementation state; code review rework: exit codes 14 and 24, `.gitignore` rule, separator line), 2026-10-22 (code review verification of package 03: `trackers` id prefixes validated), 2026-10-23 (rework of file content handling: line endings of `.gitignore`, `CLAUDE.md`, and `AGENTS.md`, strict UTF-8, warnings; code review: `editorconfig-invalid`, legacy `crlf` attribute, `text=input`), and 2026-10-24 (documentation check: exit code 14 also for the `request.md` template, warnings sentence, resolved open point removed), and 2026-10-25 (rework of `feature new` in package 03: the `request.md` template is removed, `init` no longer writes `.shadekit/templates/request.md`, exit code 14 no longer covers it; `trackers` hosts are read with `gh`), and 2026-10-26 (package 04 implementation: comma-separated enum values make a `.shadekit/` JSON file invalid), 2026-10-30 (managed section text), and 2026-11-01 (package 05 implementation: `init` writes the `gates.json` defaults), 2026-11-04 (/simplify review of feature/feature-05: exit code 17 for a file in `.shadekit/` that cannot be written). Implemented except the final content of the templates owned by later packages (skeletons until then) and a possible Copilot instruction file (package 08). |
| Status | Draft, 2026-10-14, updated 2026-10-17 (template conventions), 2026-10-18 (implementation state; code review rework: exit codes 14 and 24, `.gitignore` rule, separator line), 2026-10-22 (code review verification of package 03: `trackers` id prefixes validated), 2026-10-23 (rework of file content handling: line endings of `.gitignore`, `CLAUDE.md`, and `AGENTS.md`, strict UTF-8, warnings; code review: `editorconfig-invalid`, legacy `crlf` attribute, `text=input`), and 2026-10-24 (documentation check: exit code 14 also for the `request.md` template, warnings sentence, resolved open point removed), and 2026-10-25 (rework of `feature new` in package 03: the `request.md` template is removed, `init` no longer writes `.shadekit/templates/request.md`, exit code 14 no longer covers it; `trackers` hosts are read with `gh`), and 2026-10-26 (package 04 implementation: comma-separated enum values make a `.shadekit/` JSON file invalid), 2026-10-30 (managed section text), and 2026-11-01 (package 05 implementation: `init` writes the `gates.json` defaults), 2026-11-04 (/simplify review of feature/feature-05: exit code 17 for a file in `.shadekit/` that cannot be written), 2026-11-15 (package 08, Gate 2: call form per agent in the managed section; the Copilot instruction file is resolved, no third file). Implemented except the final content of the templates owned by later packages (skeletons until then). |
| Source | Concept §3.1 (`init`), §4.1, [§9](../../research/shade-kit-concept.md#9-version-drift) (§9.5) |
| Depends on | 01 |
| Enables | 03, 05, 18 and every phase package (they ship templates through this mechanism) |
Expand Down Expand Up @@ -209,7 +209,15 @@ Every template follows the same conventions. **Decided** in the template intervi
### Managed instruction section

- A short section in `CLAUDE.md` and `AGENTS.md` at the repository root, delimited by begin and end markers so the engine can find and replace exactly that section later. **Decided** on 2026-10-18 (implementation clarification). **Implemented** (`IInstructionSectionPlanner` / `InstructionSectionPlanner`; the text and the markers are `ManagedInstructionSection.Text`, `.BeginMarkerPrefix`, and `.EndMarker`).
- Content: the repository uses SHADE kit, the kit data lives in `.shadekit/`, that a phase starts only when the user calls its phase skill and where to see the next steps (`shade-kit-next-phase` from package 06), and that the engine is called as `shade-kit … --json`. The phase-start sentence **Decided** on 2026-10-30 ([phase start analysis](../../research/shade-kit-phase-start-analysis.md), F10), replacing "To start or continue work on a feature, use the `shade-kit-next-phase` skill." **Implemented** (`ManagedInstructionSection.Text`). The text `init` writes:
- Content, in the order of `ManagedInstructionSection.Text`:
- the repository uses SHADE kit, and its data lives in `.shadekit/` and is committed with the code;
- a phase starts only when the user calls its phase skill, never on the agent's own or from another skill;
- the call form of a skill per agent, and that every skill name in SHADE kit output is written in the form of the running agent;
- `shade-kit-next-phase` (package 06) shows where a feature stands and which skill to call next;
- the engine is called as `shade-kit <command> --json`;
- feature state changes only through `shade-kit` commands, never by editing `.shadekit/features/` by hand.

The phase-start sentence **Decided** on 2026-10-30 ([phase start analysis](../../research/shade-kit-phase-start-analysis.md), F10), replacing "To start or continue work on a feature, use the `shade-kit-next-phase` skill." **Implemented** (`ManagedInstructionSection.Text`). The call form per agent (Claude Code and GitHub Copilot CLI `/shade-kit-<skill>`, OpenAI Codex CLI `$shade-kit:shade-kit-<skill>`; Claude Code also accepts the plugin-namespaced `/shade-kit:shade-kit-<skill>`, [07](07-claude-code-integration.md#skill-names-in-claude-code)) and the rule that every skill name in SHADE kit output is written in the form of the running agent: **Decided** on 2026-11-15 (package 08, Gate 2; [agent compatibility](../../research/shade-kit-agent-compatibility.md), decision 6). **Implemented** (`ManagedInstructionSection.Text`, `Text_Always_IsTheManagedSectionWithMarkers`). A repository with the earlier text gets the section replaced by the next `init` (`updated`), because only the markers identify it (`PlanAsync_SectionWithPreviousKitText_ReplacesItWithCurrentText`). The text `init` writes:

```markdown
<!-- shade-kit:begin - managed by shade-kit, content between the markers is replaced on upgrade -->
Expand All @@ -218,6 +226,7 @@ Every template follows the same conventions. **Decided** in the template intervi
This repository uses SHADE kit. Its data lives in `.shadekit/` (configuration, templates, features) and is committed with the code.

- A phase starts only when the user calls its phase skill (`/shade-kit-<phase>`). Never start a phase skill on your own or from another skill.
- Call a skill as `/shade-kit-<skill>` in Claude Code and GitHub Copilot CLI and as `$shade-kit:shade-kit-<skill>` in OpenAI Codex CLI; write every skill name in SHADE kit output (for example in a closing message) in the form of the agent you run in.
- To see where a feature stands and which skill to call next, use the `shade-kit-next-phase` skill.
- Call the engine as `shade-kit <command> --json` and act on its JSON result.
- Change feature state only through `shade-kit` commands, never by editing `.shadekit/features/` by hand.
Expand All @@ -237,7 +246,7 @@ Every template follows the same conventions. **Decided** in the template intervi
- In an existing file every line outside the inserted or replaced part is kept: a missing final line break is added before appending, and a leading UTF-8 byte order mark is kept. A new file is UTF-8 without byte order mark. A file that starts with a UTF-16 or UTF-32 byte order mark, contains a NUL byte, or contains bytes that are not valid UTF-8 is not changed (exit code 24).
- Line endings follow the same rules as for [`.gitignore`](#gitignore): a changed file is written as a whole with the line ending decided at write time (git attributes and configuration, then `.editorconfig`, then the operating system), so its other lines are normalised too. The section counts as identical when its lines are identical, whatever line endings the file has: such a file is not written and not listed. **Decided** on 2026-10-23 (rework of file content handling), replacing "the section uses CRLF if the file contains CRLF" from 2026-10-18. **Implemented** (`InstructionSectionPlanner`, `TextFileWriter`, `PlanAsync_CurrentSectionWithOtherOrMixedLineEndings_ReturnsNullAndLeavesFileUnchanged`, `PlanAsync_OutdatedSectionInMixedFile_WritesWholeFileWithTargetLineEnding`).
- `AGENTS.md` as a symbolic link to `CLAUDE.md` works: the section is written once into `CLAUDE.md`, the link is kept, and `AGENTS.md` is not listed, because a link to a file that is already planned is skipped. **Implemented** (`InitializeAsync_AgentsMdIsSymlinkToClaudeMd_AppendsExactlyOneSectionAndKeepsSymlink` and `InitializeAsync_AgentsMdIsSymlinkToClaudeMdWithOutdatedSection_UpdatesSectionOnceAndKeepsSymlink`, skipped where symbolic links cannot be created).
- **Unverified:** whether GitHub Copilot reads `AGENTS.md` or needs `.github/copilot-instructions.md`. Package 08 resolves this and may add a third target file.
- Instruction files per agent: Claude Code reads `CLAUDE.md`, OpenAI Codex CLI reads `AGENTS.md` (`CLAUDE.md` only when configured as a fallback name), and GitHub Copilot CLI reads `AGENTS.md` and also `CLAUDE.md` ([agent compatibility](../../research/shade-kit-agent-compatibility.md), decision 5). So `init` writes no third file (no `.github/copilot-instructions.md`), and FP08-AC6 is met by the existing behaviour. Copilot loads the section twice, once from each file; accepted as a known limit. **Decided** on 2026-11-15 (package 08, Gate 2), replacing "**Unverified:** whether GitHub Copilot reads `AGENTS.md` or needs `.github/copilot-instructions.md`. Package 08 resolves this and may add a third target file." **Implemented** (`RepositoryInitializer.InstructionFileNames`, unchanged).

### Deviations from the draft

Expand Down Expand Up @@ -269,7 +278,7 @@ Every criterion is **Implemented**. The tests that prove it carry `[Trait("Requi

## Open points

- The Copilot instruction file is **Unverified** (resolved in package 08).
- Resolved on 2026-11-15 (package 08, Gate 2): the Copilot instruction file. Copilot CLI reads `AGENTS.md` (and `CLAUDE.md`), so no third file is written; see [Managed instruction section](#managed-instruction-section).
- Follow-ups found during the implementation on 2026-10-18, **Open** unless marked:
- Plain output is wrapped at 80 columns by Spectre.Console when stdout is not a terminal, so long paths in the plain output of `init` and `feature list` are split across lines. JSON output is not affected.
- Resolved on 2026-10-26 (package 04 implementation, decision of the user): the shared enum converter of `VersionedJsonSerializer` (package 01) accepted comma-separated values such as `"always, never"` and read them as a combined value that is not a defined member, for example in `report` and `outdatedFormatOnRead`. Such a value now makes any `.shadekit/` JSON file invalid (exit code 22, `invalid-file`); member names in any letter case stay accepted. **Implemented** (`Formats/SingleValueJsonStringEnumConverter.cs`, `SingleValueJsonStringEnumConverterTests`).
Expand Down
2 changes: 1 addition & 1 deletion docs/feature-packages/03-feature-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ If 1 and 2 both give a feature and they differ, the branch wins and the command

The `PATH` search and the process run are shared by `git` and `gh` since 2026-10-25 (rework of `feature new`): the internal helpers `Processes/PathExecutableSearch` (absolute `PATH` entries only, Windows quoting, Unix execute bit) and `Processes/ExternalProcessRunner` (absolute executable path, no shell, arguments passed one by one, standard output and error read concurrently as UTF-8, the process tree killed on cancellation) were extracted from `GitExecutableLocator` and `GitCommandRunner`; the public git interfaces and their behaviour are unchanged. **Implemented** (`PathExecutableSearch`, `ExternalProcessRunner`, `PathExecutableSearchTests`; the existing git tests unchanged).

Since the simplification of the rework (2026-10-25, approved by the user), the layer above is shared as well: `Processes/ExternalToolRunner` locates the executable, refuses a missing or relative path, starts it, and turns a start failure into the exception of the tool; `GitCommandRunner` and `GhCommandRunner` only pass their `ExternalTool` description. Both runner interfaces return the public `ExternalProcessResult`, whose `CreateUnexpectedExitCodeReason` builds the reason `<tool> exited with the unexpected exit code <n>[: <standard error>.]` for both tools. `GitExecutableLocator` and `GhExecutableLocator` derive from `PathExecutableLocator`, which caches the first path found, and `GitUnavailableException` and `GhUnavailableException` derive from `ExternalToolUnavailableException`, which formats the command text. Changed texts: the reason of a relative `git` path starts with `The git executable path`, a `git` start failure is `The git executable '<path>' could not be started: <message>.`, the standard error in the reason of an unexpected `git` exit code ends with a period, and the reason of a failing `gh` is `gh exited with the unexpected exit code <n>[: <standard error>.]` instead of `The gh command exited with the exit code <n>…`. The tests of the `PATH` rules are in `PathExecutableSearchTests`; the locator tests cover only the executable names and the caching. **Implemented** (`ExternalToolRunner`, `ExternalTool`, `PathExecutableLocator`, `ExternalToolUnavailableException`, `ExternalProcessResult`, `PathExecutableSearchTests`, `GitExecutableLocatorTests`, `GhExecutableLocatorTests`).
Since the simplification of the rework (2026-10-25, approved by the user), the layer above is shared as well: `Processes/ExternalToolRunner` locates the executable, refuses a missing or relative path, starts it, and turns a start failure into the exception of the tool; `GitCommandRunner` and `GhCommandRunner` only pass their `ExternalTool` description. Both runner interfaces return the public `ExternalProcessResult`, whose `CreateUnexpectedExitCodeReason` builds the reason `<tool> exited with the unexpected exit code <n>[: <standard error>.]` for both tools. `GitExecutableLocator` and `GhExecutableLocator` derive from `PathExecutableLocator`, which caches the first path found, and `GitUnavailableException` and `GhUnavailableException` derive from `ExternalToolException`, which formats the command text. Changed texts: the reason of a relative `git` path starts with `The git executable path`, a `git` start failure is `The git executable '<path>' could not be started: <message>.`, the standard error in the reason of an unexpected `git` exit code ends with a period, and the reason of a failing `gh` is `gh exited with the unexpected exit code <n>[: <standard error>.]` instead of `The gh command exited with the exit code <n>…`. The tests of the `PATH` rules are in `PathExecutableSearchTests`; the locator tests cover only the executable names and the caching. **Implemented** (`ExternalToolRunner`, `ExternalTool`, `PathExecutableLocator`, `ExternalToolException`, `ExternalProcessResult`, `PathExecutableSearchTests`, `GitExecutableLocatorTests`, `GhExecutableLocatorTests`).

- The engine starts the `git` executable in the repository root; there is no git library.
- The executable is resolved only from absolute `PATH` entries; empty and relative entries are skipped, and the first entry that contains the file wins. On Unix the file must also have at least one execute bit (owner, group, or others), like in the `PATH` search of a shell; a file without one is skipped and the next entry is checked (**Decided** on 2026-10-21, second code review, finding N02; before, a non-executable `git` in an earlier entry stopped the command with exit code 16). Windows: separator `;`, file `git.exe`, double-quoted entries supported; Unix: separator `:`, file `git`. `PATHEXT` is not used, so a `git.cmd` shim is not found. `GitCommandRunner` starts the resolved absolute path and refuses a relative one. If no entry contains a usable `git`, the command stops with exit code 16. **Decided** on 2026-10-21 (code review rework, finding F01): starting `git` by its bare name let Windows search the current directory, usually the repository, before `PATH`, so a `git.exe` committed to a cloned repository would have run.
Expand Down
Loading
Loading