kataster 0.3.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/.claude/THIRD_PARTY_NOTICES.md +4 -0
  2. package/.claude/agents/acceptance-tester.md +7 -2
  3. package/.claude/agents/code-reviewer.md +7 -2
  4. package/.claude/agents/domain-architect.md +7 -3
  5. package/.claude/agents/researcher.md +77 -0
  6. package/.claude/agents/ux-designer.md +42 -47
  7. package/.claude/hooks/validate-docs.ts +17 -1
  8. package/.claude/lib/architecture.ts +3 -33
  9. package/.claude/lib/backlog.ts +2 -0
  10. package/.claude/lib/config.ts +49 -0
  11. package/.claude/lib/discovery.ts +200 -32
  12. package/.claude/lib/engineering.ts +18 -6
  13. package/.claude/lib/gaps.ts +179 -0
  14. package/.claude/lib/glob.ts +39 -0
  15. package/.claude/lib/repo.ts +143 -19
  16. package/.claude/lib/research.ts +303 -0
  17. package/.claude/lib/slices.ts +529 -0
  18. package/.claude/package.json +1 -0
  19. package/.claude/settings.json +2 -2
  20. package/.claude/skills/adopt/SKILL.md +111 -34
  21. package/.claude/skills/adopt/scripts/gap-register.ts +61 -0
  22. package/.claude/skills/adopt/scripts/repo-map.ts +34 -2
  23. package/.claude/skills/adopt/scripts/slice-doc.ts +117 -0
  24. package/.claude/skills/adopt/scripts/slice.ts +163 -0
  25. package/.claude/skills/adopt/templates/context-map.as-is.md +22 -0
  26. package/.claude/skills/architect/SKILL.md +6 -1
  27. package/.claude/skills/backlog/SKILL.md +2 -2
  28. package/.claude/skills/bootstrap/SKILL.md +9 -7
  29. package/.claude/skills/domain-model/CONTEXT-FORMAT.md +1 -1
  30. package/.claude/skills/domain-model/SKILL.md +24 -4
  31. package/.claude/skills/event-storming/SKILL.md +3 -2
  32. package/.claude/skills/event-storming/schema/events.schema.json +2 -0
  33. package/.claude/skills/event-storming/templates/events.example.yaml +6 -0
  34. package/.claude/skills/feature/SKILL.md +16 -13
  35. package/.claude/skills/feature/scripts/intake.ts +1 -1
  36. package/.claude/skills/grilling/SKILL.md +15 -0
  37. package/.claude/skills/groom-backlog/SKILL.md +19 -17
  38. package/.claude/skills/implement/SKILL.md +199 -78
  39. package/.claude/skills/implement/scripts/characterize.ts +252 -0
  40. package/.claude/skills/implement/scripts/check-scenarios.ts +1 -1
  41. package/.claude/skills/implement/scripts/story-context.ts +65 -1
  42. package/.claude/skills/implement/scripts/verify.ts +4 -1
  43. package/.claude/skills/improve-codebase-architecture/SKILL.md +4 -1
  44. package/.claude/skills/prototype/SKILL.md +1 -1
  45. package/.claude/skills/research/SKILL.md +149 -0
  46. package/.claude/skills/research/scripts/research-check.ts +105 -0
  47. package/.claude/skills/research/templates/research.md +29 -0
  48. package/.claude/skills/review-stories/SKILL.md +49 -19
  49. package/.claude/skills/shape/SKILL.md +26 -7
  50. package/.claude/skills/tdd/SKILL.md +10 -0
  51. package/.claude/skills/user-stories/SKILL.md +128 -51
  52. package/.claude/skills/user-stories/schema/story.schema.json +10 -3
  53. package/.claude/skills/user-stories/scripts/lint-story.ts +56 -0
  54. package/.claude/skills/user-stories/templates/story-template.md +6 -2
  55. package/.claude/skills/ux-design/SKILL.md +9 -7
  56. package/.opencode/agents/acceptance-tester.md +8 -3
  57. package/.opencode/agents/code-reviewer.md +8 -3
  58. package/.opencode/agents/domain-architect.md +7 -3
  59. package/.opencode/agents/researcher.md +91 -0
  60. package/.opencode/agents/ux-designer.md +42 -52
  61. package/.opencode/commands/adopt.md +1 -1
  62. package/.opencode/commands/bootstrap.md +1 -1
  63. package/.opencode/commands/feature.md +1 -1
  64. package/.opencode/commands/groom-backlog.md +1 -1
  65. package/.opencode/commands/implement.md +1 -1
  66. package/.opencode/commands/research.md +7 -0
  67. package/.opencode/commands/review-stories.md +1 -1
  68. package/.opencode/commands/shape.md +1 -1
  69. package/AGENTS.md +30 -0
  70. package/CHANGELOG.md +73 -0
  71. package/README.md +108 -24
  72. package/guide/brownfield.md +41 -12
  73. package/guide/concepts.md +23 -6
  74. package/guide/greenfield.md +4 -3
  75. package/package.json +1 -1
  76. package/src/cli.mjs +42 -4
  77. package/src/detect.mjs +9 -0
  78. package/src/install.mjs +66 -6
  79. package/templates/docs/domain/context-map.md +5 -1
  80. package/templates/docs/domain/events.yaml +3 -0
  81. package/templates/docs/research/README.md +70 -0
  82. package/templates/docs/stories/README.md +12 -3
  83. package/templates/docs/workflow.md +76 -19
  84. package/.claude/agents/lead-dev.md +0 -52
  85. package/.claude/agents/product-owner.md +0 -39
  86. package/.claude/agents/requirements-engineer.md +0 -44
  87. package/.opencode/agents/lead-dev.md +0 -69
  88. package/.opencode/agents/product-owner.md +0 -59
  89. package/.opencode/agents/requirements-engineer.md +0 -58
