Compare commits

...

53 Commits

Author SHA1 Message Date
9b2a6bcd58 Clear reconciled wayfinder subagents 2026-08-02 14:23:44 -04:00
13cf92f627 fix(slice): write implementation tickets 2026-08-01 22:10:14 -04:00
40b16b8796 fix(skills): require isolated review and test workers 2026-08-01 18:19:32 -04:00
0f2b13c5f9 feat(wayfinder): default to isolated frontier workers 2026-08-01 17:52:09 -04:00
d758f722f9 feat(skills): add isolated worker workflow guidance 2026-08-01 16:37:09 -04:00
346413cd7d Add implementation workflow skills 2026-08-01 12:12:07 -04:00
f283646124 Add slice skill 2026-07-31 23:36:43 -04:00
99df169fbd Relax Wayfinder session ticket limit 2026-07-31 20:46:14 -04:00
8035e0e436 Allow AFK prototype tickets 2026-07-31 20:43:18 -04:00
012a4bfd1e Unify Wayfinder ticket artifacts 2026-07-31 20:38:27 -04:00
b5c6e33730 Tighten grill turn-ending protocol 2026-07-31 19:36:03 -04:00
778e726d4c Trim redundant skill-build fixture 2026-07-31 18:51:34 -04:00
d3bc9a5760 Remove benchmark skill 2026-07-31 18:50:42 -04:00
8479ad096c Remove obsolete skills placeholder 2026-07-31 18:48:54 -04:00
d0c9f94713 Remove consume and wiki skills 2026-07-31 18:45:55 -04:00
942d32dcba Make artifact naming destination-driven 2026-07-31 18:45:11 -04:00
96f795a63a fix(wayfinder): simplify map references 2026-07-31 16:03:00 -04:00
80cecf3350 feat(skills): adapt planning skills to artifact workflow 2026-07-31 15:13:31 -04:00
181dcc7a9e docs: record gitea-axi view limitation 2026-07-31 10:41:45 -04:00
7d22ff0c02 fix(skills): align invocation and prose conventions 2026-07-31 10:40:56 -04:00
4da2452084 feat(wayfinder): add artifact-backed planning skill 2026-07-31 10:35:25 -04:00
7550096968 feat(prototype): add throwaway prototype skill 2026-07-31 10:28:50 -04:00
cbc03650d1 feat(research): add durable research skill 2026-07-31 10:05:24 -04:00
8ad93c7617 feat(skills): support flat numbered artifacts 2026-07-31 09:23:13 -04:00
43280e4d4a fix(design-skill): tighten predictability checks 2026-07-30 19:34:41 -04:00
f72c262229 Add design-skill skill 2026-07-30 19:03:29 -04:00
fbd009337d Remove obsolete project skill placeholder 2026-07-30 00:30:19 -04:00
920517e623 Add project skills to dev shell 2026-07-30 00:28:43 -04:00
6bb3242e7f Move consume artifacts to artifact store 2026-07-30 00:24:52 -04:00
fb16c891b2 Move wiki source to artifact store 2026-07-30 00:15:15 -04:00
5886017976 Move grill artifacts outside project repos 2026-07-30 00:05:59 -04:00
b541251f98 feat(agents): make skill metadata agent-agnostic 2026-07-29 22:39:02 -04:00
40b37281d5 fix(shell): keep generated ignores visible to Pi 2026-07-29 17:01:22 -04:00
02f2017b40 feat(shell): deliver project skills through .agents 2026-07-29 11:54:36 -04:00
c6beafc53e fix(consume): quote Pi skill description 2026-07-29 09:13:42 -04:00
a4b88f8f42 feat(home-manager): place skills for Pi 2026-07-29 08:07:09 -04:00
ea8e2c50bc feat: add grill skill merging domain-modeling
Combine the interview-driven grill and the domain-modeling discipline into a
single model-invokable grill skill, so other skills can reach it as a backbone.

- One question at a time, each with options plus a recommendation and rationale,
  and a context quote when it turns on existing material.
- Agent-agnostic mode selection: discover .agents/CONTEXT.md then
  .claude/CONTEXT.md, and drive Domain Modeling, Free, or Clarification.
- Domain Modeling Mode maintains the glossary inline (CONTEXT-FORMAT.md) and
  offers ADRs under the three-gate test.
- Never begin implementation without an explicit user instruction, even when a
  caller skill invoked grill.
