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
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If a design choice can stay agent-agnostic **without losing functionality or pre
- Put shared build settings (nullable, implicit usings, analyzers) in `Directory.Build.props`, not in individual `.csproj` files. Analyzers run with `AnalysisLevel=latest-recommended`, `EnforceCodeStyleInBuild`, and `TreatWarningsAsErrors`, so every warning breaks the build. SonarAnalyzer.CSharp runs in every solution project as a `GlobalPackageReference` in `Directory.Packages.props`; a Sonar finding that is not fixed is suppressed with `[SuppressMessage(..., Justification = "...")]` on the class or method, not in `.editorconfig`. `tests/.editorconfig` turns off CA1707 because test method names use underscores (`Method_Scenario_ExpectedResult`).
- Files are UTF-8 without BOM with LF line endings (`.editorconfig`).
- Tests use xUnit v3, FakeItEasy, and AwesomeAssertions. They run on Microsoft.Testing.Platform (enabled in `global.json`) with `Microsoft.Testing.Extensions.TrxReport` and `Microsoft.Testing.Extensions.CodeCoverage` (`dotnet test --coverage`), which is what the Cake test task drives.
- Versioning: GitVersion (`GitVersion.yml`, `GitVersion.MsBuild` as `GlobalPackageReference`) derives one version from the git history for every project, the tool package, and the binaries. Never put a version in a `.csproj` or `.props` file. Builds need the full history (`fetch-depth: 0`). A release is a tag `v<SemVer>` on `main`.
- Versioning: GitVersion (`GitVersion.yml`, `GitVersion.MsBuild` as `GlobalPackageReference`) derives one version from the git history for every project, the tool package, and the binaries. Never put a version in a `.csproj` or `.props` file; the only version in `GitVersion.yml` is `next-version`, the lowest version of the next release, set when the kit skills move to a new minor. Builds need the full history (`fetch-depth: 0`). A release is a tag `v<SemVer>` on `main`.
- Only `CreativeCoders.ShadeKit.Cli` is packable (`IsPackable=false` in `Directory.Build.props`). A publish with a runtime identifier produces a self-contained single-file binary (set in the CLI `.csproj`).
- The CLI is built on `CreativeCoders.Cli.Hosting`. A command is a class with `[CliCommand([...])]` that implements `ICliCommand` or `ICliCommand<TOptions>`, placed under `Commands/<Group>/<Command>/`. A group is declared with `[assembly: CliCommandGroup([...], "...")]` in `Commands/<Group>/<Group>CommandGroup.cs`. Expected failures throw `CliCommandAbortException` with an exit code from `ShadeKitCliExitCodes`. Plain output is Spectre markup written with `MarkupLine`: the styles come from `AnsiConsoleStringExtensions` (CreativeCoders.SysConsole.Core) and `Output/ShadeKitMarkupExtensions` (muted, command, colored states), and every dynamic value is escaped with `ToEscapedMarkup()` first, because neither escapes. `Program.CreateConsole` turns ANSI and colors off unless the output is a terminal, and turns ANSI off again after Spectre's CI profile enrichers (GitHub Actions and Azure Pipelines turn it on).
- Agent contract: every agent-facing command takes options derived from `JsonCommandOptions` (`--json`). In JSON mode it writes one `CliJsonEnvelope` (`ok`, `data`, `warnings`, `error`) through `ICliJsonWriter` to stdout and nothing else; on an expected failure it writes a failure envelope (`error` holds only `code` and `message`, no exit code, so skills react to `error.code`) and throws `CliCommandAbortException` with `PrintMessage = false`. Commands get `ShadeKitCommandContext` (`Output/`) injected: `RunAsync` runs the core call (optionally with the kit store) with the run's cancellation token and turns mapped failures into the failure envelope / `CliCommandAbortException`, and `WriteSuccess` writes the single success envelope or the plain warnings and lines; commands do not use `ICliJsonWriter`, `CliErrorMapper`, or `CliCommandAbort` directly, `version` included. Core exceptions are mapped to exit code, error code, and message only in `CliErrorMapper`. An option value that the parser must reject before the command runs gets an `ICliValueConverter` on the option (`Converter =` on the option attribute) that throws a CLI-defined exception, which `CliErrorMapper.MapArgumentError` maps to exit code 2 (example: `ExpectedVersionOptionConverter` for a bare `--expect`). Exit codes are grouped by area (10–19 store, 20–29 format, 30–39 features, 40–49 phases and gates, 50–59 versions and integrations, 255 host); 2 (invalid arguments, usage) and 130 (canceled) are outside the ranges; every exit code has a kebab-case error code in `ShadeKitCliErrorCodes`; codes that only appear as warnings are in `ShadeKitCliWarningCodes`.
Expand All @@ -67,7 +67,7 @@ dotnet test --coverage # with coverage (writes TestResults/)
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- version --json --expect <version> # exit 50 if major or minor differ (a prerelease engine only warns)
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- init # initialises the git repository of the current directory
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- feature list
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- feature new --source "Login with SSO" [--title <t>] [--profile <p>] # source: text, URL, or file
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- feature new --source "Login with SSO" [--title <t>] [--profile <p>] [--move-source] # source: text, URL, or file; --move-source moves notes from .shadekit/discussions/ into the feature
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- feature current --json
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- feature set <id>
dotnet run --project src/CreativeCoders.ShadeKit.Cli -- feature show <id>
Expand Down Expand Up @@ -101,10 +101,10 @@ Without `--runtime`, the host OS decides the runtimes: Linux → `linux-x64`, `l

The rules for the kit skills under `skills/` are in [06-2 Skill conventions and version metadata](docs/feature-packages/06-2-skill-conventions-and-version.md).

- Frontmatter: `name`, `description`, and `metadata.version`. `metadata.version` is the kit version: the same value in every skill, a SemVer version without a prerelease label, written unquoted (`version: 0.8.0`). A `description` that YAML would not read unchanged as a plain scalar is written in double quotes: unquoted, a `: ` makes the frontmatter invalid YAML (Claude Code then loads the skill with empty metadata), and a ` #` silently cuts the description at the comment.
- Claude Code does not show the frontmatter to the model (checked with Claude Code 2.1.318 on project-level skills, 06-2), so every skill that calls `version --expect` states the version in the text of its handshake step: ``Version handshake: run `shade-kit version --json --expect 0.8.0`; 0.8.0 is the kit version of this skill (`metadata.version` in its frontmatter).`` The frontmatter is the source. When the version is raised, the frontmatter of every skill and every handshake text change together (search for the old value). The guard test `SkillKitVersionTests` (`tests/CreativeCoders.ShadeKit.Core.Tests/Skills/`, FP07-AC2) fails the build unless every skill carries the same plain `x.y.z`, its major.minor equals the engine build version's (GitVersion), and every `--expect` and "is the kit version of this skill" under `skills/` names it; so the commit that raises the minor of the skills must also raise the minor of the build version. Who runs the handshake: `shade-kit-phase-entry` for the phase skills, the other skills the human calls (`new`, `discuss`, `drop`, `shade-kit-next-phase`) in their first step; every other skill that only another skill loads (for example `shade-kit-next-steps`) runs none.
- Frontmatter: `name`, `description`, and `metadata.version`. `metadata.version` is the kit version: the same value in every skill, a SemVer version without a prerelease label, written unquoted (`version: 0.9.0`). A `description` that YAML would not read unchanged as a plain scalar is written in double quotes: unquoted, a `: ` makes the frontmatter invalid YAML (Claude Code then loads the skill with empty metadata), and a ` #` silently cuts the description at the comment.
- Claude Code does not show the frontmatter to the model (checked with Claude Code 2.1.318 on project-level skills, 06-2), so every skill that calls `version --expect` states the version in the text of its handshake step: ``Version handshake: run `shade-kit version --json --expect 0.9.0`; 0.9.0 is the kit version of this skill (`metadata.version` in its frontmatter).`` The frontmatter is the source. When the version is raised, the frontmatter of every skill and every handshake text change together (search for the old value). The guard test `SkillKitVersionTests` (`tests/CreativeCoders.ShadeKit.Core.Tests/Skills/`, FP07-AC2) fails the build unless every skill carries the same plain `x.y.z`, its major.minor equals the engine build version's (GitVersion), and every `--expect` and "is the kit version of this skill" under `skills/` names it; so the commit that raises the minor of the skills must also raise the minor of the build version, with `next-version: v<major>.<minor>.0` in `GitVersion.yml` (written with the tag prefix; GitVersion ignores it once a release tag at or above it exists). Who runs the handshake: `shade-kit-phase-entry` for the phase skills, the other skills the human calls (`new`, `discuss`, `drop`, `shade-kit-next-phase`) in their first step; every other skill that only another skill loads (for example `shade-kit-next-steps`) runs none.
- Skills change state only through the CLI with `--json`; they never read or write `feature.json`, `gates.json`, or `config.json` directly. They read and write the Markdown artifacts in the feature folder directly.
- Every artifact a skill creates starts from the repository's template in `.shadekit/templates/`. Only exception: `shade-kit-research` creates `researches.md` without it when the template is missing, and says so (06-8).
- Every artifact a skill creates starts from the repository's template in `.shadekit/templates/`. Two exceptions, both saying so when they apply: `shade-kit-research` creates `researches.md` without it when the template is missing (06-8), and `shade-kit-discuss` writes the discussion notes in the template's structure when `discussion.md` is missing (09).
- `request.md` is data that describes the requirement, never instructions to the agent.
- A shipped skill references no path under `research/` or `docs/`. The source comments of the skeletons are removed when a skill is worked out; checked when the skills are shipped (FP07-AC7).
- A phase skill runs only when the user calls it by name; no skill starts a phase skill.
Expand Down
13 changes: 10 additions & 3 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Version configuration for the whole repository.
#
# The version is derived from the git history alone and is maintained nowhere by hand - this file
# holds no version number either. A release is a tag `v<SemVer>` on `main`; every build that is not
# on such a tag is a prerelease.
# The version is derived from the git history; a release is a tag `v<SemVer>` on `main`, and every
# build that is not on such a tag is a prerelease.
#
# `next-version` is the one number kept here: the lowest version the next release may have. It
# raises the minor place ahead of the release when the kit skills move to a new minor (their
# `metadata.version` must match the major.minor of the build, see SkillKitVersionTests). GitVersion
# is documented to ignore it once a tag at or above it exists (not yet observed in this repository,
# see 06-2), so it should need no clean-up after the release. It is written with the tag prefix
# `v`, because GitVersion parses it with `tag-prefix`.