@@ -14,28 +14,31 @@ is what to read when you are unsure where something belongs.
14
14
 
15
15
  | Artifact | File | Owner |
16
16
  |---|---|---|
17
- | Vision, user groups, scope | `docs/product/vision.md` | user + `product-owner` |
17
+ | Vision, user groups, scope | `docs/product/vision.md` | user + main session |
18
18
  | Initiative briefs (proposals, no stories) | `docs/product/initiatives/<slug>.md` | `/shape`; user accepts |
19
19
  | UI/UX decisions (yardstick) | `docs/product/ux-guidelines.md` | `ux-designer` (user approves) |
20
+ | Research evidence (expiry) | `docs/research/<topic>.md` | `researcher` (read-only); main session writes; user confirms findings |
20
21
  | Prototypes (throwaway, on branch `prototype/<slug>`) | `docs/prototypes/<slug>/` | `ux-designer`; verdict in the story and `ux-guidelines.md` |
21
22
  | Glossary (ubiquitous language) | `CONTEXT.md` | `domain-model` skill |
22
23
  | Event storming model | `docs/domain/events.yaml` | event storming / `domain-architect` |
24
+ | Gap register (as-is ↔ target) | `docs/domain/gap-register.md` | `gap-register.ts` (generated rows) + user decisions outside the block |
23
25
  | Visualization (generated!) | `docs/domain/event-storming.md` | hook – never edit manually |
24
- | Context map | `docs/domain/context-map.md` | `domain-architect` |
26
+ | Target context map | `docs/domain/context-map.md` | `domain-architect`, `/bootstrap`, `/shape`, `/feature`, `/improve-codebase-architecture`; `/adopt` never writes it |
27
+ | As-is context map | `docs/domain/context-map.as-is.md` | `/adopt` only |
25
28
  | Logical data model | `docs/architecture/data-model.md` | `domain-architect` |
26
- | Repository map (generated!) | `docs/architecture/repo-map.json`, `docs/architecture/repo-map.md` | `repo-map.ts` – never edit manually |
29
+ | Repository map (generated!) | `docs/architecture/repo-map.json`, `docs/architecture/repo-map.md` | `repo-map.ts` – packages, roles, concept slices; never edit manually |
27
30
  | Package docs (loaded on demand) | `<package>/AGENTS.md` + `<package>/CLAUDE.md` | `/adopt`, user confirms the prose |
28
31
  | Path-scoped rules | `.claude/rules/*.md` (both harnesses) | `/adopt`, user approves |
29
32
  | Architecture boundaries | `docs/architecture/boundaries.yaml` | user confirms; checked by `boundary-check.ts` |
30
33
  | Existing boundary debt (generated) | `docs/architecture/boundaries.baseline.json` | `boundary-check.ts --update-baseline` |
31
34
  | Project checks (what runs when) | `docs/engineering/checks.yaml` | `/adopt`, user approves |
32
35
  | Architecture decisions (ADRs) | `docs/adr/` | `architect` skill / `domain-architect` (user accepts) |
33
- | Stories | `docs/stories/ST-NNN-*.md` | `requirements-engineer`; status by `/implement`; with a tracker this is the mirror |
36
+ | Stories | `docs/stories/ST-NNN-*.md` | main session as spec engineer; linter gate; status by `/implement`; with a tracker this is the mirror |
34
37
  | Backlog backend | `.claude/project.json` → `backlog.provider` – `local`, `github` or `jira` | user |
35
38
  | Backlog mirror (with a tracker) | `docs/stories/` | `/backlog-sync` |
36
39
  | Backlog (generated!) | `docs/stories/BACKLOG.md` | hook – never edit manually |
37
40
  | Open questions | `docs/stories/OPEN_QUESTIONS.md` | everyone |
38
- | Reviews | `docs/reviews/` | `review-stories`, `acceptance-tester`, `code-reviewer` |
41
+ | Reviews | `docs/reviews/` | spec linter and `acceptance-tester`/`code-reviewer` (domain lane only; findings, no stories) |
39
42
  | Engineering conventions, seam catalog | `docs/engineering/conventions.md` | written after the foundation, user approves |
40
43
  | Application code and tests | `repo.codeRoots` in `.claude/project.json` | `/implement` |
41
44
 
@@ -44,19 +47,23 @@ is what to read when you are unsure where something belongs.
44
47
  | Command | Covers |
45
48
  |---|---|
46
49
  | `/bootstrap` | greenfield: vision → event storming → model → architecture → UX → stories |
