setup
Interactive onboarding that turns a repo into a story-workflow project — merge-mode choice, verification gates with test-runner detection, gitignore wiring, optional project-specific reviewer personas. Use when asked to "set up the story workflow", "adopt stories", "story init", "install the story board", or when stories:plan / stories:work is wanted but .agents/shousper-stories/config.json does not exist yet. DO NOT TRIGGER when .agents/shousper-stories/config.json already exists (use stories:plan to file work, stories:work to execute it), for creating individual stories, or for project scaffolding unrelated to the story workflow.
- License 许可
- MIT
- 最近更新
- 2026-10-27
- Stars
- ★ 5
- Forks
- 2
01 前言 Front Matter
- name
- setup
- description
- Interactive onboarding that turns a repo into a story-workflow project — merge-mode choice, verification gates with test-runner detection, gitignore wiring, optional project-specific reviewer personas. Use when asked to "set up the story workflow", "adopt stories", "story init", "install the story board", or when stories:plan / stories:work is wanted but .agents/shousper-stories/config.json does not exist yet. DO NOT TRIGGER when .agents/shousper-stories/config.json already exists (use stories:plan to file work, stories:work to execute it), for creating individual stories, or for project scaffolding unrelated to the story workflow.
03 SKILL.md 正文
Story Workflow Setup
An interview, then story init writes everything. Never hand-write .agents/shousper-stories/config.json — the CLI owns the format.
Core principle: every answer becomes committed config; the gates you define here are what story done will enforce forever after. Get them runnable, not aspirational.
Preflight
- If
.agents/shousper-stories/config.jsonexists, this is reconfiguration — show the current config and confirm with your human partner before overwriting anything. - Confirm you are at the root of a git repository (
git rev-parse --show-toplevel). The board, worktrees, and locks are all repo-relative.
Interview
One topic at a time. Propose detected defaults; the human confirms or corrects.
1. Merge mode
| Mode | Who integrates | When to pick |
|---|---|---|
self |
The agent merges story/st-<id> into main when gates pass |
Solo, high trust, fastest iteration |
local |
Story parks in-review; human reviews the worktree and merges locally | Solo, human wants eyes on every change |
pr |
Push branch + GitHub PR; humans review/merge on GitHub | Teams ("multiplayer") |
If pr, probe before accepting the answer:
gh auth status # must be logged in
git remote get-url origin # must have a remote
gh repo view --json viewerPermission -q .viewerPermission # must be WRITE or ADMIN
Any probe fails → report exactly which one and what it said, and offer local as the fallback. Never configure pr mode on hope.
2. Gates
Detect the test runner from signature files and PROPOSE a test command gate:
| Signal | Proposed gate command |
|---|---|
bun.lock / bun.lockb |
bun test |
pnpm-lock.yaml |
pnpm test |
yarn.lock |
yarn test |
package-lock.json |
npm test |
Cargo.toml |
cargo test |
go.mod |
go test ./... |
pyproject.toml / pytest.ini |
pytest |
Justfile |
inspect just --list for test/check recipes |
Run the proposed command once, now. A gate that does not pass (or at least run) on the current tree is misconfigured — fix the command, or flag the broken baseline to the human before proceeding.
Then offer optional gates:
e2e— ifplaywright.config.*exists, proposenpx playwright testas a command gate.visual— a review gate: a capture command (screenshot script,just screenshot, a playwright capture) plus a persona (bundledvisual-reviewer, or a generated one). Offer only when the project has a UI.lint/build— if the project has obvious commands and the human wants them enforced per story.
Map type defaults: feature / bug / chore → ["test"]; add a ui type mapping to ["test", "visual"] only if a visual gate was defined.
Budgets: propose the defaults (maxStalls: 3 — consecutive turn ends without board progress before a run ends; maxFixRoundsPerStory: 3); change only on request.
3. Optional: project-specific personas
Offer to analyze the project (README, stack, domain) and generate reviewer personas into .agents/shousper-stories/personas/ — an api-contract-reviewer for a service, an art-director for a game. Model them on the bundled templates in stories:work's references/personas/ directory: inputs are the story file path + evidence paths; output is a single VERDICT: pass|fail line plus notes. A gate's persona field names the file; .agents/shousper-stories/personas/<name>.md wins over bundled templates.
Skip freely — the bundled qa-reviewer and visual-reviewer cover most projects.
Apply
-
Assemble the config object and write it to a scratch file, then run
story init --config <file>. The CLI writes.agents/shousper-stories/config.json, scaffoldsstories/+stories/archive/, and prints what it created. Config shape:{ "version": 1, "storiesDir": "stories", "merge": "self", "gates": { "test": { "kind": "command", "run": "bun test" }, "visual": { "kind": "review", "capture": "just screenshot", "persona": "visual-reviewer" } }, "defaults": { "feature": ["test"], "bug": ["test"], "chore": ["test"] }, "gateLock": true, "budgets": { "maxStalls": 3, "maxFixRoundsPerStory": 3 } } -
Ensure
.gitignorecontains each of these two lines exactly (append the missing ones; nothing else):.worktrees/ .agents/shousper-stories/local/ -
Verify:
story doctorreports a clean board;cat .agents/shousper-stories/config.jsonmatches the approved answers. -
Remind the human to commit
.agents/shousper-stories/config.json(andpersonas/if generated) and thestories/scaffold — the committed marker is what activates the hooks for every session in this repo. Same-machine assumption is hard: parallel workers coordinate through file locks; workers on other machines or network filesystems are not supported.
Handoff
Setup ends with exactly one of:
- A spec or design exists → invoke stories:plan to decompose it into stories. Do NOT invoke any other skill.
- Nothing to plan yet → stop. Tell the human: file work later with stories:plan; execute with stories:work.
Red Flags
Never:
- Write
.agents/shousper-stories/config.jsonby hand — always throughstory init. - Configure a gate command you have not executed successfully at least once.
- Configure
prmode with failingghprobes. - Invent gates the project cannot support (no UI → no visual gate).
- Skip the gitignore entries — loop state and locks must never be committed.
04 同仓库更多 Skills
writing-docs
Use when creating or editing documentation of any kind, including Markdown, RST, or HTML pages, READMEs, design docs, ADRs, changelogs, docstrings, and comment blocks. Covers document purpose, headings, paragraphs, lists, procedures, notices, cross-references, code samples, placeholders, example data, and word choice for technical writing.
work
Runs the story worker loop in a story-workflow project — claim ready stories, implement each in its own worktree, close through verification gates, repeat until the goal is met or the loop stalls. Use when asked to "work the board", "complete all stories", "work on epic st-XXXX", "pick up the next story", "start a worker", or to resume or continue a story run — and when a loop re-prompt names the next story in a session that started the loop. DO NOT TRIGGER without .agents/shousper-stories/config.json (use stories:setup first), for decomposing a spec into stories (stories:plan), or to stop a run (stories:cancel).
using-stories
Compressed story-workflow rulebook, injected automatically at session start (including after compaction) in projects with .agents/shousper-stories/config.json. Use when unsure of the workflow rules mid-session, when asked "how does the story workflow work here", or for a story CLI quick reference. DO NOT TRIGGER in projects without .agents/shousper-stories/config.json, to set up the workflow (stories:setup), to file stories (stories:plan), or to run the loop (stories:work).
plan
Decomposes a spec or approved design into epics and stories on the story board — sized, dependency-ordered, gated, human-approved, then filed via the story CLI. Use in a project with .agents/shousper-stories/config.json when there is a design doc (often from kit:brainstorming), spec, requirements file, or feature request to break down; it replaces kit:writing-plans in the workflow chain for story-based projects. Also use for "file stories", "break this into stories", "populate the board". DO NOT TRIGGER in projects without .agents/shousper-stories/config.json (use kit:writing-plans), for executing stories (stories:work), or for filing a single discovered-work story mid-loop (plain story create).
cancel
Stops an active story loop and reports where the board stands. Use when asked to "stop the loop", "cancel the story run", "halt autonomous story work", "kill the worker loop", or when a runaway run must be shut down. DO NOT TRIGGER for closing a single story (that is story done inside stories:work), for deleting or archiving stories, or for removing the story workflow from a project.
writing-skills
Creates, edits, and tests Claude skill files (SKILL.md) using TDD methodology with baseline pressure testing and rationalization defense. Use when writing a new skill, modifying an existing skill, optimizing a skill description for discovery (CSO), testing whether a skill triggers correctly, or structuring skill documentation. Enforces RED-GREEN-REFACTOR for process documentation.