2026-07-25 16:10:40 -04:00
1e9d19fe3d chore: clear consumed spec and task scaffolding
Both spec docs and tasks 0001-0008 were mined into the personal wiki by
/consume; delete the scaffolding it consumed, leaving the now-empty spec/
and tasks/ directories in place.
2026-07-25 11:19:47 -04:00
52fc449824 feat: route consume knowledge to two channels (#9-#14)
Reworks the consume skill around two acceptance axes and two destinations,
implementing the six issues filed from the first real consume run as one design.

- Add trigger-ability as a second acceptance axis alongside generalizes, with
  its two premises; a pull-channel note now requires both (#9).
- Give consume a push channel — the target's own CLAUDE.md — for knowledge that
  fails an axis but is still useful: specific residue or proactive rules (#10).
- Name the general-lesson/specific-residue split and route each half (#12).
- Make the step-5 plan report a complete ledger with a per-note trigger line,
  push write-set, ref-fixes, flagged-not-authored, and drops (#13).
- Extend project cleanup to reconcile CLAUDE.md (capture-gated removal/trim) and
  fix references to deleted files wherever they land (#11).
- Encode a branch-owned output location: project notes flat under
  01 sources/claude/projects/, honoring any pre-existing grouping (#14).

Records the resolved vocabulary in .claude/CONTEXT.md and the two-channel write
decision in .claude/adr/0001.

Closes #9
Closes #10
Closes #11
Closes #12
Closes #13
Closes #14
2026-07-24 22:22:28 -04:00
8c17f3aeb8 feat: add consume skill for mining knowledge into the vault
/consume is the write-side counterpart to the read-only /wiki: it mines a
target for generalized, transferable knowledge and files atomic concept
notes into 01 sources/claude/, the agent-owned area of the Obsidian vault.

It is user-invoked/deliberate. SKILL.md holds the branch-detection ladder
plus the common writing logic — read existing knowledge (via /wiki and a
direct scan), plan atomic generalized notes with a file-to-section-to-note
contribution map, present an HTML plan and wait for explicit approval, then
write on the vault's note template and clear the consumed scaffolding.

v1 ships one branch, project.md: source code is truth for current state,
while .claude/spec and .claude/tasks are the record of why (mined, then
deleted). The ladder is extensible for future source types.
2026-07-24 20:03:44 -04:00
0a8b5c2096 feat: add wiki skill for read-only vault lookup
A model-invoked skill that answers questions from the user's Obsidian
vault, read-only, over the filesystem. Enforces the vault's own
settings.json deny-Read globs itself, since the harness does not apply
them when running from another directory. Uses the 02 tags/ hubs as a
recall backstop and reads to saturation, then answers with per-note
provenance.
2026-07-24 20:03:44 -04:00
97c0eeb055 feat: add all-skills leaderboard (task 0007)
Add a second pure transform to the benchmark core: a `--leaderboard` mode
that ranks per-skill results models into an index leaderboard, one row per
skill carrying both verdicts, links out to each per-skill report, and sorts
any red first (regressions above efficacy failures), then fragile-but-passing,
then clean green.

The fragile tier reuses the 0006 per-badge chips: the efficacy chip now
carries its win count so the leaderboard reads it against the pass floor
without recomputing margins, and fragility is scoped to the passing tier so a
red row never carries a chip. The runner's SKILL.md gains the no-argument
batch flow and the index invocation. The fixture test covers the tiered sort,
the not-applicable Regression cell, and the per-skill links.
2026-07-24 16:58:02 -04:00
f4df5d31c9 feat: add trend history and ribbons (task 0006)
Add the longitudinal layer to the benchmark core: a per-skill JSON-lines
history that appends one summary line per run and trims oldest-first at
fifty, two stacked net-margin trend ribbons (Efficacy and Regression, the
latter leaving a gap for two-arm runs) with the current run ringed and a
net/delta/green-count readout, and per-badge fragility chips that flag the
narrowest passing case on each green axis so a barely-green skill cannot
look robust.

History persistence is opt-in via --history and is the core's only side
effect. Without it the core stays a pure transform. Two committed fixtures
(clean and fragile) and new fixture-test sections cover the append-and-trim,
both ribbons including the two-arm gap, and the chips.
2026-07-24 16:37:23 -04:00
9b40d9f4e5 feat: add regression arm and two verdicts (task 0005)
Turn a benchmark run into a three-arm experiment: alongside the new-skill
and no-skill arms, add a previous-version arm materialized from the
default branch's HEAD, drawn automatically whenever the skill's directory
differs from HEAD and degrading to the two-arm efficacy-only shape
otherwise. Two blind head-to-heads now fall out per trial — efficacy
(new-vs-no-skill) and regression (new-vs-old).

The deterministic core dispatches a pass rule per comparison (efficacy at
wins>=3 and losses<=1, regression at losses<=1 with no wins floor),
gates only Efficacy on the hard assertion, and yields a second
skill-level Regression verdict, green when no case regressed and
not-applicable on a two-arm run. The report gains a second badge, a
headline reading both verdicts together, a previous-version cost row with
a two-ratio footnote, and per-case side-by-side comparisons that
auto-expand on any failure or flagged loss to show the losing-trial
output pair.

The fixture test covers both shapes in one test: a three-arm run
asserting per-arm metrics, both per-case and skill-level verdicts, the
net margins, the three-row cost table and losing-trial evidence, and the
two-arm run retained as the degenerate no-previous-version case.
2026-07-24 15:23:10 -04:00
5db98dcab9 refactor: tighten benchmark-skill instructions per craft-skill audit
Collapse duplication so each rule has one home: the pass-rule threshold
and cost footnote defer to the core, and the case-contract detail defers
to CASE-FORMAT.md. Drop editor-facing sediment from the arms step.

Fixes surfaced by a verify walk-through: define the hard-assertion gate
as passing only when every predicate exits zero (an earlier failure was
maskable by a later success), state that in-session arms run at the
session default temperature, name the fixture directory, and note the
steps run from the repo root.
2026-07-24 15:01:56 -04:00
3e96db664c docs: add skill-benchmarking spec
Bring the feature's design record into git (it was authored across the
benchmark tasks but never committed). Cleaned to the repo's prose
standards on the way in: recast prose semicolons as separate sentences
and split multi-sentence lines to one sentence per line.
2026-07-24 14:42:20 -04:00
613e423617 feat: isolate benchmark arms in fixture-only worlds (task 0008)
Run each benchmark arm in a hermetic fixture-only world materialized
outside the repo, so the no-skill baseline can no longer discover the
skill's assets on disk. The new-skill arm's skill is materialized to an
isolated temp path it is pointed at; the baseline gets no skill and is
told to stay within its world.

A live 5-trial axi-review run confirms the fix: all baseline transcripts
are clean of AXI-PRINCIPLES.md, the baselines invent their own generic
rubric (the honest counterfactual), and the Efficacy verdict is green
5/5 where the contaminated 0004 run had scored red 2/5.

Runner prose only; the deterministic core is untouched.
2026-07-24 14:28:05 -04:00
ab2c05acb2 feat: add dev shell with python3 and the benchmark skill (task 0004)
nix develop places benchmark-skill into ./.claude/skills/ (so /benchmark-skill
is available in this repo) and puts python3 on PATH to run the deterministic
core without a one-off nix shell.
2026-07-24 09:01:24 -04:00
e35ed9d05b feat: add efficacy-benchmark tracer bullet (task 0004)
Introduce the thinnest complete path that benchmarks a skill's efficacy
against a no-skill baseline and renders an HTML report.

- tests/ convention: a top-level tree mirroring skills/ by full path, with
  case directories holding a case.md (CASE-FORMAT.md) and an optional fixture.
- benchmark-skill: a distributed, non-model-invocable runner (/benchmark-skill
  <name>) that orchestrates force-invoked new-skill and skill-absent baseline
  arms plus a blind per-trial judge as in-session subagents.
- Deterministic core (Python): a pure transform over the collected run data
  that sums per-arm usage, collapses each trial to WIN/TIE/LOSS, applies the
  efficacy pass rule (wins >= 3, losses <= 1), and renders a self-contained
  report. Parameterized over arms and comparisons; two-arm here.
- Fixture-driven no-LLM check (checks/benchmark-core.nix) wired into flake.nix.
- Real tests tree for axi-review; a live run produced its efficacy report.
2026-07-24 08:55:55 -04:00
1caf18d72d feat: add axi-review skill
Review a CLI against the 10 canonical AXI principles black-box: run a
staged battery of read and write probes against a user-provided target,
judge each principle strictly against axi.md, and emit a report-card
table.

Ships as SKILL.md plus AXI-PRINCIPLES.md (per-principle rubric with
probes and PASS/PARTIAL/FAIL criteria) and REPORT-FORMAT.md (the
single-table card format and verdict vocabulary).

Claude-Session: https://claude.ai/code/session_015uc7R6zNYZpCxFWJMXrxwh
2026-07-22 23:22:27 -04:00
49a73c30d1 feat: add per-project dev-shell skills placement (task 0003)
Expose lib.mkSkillsShellHook, which takes a list of selected skill derivations
and returns a dev-shell shellHook string. On shell entry the hook symlinks each
selected skill as a direct child of the project's .claude/skills/, pointing into
the store. It is stateless: each entry first removes only store-pointing symlinks
(deselected skills included), then relinks the current selection, leaving
hand-authored real directories untouched and regenerating a self-ignoring
.gitignore of the managed names. Add a nix flake check that sources the produced
hook against a fixture project and asserts placement, stale-removal, the
collision guard, non-store-symlink survival, and the .gitignore contents.
2026-07-22 22:22:38 -04:00
b0a763e5ce feat: add global-placement home-manager module (task 0002)
Expose homeModules.default, a home-manager module whose programs.agents.skills
option places operator-selected skill derivations into Claude Code's skills
directory, one recursive home.file per skill, gated on programs.claude-code.enable
and sourcing configDir from the claude-code module. Add a nix flake check that
builds the home-files tree under several operator configurations and asserts
placement, recursion, the enable gate, configDir sourcing, and coexistence with
an operator's own skills.
2026-07-22 17:18:05 -04:00
8622b35f48 feat: package skills as per-skill Nix derivations (task 0001)
Add the content tier: a standalone flake that auto-discovers each skill
(a directory containing a SKILL.md, at any depth) and exposes it as an
individually addressable derivation built by lib.mkSkill. Directories
without a SKILL.md are descended through as cosmetic containers; once a
SKILL.md is found, that directory's subfolders are its assets, not
further skills. Skill names must be globally unique across the tree — a
collision is a hard eval-time error, not a warning.

A fixture-driven skill-build check under `nix flake check` exercises the
recursive walk, the builder, the SKILL.md-at-$out-root contract, the
eval-time name passthru, and the collision error. The repo ships no real
skill content yet, so packages.<system> is empty today.
2026-07-22 16:51:40 -04:00
46 changed files with 3262 additions and 1 deletions

1
.claude/skills Symbolic link
View File

@@ -0,0 +1 @@
../.agents/skills

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

5
.gitignore vendored
View File

@@ -6,3 +6,8 @@ result-*
# Ignore automatically generated direnv output # Ignore automatically generated direnv output
.direnv .direnv
# BEGIN mkSkillsShellHook
# Generated by mkSkillsShellHook. Nix-delivered skill symlinks, kept out of git.
.claude/skills
.agents/skills/gitea-axi
# END mkSkillsShellHook

36
AGENTS.md Normal file
View File

@@ -0,0 +1,36 @@
# skills
Personal agent skills packaged through Nix.
The domain glossary lives at `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/skills/011-skills-context.md`.
## Conventions
- `AGENTS.md` is canonical for project instructions.
Context, ADRs, specs, and tasks live under `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/skills/`.
- Skill source lives under `skills/<name>/`.
Do not edit generated links under `.agents/skills/` or `.claude/skills/` as source.
- Run `nix flake check` before considering a repository-wide change complete.
The check builds every packaged skill plus the Home Manager module and shell hook.
- The dev shell may place Nix-delivered skills into `.agents/skills/` and maintain `.claude/skills` as a compatibility symlink.
Generated ignore entries belong in the root `.gitignore`, not inside `.agents/skills/`, because skill scanners honor ignore files inside scanned skill directories.
## Gotchas
- A skill-local `GLOSSARY.md` is runtime reference for that skill and has no relationship to the project's AI-artifacts-vault context glossary.
- This repository owns packaged skill sources only.
Enabling, replacing, or removing them in a consumer repository such as dotfiles is outside its scope.
- `nix flake check` evaluates the Git snapshot and omits untracked skill files.
Use `nix flake check "path:$PWD"` to include a newly created skill before staging it.
- `$(xdg-user-dir DOCUMENTS)/ai-artifacts` is itself an Obsidian vault for AI-generated artifacts, distinct from the personal vault where AI-generated notes are forbidden.
- Project artifact filenames carry globally allocated identifiers.
Discover context and ADR artifacts through the AI artifacts vault convention rather than assuming fixed names or type directories.
- Do not turn opportunistic use of another skill into a declared dependency.
Invocation of an unrelated skill remains the agent's discretion unless the current skill directly requires its contract.
- Do not instruct a skill to execute synchronously.
In-process execution is the baseline, while isolation and parallelism belong to an external caller or runtime.
- When adapting an upstream skill, preserve mechanics the upstream skill leaves unspecified.
Customize only the surfaces required to fit the local workflow rather than turning incidental choices into new contracts.
- The installed `gitea-axi pr view` does not support `--fields`.
Use plain `gitea-axi pr view <number>`.
- Wayfinder `ticket/task/human` tickets can still be implementation work.
They are blocked only at the point where human input is required.

5
CLAUDE.md Normal file
View File

@@ -0,0 +1,5 @@
# Claude Code compatibility
You MUST read and follow [`AGENTS.md`](AGENTS.md) before doing any work in this repository.
`AGENTS.md` is the canonical project instruction file.
This file exists only so Claude Code discovers that canonical instruction file.

View File

@@ -1,3 +1,3 @@
# skills # skills
My personal skills packaged through Nix. Personal agent skills packaged through Nix.

View File

@@ -0,0 +1 @@
# dup (first)

View File

@@ -0,0 +1 @@
# dup (second)

View File

@@ -0,0 +1 @@
# alpha — a top-level skill

View File

@@ -0,0 +1 @@
# beta — nested under a cosmetic container

View File

@@ -0,0 +1 @@
# not a skill — beta asset that happens to contain SKILL.md

View File

@@ -0,0 +1 @@
# gamma — several containers deep

View File

@@ -0,0 +1,202 @@
# Builds the home-files tree `homeModules.default` produces under several
# operator configurations and asserts on the skills each one places.
{
pkgs,
home-manager,
module,
mkSkill,
}:
let
inherit (pkgs) lib;
# A sample skill built through the flake's own `mkSkill`, so it carries the
# `skillName` passthru the module reads to place it.
mkSampleSkill =
name:
mkSkill {
inherit pkgs name;
src = pkgs.runCommandLocal "${name}-src" { } ''
mkdir -p "$out"
printf '%s\n' "sample skill ${name}" > "$out/SKILL.md"
'';
};
skillAlpha = mkSampleSkill "sample-alpha";
skillBeta = mkSampleSkill "sample-beta";
# A skill the operator declares as their own attribute-set entry, so the
# attribute-set assertion can look for it beside the module's.
operatorAttrSkill = pkgs.runCommandLocal "operator-attr-skill" { } ''
mkdir -p "$out"
printf '%s\n' "the operator's own attribute-set skill" > "$out/SKILL.md"
'';
# A whole directory of skills, one folder per skill, for the path form of the
# operator's own `programs.claude-code.skills`.
operatorSkillsDir = pkgs.runCommandLocal "operator-skills-dir" { } ''
mkdir -p "$out/operator-dir-skill"
printf '%s\n' "the operator's own whole-directory skill" \
> "$out/operator-dir-skill/SKILL.md"
'';
# Evaluate the real module through home-manager's standalone entry point and
# return the home-files tree it would link into $HOME.
homeFiles =
operatorConfig:
(home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
module
{
home.username = "operator";
home.homeDirectory = "/home/operator";
home.stateVersion = "24.11";
}
operatorConfig
];
}).config.home-files;
# Two skills selected beside the operator's own attribute-set skill, with
# Claude Code enabled.
attrSetSkills = homeFiles {
programs.claude-code.enable = true;
programs.agents.skills = [
skillAlpha
skillBeta
];
# A store path, not a bare derivation, so the value takes the option's path
# branch rather than its attribute-set branch.
programs.claude-code.skills.operator-attr-skill = "${operatorAttrSkill}";
};
# The operator's own skills as a whole directory (path form).
# Setting this single-valued option to a path also proves the module never
# contributes to it, since an attribute-set contribution would clash with the
# path at eval.
wholeDirSkills = homeFiles {
programs.claude-code.enable = true;
programs.agents.skills = [ skillAlpha ];
programs.claude-code.skills = "${operatorSkillsDir}";
};
# A non-default `configDir`, so the assertions can prove placement follows it
# rather than a hardcoded `.claude`.
customConfigDir = homeFiles {
programs.claude-code.enable = true;
programs.claude-code.configDir = "/home/operator/.config/claude";
programs.agents.skills = [ skillAlpha ];
};
# Pi enabled and Claude Code disabled.
piOnly = homeFiles {
programs.pi-coding-agent.enable = true;
programs.agents.skills = [ skillAlpha ];
};
# Both supported harnesses enabled.
bothHarnesses = homeFiles {
programs.claude-code.enable = true;
programs.pi-coding-agent.enable = true;
programs.agents.skills = [ skillAlpha ];
};
# A non-default Pi `configDir`, so the assertions can prove placement follows it
# rather than a hardcoded `.pi/agent`.
customPiConfigDir = homeFiles {
programs.pi-coding-agent.enable = true;
programs.pi-coding-agent.configDir = "/home/operator/.config/pi/agent";
programs.agents.skills = [ skillAlpha ];
};
# No compatible harness enabled, with a skill still selected.
agentsOff = homeFiles {
programs.claude-code.enable = false;
programs.pi-coding-agent.enable = false;
programs.agents.skills = [ skillAlpha ];
};
# An empty selection with both supported harnesses enabled.
emptySelection = homeFiles {
programs.claude-code.enable = true;
programs.pi-coding-agent.enable = true;
programs.agents.skills = [ ];
};
in
pkgs.runCommandLocal "skills-home-manager-module-check"
{
# Forcing each derivation as a build input builds its home-files tree, so an
# eval-level composition failure surfaces before any assertion runs.
inherit
attrSetSkills
wholeDirSkills
customConfigDir
piOnly
bothHarnesses
customPiConfigDir
agentsOff
emptySelection
;
}
''
fail() { echo "FAIL: $1" >&2; exit 1; }
echo "attribute-set skills: both selected skills and the operator's own land"
test -f "$attrSetSkills/.claude/skills/sample-alpha/SKILL.md" \
|| fail "selected skill sample-alpha did not land at its own name"
test -f "$attrSetSkills/.claude/skills/sample-beta/SKILL.md" \
|| fail "selected skill sample-beta did not land at its own name"
test -f "$attrSetSkills/.claude/skills/operator-attr-skill/SKILL.md" \
|| fail "the operator's own attribute-set skill was clobbered"
echo "recursive placement: a skill is a real directory of per-file symlinks"
# A file-existence test follows symlinks, so it cannot tell a recursive tree
# from one opaque symlink over the whole skill.
# The entry's own type is what the assertion reads instead.
test -d "$attrSetSkills/.claude/skills/sample-alpha" \
&& test ! -L "$attrSetSkills/.claude/skills/sample-alpha" \
|| fail "sample-alpha was placed as an opaque symlink, not a recursive tree"
echo "whole-directory skills: the selected skill lands beside the operator's directory"
test -f "$wholeDirSkills/.claude/skills/sample-alpha/SKILL.md" \
|| fail "selected skill did not coexist with a whole skills directory"
test -f "$wholeDirSkills/.claude/skills/operator-dir-skill/SKILL.md" \
|| fail "the operator's whole skills directory was clobbered"
echo "custom configDir: placement follows configDir rather than a hardcoded .claude"
test -f "$customConfigDir/.config/claude/skills/sample-alpha/SKILL.md" \
|| fail "skill was not placed under the configured configDir"
test ! -e "$customConfigDir/.claude/skills/sample-alpha" \
|| fail "skill was placed under a hardcoded .claude, ignoring configDir"
echo "Pi enabled: selected skills land in Pi's global skills directory"
test -f "$piOnly/.pi/agent/skills/sample-alpha/SKILL.md" \
|| fail "selected skill did not land under Pi's configDir"
test ! -e "$piOnly/.claude/skills/sample-alpha" \
|| fail "a skill was placed for Claude Code when only Pi was enabled"
echo "both harnesses enabled: selected skills land in both global skills directories"
test -f "$bothHarnesses/.claude/skills/sample-alpha/SKILL.md" \
|| fail "selected skill did not land under Claude Code when both harnesses were enabled"
test -f "$bothHarnesses/.pi/agent/skills/sample-alpha/SKILL.md" \
|| fail "selected skill did not land under Pi when both harnesses were enabled"
echo "custom Pi configDir: placement follows configDir rather than a hardcoded .pi/agent"
test -f "$customPiConfigDir/.config/pi/agent/skills/sample-alpha/SKILL.md" \
|| fail "skill was not placed under Pi's configured configDir"
test ! -e "$customPiConfigDir/.pi/agent/skills/sample-alpha" \
|| fail "skill was placed under a hardcoded .pi/agent, ignoring configDir"
echo "agents disabled: no skill entry is written despite a selection"
test ! -e "$agentsOff/.claude/skills/sample-alpha" \
|| fail "a skill was placed with Claude Code disabled"
test ! -e "$agentsOff/.pi/agent/skills/sample-alpha" \
|| fail "a skill was placed with Pi disabled"
echo "empty selection: nothing is installed"
test ! -e "$emptySelection/.claude/skills/sample-alpha" \
|| fail "an unselected skill was placed for Claude Code"
test ! -e "$emptySelection/.pi/agent/skills/sample-alpha" \
|| fail "an unselected skill was placed for Pi"
touch "$out"
''

136
checks/shell-hook.nix Normal file
View File

@@ -0,0 +1,136 @@
# Runs the dev-shell helper's hook against a fixture project and asserts the
# placement, stateless stale-removal, and hand-authored-skill safety it promises.
{
pkgs,
mkSkill,
mkSkillsShellHook,
}:
let
# Sample skills built through the flake's own `mkSkill`, so they carry the
# `skillName` passthru the hook reads and land at real store paths the hook
# can link to.
mkSampleSkill =
name:
mkSkill {
inherit pkgs name;
src = pkgs.runCommandLocal "${name}-src" { } ''
mkdir -p "$out"
printf '%s\n' "sample skill ${name}" > "$out/SKILL.md"
'';
};
skillAlpha = mkSampleSkill "sample-alpha";
skillBeta = mkSampleSkill "sample-beta";
# Selected, but a hand-authored real directory of the same name already exists
# in the fixture, so the hook must skip it.
skillGamma = mkSampleSkill "sample-gamma";
# Two hooks for two successive selections: the second drops sample-beta, so
# sourcing it after the first proves a deselected skill's symlink is removed.
hookBoth = mkSkillsShellHook [
skillAlpha
skillBeta
skillGamma
];
hookAlpha = mkSkillsShellHook [ skillAlpha ];
in
pkgs.runCommandLocal "skills-shell-hook-check"
{
inherit hookBoth hookAlpha;
alphaPath = "${skillAlpha}";
betaPath = "${skillBeta}";
}
''
fail() { echo "FAIL: $1" >&2; exit 1; }
echo "the hook is a non-empty string referencing each skill's store path and name"
[ -n "$hookBoth" ] || fail "the produced hook is empty"
for token in "$alphaPath" "$betaPath" sample-alpha sample-beta; do
printf '%s' "$hookBoth" | grep -qF "$token" \
|| fail "the hook does not reference $token"
done
# The fixture project carries three things the hook must not disturb: a
# hand-authored skill under its own name, a hand-authored skill whose name
# collides with a selected one, and a symlink pointing outside the store.
mkdir -p proj/.agents/skills/handmade
printf '%s\n' "a hand-authored skill" > proj/.agents/skills/handmade/SKILL.md
printf '%s\n' "# fixture ignore" "result" > proj/.gitignore
mkdir -p proj/.agents/skills/sample-gamma
printf '%s\n' "a hand-authored gamma" > proj/.agents/skills/sample-gamma/SKILL.md
ln -s /nonexistent/external-target proj/.agents/skills/external
cd proj
echo "first entry: the two free skills link as store symlinks that resolve"
printf '%s\n' "$hookBoth" > ../hook-both.sh
. ../hook-both.sh
for name in sample-alpha sample-beta; do
[ -L ".agents/skills/$name" ] || fail "$name was not linked as a symlink"
case "$(readlink ".agents/skills/$name")" in
${builtins.storeDir}/*) : ;;
*) fail "$name's symlink does not point into the store" ;;
esac
test -f ".agents/skills/$name/SKILL.md" \
|| fail "$name's link does not resolve to its SKILL.md"
done
echo "a selected skill colliding with a hand-authored one leaves the real directory"
{ [ -d .agents/skills/sample-gamma ] && [ ! -L .agents/skills/sample-gamma ]; } \
|| fail "the colliding hand-authored skill was replaced by a symlink"
grep -qx "a hand-authored gamma" .agents/skills/sample-gamma/SKILL.md \
|| fail "the colliding hand-authored skill's content was overwritten"
echo "the non-colliding hand-authored skill is an untouched real directory"
{ [ -d .agents/skills/handmade ] && [ ! -L .agents/skills/handmade ]; } \
|| fail "the hand-authored skill was replaced or removed"
test -f .agents/skills/handmade/SKILL.md || fail "the hand-authored skill lost its content"
echo "a symlink pointing outside the store is not ours, so it is left alone"
[ -L .agents/skills/external ] || fail "the non-store symlink was removed"
echo "Claude Code compatibility points at the canonical skill directory"
[ -L .claude/skills ] || fail ".claude/skills is not a compatibility symlink"
[ "$(readlink .claude/skills)" = "../.agents/skills" ] \
|| fail ".claude/skills points somewhere other than ../.agents/skills"
test -f .claude/skills/sample-alpha/SKILL.md \
|| fail "Claude Code compatibility link does not resolve selected skills"
echo "the project .gitignore lists only generated links and keeps skill scanners clear"
test ! -e .agents/skills/.gitignore || fail "the hook wrote an ignore file where skill scanners read it"
grep -qx '# fixture ignore' .gitignore || fail "the existing .gitignore content was lost"
grep -qx 'result' .gitignore || fail "the existing .gitignore pattern was lost"
grep -qx '# BEGIN mkSkillsShellHook' .gitignore || fail ".gitignore lacks the managed block start"
grep -qx '# END mkSkillsShellHook' .gitignore || fail ".gitignore lacks the managed block end"
grep -qx '.claude/skills' .gitignore || fail ".gitignore omits the compatibility symlink"
grep -qx '.agents/skills/sample-alpha' .gitignore || fail ".gitignore omits sample-alpha"
grep -qx '.agents/skills/sample-beta' .gitignore || fail ".gitignore omits sample-beta"
for tracked in .agents/skills/handmade .agents/skills/sample-gamma .agents/skills/external; do
grep -qx "$tracked" .gitignore \
&& fail ".gitignore lists $tracked, which would untrack a real path"
done
echo "no manifest or state file is written: only the fixtures and links exist"
entries=$(ls -A .agents/skills | sort | tr '\n' ' ')
[ "$entries" = "external handmade sample-alpha sample-beta sample-gamma " ] \
|| fail "unexpected entries under .agents/skills: [$entries]"
echo "second entry with sample-beta deselected: its symlink is removed, the rest stay"
printf '%s\n' "$hookAlpha" > ../hook-alpha.sh
. ../hook-alpha.sh
test ! -e .agents/skills/sample-beta || fail "the deselected skill's symlink was not removed"
[ -L .agents/skills/sample-alpha ] || fail "the still-selected skill was dropped"
{ [ -d .agents/skills/handmade ] && [ ! -L .agents/skills/handmade ]; } \
|| fail "the hand-authored skill was disturbed on re-entry"
{ [ -d .agents/skills/sample-gamma ] && [ ! -L .agents/skills/sample-gamma ]; } \
|| fail "the colliding hand-authored skill was disturbed on re-entry"
[ -L .agents/skills/external ] || fail "the non-store symlink was disturbed on re-entry"
echo "the .gitignore tracks the new selection without duplicating the managed block"
grep -qx '.agents/skills/sample-alpha' .gitignore || fail ".gitignore lost sample-alpha"
grep -qx '.agents/skills/sample-beta' .gitignore \
&& fail ".gitignore still lists the deselected sample-beta"
[ "$(grep -xc '# BEGIN mkSkillsShellHook' .gitignore)" = 1 ] \
|| fail ".gitignore has duplicate managed blocks"
touch "$out"
''

56
checks/skill-build.nix Normal file
View File

@@ -0,0 +1,56 @@
# The skill-build check: drives fixture skills through the content tier so
# `nix flake check` covers every discovery shape and the collision hard-error.
{
pkgs,
mkSkill,
discoverSkills,
}:
let
inherit (pkgs) lib;
discovered = discoverSkills ./fixtures/valid;
built = map (skill: mkSkill { inherit pkgs; inherit (skill) name src; }) discovered;
collision = builtins.tryEval (discoverSkills ./fixtures/collision);
discoveredNames = lib.sort (a: b: a < b) (map (skill: skill.name) discovered);
in
pkgs.runCommandLocal "skill-build-check"
{
# Referencing every built skill forces each one to build before this
# derivation — that is the "build every auto-discovered skill" coverage.
# Each entry is "name=storepath" so the assertions can read each $out root
# without re-deriving anything, and confirm the name passthru round-trips.
pairs = lib.concatStringsSep " " (map (skill: "${skill.skillName}=${skill}") built);
collisionSucceeded = if collision.success then "yes" else "no";
expectedNames = lib.concatStringsSep " " discoveredNames;
}
''
fail() { echo "FAIL: $1" >&2; exit 1; }
echo "content tier: the name-collision fixture must fail discovery at eval"
[ "$collisionSucceeded" = no ] \
|| fail "a two-skills-one-name tree was discovered without error"
echo "content tier: discovery finds every skill regardless of nesting depth,"
echo " and stops at a skill rather than descending into its assets"
[ "$expectedNames" = "alpha beta gamma" ] \
|| fail "discovered names were [$expectedNames], expected [alpha beta gamma]"
echo "content tier: each built skill has SKILL.md at its \$out root"
beta_path=
for pair in $pairs; do
name="''${pair%%=*}"
path="''${pair#*=}"
test -f "$path/SKILL.md" || fail "$name has no SKILL.md at its \$out root"
[ "$name" = beta ] && beta_path="$path"
done
echo "content tier: a skill's asset subfolder rides along in \$out and is"
echo " not split off into its own skill"
[ -n "$beta_path" ] || fail "beta was not discovered"
test -f "$beta_path/tools/SKILL.md" \
|| fail "beta's asset subfolder did not ride along into \$out"
touch "$out"
''

125
flake.lock generated Normal file
View File

@@ -0,0 +1,125 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitea-axi": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1785340481,
"narHash": "sha256-GSxdQ7w8yYfZnfkXUuZ2fYIKibe9ZU8xDGyqpeTb2tE=",
"ref": "refs/heads/main",
"rev": "627fc9a32bb80d97923540fc0d3e9661961462ba",
"revCount": 83,
"type": "git",
"url": "https://git.alexion.dev/alexion/gitea-axi"
},
"original": {
"type": "git",
"url": "https://git.alexion.dev/alexion/gitea-axi"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"gitea-axi",
"nixpkgs"
]
},
"locked": {
"lastModified": 1784588016,
"narHash": "sha256-ouZe80aWEhMLVMkqICFDN+JUw+0FJtCr/bh+hHtRtMg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "deeb6b7eb7e0c44ae1819c051ce175bd92a85100",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1784725727,
"narHash": "sha256-J5+C9wsO0lhDyUalQzfplDbRjyHDYeEH5+9sdyXtwa8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "041a999e8c1c5b731913855909e68d30ca69b8e0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1784497964,
"narHash": "sha256-vlHUuqAcbcH2RKmHbPiuQzbv1pnzzavXnI62RD0bqCU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "241313f4e8e508cb9b13278c2b0fa25b9ca27163",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"gitea-axi": "gitea-axi",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

109
flake.nix Normal file
View File

@@ -0,0 +1,109 @@
{
description = "Personal agent skills, packaged through Nix.";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gitea-axi = {
url = "git+https://git.alexion.dev/alexion/gitea-axi";
inputs.nixpkgs.follows = "nixpkgs";
};
# Present only so `nix flake check` can evaluate `homeModules.default` against
# real home-manager (the home-manager-module check). Its nixpkgs follows this
# flake's, so the module is checked against the same nixpkgs-and-home-manager
# pairing a consumer following this flake would get. It has no bearing on the
# module a consumer imports — that module is a bare function taking the
# importing configuration's own home-manager and pkgs.
inputs.home-manager.url = "github:nix-community/home-manager";
inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs";
outputs =
{ self, nixpkgs, flake-utils, home-manager, gitea-axi }:
let
mkSkill = import ./lib/mk-skill.nix;
mkSkillsShellHook = import ./lib/mk-skills-shell-hook.nix;
discoverSkills = import ./lib/discover.nix nixpkgs.lib;
discoveredSkills = discoverSkills ./skills;
skillPackages =
pkgs:
nixpkgs.lib.listToAttrs (
map (skill: {
inherit (skill) name;
value = mkSkill { inherit pkgs; inherit (skill) name src; };
}) discoveredSkills
);
in
{
lib = { inherit mkSkill mkSkillsShellHook; };
# Global placement: an operator selects skills into enabled agent harnesses
# via `programs.agents.skills`. Not per-system — it is a module function,
# and the skills it places come from the importing configuration's own
# selection rather than this flake's nixpkgs.
homeModules = rec {
agents-skills = ./home-manager-module.nix;
default = agents-skills;
};
}
//
# An explicit system list rather than `eachDefaultSystem`.
# That default set includes x86_64-darwin, which current nixpkgs no longer
# evaluates (its `legacyPackages` throws).
flake-utils.lib.eachSystem
[
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
]
(
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# No `default`: a catalog has no single default skill.
packages = skillPackages pkgs;
# Each discovered skill is folded in as its own check, so
# `nix flake check` builds every skill and fails on a malformed one.
checks = (skillPackages pkgs) // {
skill-build = import ./checks/skill-build.nix {
inherit pkgs mkSkill discoverSkills;
};
# Proves the global-placement module composes: it builds the
# home-files derivation `homeModules.default` produces under several
# operator configurations. Reuses this flake's `mkSkill` so the
# sample skills carry the same name contract real ones do.
home-manager-module = import ./checks/home-manager-module.nix {
inherit pkgs home-manager mkSkill;
module = self.homeModules.default;
};
# Proves the per-project dev-shell helper: it runs the produced hook
# against a fixture project and asserts placement, stateless
# stale-removal, and that hand-authored skills stay untouched.
shell-hook = import ./checks/shell-hook.nix {
inherit pkgs mkSkill mkSkillsShellHook;
};
};
# A working shell for developing skills in this repo.
# The gitea-axi project skill is placed into ./.agents/skills/ on entry,
# with ./.claude/skills as a compatibility symlink.
devShells.default = pkgs.mkShell {
packages = [
gitea-axi.packages.${system}.gitea-axi
];
shellHook = mkSkillsShellHook [
gitea-axi.packages.${system}.gitea-axi-skill
];
};
}
);
}

68
home-manager-module.nix Normal file
View File

@@ -0,0 +1,68 @@
# Places operator-selected skills into each enabled agent's global skills
# directory, one per skill, for every project.
{
config,
lib,
...
}:
let
cfg = config.programs.agents;
claudeCode = config.programs.claude-code;
pi = config.programs.pi-coding-agent;
skillFiles = configDir:
lib.listToAttrs (
map (skill: {
name = "${configDir}/skills/${skill.skillName}";
value = {
source = skill;
recursive = true;
};
}) cfg.skills
);
in
{
options.programs.agents.skills = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
example = lib.literalExpression "[ inputs.skills.packages.\${system}.some-skill ]";
description = ''
Skills to install globally into every enabled agent harness that supports
Agent Skills.
Selection is by derivation: pass skill derivations from the skills flake's
`packages.<system>`, each of which carries its placement name as an
eval-time attribute. An empty list installs nothing.
Every skill is written as its own recursive {option}`home.file`, so this
option composes with an operator's own harness-specific skills and with
other modules placing skills under the same directory rather than claiming
the tree. Placement is gated on each harness' enable option.
'';
};
# `agents` is an umbrella namespace with no shared enable, so the skills
# feature self-gates.
# An empty list writes nothing, and files land only when a compatible harness
# is enabled.
# Reading each skill's source realises its derivation, so gating on harness
# enablement also keeps that realisation off a host that installs nothing.
config = lib.mkMerge [
(lib.mkIf claudeCode.enable {
# Each name is the derivation's eval-time `skillName`, so placement reads
# no `$out` and needs no import-from-derivation.
# `recursive = true` materialises `skills/<name>/` as a directory of
# per-file symlinks, which lets this module, the operator's own skills,
# and self-placing tool modules share one `skills/` tree.
#
# This deliberately does not feed the single-valued
# `programs.claude-code.skills`, which would collide with an operator
# already setting it.
home.file = skillFiles claudeCode.configDir;
})
(lib.mkIf pi.enable {
home.file = skillFiles pi.configDir;
})
];
}

42
lib/discover.nix Normal file
View File

@@ -0,0 +1,42 @@
# Recursive skill discovery: one `{ name; src; }` per skill in a source tree.
lib: root:
let
walk =
dir:
let
subdirs = lib.filterAttrs (_: type: type == "directory") (builtins.readDir dir);
in
lib.concatLists (
lib.mapAttrsToList (
entryName: _:
let
child = dir + "/${entryName}";
in
# A directory with a SKILL.md is a skill, and its subdirectories are
# that skill's assets rather than nested skills, so the walk stops here.
# A directory without one is a cosmetic container to recurse through.
if (builtins.readDir child) ? "SKILL.md" then
[
{
name = entryName;
src = child;
}
]
else
walk child
) subdirs
);
found = walk root;
names = map (s: s.name) found;
duplicates = lib.unique (lib.filter (n: lib.count (x: x == n) names > 1) names);
in
if duplicates != [ ] then
throw ''
Skill name collision: ${lib.concatStringsSep ", " duplicates}.
Two or more skills under ${toString root} resolve to the same name.
A skill's name is its leaf directory name and must be globally unique
across the whole tree, independent of the cosmetic folders above it.
Rename one of the colliding skills.''
else
found

27
lib/mk-skill.nix Normal file
View File

@@ -0,0 +1,27 @@
# Builds a skill source directory into a derivation, `SKILL.md` at the `$out` root.
{
pkgs,
src,
name ? builtins.baseNameOf (toString src),
}:
pkgs.stdenvNoCC.mkDerivation {
inherit name src;
# A skill is just files to copy, with nothing to unpack, configure, or build.
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p "$out"
cp -R "$src"/. "$out/"
test -f "$out/SKILL.md" \
|| { echo "mkSkill: skill '${name}' has no SKILL.md at its root" >&2; exit 1; }
runHook postInstall
'';
# The name as an eval-time attribute, readable without building `$out`
# (no import-from-derivation).
passthru.skillName = name;
}

View File

@@ -0,0 +1,112 @@
# Builds a dev-shell shellHook that links a project's selected skills into its
# own `.agents/skills/` as direct-child symlinks into the Nix store, with
# `.claude/skills` as a compatibility symlink when that path is free.
# Generated ignores live in the project root so agent skill scanners still see
# the linked skills.
skills:
let
storeDir = builtins.storeDir;
links = builtins.concatStringsSep "\n" (
map (skill: " _mkskills_link '${skill.skillName}' '${skill}'") skills
);
in
''
# Places this project's Nix-delivered skills into ./.agents/skills/ on shell
# entry.
# Each run first drops every direct-child symlink pointing into the store,
# then relinks the current selection.
# Those store symlinks are unambiguously ours, so this removes deselected
# skills for free and needs no manifest.
# A real (non-symlink) skill directory is a hand-authored, project-private
# skill and is left untouched.
# When ./.claude/skills is free, it is kept as a compatibility symlink to the
# canonical ./.agents/skills directory so Claude Code sees the same skills.
# The whole hook runs in a subshell so it leaks no names into the interactive
# shell.
(
_mkskills_dir=".agents/skills"
mkdir -p "$_mkskills_dir"
_mkskills_claude_skills_managed=0
mkdir -p .claude
if [ ! -e .claude/skills ] && [ ! -L .claude/skills ]; then
ln -s ../.agents/skills .claude/skills
_mkskills_claude_skills_managed=1
elif [ -L .claude/skills ]; then
case "$(readlink .claude/skills)" in
../.agents/skills) _mkskills_claude_skills_managed=1 ;;
${storeDir}/*) rm -f .claude/skills && ln -s ../.agents/skills .claude/skills && _mkskills_claude_skills_managed=1 ;;
esac
else
printf 'mkSkillsShellHook: leaving existing non-symlink .claude/skills in place; Claude Code compatibility link not installed\n' >&2
fi
for _mkskills_entry in "$_mkskills_dir"/*; do
[ -L "$_mkskills_entry" ] || continue
case "$(readlink "$_mkskills_entry")" in
${storeDir}/*) rm -f "$_mkskills_entry" ;;
esac
done
# A real path at a selected skill's name is a hand-authored skill.
# It is left in place and left out of the managed set, so the generated
# ignore block keeps tracking it rather than the skill that would have been
# linked.
_mkskills_managed=""
_mkskills_link() {
_mkskills_dest="$_mkskills_dir/$1"
if [ -e "$_mkskills_dest" ] && [ ! -L "$_mkskills_dest" ]; then
printf 'mkSkillsShellHook: skipping %s: a non-symlink path already exists\n' "$1" >&2
else
# At most a non-store symlink remains at this name, so removing it first
# keeps the link step to a plain POSIX `ln -s` with no overwrite flag.
rm -f "$_mkskills_dest"
ln -s "$2" "$_mkskills_dest"
_mkskills_managed="$_mkskills_managed $1"
fi
}
${links}
if [ -f "$_mkskills_dir/.gitignore" ] \
&& grep -qx '# Generated by mkSkillsShellHook. Nix-delivered skill symlinks, kept out of git.' "$_mkskills_dir/.gitignore"; then
rm -f "$_mkskills_dir/.gitignore"
fi
# Regenerate the project-root ignore block from the current selection.
# Skill scanners read ignore files under .agents/skills, so the block must
# live above the scanned tree.
_mkskills_gitignore=".gitignore"
_mkskills_gitignore_tmp=".gitignore.mkskills.$$"
if [ -f "$_mkskills_gitignore" ]; then
awk '
$0 == "# BEGIN mkSkillsShellHook" { skip = 1; next }
$0 == "# END mkSkillsShellHook" { skip = 0; next }
!skip { lines[++n] = $0 }
END {
while (n > 0 && lines[n] == "") n--
for (i = 1; i <= n; i++) print lines[i]
}
' "$_mkskills_gitignore" > "$_mkskills_gitignore_tmp"
else
: > "$_mkskills_gitignore_tmp"
fi
{
if [ -s "$_mkskills_gitignore_tmp" ]; then
cat "$_mkskills_gitignore_tmp"
printf '\n'
fi
printf '%s\n' "# BEGIN mkSkillsShellHook"
printf '%s\n' "# Generated by mkSkillsShellHook. Nix-delivered skill symlinks, kept out of git."
if [ "$_mkskills_claude_skills_managed" = 1 ]; then
printf '%s\n' ".claude/skills"
fi
# Disable pathname expansion so a managed name is never glob-expanded.
set -f
for _mkskills_name in $_mkskills_managed; do
printf '.agents/skills/%s\n' "$_mkskills_name"
done
printf '%s\n' "# END mkSkillsShellHook"
} > "$_mkskills_gitignore"
rm -f "$_mkskills_gitignore_tmp"
)
''

View File

@@ -0,0 +1,141 @@
# The 10 AXI Principles — review rubric
The canonical statements come from axi.md, which is the authority for the wording.
Each entry distils the canonical statement, gives the black-box probe to run, and the criteria that map observed output to a verdict.
Judge against the canonical statement, not against any single tool's interpretation.
Verdict states are defined in [`REPORT-FORMAT.md`](REPORT-FORMAT.md).
A deviation that the tool's own skill file documents is still judged by the canonical bar, with the documentation noted on the row.
## Efficiency
### Principle 1 — Token-efficient output
Canonical: structured output uses TOON (Token-Optimized Object Notation), not JSON, omitting braces, quotes, and commas while staying unambiguously parseable.
Probe: run a list command and a detail command, and inspect stdout.
- PASS: structured output is TOON — tabular `name[N]{f1,f2}:` blocks with no per-field JSON braces or quotes.
- PARTIAL: some commands emit TOON and others emit JSON or ad-hoc text.
- FAIL: the structured commands emit JSON or free-form prose.
Failure modes: emitting raw API JSON, pretty-printed JSON, or a human-oriented box-drawing table.
### Principle 2 — Minimal default schemas
Canonical: return 34 fields per list row by default, with more available through an explicit `--fields` flag.
Probe: run a list command with no `--fields` and count the fields per row, then confirm `--fields` adds fields.
- PASS: default list rows carry 34 fields and `--fields` opts into more.
- PARTIAL: the default carries 56 fields, or `--fields` is absent while the default stays lean.
- FAIL: the default carries 7 or more fields, or every field is always present with no minimal default.
Failure modes: returning the full API object by default, or offering no `--fields` mechanism.
### Principle 3 — Content truncation
Canonical: large text fields are truncated to a limit with a size hint appended, for example `(truncated, 2847 chars total — use --full to see complete body)`.
Probe: view an entity with a long body, then check that a list command carrying a body field truncates it too rather than leaking it raw, and confirm `--full` (or its equivalent) suppresses truncation on both.
The body-leak check belongs to the list command, not the detail view, where the body is always shown.
- PASS: long bodies truncate with an inline size hint that names how to get the full text, and `--full` returns the untruncated body.
- PARTIAL: it truncates without a hint, or hints without a `--full` escape, or truncates on detail while leaking raw bodies on a list path.
- FAIL: full bodies are emitted untruncated, or they truncate with no indication at all.
Failure modes: an unbounded body on a list path that spills many full bodies into context, or silent truncation with no hint.
## Robustness
### Principle 4 — Pre-computed aggregates
Canonical: include derived fields that eliminate round trips, always report total item counts, and provide inline summaries such as `27 passed, 0 failed, 10 skipped`.
Probe: run a list command and look for a leading count that reports a total, then run a command whose result has a natural rollup (status or checks) and look for an inline summary.
- PASS: list output leads with a total count such as `count: N of T total`, and derived summaries appear inline where relevant.
- PARTIAL: the count is bare (`count: N` with no total), or some aggregates are present while obvious round trips remain.
- FAIL: no counts and no derived fields, so the agent must issue follow-up calls for basics.
When the target has no data that exercises the rollup facet, for example no PRs or CI for a checks summary, judge on the count facet alone and note that the rollup was not observable.
Failure modes: a bare count with no total, or requiring a second call for a review decision or a status rollup.
### Principle 5 — Definitive empty states
Canonical: a query that returns nothing emits an explicit zero-result message rather than empty output, because an agent cannot tell a silent failure from a genuinely empty result.
Probe: run a query guaranteed to return nothing — a nonsense search or a no-match filter — and inspect stdout.
- PASS: empty results emit an explicit marker such as `<noun>[0]: (none)` or `0 open`, never silence.
- PARTIAL: some empty paths are marked while others print nothing, for example a dashboard that is blank when empty.
- FAIL: empty output on no results, indistinguishable from a silent failure.
Failure modes: printing nothing, or exiting 0 with blank stdout.
### Principle 6 — Structured errors and exit codes
Canonical: mutations are idempotent, errors are structured and written to stdout rather than stderr, commands never prompt for interactive input, exit code is 0 for success and 1 for errors and 2 for unknown flags, and unknown flags fail loudly rather than being silently ignored.
Probe, read facet (safe): trigger a not-found id, an unknown flag, and a bad target, then check for a structured error block on stdout with a code field and the right exit codes, with 2 for the unknown flag.
Probe, write facet: run a state-toggling mutation and then repeat it — one whose second run is a no-op, such as closing an already-closed entity or pinning an already-pinned one, not a create, which duplicates by design.
Observe an idempotent result on the repeat, an early return or an `already:` marker, and confirm no command prompts.
If the target rejects the write probes, the write facet is BLOCKED.
- PASS: errors are a structured block on stdout with a code, exit codes are 0/1/2 as canonical, unknown flags exit 2, no command prompts, and a repeated mutation is idempotent.
- PARTIAL: errors are structured but on stderr, or exit codes are collapsed to a single value, or an unknown flag is silently ignored, or some mutations are not idempotent.
- FAIL: errors are free-form text on stderr, or a command prompts interactively, or a repeated mutation duplicates its effect.
- BLOCKED: the write target rejected the mutation probes, so the idempotency facet could not be observed — record the reason.
Failure modes: writing errors to stderr, prompting for confirmation, or exiting 1 for every outcome.
## Discoverability
### Principle 7 — Ambient context
Canonical: install into the agent's session from an explicit setup command, so every conversation starts with relevant state visible, and ship an installable skill for on-demand guidance.
Probe: locate the tool's bundled Agent Skill file, under `~/.pi/agent/skills/<tool>/`, `~/.claude/skills/<tool>/`, or in the installed package or repo, and check the surface for an explicit setup command.
- PASS: the tool ships a discoverable Agent Skill installed by an explicit setup command, optionally alongside a hook that injects a dashboard as initial context.
- PARTIAL: a setup command exists but installs no skill, or a skill exists with no explicit setup path, for example one installed by a postinstall script.
- FAIL: no discoverable skill file at all.
Failure modes: shipping no skill, or auto-installing via a postinstall script instead of an explicit setup command.
### Principle 8 — Content first
Canonical: running the command with no arguments displays live, actionable data rather than help text, preceded by the executable path (with `~` for home) and a one-sentence description of the tool's purpose.
Probe: run the bare invocation with no arguments.
- PASS: no-arg output is live tool state, preceded by a header naming the executable path and a one-sentence purpose.
- PARTIAL: it shows live data without the path-and-description header, or mixes help text with data.
- FAIL: no-arg output is a help or usage screen, or it errors.
Failure modes: printing usage text on no args, or showing no live data.
### Principle 9 — Contextual disclosure
Canonical: append `help[]` lines after output suggesting logical next steps as concrete command templates, keeping fixed disambiguating flags but leaving runtime values parameterized as placeholders like `<id>` rather than guessing them.
Probe: inspect the list and detail outputs for a `help[]` block, checking placeholders on list output and a filled id on unambiguous single-entity output.
- PASS: commands append a `help[]` block of concrete next-step templates, parameterizing runtime values as placeholders, and may fill a known id where a single entity makes it unambiguous.
- PARTIAL: suggestions appear on some commands but not others, or they hardcode a guessed runtime value, or the `help[]` block is empty.
- FAIL: no next-step suggestions anywhere.
Failure modes: guessing an id in a suggestion, or omitting suggestions.
### Principle 10 — Consistent way to get help
Canonical: each subcommand offers a concise `--help` flag as a fallback when contextual hints are insufficient.
Probe: run `--help` on the root and on at least one subcommand.
- PASS: every subcommand responds to `--help` with a concise flag reference.
- PARTIAL: `--help` works on some subcommands but not all, or its output is inconsistent or verbose.
- FAIL: no `--help`, or it errors or prompts.
Failure modes: `--help` missing on subcommands, or help that prompts interactively.

View File

@@ -0,0 +1,54 @@
# Report card format
The card is rendered in-session as terminal markdown.
It reports all 10 principles, in canonical order grouped by category, so the whole rubric is visible rather than only the failures.
## Verdict states
- **PASS** — observed behaviour meets the canonical bar.
- **PARTIAL** — the principle is partly met, for example TOON output with no truncation hint.
- **FAIL** — observed behaviour violates the principle.
- **N/A** — the principle genuinely does not apply, for example an aggregate count on a tool with no list commands.
- **BLOCKED** — the probe could not be run, so behaviour was not observed. This is not a FAIL. It is reserved for the write facet of Principle 6 when the target rejects the mutation probes.
## Structure
Lead with a header naming the reviewed invocation and a one-line tally, then the skill-file status, then one table of all 10 principles in canonical order, then the artifacts manifest.
Each principle is one row.
The `Evidence` cell is the command that was run plus a short inline snippet of its output.
The `Fix / Note` cell carries a concrete fix when the verdict is not PASS, or the documented-deviation note when the skill file documents the deviation, and is left empty for a clean PASS.
```
# AXI review — <invocation>
**<n> PASS · <n> PARTIAL · <n> FAIL · <n> N/A · <n> BLOCKED**
Skill file: <path where found | MISSING — Principle 7 FAIL>
| # | Principle | Verdict | Evidence | Fix / Note |
|---|-----------|---------|----------|------------|
| 1 | Token-efficient output | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 2 | Minimal default schemas | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 3 | Content truncation | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 4 | Pre-computed aggregates | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 5 | Definitive empty states | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 6 | Structured errors and exit codes | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 7 | Ambient context | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 8 | Content first | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 9 | Contextual disclosure | <VERDICT> | `<command>` → <snippet> | <fix or note> |
| 10 | Consistent way to get help | <VERDICT> | `<command>` → <snippet> | <fix or note> |
## Artifacts created
<the exact artifacts the write battery created in the target, each with its identifier | none — writes were BLOCKED>
```
## Rules
Every non-PASS row carries a concrete fix in `Fix / Note`, a real remedy rather than a restatement of the principle.
The `Evidence` cell is a terse one-liner — the command plus a short inline snippet, never a multi-line dump.
When one command's output is the evidence for several principles, cite the same command in each row.
The artifacts manifest lists every artifact the write battery created, with the identifier needed to find it, so the user can remove anything they do not want.
When writes were BLOCKED and nothing was created, the manifest says so explicitly.

View File

@@ -0,0 +1,65 @@
---
name: axi-review
description: Review a CLI for conformance to the 10 AXI (Agent eXperience Interface) principles by running it black-box and scoring each principle on a report card. Use when asked to review, audit, check, or measure a CLI's AXI conformance, or when "AXI principles", "Agent eXperience Interface", or axi.md is named.
---
# axi-review
Review a CLI against the 10 canonical AXI principles by running it and judging what it emits.
The review is black-box: the tool's observed output is the evidence, and source is consulted only where a facet cannot be triggered by running the tool.
It writes by default, so it creates real artifacts in a target you provide.
The rubric lives in [`AXI-PRINCIPLES.md`](AXI-PRINCIPLES.md) — one entry per principle, each with the probe to run and its PASS/PARTIAL/FAIL criteria.
The card's shape lives in [`REPORT-FORMAT.md`](REPORT-FORMAT.md).
## 1. Establish what you are reviewing
Fix the invocation string first — how this CLI is run (`gitea-axi`, a binary path, `npx -y foo`).
Locate the tool's own Agent Skill file, since it is the authoritative description of the command surface and is itself the evidence for Principle 7.
Look under `~/.pi/agent/skills/<tool>/SKILL.md`, then `~/.claude/skills/<tool>/SKILL.md`, then in the installed package or the repo.
A missing skill file is a Principle 7 FAIL that you carry into the judging step.
When it is missing, enumerate the surface from `--help` and no-arg output instead.
Run the bare no-arg invocation to confirm the tool executes.
If nothing runs at all — binary absent, `npx` fails — stop and report that a behavioural review is impossible.
Emit no card in that case.
Done when the tool has run, you have its subcommand surface, and you know whether a skill file exists.
## 2. Get the write target
The write battery creates real artifacts, so it needs a target you are cleared to mutate — the repo, folder, or destination this CLI acts on.
How the tool takes that target comes from its skill file, for example gitea-axi's `-R owner/name`.
If the invoking prompt did not name a target, ask the user for one in prose before running any command.
Done when you have a write target you may create artifacts in.
## 3. Run the battery once, capturing a transcript
Read [`AXI-PRINCIPLES.md`](AXI-PRINCIPLES.md) and run every probe it lists, capturing each command's stdout and exit code into one transcript.
The battery is staged, not a single command: run the empty-state reads first, then the write probes, then the reads that depend on what the writes created.
Run it once in that sense — one transcript reused across principles, not a fresh run per principle — since one command's output is evidence for several.
The write probes include creating any fixture a read probe needs, such as the long-body entity Principle 3 inspects.
The read probes create nothing.
The write probes create real artifacts — record each one in the artifacts manifest as you create it, so nothing is orphaned silently.
Capture stdout and stderr separately, since Principle 6 turns on which stream an error lands in.
If the target rejects the write probes, mark the write facet of Principle 6 BLOCKED with the reason and continue with the read probes.
Done when every probe has a captured result or a recorded BLOCKED reason, and every created artifact is in the manifest.
## 4. Judge all 10 principles
For each principle in [`AXI-PRINCIPLES.md`](AXI-PRINCIPLES.md), apply its criteria to the transcript and assign PASS, PARTIAL, FAIL, N/A, or BLOCKED.
Judge strictly against the canonical statement.
When the tool's skill file documents a deviation, note it on the row but keep the canonical verdict.
Done when all 10 principles carry a verdict backed by a cited command and a short output excerpt from the transcript.
## 5. Emit the report card
Render the card in-session following [`REPORT-FORMAT.md`](REPORT-FORMAT.md).
Done when the card matches `REPORT-FORMAT.md` and every non-PASS row carries a concrete fix.

View File

@@ -0,0 +1,304 @@
# Glossary — Structural Predictability
The disclosed domain model for [`design-skill`](SKILL.md).
Every term below is a lever on **Predictability**.
The terms are grouped by axis: **Invocation** (how a skill is reached), **Information Hierarchy** (how its content is arranged), **Steering** (how the agent's runtime behaviour is shaped), and **Pruning** (how it is kept lean).
Each **failure mode** lives beside the lever that cures it, tagged _failure mode_.
**Bold terms** in any definition are themselves defined in this glossary.
Find them by their heading.
## Predictability
The degree to which a skill makes the agent behave the same _way_ on every run — the same process, not the same output.
A brainstorming skill should _predictably_ diverge because its tokens vary while its behaviour does not.
The root virtue every other term serves — cost and maintainability are symptoms of it, not rivals.
_Avoid_: consistency, reliability, robustness, output-determinism
## Invocation
How a skill is reached — and the two loads you pay for the choice.
### Model-Invoked
A skill exposed to the model's available-skills index so the agent can discover and load it autonomously.
The human can still invoke it directly, so model-invocation always includes user reach.
It pays permanent **context load** in exchange for discoverability.
A model-invoked skill whose content is all **reference** can provide shared reference to other discoverable skills.
Pick model-invocation only when the agent must reach the skill on its own.
_Avoid_: ability, tool, capability
### User-Invoked
A skill hidden from autonomous model discovery and reached deliberately by the human through the target harness's invocation mechanism.
It trades agent discoverability for zero **context load**.
Agent Skills still require a **description**, so use a documented harness control such as `disable-model-invocation` rather than deleting required metadata.
If the target harness cannot hide a skill from model discovery, report that user-only invocation is unsupported rather than inventing a mechanism.
_Avoid_: procedure, workflow, command
### Description
Required Agent Skills metadata stating what the skill does and when it applies.
For a **model-invoked** skill, it is the top-level **context pointer** kept in the model's available-skills index and the source of that skill's **context load**.
For a **user-invoked** skill, it remains valid metadata but the harness keeps it out of the model's index.
_Avoid_: frontmatter, summary
### Context Pointer
A reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it.
The **description** is the top-level context pointer from the context window to the skill.
Pointers to disclosed files are the same object one level down.
Its wording, not the target, decides _when_ the agent reaches — and _how reliably_.
A must-have target behind a weakly worded pointer is a variance bug: fix the wording first, and inline the material only if sharpening fails.
_Avoid_: link, reference, import
### Context Load
The cost a **model-invoked** skill imposes on the agent's context window through its indexed **description**, spending both tokens and attention.
A **user-invoked** skill escapes this load because the harness does not expose its description to the model.
Context load is the brake on splitting behavior into more model-invoked skills.
_Avoid_: token cost, context bloat
### Cognitive Load
The cost a **user-invoked** skill imposes on the human — what they must hold in their head: which skills exist and when to reach for each (the human is the index).
What **model-invocation** removes by being agent-discoverable, and the brake on splitting into more user-invoked skills.
It is not a cost to minimise.
It is the price of human agency and the reason some skills stay user-invoked.
Spend it where human judgement matters.
Remove it where it does not.
_Avoid_: human index, burden, overhead
### Router Skill
A **user-invoked** skill whose job is to name other user-invoked skills and explain when the human should reach for each one.
It gives the human one entry point to remember instead of many.
It can only direct the human toward skills hidden from model discovery, not make those skills autonomously discoverable.
It is the cure for **cognitive load** when user-invoked skills multiply.
_Avoid_: dispatcher, menu, registry, index, router procedure
### Granularity
How finely you divide skills.
Finer division spends one of the two loads.
More **model-invoked** skills spend **context load** as more descriptions crowd the window and compete for attention.
More **user-invoked** skills spend **cognitive load** by giving the human more to remember and reach for.
Two cuts guide the division.
By **invocation**, split off a model-invoked skill where you have a distinct **leading word** to trigger it — a trigger word you actually use in your prompts.
By **sequence**, split a run of **steps** only when the hand-off creates a real context boundary that hides a step's **post-completion steps**.
Beware the reverse.
Merging sequences exposes each step's post-completion steps to what follows, inviting premature completion.
_Avoid_: chunking, modularity
## Information Hierarchy
How a skill's content is arranged, and how far down the ladder each piece sits.
### Information Hierarchy
A skill's content ranked by how immediately the agent needs it — a single ladder, produced by two cuts: in-file or behind a pointer, and step or reference.
The rungs:
- **Steps** — in-file, primary
- **Reference**, in-file — secondary
- **Reference**, disclosed — behind a **context pointer**
A skill with no **steps** uses just the bottom two rungs — often a legitimately flat peer-set (e.g. every rule of a review on one rung), which is a fine arrangement, not a smell.
The hierarchy is independent of invocation: a skill can be model- or user-invoked whether it is all steps, all reference, or both.
When a skill has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip — a variance lever, not just a legibility one.
Keep the top of the ladder legible.
Push down it whatever you can.
_Avoid_: structure, organization, layout
### Steps
The ordered actions the agent performs — when a skill has them, the primary tier of its content, and the part that earns its place in SKILL.md.
Not every skill has steps: a skill can be all steps (`test-driven-development`), all **reference** (a review), or both, independent of invocation.
Every step ends on a **completion criterion**, clear or vague.
_Avoid_: workflow, instructions, choreography
### Reference
Material the agent refers to on demand — definitions, facts, parameters, examples, conditional instructions.
When a skill has **steps**, reference is secondary to them.
When a skill has none, reference is the entire content.
Reference can also live outside any skill entirely under **External Reference**.
Reached via **context pointers**, and the prime candidate for **progressive disclosure**.
_Avoid_: supporting material, docs, background
### External Reference
**Reference** that lives outside the skill system as a plain, non-invocable file with no **description** or **steps**.
Any skill can point at it.
It is the home for shared reference that need not fire on its own and can be used by skills hidden from one another's discovery surface.
_Avoid_: doc, resource, knowledge base
### Progressive Disclosure
Moving **reference** down the ladder — out of SKILL.md and behind a **context pointer** — so the top stays legible.
It is not primarily a token optimisation.
It is how the **information hierarchy** is protected.
Licensed by **branching**: disclose what only some branches need, inline what every path needs, and if a pointer fires unreliably on must-have material, sharpen its wording, and pull it back inline only if that fails.
_Avoid_: lazy loading, chunking
### Co-location
Keeping the material an agent needs at once in one place — a concept's definition, rules, and caveats under a single heading, not scattered across the file — so reading one part brings its neighbours with it.
The within-file companion to the **Information Hierarchy**.
The hierarchy ranks _how far down_ a piece sits, while co-location decides _what sits beside it_ once there.
There is no formula for the right format of a body of **reference**.
The test is that a skill should read like documentation written for the agent, and grouped material reads that way where scattered material does not.
Distinct from **Duplication**: that repeats one meaning in two places, where scattering fragments a single meaning across many.
_Avoid_: grouping, clustering, cohesion
### Sprawl
_Failure mode._ A skill that is simply too long — too many lines in SKILL.md — independent of whether they are stale or repeated.
Even an all-live, all-unique skill can sprawl.
It costs readability (the agent wades through more before it can act, and attention thins across the excess), maintainability (every extra line is one more to keep **relevant**), and tokens.
The cure is the **information hierarchy**: push **reference** down behind **context pointers**, and split by **branch** or sequence so each path carries only what it needs.
Distinct from **sediment** (length from stale accumulation) and **duplication** (length from repeated meaning) — sprawl is length itself, whatever its cause.
_Avoid_: bloat, length, size, verbosity
## Steering
The levers that shape the agent's runtime behaviour toward **Predictability**.
### Branch
A distinct way a skill can be invoked — a case the skill handles — so different runs take different paths through it.
A skill with many steps may carry many branches.
A linear one has none.
_Avoid_: path, case, fork
### Leading Word
A compact concept — also called a _Leitwort_ — already living in the model's pretraining, that the agent thinks with while running the skill.
It encodes a behavioural principle in the fewest possible tokens by invoking priors the model already holds, such as _lesson_, _proximal zone of development_, _fog of war_, or _tracer bullets_.
Repeated as a token, never as a sentence, it accumulates a distributed definition across the skill and anchors a whole region of behaviour.
Coining your own works if you define it clearly, but a made-up word recruits no priors — you pay in definition tokens what a pretrained word gives free.
Reach for an existing word first.
A leading word serves **predictability** twice.
In the body it anchors **execution** — the agent reaches for the same behaviour every time the concept appears, and inside flat reference it focuses attention on a class of thing to look for, recruiting the right checks each run.
For a **model-invoked** skill, the **description** anchors **invocation**.
When the same word lives in prompts, documentation, and code, the agent links that shared language to the skill and fires it more reliably.
Word a model-invoked skill's description with the leading words actually used to request its behavior.
_Avoid_: keyword, term, motif
### Completion Criterion
The condition that tells the agent a unit of work is done — the target it judges against.
Two properties make it a lever, not just a quality.
Its **clarity** asks whether the agent can tell done from not done.
Clarity resists **premature completion** because a vague bound such as "understanding reached" lets the agent declare done and slip to the next step.
This axis needs _steps_ to bite because premature completion is a between-steps failure.
Its **demand** (how much it requires) sets **legwork** — "every modified model accounted for" forces thorough work where "produce a change list" does not — and this axis is _not_ step-bound: it can bind a body of flat reference too, which is how a skill with no steps still carries an exhaustiveness bar ("every rule applied").
The strongest criteria are both checkable and exhaustive.
_Avoid_: done condition, exit condition, stopping rule
### Legwork
The work an agent does behind the scenes within a single step — reading files, exploring the codebase, making changes, digging up what it needs rather than offloading to the user.
It lives below the step structure: never written as its own step, latent in the wording, controlled by the agent rather than the skill.
The within-step counterpart to **post-completion steps**' across-step pull.
Raised by a strong **leading word** or a **completion criterion** that demands exhaustive work.
The demand axis also applies to flat reference and drives a reference-only skill to cover every required check.
Goes thin either when that demand is missing or when **premature completion** cuts the step short.
_Avoid_: scope, effort, diligence, coverage
### Post-Completion Steps
The **steps** that follow the current step.
Visible post-completion steps pull the agent forward into **premature completion**.
The more it sees, the stronger the tug.
The defence is to hide them by splitting the sequence of steps into two.
_Avoid_: horizon, fog of war, lookahead
### Premature Completion
_Failure mode._ Ending the current step before it is genuinely done, because the agent's attention slips to being done rather than to the work.
A between-steps failure: it needs **steps** to occur — a skill with no steps that quits early isn't premature completion but thin **legwork** under an unmet demand.
It is a tug-of-war between visible **post-completion steps**, which pull forward, and the **completion criterion**'s clarity, which resists that pull.
A sharp, checkable bar holds while a vague one gives way.
Fuzziness is the necessary condition: a sharp bound resists the pull no matter how many later steps are visible, so a step that never rushes needs no defending.
Two levers hold a step that does, but reach for them in order: **sharpen the bound first** — it is local and cheap.
Only when the criterion is irreducibly fuzzy _and_ you actually observe the rush do you **hide the later steps**.
Hiding works only across a real context boundary such as a user-invoked hand-off or a subagent dispatch.
An inline model-invoked call leaves the later steps in context and clears nothing.
One cause of thin legwork, but distinct from it: legwork can be thin even when a step runs to full completion.
_Avoid_: premature closure, the rush, rushing, shortcutting
## Pruning
Keeping a skill lean — each remedy paired with the failure it cures.
### Single Source of Truth
The desired state where each meaning lives in exactly one authoritative place, so a change to the skill's behaviour is a change in one place.
**Duplication** is its violation.
_Avoid_: home, canonical location
### Duplication
_Failure mode._ The same meaning given more than one **single source of truth**.
It costs maintenance (change one place, you must change the others), costs tokens, and inflates prominence — repeating a meaning weights it on the ladder past its real rank.
The accidental inverse of a **leading word**, which raises attention on purpose by repeating a token, never the meaning.
_Avoid_: repetition, redundancy
### Relevance
Whether an instruction still bears on what the skill does — the lens for what to keep.
An instruction loses relevance either by never bearing on the task or by going stale as the behavior or world it describes changes.
Shorter skills are easier to keep relevant because each instruction is cheaper to check.
Distinct from **no-op**: relevance asks whether an instruction bears on the task, not whether it changes behavior.
_Avoid_: load-bearing, staleness, freshness
### Sediment
_Failure mode._ Layers of old content that settle in a skill and are never cleared, because adding feels safe and removing feels risky — so stale and irrelevant lines accumulate and you must core down through them to find what is still live.
This is the default fate of any skill without a pruning discipline.
It is the slow erosion of **relevance**, as opposed to **duplication**'s repeated meaning.
_Avoid_: accretion, bloat, cruft, rot
### No-Op
_Failure mode._ An instruction that changes nothing because the model already does it by default — you pay load to tell the agent what it would do anyway.
The test asks whether an instruction changes behavior versus the default.
An instruction can be perfectly **relevant** and still be a no-op.
The same priors that make a **leading word** free make a no-op worthless.
A leading word is a _technique_, while No-Op is a _verdict_ on an instruction.
The two concepts cross.
A leading word too weak to beat the default is a no-op (_be thorough_ when the agent is already thorough-ish), and the fix is a stronger word that passes the verdict (_relentless_), not a different technique.
So the No-Op test — does it change behaviour versus the default? — is also how you grade whether a leading word is earning its repetitions.
This is model-relative, not reader-relative: two people disagreeing over whether a line is a no-op disagree about the default, and settle it by running the skill, not by debate.
_Avoid_: redundant instruction, restating the obvious, belaboring

View File

@@ -0,0 +1,144 @@
---
name: design-skill
description: Draft a new Agent Skill, or audit and rewrite an existing one for structural predictability. Run deliberately as /skill:design-skill when designing or improving a skill, never automatically.
disable-model-invocation: true
---
# design-skill
Judge only structural **predictability** using the terms in [`GLOSSARY.md`](GLOSSARY.md).
Do not expand the work into general prose, safety, or technical review.
Read each relevant definition before applying it.
## Select the branch
Use **Draft a new skill** when the request describes a new capability or repeated process with no existing skill to modify.
Use **Audit an existing skill** when the request names an existing skill to review, fix, or improve.
Both branches end at **Verify**.
## Draft a new skill
### 1. Capture intent
Extract every answer already settled by the conversation or target project before asking anything.
Ask one question at a time only for missing decisions:
- Is the skill a **procedure**, **reference**, or both?
- Should it be model-invoked or user-invoked?
Walk the **context load** and **cognitive load** trade-off rather than defaulting.
- What distinct **branches** take genuinely different paths?
- Does project documentation already own any required material?
Point to that **external reference** instead of duplicating it.
- What checkable **completion criterion** ends each step?
- Does the project already use a **leading word** for the behavior?
Done when every item is settled or the user explicitly asks for a draft to iterate on.
### 2. Resolve the canonical source
Read the target project's instructions and inspect its repository structure before choosing a destination.
Prefer an existing Agent Skills source convention.
For a project-specific skill, use the project's canonical project-local skill source.
For a general skill, use the personal collection named by the user or project instructions.
Do not edit generated, installed, vendored, or compatibility surfaces as source.
When the discovered skill is a link or generated placement, trace it to its canonical source.
If multiple plausible sources remain, ask which one owns the skill.
Done when the destination is writable, authoritative, and inside the intended project or collection.
### 3. Write the skill
Use the Agent Skills standard as the baseline:
- Put the skill in a directory containing `SKILL.md`.
- Give the frontmatter a valid `name` and a specific `description`.
- Use documented harness extensions only when the target environment supports them.
- Keep paths relative to the skill directory.
Follow the **information hierarchy**.
Keep ordered **steps** in `SKILL.md`, keep reference needed by every branch nearby, and disclose branch-specific or extensive reference through precise pointers.
Reuse authoritative project documentation rather than restating it.
Every branch must have a complete path, every step must have a checkable completion criterion, and every sentence must pass the **no-op** test.
Done when the skill conforms to the target project's conventions and every captured decision has one authoritative expression.
## Audit an existing skill
### 1. Locate and read it
Read the target project's instructions and locate the named skill's canonical source.
Trace generated or linked placements rather than editing them.
Ask only when multiple plausible sources remain.
Read `SKILL.md`, every disclosed file, and any project documentation it treats as authoritative.
Done when the full design and every source-of-truth boundary are visible.
### 2. Apply the predictability checklist
Check every relevant definition in `GLOSSARY.md` and quote the exact offending passage for each finding:
- **Premature completion**: does each step end on a checkable criterion demanding all required work?
- **Duplication**: does any meaning have more than one source of truth?
- **Sediment**: does any sentence no longer bear on the skill's behavior?
- **Sprawl**: should reference be disclosed or a genuine branch be separated?
- **No-op**: does each sentence change model behavior from the default?
- **Invocation**: does the chosen invocation mode fit actual use and target-harness support?
- **Leading word**: can repeated explanation collapse into established vocabulary?
Judge sentence by sentence rather than line by line.
A line may contain both a load-bearing sentence and a no-op sentence.
Done when every glossary failure mode has been checked and every finding has quoted evidence.
### 3. Rewrite it
Rewrite the canonical source to address every finding.
Preserve intentional behavior that passed the checklist.
Follow target-project instructions for any change outside the skill directory.
Done when every finding is fixed or explicitly retained with a structural reason.
## Verify
### 1. Run deterministic checks
Run the target project's required checks and any available Agent Skills validator.
At minimum, verify frontmatter, naming, relative references, disclosed-file existence, and invocation compatibility with the target harness.
Done when every available deterministic check passes and every unavailable check is reported.
### 2. Smoke-test behavior
Derive one realistic task prompt from the skill's intended trigger phrasing.
Launch a fresh context through an actual subagent tool or documented headless harness command, load the skill there, and run the prompt.
The fresh context must attempt the target skill's task rather than design or audit that skill.
Save the exact prompt and fresh-context output in temporary files outside the target project.
Inspect that output for whether the agent followed the intended branch, hesitated, misread an instruction, or behaved unexpectedly.
Do not count the current design run, a self-review, or deterministic validation as behavioral evidence.
A smoke test does not require advance approval.
Done when the final report names the fresh-context mechanism and both evidence paths, and the captured output shows no structural confusion.
If no isolated execution mechanism exists, report that limitation instead.
### 3. Offer stronger verification when available
Detect whether the target project has an established behavioral test or benchmark convention for skills.
Use existing persistent tests when present.
Create a persistent test only when project instructions require one.
Before running a stochastic, repeated, paid, or otherwise substantial benchmark, show the user the proposed scenario and obtain approval.
If approval is declined, retain the smoke-test result as the weaker evidence level.
Done when an approved benchmark passes, the user declines it, or no established benchmark exists.
### 4. Re-audit and finish
Re-read the final skill against every applicable `GLOSSARY.md` failure mode in light of verification.
Fix every new finding and repeat affected checks after a substantial fix.
Follow explicit user or project instructions for staging or other version-control actions.
Otherwise leave changes unstaged and report every changed path.
Never commit unless explicitly instructed.
Done when no structural finding remains, required checks pass, behavioral confidence is stated accurately, and the applicable version-control policy was followed.

View File

@@ -0,0 +1,30 @@
# Context Artifact Format
## Structure
```md
# {Context Name}
{One or two sentence description of what this context is and why it exists.}
## Language
**Order**:
{A one or two sentence description of the term}
_Avoid_: Purchase, transaction
**Invoice**:
A request for payment sent to a customer after delivery.
_Avoid_: Bill, payment request
**Customer**:
A person or organization that places orders.
_Avoid_: Client, buyer, account
```
## Rules
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.

94
skills/grill/SKILL.md Normal file
View File

@@ -0,0 +1,94 @@
---
name: grill
description: Interview the user relentlessly to stress-test a plan or design before building — one question at a time, each with options, a recommendation, and its rationale — walking the decision tree until every branch is decided. Folds in domain-model and ADR upkeep when the project has a context file. Model-invokable, including as a step inside other skills. Use when the user wants to pressure-test a plan, or uses any 'grill' trigger phrase.
---
# grill
Interview the user relentlessly about every aspect of a plan or design.
Keep going not until it feels like you understand each other, but until the decision tree is walked to exhaustion.
Ask one question at a time, in plain text, and wait for the answer before the next.
Never use an interactive question tool.
While the interview is active, every assistant turn must end with exactly one of: the next numbered question, the final decision summary, or a plain statement that grill is paused because the user explicitly changed tasks.
If the turn includes a correction, file edit, apology, or explanation, follow it with the next numbered question unless the user explicitly paused grill or changed tasks.
Do not use dangling transition phrases such as “continuing” unless the continuation is actually present in the same message.
Every question carries **options** — the concrete choices, each with its trade-offs — followed by your **recommendation**, the option you would pick and why.
When the question turns on an existing document, artifact, or piece of code, open it with a **context quote**: blockquote the exact passage, so the user sees what you mean without hunting for it.
Before asking, investigate.
When code, docs, or the conversation already settle a question, resolve it yourself instead of spending a question on it.
**Never begin implementation** — during the interview or after it — without an explicit instruction from the user.
This holds even when another skill invoked grill: grill delivers its summary and stops, and a caller that receives that summary is not itself the instruction to build.
## 1. Select the mode
Resolve the artifact destination before looking for or creating artifacts.
Default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when a write requires it.
Read the destination's `AGENTS.md` before any artifact write.
Inspect the destination directly for its context artifact, using the destination naming convention instead of assuming a filename.
- **Domain Modeling Mode** — exactly one context artifact was found.
Run the interview and maintain the project's domain model as terms settle (see [Domain Modeling Mode](#domain-modeling-mode)).
- **Free Mode** — no context artifact was found, and the plan raises no project-specific vocabulary worth pinning down.
Run the interview with no document side effects.
- **Clarification** — no context artifact was found, but the plan introduces terms specific to this project that later work will need to use consistently — the kind of terms [`CONTEXT-FORMAT.md`](CONTEXT-FORMAT.md) admits, not general programming concepts.
Before interviewing, ask whether to create a glossary.
If yes, choose the context artifact filename from the destination's `AGENTS.md` and nearby artifact convention, allocate any required identifier, and continue in Domain Modeling Mode.
If no, continue in Free Mode.
Stop and report the conflicting paths if more than one matching context artifact exists.
Done when the interview is running in Domain Modeling Mode or Free Mode.
## 2. Run the interview
Walk the decision tree one branch at a time, resolving each decision's dependencies before moving to the next.
Alongside the questions, challenge and stress-test:
- When the user's language is vague or overloaded, propose a precise canonical term in its place.
- Probe edge cases with concrete scenarios that force the boundaries between concepts to be made explicit.
- When a stated behavior contradicts what the code actually does, surface the contradiction with both sides quoted.
In Domain Modeling Mode, feed the settling terms and decisions into the glossary and ADRs below.
Done when every branch carries an explicit decision and no dependency between decisions is left open.
## 3. Close the interview
Once the interview is done:
1. Output a concise summary of every decision reached — and, in Domain Modeling Mode, every term crystallized.
2. Stop and wait for the user's next instruction.
Done when the summary is delivered and grill is waiting.
## Domain Modeling Mode
Active only when step 1 selected this mode.
### Glossary
As a term crystallizes, update the context artifact right then — do not batch these to the end.
When a settling term clashes with one already in the glossary, call it out and reconcile to a single canonical word.
Keep the artifact a glossary and nothing else: vocabulary and ubiquitous language, no implementation detail.
Write it in the format of [`CONTEXT-FORMAT.md`](CONTEXT-FORMAT.md).
### ADRs
Offer to record an architectural decision only when all three hold:
1. **Hard to reverse** — changing your mind later carries real cost.
2. **Surprising without context** — a future reader will wonder why it was done this way.
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons.
If any of the three is missing, skip it.
A recorded decision lives directly in the resolved artifact destination.
Choose its filename from the destination's `AGENTS.md` and nearby artifact convention, allocating an identifier only when that convention requires one.
It can be a single paragraph:
> # {Short title of the decision}
>
> {1-3 sentences: the context, what was decided, and why.}

122
skills/implement/SKILL.md Normal file
View File

@@ -0,0 +1,122 @@
---
name: implement
description: Implement scoped work using the local implementation workflow, following Wayfinder ticket protocol when an implementation ticket artifact is part of the selected work.
disable-model-invocation: true
---
# implement
Implement scoped work and hand off working code.
This skill defines execution protocol rather than deciding what work the agent is allowed to implement.
When selected work has a Wayfinder ticket artifact, follow the Wayfinder artifact lifecycle.
When selected work has no Wayfinder artifact, implement normally and use the same review, commit, and handoff discipline without creating a tracking artifact.
This skill delegates to other skills by name.
Before satisfying a delegated skill step, explicitly load that skill's `SKILL.md` with `read` unless the harness has already injected that skill's full content into the current context.
Do not satisfy a delegated skill step by imitating its title from memory.
## 1. Establish the selected work
Identify the work to implement from the user's request and current context.
Use a Wayfinder implementation ticket artifact, issue, spec, direct request, branch context, or other clear source when that is what the agent has selected.
Do not require a Wayfinder artifact and do not create one just to satisfy this skill.
Old `.claude/tasks` files may be ordinary context, but their lifecycle semantics are not part of this workflow.
When the selected work has a Wayfinder ticket artifact, re-read it before claiming.
Verify that blockers are satisfied by the artifact metadata and that no other session has claimed it.
Claim it before changing code by setting `status: claimed`, `claimed-by` to the current session identifier, and `claimed-at` to the current timestamp.
Use `PI_SESSION_ID` when available.
Done when the selected work is clear, and any Wayfinder ticket artifact is freshly read and claimed when applicable.
## 2. Verify the execution checkout
Assume the current checkout is the assigned execution checkout.
Do not create, lease, clean up, or switch worktrees.
Report the checkout path and branch when useful for handoff.
Check the working tree before changing code.
Stop on unrelated or ambiguous uncommitted changes.
Continue only when dirty state is clearly already part of the selected work.
Never auto-stash.
For source-changing implementation work that will be committed, work on a non-default branch unless repository context explicitly directs otherwise.
If an appropriate non-default branch is already prepared, continue there.
If you are on the default branch, fast-forward the default branch first and create a task branch.
Stop if the default branch cannot fast-forward cleanly.
Follow repository, user, or orchestrator branch naming conventions.
If no convention is discoverable and you must create a branch, choose a clear short descriptive name and report it.
Check declared implementation blockers where they exist.
Stop when prerequisite implementation work is not reachable from the current base, and report the likely unmerged prerequisite.
Do not automatically branch from, merge, or cherry-pick sibling task work.
Follow an explicit integration-branch or wide-refactor plan only when the selected work names that exception.
Done when the checkout, branch, dirty state, and reachable prerequisites are safe for the selected implementation work.
## 3. Implement the work
Use `test-driven-development` as a strong default when behavior can usefully be specified and tested before implementation.
Load `test-driven-development` before deciding whether it applies.
Skip it only when the work is mechanical, documentation-only, exploratory, or when test-first would not add value.
When skipping it, state the reason before implementation.
Skipping test-driven development is an agent judgment, not an omission.
Build the selected work in the assigned checkout.
Run focused verification while working and run broader verification when the repository or change calls for it.
Treat working code and tests as the implementation artifact.
Do not create a separate process report for test-driven development.
Record only durable outcomes such as tests added or changed, verification run, and deviations worth noting.
Stage created and modified files intentionally.
Do not use broad staging that sweeps unrelated files into the change.
Done when the selected work is implemented as working code and locally verified to the level the change warrants.
## 4. Review the final intended handoff state
Load and run `review` before reporting final handoff or resolving a Wayfinder ticket.
Choose review timing by judgment.
Review may happen before commit, after commit, or both.
The review must cover the final intended handoff state, including a local uncommitted handoff when no commit is made.
Do not report final handoff until review has run or you have explained why review could not cover that state.
Fix blocking review findings unless the agent or user explicitly accepts them.
When code changes are made in response to review, rerun `review` on the relevant change set.
Record accepted blocking findings in the final handoff or Wayfinder closeout when they affect a future reader's decision to trust or continue the work.
Handle non-blocking findings by judgment.
Fix them when cheap or high-value, and otherwise report or record only when useful.
Done when review has covered the final intended handoff state and blocking findings are fixed or explicitly accepted.
## 5. Commit and hand off
Follow the repository's commit and PR conventions.
Discover those conventions from repository instructions or recent history rather than assuming them.
Commit only the selected work.
Use one commit when that is the natural shape, but follow the repository's convention when it expects a different history shape.
Push and open a PR when the repository and selected workflow call for that handoff.
If there is no remote or no supported forge workflow, stop after the local handoff point and report what remains for a human.
Keep PR and handoff text focused on what was built, verification, review disposition, and any deviations that matter.
Done when the implementation has a concrete handoff state: committed locally, pushed, opened as a PR, or stopped with the exact remaining human action reported.
## 6. Close out Wayfinder artifacts when present
When the selected work has a Wayfinder ticket artifact, re-read it before closeout.
Record durable coordination facts only.
Wayfinder `status` is the lifecycle authority.
Acceptance criteria checkboxes may be updated as useful detail with `[x]` for satisfied criteria and `[-]` for deliberately dropped criteria when practical.
Checkbox state is not the source of truth.
Keep Implementation Notes concise.
Capture only what future agents or humans need: deviations, dropped or changed scope, verification, branch, commit, PR, or why the ticket remains unresolved.
Use judgment for partial or ambiguous outcomes, but keep lifecycle recording honest.
Do not imply completion when the work is not complete.
When resolving a Wayfinder ticket, set `status: resolved` and repair the owning map's Frontier according to Wayfinder artifact rules.
Put detailed implementation records in the ticket, commit, PR, and working code rather than in the map.
The parent map should receive only the concise outcome summary required by Wayfinder.
Done when any Wayfinder ticket and parent map agree with the implementation's actual lifecycle state.

100
skills/prototype/LOGIC.md Normal file
View File

@@ -0,0 +1,100 @@
# Logic Prototype
A tiny interactive terminal app that lets the user drive a state model by hand. Use this when the question is about **business logic, state transitions, or data shape** — the kind of thing that looks reasonable on paper but only feels wrong once you push it through real cases.
## When this is the right shape
- "I'm not sure if this state machine handles the edge case where X then Y."
- "Does this data model actually let me represent the case where..."
- "I want to feel out what the API should look like before writing it."
- Anything where the user wants to **press buttons and watch state change**.
If the question is "what should this look like" — wrong branch. Use [UI.md](UI.md).
## Process
### 1. State the question
Before writing code, write down what state model and what question you're prototyping.
Use one paragraph in the prototype's README or a comment at the top of the file.
A logic prototype that answers the wrong question is pure waste, so make the question explicit enough to check later whether the user is watching now or returning to it AFK.
Done when the prototype states one concrete logic question and the model being tested.
### 2. Pick the language
Use whatever the host project uses. If the project has no obvious runtime (e.g. a docs repo), ask.
Match the project's existing conventions for tooling.
Don't add a new package manager or runtime just for the prototype.
Done when the prototype has a runnable host-project language and toolchain without introducing a new runtime convention.
### 3. Isolate the logic in a portable module
Put the actual logic — the bit that's answering the question — behind a small, pure interface that could be lifted out and dropped into the real codebase later. The TUI around it is throwaway; the logic module shouldn't be.
The right shape depends on the question:
- **A pure reducer** — `(state, action) => state`. Good when actions are discrete events and state is a single value.
- **A state machine** — explicit states and transitions. Good when "which actions are even legal right now" is part of the question.
- **A small set of pure functions** over a plain data type. Good when there's no implicit current state — just transformations.
- **A class or module with a clear method surface** when the logic genuinely owns ongoing internal state.
Pick whichever shape best fits the question being asked, *not* whichever is easiest to wire to a TUI. Keep it pure: no I/O, no terminal code, no `console.log` for control flow. The TUI imports it and calls into it; nothing flows the other direction.
This is what makes the prototype useful past its own lifetime.
When the question is answered, the validated reducer, machine, or function set can be lifted into the real module on its own.
Done when all tested logic lives behind one portable, pure interface and the TUI depends on it in only one direction.
### 4. Build the smallest TUI that exposes the state
Build it as a **lightweight TUI** — on every tick, clear the screen (`console.clear()` / `print("\033[2J\033[H")` / equivalent) and re-render the whole frame. The user should always see one stable view, not an ever-growing scrollback.
Each frame has two parts, in this order:
1. **Current state**, pretty-printed and diff-friendly (one field per line, or formatted JSON). Use **bold** for field names or section headers and **dim** for less important context (timestamps, IDs, derived values). Native ANSI escape codes are fine — `\x1b[1m` bold, `\x1b[2m` dim, `\x1b[0m` reset. No need to pull in a styling library unless one is already in the project.
2. **Keyboard shortcuts**, listed at the bottom: `[a] add user [d] delete user [t] tick clock [q] quit`. Bold the key, dim the description, or vice-versa — whatever reads cleanly.
Behaviour:
1. **Initialise state** — a single in-memory object/struct. Render the first frame on start.
2. **Read one keystroke (or one line)** at a time, dispatch to a handler that mutates state.
3. **Re-render** the full frame after every action — don't append, replace.
4. **Loop until quit.**
The whole frame should fit on one screen.
Done when every available action re-renders a complete one-screen view of the current state and shortcuts.
### 5. Make it runnable in one command
Add a script to the project's existing task runner (`package.json` scripts, `Makefile`, `justfile`, `pyproject.toml`). The user should run `pnpm run <prototype-name>` or equivalent — never need to remember a path.
If the host project has no task runner, put the command at the top of the prototype's README.
Done when a fresh user can launch the prototype with one documented command.
### 6. Evaluate it
In HITL mode, give the user the run command.
They drive it themselves.
The interesting moments are when they say "wait, that shouldn't be possible" or "huh, I assumed X would be different" because those expose bugs in the idea.
Add actions when the feedback needs them.
In AFK mode, run the command yourself and drive the hard cases that answer the stated question.
Record the observations that support the verdict.
Done when the evaluator can exercise the model and the prototype exposes every state transition needed to reach a verdict.
## Production mapping
When the shared [SKILL](SKILL.md) permits production work, lift the validated reducer, machine, or function set into the real module.
Keep the TUI shell on the throwaway branch.
## Anti-patterns
- **Don't generalise.** No "what if we wanted to support X later." The prototype answers one question.
- **Don't blur the logic and the TUI together.** If the reducer / state machine references `console.log`, prompts, or terminal escape codes, it's no longer portable. Keep the TUI as a thin shell over a pure module.
- **Don't ship the TUI shell into production.** The shell is optimised for being driven by hand from a terminal. The logic module behind it is the bit worth keeping.

88
skills/prototype/SKILL.md Normal file
View File

@@ -0,0 +1,88 @@
---
name: prototype
description: Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
---
# Prototype
A prototype is **throwaway code that answers one question**.
The question decides the branch.
The interaction mode decides who reaches the verdict.
Use AFK mode when the question has objective observable criteria the agent can test end to end.
Use HITL mode when the verdict depends on human judgment, taste, or UX feel.
## 1. Pick a branch
Identify the question from the user's prompt and surrounding code.
Ask when it remains genuinely ambiguous and the user is reachable.
- **Does this logic or state model feel right?**
Follow [`LOGIC.md`](LOGIC.md) to build a tiny interactive terminal app that pushes the model through hard-to-reason-about cases.
- **What should this look like?**
Follow [`UI.md`](UI.md) to build several radically different UI variants on one route with a URL-controlled switcher.
When the user is unavailable, default to Logic for a backend module and UI for a page or component, then state the assumption in the prototype.
Done when exactly one branch and one design question govern the prototype.
## Common rules
- **Throwaway from day one.**
Locate the code close to where it would be used, but name it so nobody mistakes it for production.
Follow the project's routing and source-layout conventions rather than inventing a new top-level structure.
- **One command to run.**
Use the project's existing task runner so the user does not need to remember a path or setup sequence.
- **No persistence by default.**
Keep state in memory unless persistence is the question being tested.
Use an unmistakably disposable database or local file when that question requires one.
- **Skip polish.**
Add no tests, production-grade error handling, speculative abstractions, or unrelated cleanup.
- **Surface state.**
Show the full relevant state after every Logic action or UI variant switch.
## 2. Build and reach a verdict
Follow the selected branch through its evaluation step.
In HITL mode, hand the prototype to the user and iterate in response to their feedback.
In AFK mode, run the prototype yourself and evaluate the objective observations against the question.
Do not treat a runnable prototype as the result.
The result is the verdict that answers the design question.
Done when the verdict is explicit, or when the prototype establishes that it did not resolve the question.
## 3. Capture the primary source
Commit the complete prototype to a throwaway branch outside main.
The branch is the primary source.
Resolve the artifact destination before naming the file.
When the caller provides a destination directory, use it exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when needed.
Before choosing a filename, read the destination's `AGENTS.md`.
Use the naming convention declared there, or infer it from nearby artifacts when the file delegates naming to local context.
Do not assume a counter, numeric prefix, slug shape, or artifact-type suffix unless the destination convention requires it.
If no convention can be determined, choose the least surprising lowercase descriptive Markdown filename and state that the destination did not define a naming convention.
When the caller provides an existing ticket artifact path, use it exactly, do not allocate a filename, and complete that artifact in place.
Otherwise, allocate any identifier required by the destination convention and include `parent` only when an earlier artifact directly caused the prototype.
The Prototype artifact links the throwaway branch and preserves the question, run instructions, verdict, and branch-appropriate evidence.
When the resolved file is an existing ticket artifact, preserve its workflow metadata and complete the result in that file.
The branch-appropriate evidence is:
- UI evidence uses screenshots.
- Logic evidence uses useful code snippets and, where needed, a short interaction transcript.
Done when the complete prototype is committed outside main and exactly one Prototype artifact preserves the result according to the destination convention.
## 4. Fold in the decision when permitted
A planning-only caller such as Wayfinder stops after the verdict and leaves production code unchanged.
Otherwise, fold the validated decision into production only when the caller permits implementation.
Follow the selected branch's **Production mapping** and keep all other throwaway code out of main.
Done when production is unchanged for a planning-only run, or contains only the permitted validated decision for an implementation run.

124
skills/prototype/UI.md Normal file
View File

@@ -0,0 +1,124 @@
# UI Prototype
Generate **several radically different UI variations** on a single route, switchable from a floating bottom bar. The user flips between variants in the browser, picks one (or steals bits from each), then throws the rest away.
If the question is about logic/state rather than what something looks like — wrong branch. Use [LOGIC.md](LOGIC.md).
## When this is the right shape
- "What should this page look like?"
- "I want to see a few options for this dashboard before committing."
- "Try a different layout for the settings screen."
- Any time the user would otherwise spend a day picking between three vague mockups in their head.
## Two sub-shapes — strongly prefer sub-shape A
A UI prototype is much easier to judge when it's **butting up against the rest of the app** — real header, real sidebar, real data, real density. A throwaway route on its own is a vacuum: every variant looks fine in isolation. Default to sub-shape A whenever there's a plausible existing page to host the variants. Only reach for sub-shape B if the prototype genuinely has no nearby home.
### Sub-shape A — adjustment to an existing page (preferred)
The route already exists. Variants are rendered **on the same route**, gated by a `?variant=` URL search param. The existing data fetching, params, and auth all stay — only the rendering swaps. This is the default; pick it unless there's a specific reason not to.
If the prototype is for something that doesn't yet have a page but *would naturally live inside one* (a new section of the dashboard, a new card on the settings screen, a new step in an existing flow) — that's still sub-shape A. Mount the variants inside the host page.
### Sub-shape B — a new page (last resort)
Only use this when the thing being prototyped genuinely has no existing page to live inside — e.g. an entirely new top-level surface, or a flow that can't be embedded anywhere sensible.
Create a **throwaway route** following whatever routing convention the project already uses — don't invent a new top-level structure. Name it so it's obviously a prototype (e.g. include the word `prototype` in the path or filename). Same `?variant=` pattern.
Before committing to sub-shape B, sanity-check: is there really no existing page this could be embedded in? An empty route hides design problems that a populated one would expose.
In both sub-shapes the floating bottom bar is identical.
## Process
### 1. State the question and pick N
Default to **3 variants**. More than 5 stops being radically different and starts being noise — cap there.
Write down the plan in one line, in the prototype's location or a top-of-file comment:
> "Three variants of the settings page, switchable via `?variant=`, on the existing `/settings` route."
This works whether the user is here to push back or not.
Done when the prototype states one concrete UI question, its host route, and a variant count from three through five.
### 2. Generate radically different variants
Draft each variant. Hold each one to:
- The page's purpose and the data it has access to.
- The project's component library / styling system (TailwindCSS, shadcn, MUI, plain CSS, whatever).
- A clear exported component name, e.g. `VariantA`, `VariantB`, `VariantC`.
Variants must be **structurally different** — different layout, different information hierarchy, different primary affordance, not just different colours. Three slightly-tweaked card grids isn't a UI prototype, it's wallpaper. If two drafts come out too similar, redo one with explicit "do not use a card grid" guidance.
Done when every variant materially differs in layout, information hierarchy, and primary affordance while using the project's existing design system.
### 3. Wire them together
Create a single switcher component on the route:
```tsx
// pseudo-code — adapt to the project's framework
const variant = searchParams.get('variant') ?? 'A';
return (
<>
{variant === 'A' && <VariantA {...data} />}
{variant === 'B' && <VariantB {...data} />}
{variant === 'C' && <VariantC {...data} />}
<PrototypeSwitcher variants={['A','B','C']} current={variant} />
</>
);
```
For sub-shape A (existing page): keep all the existing data fetching above the switcher; only the rendered subtree changes per variant.
For sub-shape B (new page): the throwaway route under `/prototype/<name>` mounts the same switcher.
Done when one route renders every variant from the URL parameter without duplicating data loading.
### 4. Build the floating switcher
A small fixed-position bar at the bottom-centre of the screen with three pieces:
- **Left arrow** — cycles to the previous variant (wraps around).
- **Variant label** — shows the current variant key and, if the variant exports a name, that name too. e.g. `B — Sidebar layout`.
- **Right arrow** — cycles forward (wraps around).
Behaviour:
- Clicking an arrow updates the URL search param (use the framework's router — `router.replace` on Next, `navigate` on React Router, etc) so the variant is shareable and reload-stable.
- Keyboard: `←` and `→` arrow keys also cycle. Don't intercept arrow keys when an `<input>`, `<textarea>`, or `[contenteditable]` is focused.
- Visually distinct from the page (e.g. high-contrast pill, subtle shadow) so it's obviously not part of the design being evaluated.
- Hidden in production builds — gate on `process.env.NODE_ENV !== 'production'` or an equivalent check, so a stray prototype merge can't ship the bar to users.
Put the switcher in a single shared component so both sub-shapes can reuse it. Locate it wherever shared UI lives in the project.
Done when mouse and keyboard controls cycle through every shareable variant without intercepting text-editing keys, and the switcher cannot render in production.
### 5. Evaluate it
In HITL mode, surface the URL and the `?variant=` keys.
The user flips through the variants and may combine elements rather than choosing one unchanged.
In AFK mode, open the URL yourself, compare every variant against the stated objective criteria, and record the observations that support the verdict.
Use HITL instead when the decision depends on taste, product judgment, or UX feel.
Done when the evaluator can compare every variant in its host context and the prototype exposes enough contrast to reach a verdict.
## Production mapping
When the shared [SKILL](SKILL.md) permits production work, keep the full variant set on the throwaway branch and apply the verdict as follows:
- **Sub-shape A** — fold the winner into the existing page and drop the losing variants and switcher from main.
- **Sub-shape B** — promote the winner to a real route and drop the throwaway route and switcher from main.
## Anti-patterns
- **Variants that differ only in colour or copy.** That's a tweak, not a prototype. Real variants disagree about structure.
- **Sharing too much code between variants.** A shared `<Header>` is fine; a shared `<Layout>` defeats the point. Each variant should be free to throw out the layout.
- **Wiring variants to real mutations.** Read-only prototypes are fine. If a variant needs to mutate, point it at a stub — the question is "what should this look like", not "does the backend work".
- **Promoting the prototype directly to production.** The variant code was written under prototype constraints (no tests, minimal error handling). Rewrite it properly when you fold it in.

52
skills/research/SKILL.md Normal file
View File

@@ -0,0 +1,52 @@
---
name: research
description: Investigate a question against high-trust primary sources and capture the cited findings as a Research artifact. Use when a topic needs documentation, API, specification, source-code, or other reading legwork.
---
# Research
Investigate one question and preserve the findings in one cited Research artifact.
Run in the current process.
Isolation and concurrency belong to the caller.
## 1. Resolve the artifact
Resolve the artifact destination before naming the file.
When the caller provides a destination directory, use it exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when needed.
Before choosing a filename, read the destination's `AGENTS.md`.
Use the naming convention declared there, or infer it from nearby artifacts when the file delegates naming to local context.
Do not assume a counter, numeric prefix, slug shape, or artifact-type suffix unless the destination convention requires it.
If no convention can be determined, choose the least surprising lowercase descriptive Markdown filename and state that the destination did not define a naming convention.
When the caller provides an existing ticket artifact path, use it exactly, do not allocate a filename, and complete that artifact in place.
Otherwise, allocate any identifier required by the destination convention and include `parent` only when an earlier artifact directly caused the research.
Done when one authoritative Research artifact path and its metadata are settled according to the destination convention.
## 2. Investigate the question
Use primary sources such as official documentation, specifications, source code, and first-party APIs rather than relying on secondary accounts.
Follow every substantive claim back to the primary source that owns it.
Use secondary material only to discover primary sources.
When no primary source establishes a needed claim, record that limitation instead of presenting the claim as settled.
Done when the question is answered as far as primary evidence permits and every substantive claim has an owning source or an explicit evidence gap.
## 3. Write the Research artifact
Write the findings to the resolved Markdown file and follow the destination's artifact conventions.
When the resolved file is an existing ticket artifact, preserve its workflow metadata and complete the result in that file.
Keep the question, findings, limitations, and citations sufficient for a future reader to evaluate the result without reconstructing the research session.
Do not create a source dump or research log.
Done when exactly one Research artifact exists at the resolved path and every substantive claim in it cites its source.
## 4. Return the result
Report the artifact path and a concise statement of what the research established or could not establish.
Done when the caller can locate the artifact and understand whether the question was resolved.

121
skills/review/SKILL.md Normal file
View File

@@ -0,0 +1,121 @@
---
name: review
description: Produce a structured, report-only review of a context-selected change set across risk, standards, intent, evidence, and documentation.
---
# review
Review a change set selected from context and produce a structured review report.
This skill is standalone and context-driven.
It does not know about implementation lifecycle, Wayfinder claiming, task resolution, PR creation, or ticket closeout.
It must not edit code.
Reviewer prompts live under [`reviewers/`](reviewers/).
Load the relevant reviewer files before running independent dimension reviews.
## 1. Select and capture the change set
Select the relevant change set from current context.
The change set may be uncommitted changes, branch changes, a PR, explicit files, or another clear source.
State what change set you selected before reviewing.
Ask or stop only when scope ambiguity would make the review untrustworthy.
Capture enough material for reviewers to inspect the selected change set.
This may include a diff, changed-file list, commit list, PR details, relevant intent source, available verification evidence, and repository instructions or standards sources.
Do not overprescribe mode selection or intent-source taxonomy.
Use agent judgment when the selected change set and intent source are clear enough to review.
Done when the chosen change set is explicit and reviewers have enough input to judge it.
## 2. Run dimension reviews
Run independent dimension reviewers through whatever real context boundary the current harness provides.
A separate agent, worker, subprocess, or documented headless session is sufficient when each reviewer can inspect its dimension without seeing the parent review's intermediate conclusions.
Use one reviewer per dimension when practical.
If no real context boundary is available, stop before reviewing and report that independent review cannot be completed in the current runtime.
Do not replace independent reviewers with in-process role switches.
Use these reviewer files:
- [`reviewers/risk.md`](reviewers/risk.md)
- [`reviewers/standards.md`](reviewers/standards.md)
- [`reviewers/intent.md`](reviewers/intent.md)
- [`reviewers/evidence.md`](reviewers/evidence.md)
- [`reviewers/documentation.md`](reviewers/documentation.md)
Each reviewer should follow its own purpose, boundary, rubric, and output expectations.
The shared base finding shape is flexible:
```markdown
- **Severity**: error | warning | info
**Blocking**: yes | no
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <impact>
**Suggested fix**: <concrete next action, or none>
```
Reviewers may add dimension-specific fields where useful.
Reviewers classify findings as blocking or non-blocking.
The caller or user decides final disposition.
Done when each applicable dimension has returned findings or a clear statement that the dimension does not apply.
## 3. Run targeted checks when useful
Run targeted checks when they are needed to assess a dimension.
Prefer focused commands that clarify evidence, risk, or standards conformance.
Do not turn review into a full external validation pipeline.
If a full suite or expensive check is clearly needed, explain why before relying on it.
Record commands and artifacts that materially influenced the review.
Do not present unrun checks as evidence.
Done when the review has enough evidence for its findings and limitations are stated honestly.
## 4. Aggregate the structured review report
Produce a structured review report, not a gate artifact and not a pass/fail verdict.
Keep sections separate so one dimension does not mask another.
Deduplicate exact duplicates only.
Mention when separate dimensions independently flag the same issue.
Use this report shape unless the selected change set calls for a small adaptation:
```markdown
## Reviewed change set
<what was reviewed and how it was captured>
## Risk
<risk reviewer section>
## Standards
<standards reviewer section>
## Intent
<intent reviewer section>
## Evidence
<evidence reviewer section>
## Documentation
<documentation reviewer section>
## Summary
- Blocking findings: <count>
- Non-blocking findings: <count>
- Targeted checks run: <commands or none>
- Evidence limitations: <limitations or none>
```
Do not invent a pass/fail verdict.
Use blocking findings present or absent as the review's actionable summary.
Done when the report states the reviewed change set, preserves every applicable dimension, and summarizes blocking status and evidence limitations.

View File

@@ -0,0 +1,30 @@
# Documentation reviewer
Review only documentation consequences of the selected change set.
Do not make Risk, Standards, Intent, or Evidence findings unless the issue directly affects documentation correctness.
Look for user-facing, operator-facing, contributor-facing, and agent-facing documentation that should change because behavior, interfaces, commands, options, workflows, or constraints changed.
Also look for stale documentation introduced or left behind by the change.
Do not demand new documentation surfaces for every change.
Prefer updating the existing owner of the fact when one is discoverable.
Documentation findings may be non-blocking when the change is internal and no durable reader would be misled.
They may be blocking when users, operators, future contributors, or agents would reasonably make a wrong decision from stale or missing documentation.
## Output format
```markdown
## Documentation
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Documentation owner**: <file, artifact, or none known>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <reader impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,38 @@
# Evidence reviewer
Review only whether the selected change set has convincing evidence.
Do not make Risk, Standards, Intent, or Documentation findings unless the issue directly affects evidentiary value.
Check tests, commands, artifacts, manual checks, and any evidence the change provides.
You may recommend or run targeted checks when the orchestrating review context allows it.
Do not present unrun checks as evidence.
Reject source-grep pseudo-tests as proof of behavior.
A test whose only evidence is matching implementation source text, tokens, lines, syntax, prompt phrases, regexes, AST shapes, or incidental snapshots does not prove behavior.
Prefer evidence that demonstrates observable behavior, state, output, side effects, failure modes, or semantic meaning through a public or executable interface.
For declarative artifacts, prefer invoking the real consumer or parsing into a typed or normalized semantic model.
Reading file contents is legitimate when the file itself is the owned output or serialized contract under test.
## Output format
```markdown
## Evidence
Evidence checked:
- <command, test, artifact, or none>
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Evidence checked**: <command, test, artifact, or none>
**Evidence gap**: <what remains unproven, or none>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <trust or verification impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,33 @@
# Intent reviewer
Review only whether the selected change set satisfies the apparent intent.
Do not make Risk, Standards, Evidence, or Documentation findings unless the issue directly changes intent fidelity.
Use the clearest available intent source from context.
Possible sources include a Wayfinder task, issue, spec, direct request, PR description, branch context, commit messages, or conversation context.
Do not invent requirements.
When intent is inferred rather than explicit, say so and treat it with appropriate caution.
Look for missing requested behavior, partial implementation, behavior outside the selected scope, and implementations that appear to satisfy wording while violating the underlying request.
Do not require remote branch, PR, or CI outcomes when another workflow step owns those outcomes.
## Output format
```markdown
## Intent
Intent source: <source or none>
Intent confidence: <explicit|inferred|unavailable>
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Intent source**: <task, spec, issue, request, branch context, or none>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <intent or correctness impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,46 @@
# Risk reviewer
Review only risk.
Do not make Standards, Intent, Evidence, or Documentation findings unless the issue directly changes the risk assessment.
Assess how much attention the selected change set warrants before handoff.
Use the worst-factor-wins rubric from the old local review workflow.
Rate each factor Low, Medium, or High with a concise reason:
- Blast radius.
- Reversibility.
- Test coverage.
- Sensitive domain.
- Size and complexity.
- Runtime criticality.
Overall risk is the highest factor.
Risk alone need not block.
Missing evidence for a risky change may be blocking when a future reader should not trust the handoff without more proof.
## Output format
```markdown
## Risk
**Overall: <LOW|MEDIUM|HIGH>**
- Blast radius: <rating> — <reason>
- Reversibility: <rating> — <reason>
- Test coverage: <rating> — <reason>
- Sensitive domain: <rating> — <reason>
- Size and complexity: <rating> — <reason>
- Runtime criticality: <rating> — <reason>
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Risk factor**: <factor or none>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <risk impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,43 @@
# Standards reviewer
Review only repository standards and maintainability.
Do not make Risk, Intent, Evidence, or Documentation findings unless the issue directly affects standards conformance.
Use repository instructions and discovered standards sources such as `AGENTS.md`, `CONTRIBUTING.md`, coding standards, or nearby conventions.
When documented standards conflict with generic advice, the repository standard wins.
Also apply this smell baseline when tooling or project standards do not already cover the issue:
- Mysterious Name.
- Duplicated Code.
- Feature Envy.
- Data Clumps.
- Primitive Obsession.
- Repeated Switches.
- Shotgun Surgery.
- Divergent Change.
- Speculative Generality.
- Message Chains.
- Middle Man.
- Refused Bequest.
Treat smell findings as judgment calls, not automatic hard violations.
Skip anything deterministic tooling already enforces unless the current review evidence shows the tool is not being run.
## Output format
```markdown
## Standards
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Standard source**: <file and rule, smell baseline, or convention>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <maintainability or standards impact>
**Suggested fix**: <concrete next action, or none>
```

178
skills/slice/SKILL.md Normal file
View File

@@ -0,0 +1,178 @@
---
name: slice
description: Turn a settled plan, spec, conversation, or artifact into Wayfinder implementation tickets for tracer-bullet slices. Run deliberately as /skill:slice when the user asks to slice work.
disable-model-invocation: true
---
# slice
Turn settled source material into implementation-ready Wayfinder tickets.
Use this when the user asks to slice a plan, spec, conversation, or artifact into agent-grabbable implementation work.
Do not use this to resolve planning fog.
If the source contains unresolved decisions, report them instead of inventing implementation slices.
`slice` writes Wayfinder `ticket/implementation` artifacts for implementation slices and `ticket/task/human` artifacts only when the slice cannot proceed without human action.
It does not write legacy `.claude/tasks/` files.
## 1. Gather source material
Work from the current conversation first.
If the caller passes paths, artifact links, issue references, or URLs, read the referenced body and relevant comments or nearby artifact context before slicing.
When source material names a Wayfinder artifact, use that artifact as the default provenance parent.
When no source artifact exists, use the active Wayfinder map if one is clear from context.
When neither exists, create or select the minimal Wayfinder parent required by the destination's artifact rules before writing tickets.
Explore the codebase when the current implementation state is not already understood.
Use the project's established vocabulary and respect relevant ADRs, context artifacts, and repository instructions.
Look for prefactoring that makes the change easier before slicing the behavior.
Done when the source, project context, and default parent artifact are known.
## 2. Resolve the artifact destination
Resolve the destination before naming files.
Use an explicitly supplied destination directory exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI-artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when a new artifact requires it.
Read the destination's `AGENTS.md` before any artifact write.
Follow the destination's filename, identifier, slug, frontmatter, and wikilink conventions.
If Wayfinder artifact reference is available, read it before writing.
The minimum Wayfinder ticket contract is:
```markdown
---
status: open
parent: "[[<source-artifact-or-map>]]"
blocked-by: []
tags:
- ticket/implementation
---
# <task name>
## Question
<one precise implementation action sized to one agent session>
```
Use `ticket/task/human` instead of `ticket/implementation` when execution or validation requires human input before implementation can proceed.
Do not create claims.
Tickets start open and unclaimed.
Done when the destination and artifact conventions are known.
## 3. Draft slices
Break the work into tracer-bullet slices.
Each normal slice must deliver a narrow complete path through every layer the change requires.
Do not create horizontal layer-only slices.
Reject any proposed slice whose title or delivered behavior is only parsing, only schema, only API, only UI, only tests, or only documentation when those layers are part of one user-visible change.
For a small feature, one slice is usually correct because parsing, behavior, tests, and documentation belong in the same coherent commit.
A completed slice must be demoable or verifiable on its own.
A slice should make sense as one coherent commit.
Put prefactoring slices before behavior slices that depend on them.
Record blocking edges while drafting.
Use blockers only for work that genuinely gates the slice.
A slice with no blockers can start immediately.
Use `parent` for provenance and `blocked-by` for prerequisites.
Use the wide-refactor exception when a single mechanical change has a blast radius that prevents any vertical slice from landing green.
Sequence that work as expand, migration batches, and contract.
The expand slice adds the new form beside the old so nothing breaks.
Each migration batch is sized by blast radius and is blocked by the expand slice.
The contract slice removes the old form and is blocked by every migration batch.
When migration batches cannot stay green alone, keep the sequence but state the integration-branch constraint and add a final integrate-and-verify slice.
Done when every currently implementable slice has a title, type, blockers, delivered behavior, acceptance criteria, and any needed handoff notes.
## 4. Classify ticket type
Use `ticket/implementation` when an agent can complete and verify the implementation slice without live human input.
Use `ticket/task/human` when execution or validation depends on the user before implementation can proceed.
Examples include subjective UI judgment, physical device checks, unavailable credentials, external account approval, or behavior only the human can confirm.
Do not mark a ticket human merely because it is important or risky.
Make the required human involvement explicit in the ticket body.
If slicing reveals a precise unresolved planning question, do not disguise it as an implementation ticket.
Report it and stop, unless the caller asks to create the appropriate Wayfinder research, prototype, or grill ticket.
Done when each proposed slice has the correct ticket type.
## 5. Review before writing
Present the proposed breakdown and wait for approval unless the caller explicitly asks for noninteractive output.
For each slice show exactly this review shape:
```markdown
1. **Title**: <proposed task title>
**Type**: implementation or human task
**Blocked by**: <proposed blockers, or None>
**What it delivers**: <end-to-end behavior or implementation result>
**Acceptance criteria**:
- <observable completion check>
```
Ask the user whether the granularity feels right, whether the blocking edges are correct, and whether any slices should be merged or split.
Iterate until the breakdown is approved.
In explicitly noninteractive mode, write the best breakdown and record any assumptions in `## Implementation Notes`.
Done when the proposed slices are approved or noninteractive assumptions are explicit.
## 6. Write ticket artifacts
Allocate filenames and identifiers according to the destination convention.
Create one Wayfinder ticket artifact per approved slice.
Use the destination's wikilink style when referring to artifacts.
Never refer to a ticket by a bare identifier, filename, or slug in user-facing text.
Each ticket body should use this shape:
```markdown
# <task name>
## Question
<one precise implementation action sized to one agent session>
## What to build
<concise end-to-end behavior or implementation result, not a layer-by-layer checklist>
## Acceptance criteria
- [ ] <observable criterion>
## Implementation Notes
<concise handoff guidance when useful>
```
Keep `## Implementation Notes` empty when no guidance earns its place.
Later implementing agents may append execution notes, verification results, and reasons for deliberately dropped criteria.
Avoid brittle file paths and code snippets unless a prototype or prior decision snippet encodes the decision more precisely than prose can.
Done when every approved slice has exactly one open, unclaimed Wayfinder ticket artifact.
## 7. Advance the Frontier
Re-read the map or parent artifact before editing shared state.
If there is a Wayfinder map, recompute its Frontier from ticket metadata.
A ticket belongs on the Frontier when it is open, every blocker is satisfied, and it has no claim.
The map's Frontier is the only map section that links to ticket artifacts.
Do not copy ticket details into the map.
If the destination uses identifier allocation and concurrent writes caused duplicate identifiers or filenames, preserve pre-existing artifacts, rename current outputs, update wikilinks, and advance the counter as needed.
Done when the ticket artifacts and map Frontier agree with current ticket metadata.
## 8. Report
Report the created ticket artifacts by title using the destination's link style.
Summarize the current Frontier.
Mention any assumptions, unresolved planning questions, or human-dependent validation tickets.
Done when the user can choose the next implementation task from the Frontier.

58
skills/subagents/SKILL.md Normal file
View File

@@ -0,0 +1,58 @@
---
name: subagents
description: Delegate isolated work through Pi subagent tools. Use when a workflow needs an independent worker, fresh context, parallel reviewers, or hidden role separation.
disable-model-invocation: true
---
# subagents
## 1. Confirm support
Prefer tool calls when the current runtime exposes them.
The supported tool names are `subagent_spawn`, `subagent_batch`, `subagent_list`, `subagent_status`, `subagent_result`, and `subagent_cancel`.
If these tools are unavailable, do not pretend that an in-process role switch is a subagent.
State that Pi subagent tools are unavailable in the current runtime.
Do not perform the delegated subagent work in-process.
Done when the run has a supported subagent tool path.
## 2. Prepare a bounded prompt
Give each subagent a self-contained prompt.
Include the role, task, repository path, relevant files or artifacts, constraints, and expected output shape.
Do not expose private planning state that the workflow is trying to isolate.
For test-driven development, send one behavior at a time rather than a backlog.
For review, send one review dimension at a time unless batching independent dimensions.
Use `context: "independent"` for a fresh worker by default.
Use `context: "fork"` only when the child intentionally needs the parent transcript as starting context.
Choose named agents only when the project has configured them.
Do not invent named agents as part of the delegation.
Done when the prompt is narrow enough that the subagent can complete without sharing hidden state or requiring follow-up orchestration.
## 3. Spawn and track workers
Use `subagent_spawn` for one worker.
Use `subagent_batch` when several independent workers can run in parallel.
Both spawn tools return before the child work is complete.
Record accepted child ids and per-entry failures.
Use `subagent_list` or `subagent_status` to track lifecycle when needed.
Use `subagent_result` to retrieve completion output.
Use `subagent_cancel` for stale or no-longer-needed workers.
Do not claim the delegated work is complete until every required child result is available or a failed child has an explicit disposition.
Treat `queued`, `starting`, `running`, and `settling` as incomplete states.
Treat `failed`, `cancelled`, `timed_out`, and `orphaned` as failures unless the caller explicitly accepts the missing result.
Done when every required worker result has been collected or every missing result has a stated disposition.
## 4. Integrate results
Use subagent output as evidence, not as an unquestioned command.
Preserve which child produced each material finding.
When subagents disagree, report the disagreement rather than averaging it away.
When a subagent result changes implementation direction, verify the relevant facts in the parent context before editing code.
Done when the parent has integrated child results into the caller workflow with provenance and limitations visible.

View File

@@ -0,0 +1,77 @@
---
name: test-driven-development
description: Drive red-green-refactor implementation with tests written by someone other than the implementation agent, using public behavior and independent expected values.
---
# test-driven-development
Use test-driven development as process discipline for behavior-bearing changes.
The result is working behavior plus useful tests, not a separate report artifact.
## 1. Establish roles and behavior backlog
Name the two functional roles before writing tests.
The implementation agent changes production code and drives the loop.
The test writer writes and edits tests.
Tests are always written by someone other than the agent doing implementation.
Launch an independent test writer through whatever real context boundary the current harness provides.
A separate agent, worker, subprocess, or documented headless session is sufficient when it cannot see the implementation agent's private backlog.
If no real context boundary is available, stop before writing tests and report that test-driven development cannot be completed in the current runtime.
Do not replace the independent test writer with an in-process role switch.
Do not silently skip the independent-test-writer requirement.
The implementation agent may keep a private behavior backlog.
Keep that backlog isolated from the test writer.
The test writer receives one behavior at a time, not the whole backlog.
Done when roles are explicit and the implementation agent has the next behavior ready without exposing the whole backlog to the test writer.
## 2. Choose the public seam and source of truth
Test public behavior through the interface the code exposes or the task requires.
When the seam is unclear, identify the smallest public seam that can prove the behavior.
Do not test internals just to make RED easy.
Each test needs an independent source of truth for expected values.
Acceptable sources include a spec, task, intent excerpt, worked example, known-good literal, existing behavior being preserved, user clarification, or external standard.
The implementation agent's derived computation is not enough.
Done when the next behavior has a public seam, enough context for the test writer, and an independent expected-value source.
## 3. Run one red-green cycle
Give the test writer exactly one behavior, the public seam and context, the independent expected-value source, and any relevant project test conventions.
The test writer writes or edits one test for that behavior and confirms it fails for the intended reason.
A failing test should fail because the behavior is missing or wrong, not because of import, syntax, fixture, or collection errors.
The implementation agent writes the minimal production code needed to pass that test.
The implementation agent must not edit test-writer-authored tests.
If the test has a mechanical defect, send the error back to the test writer.
If the implementation agent believes the test asserts the wrong semantics, pause for user or intent clarification.
Done when one behavior has a meaningful failing test and then passes through production-code changes made by the implementation agent.
## 4. Repeat behavior by behavior
Repeat the red-green cycle one behavior at a time.
Do not bulk-write tests before implementation.
Do not let the test writer see the behavior backlog.
Do not add speculative behavior while making the current test pass.
Run focused verification as each behavior lands.
Use broader verification when the repository or change warrants it.
Done when every selected behavior has passed through the one-behavior red-green loop or has been deliberately deferred by the implementation agent's judgment.
## 5. Refactor only after green
Never refactor while RED.
After tests pass, the implementation agent may refactor production code.
Refactoring means changing code structure without changing externally observable behavior.
The test writer updates tests only for deliberate public seam changes or test defects.
A test failure during refactoring normally means production behavior broke.
Fix production code unless the public seam changed deliberately.
Done when refactoring, if any, is complete and the relevant tests remain green.

View File

@@ -0,0 +1,154 @@
# Wayfinder artifacts
## Resolve the project
Resolve the artifact destination before naming files.
When the caller provides a destination directory, use it exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when a new artifact requires it.
Read the destination's `AGENTS.md` before any artifact write.
Allocate identifiers only when the destination convention requires them.
## Names
Use an effort name that identifies one durable effort and is not reused for another map in the project.
Choose each filename from the destination's `AGENTS.md` and nearby artifact convention.
Do not assume a counter, numeric prefix, slug shape, or artifact-type suffix unless the destination convention requires it.
If no convention can be determined, choose the least surprising lowercase descriptive Markdown filename and state that the destination did not define a naming convention.
Refer to artifacts through the link style used by the destination.
Never use a bare identifier as a human-facing reference.
Ticket filenames use the substantive artifact type as their artifact-type suffix: `research`, `prototype`, `grill`, `task`, or `implementation`.
Do not use `ticket` as a filename artifact-type suffix.
## Map
The map is the effort's root artifact and has no `parent`.
It is a route summary rather than the store for ticket resolutions.
Only the Frontier links to tickets or other artifacts.
```markdown
---
status: open
tags:
- wayfinder/map
---
# <effort name>
## Destination
<one or two lines describing what reaching the end of this map looks like>
## Notes
<standing domain, skill, and execution guidance>
## Frontier
- [[<open-unblocked-unclaimed-ticket>]]
## Decisions so far
<one plain-language decision or implementation outcome per resolved ticket, without artifact links>
## Not yet specified
<in-scope fog that is not precise enough to ticket>
## Out of scope
<work consciously ruled beyond the destination>
```
Map status is `open` while any live ticket or fog remains and `complete` when neither remains.
The Frontier is a derived navigation index and the map's only artifact-link section.
Ticket metadata is authoritative.
Repair the Frontier whenever it is missing, stale, or inconsistent with ticket state.
Order Frontier links by the destination's declared ordering unless the user chooses another ticket.
Fall back to filename order when no ordering is declared.
Under **Decisions so far**, record one concise, self-contained decision or implementation outcome for each resolved ticket.
Do not link or identify the resolved ticket, or copy supporting detail from the canonical resolution into the map.
## Tickets
A new ticket starts as:
```markdown
---
status: open
parent: "[[<map-or-surfacing-ticket>]]"
blocked-by: []
tags:
- ticket/<type>
---
# <ticket name>
## Question
<one precise question, prerequisite action, or implementation slice sized to one agent session>
```
Use one of these tags:
- `ticket/research`
- `ticket/prototype/afk`
- `ticket/prototype/hitl`
- `ticket/grill`
- `ticket/task/afk`
- `ticket/task/human`
- `ticket/implementation`
`parent` records provenance.
An initial ticket points to the map.
A ticket surfaced by another ticket points to the surfacing ticket.
An artifact may have many children, which agents find by searching for backlinks to its wikilink.
`blocked-by` records zero or more upstream artifacts that must resolve before the ticket becomes actionable.
It is independent of `parent`.
A ticket blocker is satisfied when its status is `resolved`.
A non-ticket blocker is satisfied when its artifact exists.
A ticket is on the Frontier when its status is `open`, every blocker is satisfied, and it has no claim.
A `ticket/task/afk` ticket is prerequisite work that unblocks the route.
A `ticket/implementation` ticket is a code, configuration, documentation, or test slice that delivers part of an execution map's destination.
## Claims and status
Ticket status is one of:
- `open`
- `claimed`
- `resolved`
- `out-of-scope`
Claim a ticket by setting `status: claimed`, `claimed-by` to the current execution-session identifier, and `claimed-at` to the current timestamp before doing any work.
Use `PI_SESSION_ID` when available and an equivalent harness session identifier otherwise.
Claims do not expire automatically.
The acting agent uses the available context to recover an abandoned claim.
Only resolved tickets contribute decisions or implementation outcomes under **Decisions so far**.
An out-of-scope ticket is closed, while **Out of scope** states the excluded work and reason in plain language without linking or identifying the ticket.
## Results
A ticket is a self-resolving artifact.
Its canonical result lives in that same artifact rather than in a child result artifact.
When invoking `research`, `prototype`, or `implement`, provide the resolved ticket artifact path.
The called skill completes the ticket artifact in place and does not edit the map.
The coordinating Wayfinder agent validates the updated ticket artifact, marks the ticket resolved when the called skill has not already done so, and updates the map.
If a called skill cannot honor this artifact contract, leave the ticket unresolved and record the incompatibility instead of silently storing the result elsewhere.
Navigate the artifact journey forward by finding every note whose `parent` links to the current artifact.
Do not duplicate those relationships through per-artifact Next sections.
## Concurrent writes
Re-read every shared artifact immediately before editing it.
After concurrent workers return, detect duplicate identifiers or filenames, preserve pre-existing artifacts, rename current outputs when required by the destination convention, update their links, and advance any counter required by that convention.
Recompute the Frontier only after returned artifacts and ticket states have been reconciled.

176
skills/wayfinder/SKILL.md Normal file
View File

@@ -0,0 +1,176 @@
---
name: wayfinder
description: Plan or coordinate a huge chunk of work that exceeds one agent session as a durable map of tickets, then resolve them until the way to the destination is clear.
disable-model-invocation: true
---
# Wayfinder
A loose idea has arrived that is too large for one agent session and wrapped in fog.
Wayfinding charts the way to a **destination** rather than charging at it.
It creates a durable map of questions whose resolutions are decisions, findings, prototypes, completed prerequisites, or explicit implementation slices.
Read [`ARTIFACTS.md`](ARTIFACTS.md) before charting or working a map.
It is the single source of truth for how maps, tickets, claims, blocking, resolutions, and the Frontier live in the resolved artifact destination.
## Plan, don't do
Wayfinder plans by default.
The map is complete when nothing remains to decide before someone performs the destination work.
The urge to implement the destination usually marks the edge of a planning map and the time to hand off.
An effort may explicitly permit execution in its Notes, but otherwise preserve resolutions rather than deliver the destination.
A map may explicitly be an execution map when the destination is a tracked implementation effort rather than a route to a later handoff.
Execution maps use the same ticket, claim, and Frontier mechanics, but implementation tickets may deliver slices of the destination.
The destination varies by effort and shapes every ticket.
It may be a spec to hand off, a decision to lock before planning, a change whose route must be understood before implementation, or an implementation effort whose slices need coordination.
## Refer by name
Refer to every map and ticket by its human-readable title using the destination's link style, never by a bare identifier, filename, or slug.
When the destination convention includes an artifact identifier, keep it inside the link without letting it stand in for the name.
## Ticket types
Every ticket is either **HITL**, worked through a live exchange with the human, or **AFK**, driven by the agent.
A HITL ticket only resolves through that exchange.
The agent never speaks for the human's side.
- **Research** (AFK): Investigate documentation, third-party APIs, or resources outside the current working directory through `research`.
The called skill completes the Research ticket artifact in place.
- **Prototype** (AFK or HITL): Raise the fidelity of a logic, state-model, or UI decision through `prototype`.
Use AFK when the question has objective observable criteria the agent can test end to end.
Use HITL when the verdict depends on human judgment, taste, or UX feel.
The called skill completes the Prototype ticket artifact in place after the verdict is reached.
- **Grill** (HITL): Resolve a decision through `grill`.
This is the default ticket type.
- **Task** (AFK or HITL): Perform prerequisite work that fits the map's destination.
In a planning map, a Task earns its place by unblocking a decision rather than delivering part of the destination.
The agent performs it where possible and otherwise gives the human a precise checklist.
- **Implementation** (AFK): Deliver a code, configuration, documentation, or test slice of an execution map through `implement`.
Implementation tickets expect checkout verification, tests where useful, review, commit or handoff, and Wayfinder closeout.
## Fog of war
The map is deliberately incomplete.
Beyond its tickets lies the **fog of war**, where in-scope questions are visible but cannot yet be stated precisely because they depend on unresolved questions.
Resolving a ticket clears the fog ahead of it and graduates newly precise questions into tickets.
Use this test:
- Create a ticket when the question is precise now, even if it is blocked.
- Keep an entry under **Not yet specified** when the question cannot yet be phrased precisely.
Do not pre-slice fog into speculative tickets.
One fog entry may become several tickets or disappear as the frontier advances.
The destination fixes scope.
Work beyond it belongs under **Out of scope**, never under **Not yet specified**.
When an existing ticket proves to be beyond the destination, mark it out of scope and summarize the excluded work and reason in that section without an artifact link.
Do not record a scope boundary as a decision on the route.
## Select the mode
- A loose idea without a map uses **Chart the map**.
- An existing map uses **Work through the map**.
- A session working a map with unblocked AFK Frontier tickets uses **Coordinate workers** inside **Work through the map** when the current harness provides a real isolation or concurrency mechanism.
Worker coordination is the default for AFK Frontier work when an isolation or concurrency mechanism is available.
The current session acts as coordinator.
A worker session resolves exactly one claimed ticket and stops.
A coordinating session may dispatch multiple open Frontier tickets through whatever real isolation or concurrency mechanism the current harness provides.
A coordinating session does not claim tickets it intends to delegate.
Each worker claims its own ticket so accountability remains attached to the session doing the work.
An interactive Wayfinder session may resolve multiple tickets sequentially only when worker coordination is unavailable, unnecessary, or explicitly not selected.
It must complete the full reconcile, claim, resolve, record, and frontier-advance loop before selecting another ticket.
Do not auto-consume HITL tickets without user participation.
## Chart the map
1. **Name the destination.**
Invoke `grill` to settle what this map is finding its way toward.
Done when the destination names the spec, decision, or change at the end of the effort and fixes its scope.
2. **Map the frontier breadth-first.**
Invoke `grill` again to fan out across the whole space without resolving any one branch in depth.
Surface every currently precise question, its blocking relationships, and the remaining fog.
If no fog remains and the whole route fits one session, stop and ask how the user wants to proceed instead of creating a map.
Done when every visible in-scope uncertainty has exactly one home as a precise ticket question or an honest fog entry.
3. **Create the map and tickets.**
Create the map first, then every currently precise ticket, then wire blocking relationships in a second pass according to [`ARTIFACTS.md`](ARTIFACTS.md).
Done when the map is the effort root, every precise question has one ticket, every known blocking edge is represented, and the Frontier is current.
4. **Dispatch Research.**
Invoke `research` for each Research ticket using whatever isolation or concurrency the caller provides.
Reconcile each completed Research ticket according to [`ARTIFACTS.md`](ARTIFACTS.md).
Leave a ticket open with the reason visible when its Research run cannot complete.
Done when every dispatched Research ticket is resolved or records why it remains open.
5. **Stop.**
Stop without resolving a HITL ticket.
Done when charting has created and dispatched the visible route without consuming its human decision work.
## Work through the map
1. **Orient.**
Read the map at low resolution rather than loading every ticket.
Reconcile its derived Frontier against ticket metadata.
Done when the destination, Notes, prior decisions, fog, scope boundary, and current Frontier agree with the artifacts.
2. **Claim one ticket or coordinate workers.**
If unblocked AFK Frontier tickets can be delegated through a real isolation or concurrency mechanism, use **Coordinate workers** instead of claiming a ticket here.
Use the user-named ticket when it is actionable and not delegated.
Otherwise take the first Frontier ticket in the destination's declared ordering, falling back to filename order when no ordering is declared.
Persist the claim before doing any direct work.
Done when exactly one unblocked ticket records this session's claim with `status: claimed`, or the session has switched to worker coordination without claiming delegated tickets.
3. **Resolve by type.**
Invoke `research`, `prototype`, `grill`, or `implement` for the corresponding ticket type.
Perform a Task through the capability or human checklist it requires.
Load related artifacts only when needed.
Done when the question has a resolution, the prerequisite Task is complete, or the implementation slice has a concrete handoff state.
4. **Record the resolution.**
Persist the canonical result in the ticket artifact, resolve the ticket, and append its concise decision or implementation outcome under the map's **Decisions so far** according to [`ARTIFACTS.md`](ARTIFACTS.md).
Do not link or identify the resolved ticket from the map.
Done when the resolution lives in the ticket artifact and the map states only the resulting decision or outcome.
5. **Advance the frontier.**
Create tickets surfaced by the resolution and wire their blockers.
Graduate newly precise fog, remove invalidated tickets, move beyond-destination work out of scope, and recompute the Frontier.
Re-read shared artifacts before each write because other sessions may edit the effort concurrently.
Done when every newly visible question has exactly one home and the map agrees with all current ticket metadata.
6. **Complete, continue, or stop.**
When no unresolved tickets or fog remain, mark the map complete and stop for an explicit handoff instruction.
In a worker session, stop after one ticket is resolved and the frontier is advanced.
In an interactive or coordinating session, continue to another Frontier ticket only after reconciling the map and shared artifacts again.
Otherwise stop.
Done when the map records its current lifecycle state and no destination work has begun without permission.
## Coordinate workers
1. **Select dispatchable tickets.**
Re-read the map and current Frontier before dispatch.
Select only open, unclaimed, unblocked AFK tickets.
Do not dispatch HITL tickets without live user participation.
Include every eligible AFK Frontier ticket unless serial execution or likely conflict requires selecting a smaller batch.
Done when every selected ticket is eligible and no selected ticket has been claimed by the coordinator.
2. **Dispatch workers.**
Send each selected worker exactly one ticket, the artifact path, the map context it needs, and the instruction to claim the ticket itself before work.
Route Research tickets through `research`, AFK Prototype tickets through `prototype`, Implementation tickets through `implement`, and AFK Task tickets through the focused task capability or checklist they require.
Use whatever real isolation or concurrency mechanism the current harness provides.
If no such mechanism exists, stop and report that worker coordination is unavailable in this runtime.
Use parallel workers when selected tickets are independent.
Use serial workers when tickets likely edit the same files, checkout, branch, or shared artifact surfaces.
Done when every selected ticket has either a launched worker or a visible dispatch failure.
3. **Join workers.**
Wait for every launched worker to finish, fail, time out, or be cancelled before treating coordination as complete.
Do not implement in the coordinator while workers are running.
Do not report final handoff while workers are still running.
Done when every launched worker has a terminal result or an explicit recovery status.
4. **Reconcile worker results.**
Re-read every shared artifact touched by returned workers.
Validate each ticket's claim, status, and canonical result.
Detect duplicate surfaced tickets or filenames, preserve pre-existing artifacts, and repair links according to [`ARTIFACTS.md`](ARTIFACTS.md).
Record whether a failed worker's claim remains, was reopened, or needs human recovery.
When Pi subagents supplied the worker results, call `subagent_clear` for each terminal child only after its findings have been reconciled into the artifacts or recovery record.
Done when all returned work is reconciled, every failed or missing worker result has an honest artifact state, and no reconciled terminal subagent remains in the visible work set.
5. **Advance the frontier.**
Recompute the Frontier after reconciliation, not before.
Mark the map `complete` only when no live ticket or fog remains.
Never use `resolved` as a map status.
Done when the map status, Frontier, and ticket metadata agree.

View File

@@ -0,0 +1,17 @@
---
description: Review a tiny CLI against the 10 AXI principles and produce a report card.
---
## Prompt
There is a small command-line tool named `greet` in the current directory (`./greet`).
Review it against the 10 AXI (Agent eXperience Interface) principles by running it black-box, and give me a report card that scores each principle with a concrete verdict and a fix for anything that isn't a clean pass.
## Hard assertions
```sh
grep -qiE 'AXI|principle' "$OUTPUT"
grep -qiE 'PASS|PARTIAL|FAIL' "$OUTPUT"
```
## Soft criteria
- The review scores each of the 10 AXI principles with an explicit verdict grounded in the tool's actual observed output, not in guesses about its source.
- Every principle that is not a clean pass carries a concrete, actionable fix.
- The review is driven by running the `greet` tool and citing what it emitted, rather than by generic CLI advice.

View File

@@ -0,0 +1,41 @@
#!/usr/bin/env sh
# greet: a tiny CLI, deliberately imperfect, for exercising an AXI review.
usage() {
cat <<'EOF'
greet — say hello
USAGE:
greet hello <name> print a greeting
greet json <name> print the greeting as JSON
greet --help show this help
EOF
}
case "$1" in
--help|-h|help)
usage
;;
hello)
if [ -z "$2" ]; then
echo "error: missing name" >&2
exit 1
fi
echo "Hello, $2!"
;;
json)
if [ -z "$2" ]; then
echo "error: missing name" >&2
exit 1
fi
printf '{"greeting":"Hello","name":"%s"}\n' "$2"
;;
"")
usage >&2
exit 2
;;
*)
echo "error: unknown command '$1'" >&2
exit 2
;;
esac