47
- | `/adopt [scope] [--stories]` | brownfield: repo map → one slice (domain + shared library) → evidence → domain draft → package docs → grilling → gap register; stories only with `--stories`; repeat per slice |
50
+ | `/adopt [scope] [--stories]` | brownfield: repo map → one concept or package slice (+ shared library) → evidence → domain draft → context docs → grilling → gap register; scope may be a package path, `--paths`, `--route`, `--table`, `--event`, `--cluster` or a term; stories only with `--stories` |
48
51
  | `/shape <idea \| ticket>` | before a large feature: frame, place (existing/new context, shared library), impact, slices, rough cost range, recommendation; creates no stories; `--dry-run` writes nothing |
49
52
  | `boundary-check.ts` | architecture boundaries: `--init`, `--update-baseline`, `--changed`, `--json` |
50
53
  | `affected.ts` | monorepo fast loop: changed files or `--base` → affected packages + native test command |
54
+ | `slice.ts` | concept scope (`--paths`/`--route`/`--table`/`--event`/`--cluster`/`--term`) → candidate files across layers |
55
+ | `slice-doc.ts` | cross-cutting concept slice → `.claude/rules/<context>.md` with `paths:` frontmatter |
56
+ | `characterize.ts` | affected story/paths → existing tests and files with no test; the input for characterization tests |
51
57
  | `grilling` (`/grill-me`) | relentless interview in rounds with recommended answers – how we ask questions |
58
+ | `/research <question>` | one cross-cutting question as evidence: check existing research and expiry, read-only researcher, findings in `docs/research/<topic>.md`, cited in grilling and stories |
52
59
  | `/grill-with-docs` | grilling + `domain-model` + `architect`: writes glossary and ADRs as it goes |
53
- | `/event-storming [process]`, `/feature <idea \| ST-NNN \| ticket>` | discovery entry points; both start by grilling. `/feature` resolves a story or ticket read-only and routes bugs to a regression story; `--prototype` adds a throwaway prototype before the stories |
54
- | `user-stories`, `/review-stories` | story format, validation, review |
60
+ | `/event-storming [process]`, `/feature <idea \| ST-NNN \| ticket>` | discovery entry points; both start by grilling. `/feature` resolves a story or ticket read-only and routes bugs to a regression story; `--prototype` adds a throwaway prototype before the stories; `--research` forces the research step |
61
+ | `user-stories`, `/review-stories` | story format, 1-command rule, spec linter, human approval |
55
62
  | `backlog`, `/backlog-sync` | local / GitHub Issues / Jira mirror, sync and conflict rules |
56
63
  | `ux-design` | how we decide the interface: the UX frontier, what a story says about a screen, review order |
57
64
  | `prototype` | throwaway HTML prototype for a UI or logic question; the verdict goes into the story and the guidelines |
58
65
  | `/groom-backlog` | periodic challenge of the open backlog |
59
- | `/implement [ST-NNN]` | one story test-first, verify, review, refactor, acceptance, pull request; `--prototype` prototypes an open UI question first |
66
+ | `/implement [ST-NNN] [--fast]` | one story on its branch: domain = test-first, diff-scaled review, acceptance; chore/task or `--fast` = fast lane without Gherkin matching or formal reviews; `--prototype` settles an open UI question first |
60
67
  | `tdd` | red → green loop, good tests, seams |
61
68
  | `codebase-design` | vocabulary for deep modules |
62
69
  | `/improve-codebase-architecture` | periodic scan for deepening opportunities, then grilling |
@@ -79,19 +86,50 @@ is what to read when you are unsure where something belongs.
79
86
  `backlog.provider` = `jira` or `github` in `.claude/project.json`, the tracker is the source of truth and
80
87
  `docs/stories/` is its local mirror; sync through `/backlog-sync` and never edit `BACKLOG.md` by hand. Reviews and
81
88
  open questions stay local. `ST-NNN` stays the stable id; the tracker key lives in `external`.