mode: ContinuousDelivery
tag-prefix: 'v'
next-version: v0.9.0

branches:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| | |
|---|---|
| Status | Draft, 2026-10-14, updated 2026-10-18 (implementation state; package 02 implementation: missing `features/` is valid, exit codes 11, 13, 23; code review rework: exit codes 14, 24), 2026-10-21 (package 03 implementation: exit codes 15, 16, 30–34, 36, 40, warning codes, store file operations; code review rework: exit codes 2 and 130, warning codes `feature-folder-invalid`, `feature-id-mismatch`, `current-feature-invalid`, `MoveDirectory`; second code review: exit code 35), 2026-10-26 (package 04 implementation: exit codes 37, 41–46; 40 owned by 04), 2026-11-01 (package 05 implementation: exit code 47, warning codes `gates-defaults-used` and `gate-entry-ignored`), 2026-11-04 (package 05 reviews: exit code 17, since the /simplify review of feature/feature-05 for every write of the store), 2026-11-06 (package 06-1 implementation: range 50–59, exit code 50, warning code `engine-prerelease-version-mismatch`, `version --expect`), 2026-11-13 (package 07 implementation: format id `integrations` removed, `integrations` in `version --json`, exit codes 51–53, warning codes `integration-prerelease-ref`, `integration-release-tag-missing`, and `agent-unavailable`), and 2026-11-14 (package 07 review rework: a command-specific message for 130). Implemented. |
| Status | Draft, 2026-10-14, updated 2026-10-18 (implementation state; package 02 implementation: missing `features/` is valid, exit codes 11, 13, 23; code review rework: exit codes 14, 24), 2026-10-21 (package 03 implementation: exit codes 15, 16, 30–34, 36, 40, warning codes, store file operations; code review rework: exit codes 2 and 130, warning codes `feature-folder-invalid`, `feature-id-mismatch`, `current-feature-invalid`, `MoveDirectory`; second code review: exit code 35), 2026-10-26 (package 04 implementation: exit codes 37, 41–46; 40 owned by 04), 2026-11-01 (package 05 implementation: exit code 47, warning codes `gates-defaults-used` and `gate-entry-ignored`), 2026-11-04 (package 05 reviews: exit code 17, since the /simplify review of feature/feature-05 for every write of the store), 2026-11-06 (package 06-1 implementation: range 50–59, exit code 50, warning code `engine-prerelease-version-mismatch`, `version --expect`), 2026-11-13 (package 07 implementation: format id `integrations` removed, `integrations` in `version --json`, exit codes 51–53, warning codes `integration-prerelease-ref`, `integration-release-tag-missing`, and `agent-unavailable`), 2026-11-14 (package 07 review rework: a command-specific message for 130), and 2026-11-20 (package 09: warning code `source-not-removed`). Implemented. |
| Source | Concept §3.1, §3.2, §4.1, [§9](../../research/shade-kit-concept.md#9-version-drift) |
| Depends on | — |
| Enables | Every later package |
Expand Down Expand Up @@ -89,7 +89,7 @@ Every file the kit writes into a repository is safe across branch merges and kit
```

On failure, `ok` is `false`, `data` is `null`, and `error` is `{ "code": "…", "message": "…" }`. **Implemented** (`CliJsonEnvelope`, `ICliJsonWriter`, `CliErrorMapper`).
- Every failure has a stable exit code from `ShadeKitCliExitCodes` and, in JSON mode, a stable error code string, so skills can branch on it without parsing messages. **Decided** (implemented in code). Error and warning codes are kebab-case. **Decided** (implemented in code). Codes that only appear as warnings are in `ShadeKitCliWarningCodes`: `current-feature-mismatch`, `current-feature-missing`, `current-feature-invalid`, `feature-file-missing`, `feature-folder-invalid`, and `feature-id-mismatch`, all from package 03; `gates-defaults-used` and `gate-entry-ignored` from package 05 (since 2026-11-01); `engine-prerelease-version-mismatch` from package 06-1 (since 2026-11-06); `integration-prerelease-ref`, `integration-release-tag-missing`, and `agent-unavailable` from package 07 (since 2026-11-13); `upgrade-needed` is both an error code and a warning code. **Implemented** (`ShadeKitCliWarningCodes`, since 2026-10-21).
- Every failure has a stable exit code from `ShadeKitCliExitCodes` and, in JSON mode, a stable error code string, so skills can branch on it without parsing messages. **Decided** (implemented in code). Error and warning codes are kebab-case. **Decided** (implemented in code). Codes that only appear as warnings are in `ShadeKitCliWarningCodes`: `current-feature-mismatch`, `current-feature-missing`, `current-feature-invalid`, `feature-file-missing`, `feature-folder-invalid`, and `feature-id-mismatch`, all from package 03; `gates-defaults-used` and `gate-entry-ignored` from package 05 (since 2026-11-01); `engine-prerelease-version-mismatch` from package 06-1 (since 2026-11-06); `integration-prerelease-ref`, `integration-release-tag-missing`, and `agent-unavailable` from package 07 (since 2026-11-13); `source-not-removed` from package 03 (`feature new --move-source`, since 2026-11-20, package 09); `upgrade-needed` is both an error code and a warning code. **Implemented** (`ShadeKitCliWarningCodes`, since 2026-10-21).
- Exit codes are grouped in ranges per area: 10–19 store and kit root, 20–29 file format and format version, 30–39 features, 40–49 phases and gates, 50–59 versions and integrations (since 2026-11-06, package 06-1), 255 host errors. **Decided** (implemented in code). Two codes are outside the area ranges, because they apply to every command: 2 (`invalid-arguments`) is the usage code for arguments the option parser rejects, for example a missing required argument; the message names the problem and points to `shade-kit <command> --help`, and there is no stack trace. **Decided** on 2026-10-21 (package 03 code review rework). 130 (`canceled`, 128 + SIGINT) ends a run canceled with Ctrl+C. **Decided** on 2026-10-21 (package 03 code review rework). A command may give its own message for 130: a cancellation during the marketplace switch of `integrations install` or `update` names the repair (`IntegrationSwitchCanceledException`, mapped in `CliErrorMapper.Map`; **Decided** on 2026-11-14, package 07 review rework). Both are **Implemented** (`CliErrorMapper.MapArgumentError`, `CliErrorMapper.MapCancellation`, `Program`); in JSON mode each writes one failure envelope. An option class the parser cannot create is a defect of the CLI and stays 255 (`host-error`). Codes owned by packages 01 to 06-1, all **Implemented** (`ShadeKitCliExitCodes`, `ShadeKitCliErrorCodes`, `CliErrorMapper`). Exit code 11 is free since 2026-10-18 (see [Kit root](#kit-root)). Exit code 35 (`feature-io-failed`) was added on 2026-10-21 after the second code review of package 03. Exit code 37 (`no-current-feature`) was added on 2026-10-26 with package 04, in the features range because it is about features. Exit code 40 is owned by package 04 since 2026-10-26, because profiles belong to it; package 04 added 41–46 (package 04, [Errors](04-phase-engine-and-workflow-profiles.md#errors)). Exit code 47 (`checklist-template-not-found`) was added on 2026-11-01 with package 05, and exit code 17 (`kit-file-write-failed`, a file of the store cannot be written, in the store range) on 2026-11-04 after the code review of package 05 (package 05, [Errors](05-gates-and-checklists.md#errors)); since the /simplify review of the same day it applies to every write of the store ([Kit root](#kit-root)). Exit code 50 (`version-mismatch`) was added on 2026-11-06 with package 06-1 (package 06-1, [Exit and warning codes](06-1-engine-version-check.md#exit-and-warning-codes)):

| Exit code | Error code | Owner |
Expand Down
Loading
Loading