Compare commits
52 Commits
8622b35f48
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b2a6bcd58 | |||
| 13cf92f627 | |||
| 40b16b8796 | |||
| 0f2b13c5f9 | |||
| d758f722f9 | |||
| 346413cd7d | |||
| f283646124 | |||
| 99df169fbd | |||
| 8035e0e436 | |||
| 012a4bfd1e | |||
| b5c6e33730 | |||
| 778e726d4c | |||
| d3bc9a5760 | |||
| 8479ad096c | |||
| d0c9f94713 | |||
| 942d32dcba | |||
| 96f795a63a | |||
| 80cecf3350 | |||
| 181dcc7a9e | |||
| 7d22ff0c02 | |||
| 4da2452084 | |||
| 7550096968 | |||
| cbc03650d1 | |||
| 8ad93c7617 | |||
| 43280e4d4a | |||
| f72c262229 | |||
| fbd009337d | |||
| 920517e623 | |||
| 6bb3242e7f | |||
| fb16c891b2 | |||
| 5886017976 | |||
| b541251f98 | |||
| 40b37281d5 | |||
| 02f2017b40 | |||
| c6beafc53e | |||
| a4b88f8f42 | |||
| ea8e2c50bc | |||
| 1e9d19fe3d | |||
| 52fc449824 | |||
| 8c17f3aeb8 | |||
| 0a8b5c2096 | |||
| 97c0eeb055 | |||
| f4df5d31c9 | |||
| 9b40d9f4e5 | |||
| 5db98dcab9 | |||
| 3e96db664c | |||
| 613e423617 | |||
| ab2c05acb2 | |||
| e35ed9d05b | |||
| 1caf18d72d | |||
| 49a73c30d1 | |||
| b0a763e5ce |
1
.claude/skills
Symbolic link
1
.claude/skills
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../.agents/skills
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
## Problem Statement
|
|
||||||
|
|
||||||
I manage a collection of Claude Code agent skills and need a way to select which ones apply globally (on every project) versus per-project.
|
|
||||||
Today that per-project selection is driven by three agent-run skills — `setup-skills`, `update-skills`, `remove-skills` — backed by a `.claude/skills-lock.yaml` lockfile and a content-hashing script.
|
|
||||||
Setup copies a skill out of a shared library into a project's tree; update re-hashes to detect drift and applies safe upstream changes; remove deletes it.
|
|
||||||
This is a lot of hand-maintained machinery: an LLM chore to run, a lockfile to keep clean, and a hash-based drift classifier to reason about.
|
|
||||||
I want skills packaged and versioned through Nix instead, so that selection is declarative, updates are a pinned-input bump, and the whole copy-and-hash apparatus disappears.
|
|
||||||
|
|
||||||
## Solution
|
|
||||||
|
|
||||||
A standalone Nix flake (`alexion/skills`) that packages each skill as an individually addressable derivation and exposes optional integration outputs for placing selected skills where Claude Code discovers them.
|
|
||||||
|
|
||||||
- Adding a skill is creating a directory containing a `SKILL.md`; the flake auto-discovers it.
|
|
||||||
- A home-manager config selects skills it wants **globally** (into `~/.claude/skills/`) via a home-manager module.
|
|
||||||
- A project's own flake selects skills it wants **for that project** (into `<project>/.claude/skills/`) via a dev-shell helper, pinning this flake as an input.
|
|
||||||
- "Update" becomes `nix flake update`; "remove" becomes deleting a line from the selecting config; "setup" becomes adding one.
|
|
||||||
- The three management skills, the lockfile, and the hashing script are retired — Nix subsumes all of their responsibilities.
|
|
||||||
|
|
||||||
Nix is accepted as a hard requirement: every machine and every project is Nix/dev-shell based, so there is no need to keep skills as portable, committed-into-the-tree files for non-Nix consumers.
|
|
||||||
|
|
||||||
## User Stories
|
|
||||||
|
|
||||||
1. As a skill author, I want to add a new skill by creating a directory with a `SKILL.md` and nothing else, so that adding a skill requires no edit to the flake.
|
|
||||||
2. As a skill author, I want to organize skills into arbitrarily nested subfolders (e.g. group related workflow skills together), so that the source tree stays browsable as the collection grows.
|
|
||||||
3. As a skill author, I want that grouping to be purely cosmetic, so that where a skill's folder sits never changes how it is selected, placed, or named.
|
|
||||||
4. As an operator, I want to select a set of skills to be active in every project via my home-manager configuration, so that my always-on skills are declared in one place and installed reproducibly.
|
|
||||||
5. As a project maintainer, I want to select a set of skills for a single project via that project's flake, so that only the skills relevant to that project are active there.
|
|
||||||
6. As a project maintainer, I want the selected skills to appear under the project's `.claude/skills/` automatically when I enter its dev shell, so that I never run a manual install step.
|
|
||||||
7. As a project maintainer, I want the committed record of which skills a project uses to be the project's `flake.nix` selection plus its pinned input, so that the selection diffs cleanly in git and reproduces exactly on any machine.
|
|
||||||
8. As a project maintainer, I want the generated skill symlinks kept out of git, so that machine-specific store paths never get committed.
|
|
||||||
9. As a project maintainer, I want to keep my own hand-authored, project-private skills in `.claude/skills/` alongside the Nix-delivered ones, so that a project can have bespoke skills without adding them to the shared repo.
|
|
||||||
10. As a project maintainer, I want the dev shell to only ever touch the skills it manages, so that my hand-authored skills are never removed or clobbered.
|
|
||||||
11. As an operator, I want to update all pinned skills with `nix flake update`, so that picking up upstream skill changes is a single, reviewable, atomic operation.
|
|
||||||
12. As an operator, I want a skill I previously selected to disappear when I remove it from my selection and re-enter the shell (or rebuild), so that removal needs no cleanup command.
|
|
||||||
13. As an operator, I want to promote a skill from per-project to global (or vice versa) by moving one line between a project flake and my home-manager config, so that changing a skill's reach never moves files.
|
|
||||||
14. As a skill author, I want two skills that would resolve to the same name to fail the build with a clear error, so that a silent clobber can never happen.
|
|
||||||
15. As a skill author, I want the packaging to know nothing about `.claude/skills` or Claude Code, so that when a skill later needs to feed a different agent/tool the content is not welded to one placement convention.
|
|
||||||
16. As an operator, I want my global skill placement to compose with other modules that write into the same skills directory (e.g. a tool that self-installs its own skill), so that independent sources coexist without collisions.
|
|
||||||
17. As a maintainer, I want `nix flake check` to fail if a skill is malformed, if the home-manager placement regresses, or if the dev-shell helper stops producing a valid hook, so that breakage is caught before it ships.
|
|
||||||
|
|
||||||
## Implementation Decisions
|
|
||||||
|
|
||||||
### Overall structure
|
|
||||||
|
|
||||||
- The flake has two clearly separated tiers: a **content tier** (tool-agnostic skill packaging) and an **integration tier** (optional, Claude-Code-specific placement). A skill derivation in the content tier must never reference `.claude/skills` or anything Claude-Code-specific.
|
|
||||||
- Flake scaffolding uses `flake-utils.lib.eachSystem` over `x86_64-linux`, `aarch64-linux`, `aarch64-darwin`, with `nixpkgs` tracking unstable.
|
|
||||||
An explicit system list is passed rather than `eachDefaultSystem`, because that default set includes `x86_64-darwin`, which recent nixpkgs dropped and whose `legacyPackages` now throws.
|
|
||||||
|
|
||||||
### Content tier
|
|
||||||
|
|
||||||
- Skills are **auto-discovered** by recursively walking the `skills/` tree; any directory containing a `SKILL.md` is a skill, at any depth. Once a `SKILL.md` is found, that directory is a skill and its own subfolders are its assets, not further skills.
|
|
||||||
- Directories that do not contain a `SKILL.md` are organizational containers only; the walk descends through them. This nesting is **cosmetic**: it never reaches the placement location and is not a selectable unit (no "select a whole group" — that is a purely additive future change if ever wanted).
|
|
||||||
- Each skill becomes an **individually addressable derivation**, exposed at `packages.<system>.<skill-name>`. There is no `packages.<system>.default` — a catalog has no single default skill.
|
|
||||||
- A skill is addressed by its **name** (leaf directory / frontmatter `name`), independent of its source path. Placement flattens the source path away — a skill nested at `skills/workflow/to-spec/` is placed as a direct child `.../skills/to-spec/`, because Claude Code only discovers direct children of the skills root.
|
|
||||||
- **Skill-derivation contract** (the interchange primitive, shared with self-packaging tool repos like `gitea-axi`):
|
|
||||||
- `$out` contains `SKILL.md` at its root, plus any assets.
|
|
||||||
- The derivation carries its **name as an eval-time attribute** (e.g. `pname` / a passthru), so placement can form `.../skills/<name>` without reading `$out` (no import-from-derivation).
|
|
||||||
- **Names must be globally unique** across the whole tree. A collision detected during the discovery walk is a **hard build error** with a clear message, not a warning or a lint.
|
|
||||||
- A `lib.mkSkill` builder is exposed (turns a skill source directory into a conforming derivation). Exposing it costs nothing and lets a tool repo reuse it, even though tool repos are expected to self-package today.
|
|
||||||
|
|
||||||
### Cross-skill references
|
|
||||||
|
|
||||||
- There is **no dependency/closure machinery.** Skills interact by **name-based invocation** (the Skill tool), not by reading each other's files. A skill that references another skill relies on that skill being loaded (globally or in the same project), not on any relative path resolving on disk.
|
|
||||||
- Design convention, enforced by convention only (no lint): **skills are self-contained** — a skill never reaches into another skill's files; anything it needs at a path, it carries itself. The retired management skills (which read siblings' `LOCKFILE.md` and executed a sibling's script) are exactly the anti-pattern this convention forbids.
|
|
||||||
|
|
||||||
### Integration tier — selection
|
|
||||||
|
|
||||||
- Selection is **by derivation**, not by name string. Consumers pass skill derivations pulled from `packages.<system>` (e.g. bind `packages.<system>` to a short local name and list the skills off it).
|
|
||||||
- Rationale: skills are derivations in this ecosystem, so a derivation-based API composes with any skill satisfying the contract, from any repo, and keeps this flake ignorant of skills it does not own (respecting the boundary that tool-specific skills live in and are packaged by their own repos, not registered here).
|
|
||||||
|
|
||||||
### Integration tier — global placement (home-manager)
|
|
||||||
|
|
||||||
- Exposed as `homeModules.default`.
|
|
||||||
- The operator-facing option is **`programs.agents.skills`**, a `listOf package` with default `[]`. `agents` is deliberately an umbrella namespace (room for future `programs.agents.<other>`), and it has **no shared `programs.agents.enable`** — each sub-feature self-gates, so the namespace stays a clean, mergeable surface a different repo could also extend without an ownership conflict. An empty list is a no-op.
|
|
||||||
- For each selected skill the module writes an individual home file at `${claude-code.configDir}/skills/<name>` with `source = <skill derivation>` and **`recursive = true`**, gated on `programs.claude-code.enable`, reading `configDir` from the claude-code module.
|
|
||||||
- `recursive = true` is a **hard requirement, not a style choice**: it forces home-manager to materialize `.../skills/<name>/` as a real directory of per-file symlinks rather than claiming the directory as one opaque symlink. That is what allows this module, the operator's own skills declarations, and self-placing tool modules to coexist under one `skills/` tree.
|
|
||||||
- The module deliberately does **not** feed `programs.claude-code.skills`. That option is single-valued and would collide with an operator already setting it; per-skill `home.file` composes where the option does not.
|
|
||||||
|
|
||||||
### Integration tier — per-project placement (dev shell)
|
|
||||||
|
|
||||||
- Exposed as `lib.mkSkillsShellHook`, which takes a list of selected skill derivations and returns a shellHook string a project drops into its dev shell.
|
|
||||||
- On shell entry the hook symlinks each selected skill as a **direct child** of `<project>/.claude/skills/`, pointing into the Nix store.
|
|
||||||
- **Stateless lifecycle:** each entry first removes only the symlinks under `.claude/skills/` that point into the store (unambiguously "ours"), then recreates the current selection. This yields free stale-removal (deselect a skill → its symlink is gone next entry) and never touches real directories. No manifest or state file.
|
|
||||||
- **Coexistence with hand-authored skills:** real (non-symlink) skill directories under `.claude/skills/` are left untouched. The hook maintains a generated, self-ignoring `.claude/skills/.gitignore` that lists the names it manages (and ignores itself), so Nix-delivered symlinks stay out of git while hand-authored skills remain tracked.
|
|
||||||
- The committed record of a project's selection is its **`flake.nix`** (the selection list) plus its pinned `flake.lock`; the generated symlinks are gitignored.
|
|
||||||
- The hook is a plain shell string relying on ambient POSIX tools; it does not need a home-manager context (projects are not home-manager-managed).
|
|
||||||
|
|
||||||
### Retired
|
|
||||||
|
|
||||||
- `setup-skills`, `update-skills`, `remove-skills`, the `skills-lock.yaml` lockfile concept, and the directory-hashing script are all replaced by Nix and are **not** carried into this repo. Their responsibilities map to: selection in a flake (setup / remove) and `nix flake update` (update).
|
|
||||||
|
|
||||||
## Testing Decisions
|
|
||||||
|
|
||||||
- A good test here exercises the flake's **public outputs** as a consumer would observe them — a built skill, an evaluated-and-built module, an instantiated helper — not the internal shape of the discovery walk or builder. The outputs are the surface; there is no separate production code path needing its own seam.
|
|
||||||
- The single seam is **`nix flake check`**, with three focused checks beneath it (prior art: the `gitea-axi` flake's package-build and `checks/home-manager-module.nix` checks):
|
|
||||||
1. **Skill-build check** — builds every auto-discovered skill derivation. This one check transitively exercises the recursive discovery walk, the `mkSkill` builder, the `SKILL.md`-at-`$out`-root contract, and the name-uniqueness hard error (which fires at eval and so also surfaces here).
|
|
||||||
2. **Home-manager-module composition check** — instantiates `homeModules.default` under a sample home-manager configuration that selects a couple of skills with `programs.claude-code` enabled, and builds the resulting home-files derivation. This is the load-bearing check: it proves per-skill `home.file`, `recursive = true`, the `claude-code.enable` gate, and `configDir` sourcing compose as intended. Direct analogue of gitea-axi's home-manager-module check.
|
|
||||||
3. **shellHook assertion** — instantiates `lib.mkSkillsShellHook` with sample skills and asserts the produced hook is non-empty and references the expected store paths / skill names.
|
|
||||||
- Prefer the highest seam: none of these introduce a bespoke test hook into production logic; they evaluate/realize the flake outputs directly.
|
|
||||||
|
|
||||||
## Out of Scope
|
|
||||||
|
|
||||||
- **Dotfiles and any migration of existing skills.** This repo owns only the packaging and integration outputs. Moving current skills out of the dotfiles tree, rewiring the dotfiles home-manager configuration to consume this flake, deleting the retired management skills from wherever they currently live, and reviewing/rewriting individual skills are all handled separately and by hand. The repo starts with flake machinery and no skill content; skills are added incrementally, "as needed."
|
|
||||||
- **Integration with tool-specific skills.** Skills that ship inside a tool's own repo (e.g. `gitea-axi`) self-package and self-place; they are not listed in or delivered by this flake. This flake stays ignorant of them. The shared skill-derivation contract is the only thing in common.
|
|
||||||
- **Selectable groups.** Nested folders are cosmetic; selecting a whole group as a unit is not built (additive later if wanted).
|
|
||||||
- **A formal cross-skill dependency system.** Not built; name-based invocation plus the self-containment convention is the whole mechanism.
|
|
||||||
- **Non-Nix portability.** Skills are not required to work on a machine without Nix; there is no committed-into-the-tree copy for non-Nix consumers.
|
|
||||||
- **Multiple harnesses.** Placement targets Claude Code only. The `programs.agents` namespace is chosen to leave room for other harnesses later, but no second harness is implemented now.
|
|
||||||
|
|
||||||
## Further Notes
|
|
||||||
|
|
||||||
- The global-vs-per-project distinction is no longer a directory (`library/` is gone) or a file-copy state; it is purely **which config selects a skill**. The same per-skill derivation is selected by home-manager for the global set and by a project's dev shell for that project's set.
|
|
||||||
- The two integration outputs place skills through different mechanisms because they run in different contexts: home-manager (`home.file`, `recursive = true`) for the global set, and a dev-shell shellHook (store symlinks) for the per-project set. Both operate on the same by-derivation selection and the same skill-derivation contract.
|
|
||||||
- `programs.agents` is a generic namespace; if this repo is ever made public it is a mild land-grab worth revisiting, but it is appropriate for a personal ecosystem.
|
|
||||||
- The design intentionally mirrors `gitea-axi` (flake scaffolding, per-skill `home.file` with `recursive = true`, module shape, check style) so the two repos stay consistent and the placement lessons already encoded in gitea-axi's ADRs carry over.
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
spec: nix-skill-packaging
|
|
||||||
---
|
|
||||||
|
|
||||||
## What to build
|
|
||||||
|
|
||||||
The foundational tracer bullet: a standalone Nix flake that packages each skill as an individually addressable derivation, plus the check that proves it.
|
|
||||||
|
|
||||||
The flake scaffolding uses `flake-utils.lib.eachSystem` over `x86_64-linux`, `aarch64-linux`, `aarch64-darwin`, with `nixpkgs` tracking unstable.
|
|
||||||
An explicit system list is passed rather than `eachDefaultSystem`, whose default set includes the now-dropped `x86_64-darwin`.
|
|
||||||
|
|
||||||
The content tier recursively walks the `skills/` tree: any directory containing a `SKILL.md` is a skill (at any depth), and once found, its own subfolders are its assets rather than further skills. Directories without a `SKILL.md` are cosmetic organizational containers the walk descends through — the nesting never reaches the placement name and is not a selectable unit.
|
|
||||||
|
|
||||||
Each discovered skill becomes an individually addressable derivation exposed at `packages.<system>.<skill-name>`, built by an exposed `lib.mkSkill` builder. There is no `packages.<system>.default`. A skill is addressed by its name (leaf directory / frontmatter `name`), independent of its source path. The derivation satisfies the skill-derivation contract: `$out` contains `SKILL.md` at its root plus any assets, and the derivation carries its name as an eval-time attribute (e.g. `pname` / a passthru) so placement can form `.../skills/<name>` without import-from-derivation. Nothing in this tier references `.claude/skills` or anything Claude-Code-specific.
|
|
||||||
|
|
||||||
Names must be globally unique across the whole tree; a collision detected during the discovery walk is a hard eval-time build error with a clear message, not a warning.
|
|
||||||
|
|
||||||
Verified by the skill-build check under `nix flake check`, which builds every auto-discovered skill derivation and thereby transitively exercises the recursive walk, the `mkSkill` builder, the `SKILL.md`-at-`$out`-root contract, and the name-uniqueness hard error. Because the repo ships with no real skill content, this check drives fixture skills (à la gitea-axi's `runCommandLocal` fixtures), including a collision fixture that must fail the build.
|
|
||||||
|
|
||||||
## Acceptance criteria
|
|
||||||
|
|
||||||
- [x] `flake.nix` iterates the three systems via `flake-utils.lib.eachSystem` (explicit list, not `eachDefaultSystem`) with `nixpkgs` unstable.
|
|
||||||
- [x] The `skills/` tree is auto-discovered recursively: any directory containing a `SKILL.md` is a skill at any depth; its subfolders become its assets, not further skills.
|
|
||||||
- [x] Directories without a `SKILL.md` are traversed as cosmetic containers only and never affect a skill's placement name.
|
|
||||||
- [x] Each discovered skill is exposed at `packages.<system>.<skill-name>`; there is no `packages.<system>.default`.
|
|
||||||
- [x] `lib.mkSkill` is exposed and turns a skill source directory into a conforming derivation.
|
|
||||||
- [x] A built skill's `$out` contains `SKILL.md` at its root, and the derivation carries its name as an eval-time attribute (no import-from-derivation needed to read it).
|
|
||||||
- [x] No content-tier derivation references `.claude/skills` or anything Claude-Code-specific.
|
|
||||||
- [x] Two skills that resolve to the same name fail the build at eval with a clear collision message.
|
|
||||||
- [x] `nix flake check` includes a skill-build check that builds every auto-discovered skill; a name-collision fixture makes it fail.
|
|
||||||
|
|
||||||
## Implementation Notes
|
|
||||||
|
|
||||||
Files: `flake.nix` (scaffolding + wiring), `lib/mk-skill.nix` (builder), `lib/discover.nix` (recursive walk + uniqueness), `checks/skill-build.nix` with fixtures under `checks/fixtures/`, and an empty `skills/.gitkeep` root.
|
|
||||||
|
|
||||||
- **Name source — leaf directory name, not frontmatter.**
|
|
||||||
The spec's "What to build" phrases the name as "leaf directory / frontmatter `name`", but the acceptance criteria only ever require the leaf directory name (criteria 2 and 6).
|
|
||||||
Discovery and `mkSkill` derive the name purely from the leaf directory (`mkSkill`'s `name` defaults to `builtins.baseNameOf src`).
|
|
||||||
The two are equal by Claude Code convention; parsing `SKILL.md` YAML frontmatter at eval would add real complexity for no behavioural gain when they agree, so the frontmatter branch is deliberately not implemented.
|
|
||||||
If divergence between directory name and frontmatter name ever needs enforcing, that is an additive validation for later.
|
|
||||||
|
|
||||||
- **Eval-time name attribute.**
|
|
||||||
Carried as `passthru.skillName` (in addition to the derivation's own `name`), so the integration tier can form `.../skills/<name>` at eval time without import-from-derivation.
|
|
||||||
|
|
||||||
- **Empty `skills/` root.**
|
|
||||||
The repo ships no real skill content, so `skills/` holds only a `.gitkeep` and `packages.<system>` is an empty set today.
|
|
||||||
The `skill-build` check therefore drives fixture skills (a top-level skill, one under a cosmetic container with an asset subfolder, and one nested several containers deep) plus a separate two-skills-one-name collision fixture that `builtins.tryEval` confirms fails discovery at eval.
|
|
||||||
|
|
||||||
- **Real skills also folded into `checks` (beyond the literal criteria).**
|
|
||||||
Each real discovered skill is added to `checks.<system>` alongside `skill-build`, so once skills land `nix flake check` builds each one and fails on a malformed skill (spec user story 17).
|
|
||||||
This is empty today and is a natural extension of criterion 9's "builds every auto-discovered skill", not new scope.
|
|
||||||
|
|
||||||
- **Integration tier (home-manager module, dev-shell shellHook) is intentionally absent** — it belongs to tasks 0002 and 0003. No `home-manager` flake input is added yet for that reason.
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -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
36
AGENTS.md
Normal 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
5
CLAUDE.md
Normal 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.
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
# skills
|
# skills
|
||||||
|
|
||||||
My personal skills packaged through Nix.
|
Personal agent skills packaged through Nix.
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
# delta — another top-level skill
|
|
||||||
202
checks/home-manager-module.nix
Normal file
202
checks/home-manager-module.nix
Normal 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
136
checks/shell-hook.nix
Normal 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"
|
||||||
|
''
|
||||||
@@ -34,8 +34,8 @@ pkgs.runCommandLocal "skill-build-check"
|
|||||||
|
|
||||||
echo "content tier: discovery finds every skill regardless of nesting depth,"
|
echo "content tier: discovery finds every skill regardless of nesting depth,"
|
||||||
echo " and stops at a skill rather than descending into its assets"
|
echo " and stops at a skill rather than descending into its assets"
|
||||||
[ "$expectedNames" = "alpha beta delta gamma" ] \
|
[ "$expectedNames" = "alpha beta gamma" ] \
|
||||||
|| fail "discovered names were [$expectedNames], expected [alpha beta delta gamma]"
|
|| fail "discovered names were [$expectedNames], expected [alpha beta gamma]"
|
||||||
|
|
||||||
echo "content tier: each built skill has SKILL.md at its \$out root"
|
echo "content tier: each built skill has SKILL.md at its \$out root"
|
||||||
beta_path=
|
beta_path=
|
||||||
|
|||||||
64
flake.lock
generated
64
flake.lock
generated
@@ -18,6 +18,68 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1784497964,
|
"lastModified": 1784497964,
|
||||||
@@ -37,6 +99,8 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
"gitea-axi": "gitea-axi",
|
||||||
|
"home-manager": "home-manager_2",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
58
flake.nix
58
flake.nix
@@ -4,10 +4,25 @@
|
|||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
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 =
|
outputs =
|
||||||
{ self, nixpkgs, flake-utils }:
|
{ self, nixpkgs, flake-utils, home-manager, gitea-axi }:
|
||||||
let
|
let
|
||||||
mkSkill = import ./lib/mk-skill.nix;
|
mkSkill = import ./lib/mk-skill.nix;
|
||||||
|
mkSkillsShellHook = import ./lib/mk-skills-shell-hook.nix;
|
||||||
discoverSkills = import ./lib/discover.nix nixpkgs.lib;
|
discoverSkills = import ./lib/discover.nix nixpkgs.lib;
|
||||||
|
|
||||||
discoveredSkills = discoverSkills ./skills;
|
discoveredSkills = discoverSkills ./skills;
|
||||||
@@ -22,7 +37,16 @@
|
|||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib = { inherit mkSkill; };
|
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`.
|
# An explicit system list rather than `eachDefaultSystem`.
|
||||||
@@ -49,6 +73,36 @@
|
|||||||
skill-build = import ./checks/skill-build.nix {
|
skill-build = import ./checks/skill-build.nix {
|
||||||
inherit pkgs mkSkill discoverSkills;
|
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
68
home-manager-module.nix
Normal 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;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
112
lib/mk-skills-shell-hook.nix
Normal file
112
lib/mk-skills-shell-hook.nix
Normal 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"
|
||||||
|
)
|
||||||
|
''
|
||||||
141
skills/axi-review/AXI-PRINCIPLES.md
Normal file
141
skills/axi-review/AXI-PRINCIPLES.md
Normal 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 3–4 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 3–4 fields and `--fields` opts into more.
|
||||||
|
- PARTIAL: the default carries 5–6 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.
|
||||||
54
skills/axi-review/REPORT-FORMAT.md
Normal file
54
skills/axi-review/REPORT-FORMAT.md
Normal 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.
|
||||||
65
skills/axi-review/SKILL.md
Normal file
65
skills/axi-review/SKILL.md
Normal 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.
|
||||||
304
skills/design-skill/GLOSSARY.md
Normal file
304
skills/design-skill/GLOSSARY.md
Normal 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
|
||||||
144
skills/design-skill/SKILL.md
Normal file
144
skills/design-skill/SKILL.md
Normal 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.
|
||||||
30
skills/grill/CONTEXT-FORMAT.md
Normal file
30
skills/grill/CONTEXT-FORMAT.md
Normal 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
94
skills/grill/SKILL.md
Normal 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
122
skills/implement/SKILL.md
Normal 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
100
skills/prototype/LOGIC.md
Normal 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
88
skills/prototype/SKILL.md
Normal 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
124
skills/prototype/UI.md
Normal 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
52
skills/research/SKILL.md
Normal 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
121
skills/review/SKILL.md
Normal 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.
|
||||||
30
skills/review/reviewers/documentation.md
Normal file
30
skills/review/reviewers/documentation.md
Normal 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>
|
||||||
|
```
|
||||||
38
skills/review/reviewers/evidence.md
Normal file
38
skills/review/reviewers/evidence.md
Normal 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>
|
||||||
|
```
|
||||||
33
skills/review/reviewers/intent.md
Normal file
33
skills/review/reviewers/intent.md
Normal 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>
|
||||||
|
```
|
||||||
46
skills/review/reviewers/risk.md
Normal file
46
skills/review/reviewers/risk.md
Normal 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>
|
||||||
|
```
|
||||||
43
skills/review/reviewers/standards.md
Normal file
43
skills/review/reviewers/standards.md
Normal 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
178
skills/slice/SKILL.md
Normal 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
58
skills/subagents/SKILL.md
Normal 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.
|
||||||
77
skills/test-driven-development/SKILL.md
Normal file
77
skills/test-driven-development/SKILL.md
Normal 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.
|
||||||
154
skills/wayfinder/ARTIFACTS.md
Normal file
154
skills/wayfinder/ARTIFACTS.md
Normal 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
176
skills/wayfinder/SKILL.md
Normal 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.
|
||||||
17
tests/skills/axi-review/basic-cli-review/case.md
Normal file
17
tests/skills/axi-review/basic-cli-review/case.md
Normal 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.
|
||||||
41
tests/skills/axi-review/basic-cli-review/fixture/greet
Executable file
41
tests/skills/axi-review/basic-cli-review/fixture/greet
Executable 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
|
||||||
Reference in New Issue
Block a user