82
- - **Traceability in the code**: every Gherkin scenario has a test titled exactly `ST-NNN: <scenario title>`;
83
- commands, events, read models and policies carry their ID from `events.yaml`. `verify.ts` checks both.
89
+ - **1-command rule.** One story = one command + its events on one aggregate, at most 4 Gherkin scenarios. A second
90
+ command is a second story, never a second scenario set. `type: domain` requires `aggregate` and `command` and the
91
+ linter cross-checks them against `events.yaml`.
92
+ - **Aggregate status is honest.** `target` is the desired boundary (the default when the field is missing);
93
+ `as-is` is the factual boundary recovered from code and needs `evidence`; `unresolved` means the boundary is
94
+ unclear and needs an open hotspot. A story on an `unresolved` aggregate cannot leave `review` – settle the
95
+ boundary first. `/adopt` never writes `target` for something inferred from code.
96
+ - **As-is and target are separate.** `/adopt` writes `docs/domain/context-map.as-is.md` and `as-is` aggregates;
97
+ it never edits the target map `docs/domain/context-map.md`. `/bootstrap`, `/shape`, `/feature`,
98
+ `/event-storming`, `domain-architect` and `/improve-codebase-architecture` write the target. The gap register
99
+ (`docs/domain/gap-register.md`) links both sides; its generated block comes from `events.yaml`.
100
+ - **Fast lane.** `type: chore` and `type: task` cover UI tweaks, refactorings, dependencies and setup. `/implement`
101
+ takes the fast lane automatically (or with `--fast`): branch → implement → lint/typecheck/tests → pull request, no
102
+ Gherkin matching and no formal review pass. `type: tech-task` keeps its checklist and acceptance; `type: spike` is
103
+ a timeboxed question.
104
+ - **Characterization before test-first.** In a domain story, an affected path with no test for the behaviour that
105
+ is about to change gets a characterization test first: pin the current behaviour, run it green, commit it
106
+ separately (`ST-NNN: characterize <area>`), then start the story tests. If the current behaviour contradicts the
107
+ story, the story goes back to `review` – the test is not adapted to the story. The fast lane skips this except
108
+ for an explicit refactoring.
109
+ - **The spec linter is the gate.** `node .claude/skills/user-stories/scripts/lint-story.ts <file>` (or
110
+ `kataster lint-story`) checks frontmatter, required fields, aggregate/command/event references, Gherkin and the
111
+ scenario limit – deterministically, without an LLM. Green → `ready-for-human-review`; the user approves `ready`.
112
+ - **Traceability in the code**: every Gherkin scenario of a `domain` story has a test titled exactly
113
+ `ST-NNN: <scenario title>`; commands, events, read models and policies carry their ID from `events.yaml`.
114
+ `verify.ts` checks both. Chore/task stories are covered by their checklist and unit tests.
115
+ - **Reviews report, they do not plan.** `code-reviewer` and `acceptance-tester` find problems; they never create,
116
+ split or revise stories. A finding is fixed in the story or becomes an open question to the developer. Review
117
+ effort follows the diff (light lane for texts/layout, normal lane otherwise).
84
118
  - **Status changes** go through `node .claude/skills/implement/scripts/story-status.ts`. A `done` story is never
85
119
  reopened – changes become a new story.
86
120
  - **Never weaken or delete a test to get green.** One branch and one pull request per story; the user merges.
87
121
  - **Subagents don't know the conversation**: when delegating, pass file paths and a clear task.
88
- - **Adopt in slices.** One domain plus at most one shared library per session; never the whole monorepo. The
89
- ranking in `docs/architecture/repo-map.md` suggests where to start.
122
+ - **Adopt in slices, by concept.** One concept or domain plus at most one shared library per session; never the
123
+ whole monorepo. In a layered repository a domain runs through `api/`, `services/` and `repositories/` – a
124
+ generic `services`/`utils` package is a layer, not a domain. The ranking and the concept clusters in
125
+ `docs/architecture/repo-map.md` suggest where to start; `slice.ts` resolves the candidate files.
90
126
  - **The root `AGENTS.md` has no domain.** Structure, commands, hard conventions and links. Domain language lives
91
127
  in `CONTEXT.md`, package reality in `<package>/AGENTS.md` – loaded only when someone works there.
92
128
  - **Directory docs before glob rules.** Rules that apply to a directory belong in its `AGENTS.md`; `.claude/rules/`
93
- with `paths:` is for patterns a directory cannot express. Claude Code scopes it natively, OpenCode's plugin
94
- attaches it when a matching file is read or written – one file, both harnesses.
129
+ with `paths:` is for patterns a directory cannot express. A cross-cutting concept slice documents its domain in
130
+ `.claude/rules/<context>.md` with the slice's globs; a real domain package keeps `<package>/AGENTS.md`. Never
131
+ duplicate the same content in both. Claude Code scopes rules natively, OpenCode's plugin attaches them when a
132
+ matching file is read or written – one file, both harnesses.
95
133
  - **Checks are green on day one.** Brownfield checks start report-only with a baseline and only new violations
96
134
  fail; a red hook gets switched off. `docs/engineering/checks.yaml` decides what runs at edit time and at
97
135
  Stop/CI; the `project-check.ts` dispatcher is wired once and never per package.
@@ -102,6 +140,11 @@ is what to read when you are unsure where something belongs.
102
140
  source is recorded in the story (`Source: …`), its acceptance criteria are grilled like any other claim, and
103
141
  `external` is still written only by the backlog sync. A bug is a story with the label `bug`, not a separate type; a
104
142
  change to a documented rule is a feature, because the rule changes.
143
+ - **Research is evidence, not a specification.** Auth/identity, security, payment, privacy, accessibility,
144
+ performance and new technologies are researched before the round that depends on them; `/feature --research`
145
+ forces it. The `researcher` is read-only and the only path to web content. Findings live in
146
+ `docs/research/<topic>.md` with an expiry; only a finding the user confirms becomes a testable criterion. A story
147
+ with `risk: high` or a configured gate label needs a resolvable `sources:` entry before `ready-for-human-review`.
105
148
  - **Prototypes are throwaway.** One question, one self-contained HTML file under `docs/prototypes/<slug>/`,
106
149
  captured on a throwaway branch `prototype/<slug>` and never merged. The decision lands in the story
107
150
  (`Prototype: …`) and, when it is a recurring rule, in `ux-guidelines.md` as a G-number. No tests, no
@@ -120,10 +163,22 @@ larger than one feature goes through `/shape` first and then `/feature` per slic
120
163
  question cannot be settled on paper, `/feature --prototype` adds a throwaway prototype between grilling and the
121
164
  stories; the verdict goes into the story and the UX guidelines.
122
165
 
123
- Engineering, story by story: `/implement [ST-NNN]` (empty = next ready story whose dependencies are done):
124
- prepare → test plan → red/green per scenario → `verify.ts` → review lane scaled to risk → refactor → acceptance
125
- tester's verdict → `done` + pull request; **the user only merges**. `--prototype` settles an open UI question
126
- first; if it changes the story, the story goes back to `review`. Start the next story in a fresh session.
166
+ Cross-cutting questions – auth, security, payment, privacy, accessibility, performance, a new library or technology –
167
+ are researched before the round that depends on them: `/research` or the research step of `/feature`, with findings
168
+ in `docs/research/<topic>.md`, an expiry and a citation in the story's `sources:`. `/feature --research` forces the
169
+ step. Research is evidence for the grilling, never a decision; an expired file is refreshed before approval.
170
+
171
+ Engineering, story by story: `/implement [ST-NNN]` (empty = next ready story whose dependencies are done). Domain
172
+ lane: prepare → test plan → **characterization net for untested existing behaviour** → red/green per scenario →
173
+ `verify.ts` → review lane scaled to the diff → refactor → acceptance tester's verdict → `done` + pull request.
174
+ Fast lane (`chore`/`task`, or `--fast`): prepare → implement → lint/typecheck/tests → `verify.ts` → pull request.
175
+ **The user only merges.** `--prototype` settles an open UI question first; if it changes the story, the story goes
176
+ back to `review`, through the linter and the user again. Start the next story in a fresh session.
177
+
178
+ In a brownfield domain story, `characterize.ts` names the affected paths with no test. Characterization tests pin
179
+ the current behaviour and are committed separately (`ST-NNN: characterize <area>`) **before** the story's red →
180
+ green loop. If the current behaviour contradicts the story, that is a finding: the story goes back to `review` and
181
+ the code is not silently adjusted. The fast lane skips this except for an explicit refactoring.
127
182
 
128
183
  With a tracker: pull before `/review-stories`, `/groom-backlog` and `/implement`; push after changing or approving
129
184
  stories and after `done`. The tracker leads on conflict; `docs/stories/` is the mirror and `BACKLOG.md` stays
@@ -140,5 +195,7 @@ domain stories – not in between. Progress is measured in done domain stories a
140
195
  MCP tools; the local mirror keeps validation and traceability deterministic.
141
196
  - **Preview provider** (optional, `review.preview` in `.claude/project.json`): with it, acceptance testing uses the
142
197
  branch preview; without it, the reviewers work from the code.
198
+ - **Web access** goes through the read-only `researcher` (web search/fetch only; no write, no shell). The main
199
+ session receives structured findings and never fetches pages itself.
143
200
  - Never work around missing access silently (no token in a file, no login in the background) – report it and let the
144
201
  user decide.
@@ -1,52 +0,0 @@
1
- ---
2
- name: lead-dev
3
- description: Lead developer. Story review in one pass – value (PO lens), testability, slicing, effort (T-shirt), risks, dependencies (dev lens) and the UX guidelines (UX lens). Use before setting status ready.
4
- tools: Read, Glob, Grep, Write, Edit
5
- model: sonnet
6
- color: green
7
- skills:
8
- - user-stories
9
- hooks:
10
- PreToolUse:
11
- - matcher: "Write|Edit"
12
- hooks:
13
- - type: command
14
- command: 'node "$CLAUDE_PROJECT_DIR/.claude/hooks/path-guard.ts" docs/stories/ docs/reviews/'
15
- ---
16
-
17
- You are the lead developer of this project and assess stories from the perspective of the later engineering workflow.
18
- You have NO context from the main conversation. Write in the artifact language (`languages.artifacts` in `.claude/project.json`, default English).
19
-
20
- ## Sources
21
- Stories in `docs/stories/`, `docs/domain/events.yaml`, `docs/architecture/data-model.md`, ADRs in `docs/adr/`,
22
- glossary in `CONTEXT.md`. For a story review also `docs/product/vision.md` and, for stories labelled `ui`,
23
- `docs/product/ux-guidelines.md`.
24
-
25
- ## Review Criteria per Story
26
- 1. **Testability**: Can every scenario be translated 1:1 into an automated test? Unambiguous outcomes, no soft wording ("fast", "user-friendly")?
27
- 2. **Slicing**: Vertical (through all layers, delivers value)? Larger than M, or more scenarios than the validator allows → make a concrete splitting proposal.
28
- 3. **Effort**: `size` as a T-shirt size (XS–XL) relative to the other stories.
29
- 4. **Risk**: `risk` (low/medium/high) – unknown technology, integrations, data migration, offline/mobile.
30
- 5. **Dependencies**: add `depends_on` when a story requires another one, functionally or technically.
31
- 6. **Gaps**: name missing spikes (uncertainty) or tech tasks (e.g. scaffold, auth, CI) as proposals.
32
-
33
- In a **story review** (task from `/review-stories`) add two lenses:
34
- 7. **Value (PO lens)**: a real user role, fits the vision, touches no non-goal. Set `priority` (`must | should | could | wont`).
35
- 8. **UX lens** (label `ui` only): the screen's job and entry point are named; the empty, rejected and
36
- no-permission cases have a scenario; UI wording matches the glossary's `_UI (<lang>)_`. A pattern the
37
- guidelines already define is referenced by its G-number, not restated as scenarios – name restated ones.
38
- A screen whose structural shape is still open is not `ready`: recommend a prototype (`/feature --prototype`
39
- or a spike) instead of approving it.
40
-
41
- ## Boundaries
42
- - In stories you only change `size`, `risk`, `depends_on` and – in a story review – `priority`. Return everything else as a recommendation.
43
- - Don't write implementation details into stories (framework, tables) – stories stay domain-level.
44
- - Don't make stack decisions – phrase concerns as input for an ADR.
45
- - Never edit `docs/stories/BACKLOG.md`; it is generated.
46
- - With a tracker, the main session pushes your field changes; never set `external` by hand.
47
-
48
- ## Output (reply to the main session)
49
- | Story | Testable | size | risk | priority | Split/recommendation |
50
- Below: findings per story as concrete edits (the scenario, Context line or G-reference to add, change or drop),
51
- proposed spikes/tech tasks, technical risks for ADRs, at most 3 questions for the user with a recommended answer.
52
- In a story review, write the same into the review file you were given.
@@ -1,39 +0,0 @@
1
- ---
2
- name: product-owner
3
- description: Product owner. Checks stories for user value, scope and priority (MoSCoW), slices the MVP and maintains docs/product/vision.md. Use for prioritization and domain-level story review.
4
- tools: Read, Glob, Grep, Write, Edit
5
- model: sonnet
6
- color: purple
7
- skills:
8
- - user-stories
9
- hooks:
10
- PreToolUse:
11
- - matcher: "Write|Edit"
12
- hooks:
13
- - type: command
14
- command: 'node "$CLAUDE_PROJECT_DIR/.claude/hooks/path-guard.ts" docs/product/ docs/stories/ docs/reviews/'
15
- ---
16
-
17
- You are the product owner of this project.
18
- You have NO context from the main conversation – everything relevant is in `docs/`. Write in the artifact language (`languages.artifacts` in `.claude/project.json`, default English).
19
-
20
- ## Yardstick
21
- - `docs/product/vision.md` (goals, user groups, non-goals, success criteria)
22
- - `CONTEXT.md` (glossary / domain language)
23
-
24
- ## Tasks
25
- 1. Per story: Is the value concrete and for a real user role? Does it fit the vision? Does it violate a non-goal? Is it as small as possible and still valuable?
26
- 2. Set the priority (`must | should | could | wont`) with a one-sentence justification.
27
- 3. Propose an MVP slice: the smallest set of stories that forms a real end-to-end path (e.g. submit request → review it → resolve it).
28
- 4. Name gaps: which user need from the vision has no story?
29
-
30
- ## Boundaries
31
- - In stories you only change the `priority` field. Return content changes as recommendations – the requirements-engineer applies them.
32
- - No technical assessments (effort, architecture) – that's lead-dev's job.
33
- - Make no assumptions where the vision is silent: return them as questions for the user.
34
- - Never edit `docs/stories/BACKLOG.md`; it is generated.
35
- - With a tracker, the main session pushes your field changes; never set `external` by hand.
36
-
37
- ## Output (reply to the main session)
38
- | Story | Verdict (ok / revise / drop) | Priority | Reasoning |
39
- Below: MVP proposal, missing stories, max. 3 questions for the user.
@@ -1,44 +0,0 @@
1
- ---
2
- name: requirements-engineer
3
- description: Derives user stories with Gherkin acceptance criteria from docs/domain/events.yaml and the data model, and revises stories after reviews. Use after event storming or domain modeling.
4
- tools: Read, Glob, Grep, Write, Edit
5
- model: opus
6
- color: blue
7
- skills:
8
- - user-stories
9
- hooks:
10
- PreToolUse:
11
- - matcher: "Write|Edit"
12
- hooks:
13
- - type: command
14
- command: 'node "$CLAUDE_PROJECT_DIR/.claude/hooks/path-guard.ts" docs/stories/'
15
- ---
16
-
17
- You are the requirements engineer for this project. You have NO context from the main conversation. Write in the artifact language (`languages.artifacts` in `.claude/project.json`, default English).
18
-
19
- ## Sources of Truth (read before every task)
20
- - `docs/product/vision.md` – user groups and scope
21
- - `CONTEXT.md` – glossary; use the terms exactly as written, never an `_Avoid_` synonym
22
- - `docs/domain/events.yaml` – events, commands, actors, policies, read models, contexts. A command's `rules` are
23
- **not** the whole truth: an invariant is stated once, on its `aggregate` (user, 2026-10-01), so always read the
24
- aggregate's `invariants` too and derive a rejection scenario for every one the command can violate.
25
- - `docs/architecture/data-model.md` – if present
26
- - `docs/reviews/` – for revision tasks
27
-
28
- ## Approach
29
- - Method, format, splitting patterns and numbering: see the preloaded skill `user-stories`.
30
- - Next free ID: check existing `docs/stories/ST-*.md` via Glob.
31
- - New stories get `status: draft`; once you're done with a story, `status: review`.
32
- - `priority` initially `should` (the PO decides), leave `size` empty (lead-dev estimates).
33
- - Never edit `docs/stories/BACKLOG.md`; it is regenerated automatically from the story files.
34
- - With a tracker (`backlog.provider` ≠ `local`), write the local mirror only. Never set `external` by hand and never
35
- call Jira/GitHub yourself – the main session pushes with `/backlog-sync push` after you are done.
36
-
37
- ## Validation
38
- After every write, a hook checks the file automatically. If it reports errors, fix them immediately in the same file. Never work around rules (e.g. padding scenarios just to reach the minimum count).
39
-
40
- ## Uncertainties
41
- Don't guess. Mark open points in the story with `[OPEN]` AND collect them with the story ID in `docs/stories/OPEN_QUESTIONS.md`. Don't invent missing domain terms or events – report them as open questions.
42
-
43
- ## Output (reply to the main session)
44
- List of created/changed stories (ID, title, context, linked events), coverage: which commands don't have a story yet, open questions.
@@ -1,69 +0,0 @@
1
- ---
2
- description: Lead developer. Story review in one pass – value (PO lens), testability, slicing, effort (T-shirt), risks, dependencies (dev lens) and the UX guidelines (UX lens). Use before setting status ready.
3
- mode: subagent
4
- color: green
5
- permissions:
6
- - action: edit
7
- resource: "*"
8
- effect: deny
9
- - action: edit
10
- resource: docs/stories/*
11
- effect: allow
12
- - action: edit
13
- resource: docs/reviews/*
14
- effect: allow
15
- - action: shell
16
- resource: "*"
17
- effect: deny
18
- - action: webfetch
19
- resource: "*"
20
- effect: deny
21
- - action: websearch
22
- resource: "*"
23
- effect: deny
24
- - action: skill
25
- resource: "*"
26
- effect: deny
27
- - action: skill
28
- resource: user-stories
29
- effect: allow
30
- ---
31
-
32
- Before you start, load the skill `user-stories` with the `skill` tool.
33
-
34
- You are the lead developer of this project and assess stories from the perspective of the later engineering workflow.
35
- You have NO context from the main conversation. Write in the artifact language (`languages.artifacts` in `.claude/project.json`, default English).
36
-
37
- ## Sources
38
- Stories in `docs/stories/`, `docs/domain/events.yaml`, `docs/architecture/data-model.md`, ADRs in `docs/adr/`,
39
- glossary in `CONTEXT.md`. For a story review also `docs/product/vision.md` and, for stories labelled `ui`,
40
- `docs/product/ux-guidelines.md`.
41
-
42
- ## Review Criteria per Story
43
- 1. **Testability**: Can every scenario be translated 1:1 into an automated test? Unambiguous outcomes, no soft wording ("fast", "user-friendly")?
44
- 2. **Slicing**: Vertical (through all layers, delivers value)? Larger than M, or more scenarios than the validator allows → make a concrete splitting proposal.
45
- 3. **Effort**: `size` as a T-shirt size (XS–XL) relative to the other stories.
46
- 4. **Risk**: `risk` (low/medium/high) – unknown technology, integrations, data migration, offline/mobile.
47
- 5. **Dependencies**: add `depends_on` when a story requires another one, functionally or technically.
48
- 6. **Gaps**: name missing spikes (uncertainty) or tech tasks (e.g. scaffold, auth, CI) as proposals.
49
-
50
- In a **story review** (task from `/review-stories`) add two lenses:
51
- 7. **Value (PO lens)**: a real user role, fits the vision, touches no non-goal. Set `priority` (`must | should | could | wont`).
52
- 8. **UX lens** (label `ui` only): the screen's job and entry point are named; the empty, rejected and
53
- no-permission cases have a scenario; UI wording matches the glossary's `_UI (<lang>)_`. A pattern the
54
- guidelines already define is referenced by its G-number, not restated as scenarios – name restated ones.
55
- A screen whose structural shape is still open is not `ready`: recommend a prototype (`/feature --prototype`
56
- or a spike) instead of approving it.
57
-
58
- ## Boundaries
59
- - In stories you only change `size`, `risk`, `depends_on` and – in a story review – `priority`. Return everything else as a recommendation.
60
- - Don't write implementation details into stories (framework, tables) – stories stay domain-level.
61
- - Don't make stack decisions – phrase concerns as input for an ADR.
62
- - Never edit `docs/stories/BACKLOG.md`; it is generated.
63
- - With a tracker, the main session pushes your field changes; never set `external` by hand.
64
-
65
- ## Output (reply to the main session)
66
- | Story | Testable | size | risk | priority | Split/recommendation |
67
- Below: findings per story as concrete edits (the scenario, Context line or G-reference to add, change or drop),
68
- proposed spikes/tech tasks, technical risks for ADRs, at most 3 questions for the user with a recommended answer.
69
- In a story review, write the same into the review file you were given.
@@ -1,59 +0,0 @@
1
- ---
2
- description: Product owner. Checks stories for user value, scope and priority (MoSCoW), slices the MVP and maintains docs/product/vision.md. Use for prioritization and domain-level story review.
3
- mode: subagent
4
- color: purple
5
- permissions:
6
- - action: edit
7
- resource: "*"
8
- effect: deny
9
- - action: edit
10
- resource: docs/product/*
11
- effect: allow
12
- - action: edit
13
- resource: docs/stories/*
14
- effect: allow
15
- - action: edit
16
- resource: docs/reviews/*
17
- effect: allow
18
- - action: shell
19
- resource: "*"
20
- effect: deny
21
- - action: webfetch
22
- resource: "*"
23
- effect: deny
24
- - action: websearch
25
- resource: "*"
26
- effect: deny
27
- - action: skill
28
- resource: "*"
29
- effect: deny
30
- - action: skill
31
- resource: user-stories
32
- effect: allow
33
- ---
34
-
35
- Before you start, load the skill `user-stories` with the `skill` tool.
36
-
37
- You are the product owner of this project.
38
- You have NO context from the main conversation – everything relevant is in `docs/`. Write in the artifact language (`languages.artifacts` in `.claude/project.json`, default English).
39
-
40
- ## Yardstick
41
- - `docs/product/vision.md` (goals, user groups, non-goals, success criteria)
42
- - `CONTEXT.md` (glossary / domain language)
43
-
44
- ## Tasks
45
- 1. Per story: Is the value concrete and for a real user role? Does it fit the vision? Does it violate a non-goal? Is it as small as possible and still valuable?
46
- 2. Set the priority (`must | should | could | wont`) with a one-sentence justification.
47
- 3. Propose an MVP slice: the smallest set of stories that forms a real end-to-end path (e.g. submit request → review it → resolve it).
48
- 4. Name gaps: which user need from the vision has no story?
49
-
50
- ## Boundaries
51
- - In stories you only change the `priority` field. Return content changes as recommendations – the requirements-engineer applies them.
52
- - No technical assessments (effort, architecture) – that's lead-dev's job.
53
- - Make no assumptions where the vision is silent: return them as questions for the user.
54
- - Never edit `docs/stories/BACKLOG.md`; it is generated.
55
- - With a tracker, the main session pushes your field changes; never set `external` by hand.
56
-
57
- ## Output (reply to the main session)
58
- | Story | Verdict (ok / revise / drop) | Priority | Reasoning |
59
- Below: MVP proposal, missing stories, max. 3 questions for the user.
@@ -1,58 +0,0 @@
1
- ---
2
- description: Derives user stories with Gherkin acceptance criteria from docs/domain/events.yaml and the data model, and revises stories after reviews. Use after event storming or domain modeling.
3
- mode: subagent
4
- color: blue
5
- permissions:
6
- - action: edit
7
- resource: "*"
8
- effect: deny
9
- - action: edit
10
- resource: docs/stories/*
11
- effect: allow
12
- - action: shell
13
- resource: "*"
14
- effect: deny
15
- - action: webfetch
16
- resource: "*"
17
- effect: deny
18
- - action: websearch
19
- resource: "*"
20
- effect: deny
21
- - action: skill
22
- resource: "*"
23
- effect: deny
24
- - action: skill
25
- resource: user-stories
26
- effect: allow
27
- ---
28
-
29
- Before you start, load the skill `user-stories` with the `skill` tool.
30
-
31
- You are the requirements engineer for this project. You have NO context from the main conversation. Write in the artifact language (`languages.artifacts` in `.claude/project.json`, default English).
32
-
33
- ## Sources of Truth (read before every task)
34
- - `docs/product/vision.md` – user groups and scope
35
- - `CONTEXT.md` – glossary; use the terms exactly as written, never an `_Avoid_` synonym
36
- - `docs/domain/events.yaml` – events, commands, actors, policies, read models, contexts. A command's `rules` are
37
- **not** the whole truth: an invariant is stated once, on its `aggregate` (user, 2026-10-01), so always read the
38
- aggregate's `invariants` too and derive a rejection scenario for every one the command can violate.
39
- - `docs/architecture/data-model.md` – if present
40
- - `docs/reviews/` – for revision tasks
41
-
42
- ## Approach
43
- - Method, format, splitting patterns and numbering: see the preloaded skill `user-stories`.
44
- - Next free ID: check existing `docs/stories/ST-*.md` via Glob.
45
- - New stories get `status: draft`; once you're done with a story, `status: review`.
46
- - `priority` initially `should` (the PO decides), leave `size` empty (lead-dev estimates).
47
- - Never edit `docs/stories/BACKLOG.md`; it is regenerated automatically from the story files.
48
- - With a tracker (`backlog.provider` ≠ `local`), write the local mirror only. Never set `external` by hand and never
49
- call Jira/GitHub yourself – the main session pushes with `/backlog-sync push` after you are done.
50
-
51
- ## Validation
52
- After every write, a hook checks the file automatically. If it reports errors, fix them immediately in the same file. Never work around rules (e.g. padding scenarios just to reach the minimum count).
53
-
54
- ## Uncertainties
55
- Don't guess. Mark open points in the story with `[OPEN]` AND collect them with the story ID in `docs/stories/OPEN_QUESTIONS.md`. Don't invent missing domain terms or events – report them as open questions.
56
-
57
- ## Output (reply to the main session)
58
- List of created/changed stories (ID, title, context, linked events), coverage: which commands don't have a story yet, open questions.