kataster 0.0.0-stage → 0.2.1

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 (162) hide show
  1. package/.claude/agents/acceptance-tester.md +53 -0
  2. package/.claude/agents/code-reviewer.md +56 -0
  3. package/.claude/agents/domain-architect.md +40 -0
  4. package/.claude/agents/lead-dev.md +50 -0
  5. package/.claude/agents/product-owner.md +39 -0
  6. package/.claude/agents/repo-analyst.md +78 -0
  7. package/.claude/agents/requirements-engineer.md +44 -0
  8. package/.claude/agents/ux-designer.md +64 -0
  9. package/.claude/hooks/bash-guard.ts +92 -0
  10. package/.claude/hooks/code-check.ts +37 -0
  11. package/.claude/hooks/path-guard.ts +34 -0
  12. package/.claude/hooks/path-rules.ts +66 -0
  13. package/.claude/hooks/project-check.ts +108 -0
  14. package/.claude/hooks/protect-files.ts +55 -0
  15. package/.claude/hooks/session-start.ts +213 -0
  16. package/.claude/hooks/stop-gate.ts +56 -0
  17. package/.claude/hooks/validate-docs.ts +58 -0
  18. package/.claude/lib/architecture.ts +736 -0
  19. package/.claude/lib/backlog-github.ts +454 -0
  20. package/.claude/lib/backlog-jira.ts +347 -0
  21. package/.claude/lib/backlog-sync.ts +42 -0
  22. package/.claude/lib/backlog.ts +396 -0
  23. package/.claude/lib/bazel.ts +212 -0
  24. package/.claude/lib/config.ts +122 -0
  25. package/.claude/lib/discovery.ts +821 -0
  26. package/.claude/lib/engineering.ts +406 -0
  27. package/.claude/lib/nx.ts +129 -0
  28. package/.claude/lib/repo.ts +1194 -0
  29. package/.claude/lib/toolgraph.ts +74 -0
  30. package/.claude/lib/turbo.ts +166 -0
  31. package/.claude/package-lock.json +427 -0
  32. package/.claude/package.json +21 -0
  33. package/.claude/settings.json +82 -0
  34. package/.claude/skills/adopt/SKILL.md +283 -0
  35. package/.claude/skills/adopt/scripts/boundary-check.ts +156 -0
  36. package/.claude/skills/adopt/scripts/package-doc.ts +71 -0
  37. package/.claude/skills/adopt/scripts/repo-map.ts +123 -0
  38. package/.claude/skills/adopt/scripts/rule-doc.ts +80 -0
  39. package/.claude/skills/architect/ADR-FORMAT.md +97 -0
  40. package/.claude/skills/architect/SKILL.md +64 -0
  41. package/.claude/skills/architect/TECH-STACK.md +21 -0
  42. package/.claude/skills/backlog/SKILL.md +198 -0
  43. package/.claude/skills/backlog/scripts/backlog-pull.ts +45 -0
  44. package/.claude/skills/backlog/scripts/backlog-push.ts +38 -0
  45. package/.claude/skills/backlog/scripts/backlog-status.ts +32 -0
  46. package/.claude/skills/backlog/scripts/jira-import.ts +40 -0
  47. package/.claude/skills/backlog/scripts/jira-plan.ts +26 -0
  48. package/.claude/skills/backlog/scripts/jira-record.ts +41 -0
  49. package/.claude/skills/bootstrap/SKILL.md +119 -0
  50. package/.claude/skills/codebase-design/DEEPENING.md +37 -0
  51. package/.claude/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  52. package/.claude/skills/codebase-design/SKILL.md +114 -0
  53. package/.claude/skills/domain-model/CONTEXT-FORMAT.md +47 -0
  54. package/.claude/skills/domain-model/SKILL.md +64 -0
  55. package/.claude/skills/domain-model/templates/data-model.md +29 -0
  56. package/.claude/skills/engineering-conventions/SKILL.md +31 -0
  57. package/.claude/skills/event-storming/SKILL.md +44 -0
  58. package/.claude/skills/event-storming/schema/events.schema.json +124 -0
  59. package/.claude/skills/event-storming/scripts/render-event-storming.ts +11 -0
  60. package/.claude/skills/event-storming/scripts/validate-events.ts +11 -0
  61. package/.claude/skills/event-storming/templates/events.example.yaml +91 -0
  62. package/.claude/skills/feature/SKILL.md +86 -0
  63. package/.claude/skills/feature/scripts/intake.ts +356 -0
  64. package/.claude/skills/grill-me/SKILL.md +7 -0
  65. package/.claude/skills/grill-with-docs/SKILL.md +7 -0
  66. package/.claude/skills/grilling/SKILL.md +30 -0
  67. package/.claude/skills/groom-backlog/SKILL.md +93 -0
  68. package/.claude/skills/groom-backlog/scripts/backlog-health.ts +238 -0
  69. package/.claude/skills/implement/SKILL.md +129 -0
  70. package/.claude/skills/implement/scripts/affected.ts +245 -0
  71. package/.claude/skills/implement/scripts/check-commands.ts +37 -0
  72. package/.claude/skills/implement/scripts/check-language.ts +15 -0
  73. package/.claude/skills/implement/scripts/check-scenarios.ts +59 -0
  74. package/.claude/skills/implement/scripts/next-story.ts +23 -0
  75. package/.claude/skills/implement/scripts/story-context.ts +135 -0
  76. package/.claude/skills/implement/scripts/story-status.ts +47 -0
  77. package/.claude/skills/implement/scripts/verify.ts +92 -0
  78. package/.claude/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  79. package/.claude/skills/improve-codebase-architecture/SKILL.md +71 -0
  80. package/.claude/skills/retro/SKILL.md +53 -0
  81. package/.claude/skills/review-stories/SKILL.md +31 -0
  82. package/.claude/skills/shape/SKILL.md +193 -0
  83. package/.claude/skills/tdd/SKILL.md +38 -0
  84. package/.claude/skills/tdd/mocking.md +59 -0
  85. package/.claude/skills/tdd/tests.md +77 -0
  86. package/.claude/skills/user-stories/SKILL.md +138 -0
  87. package/.claude/skills/user-stories/schema/story.schema.json +39 -0
  88. package/.claude/skills/user-stories/scripts/render-backlog.ts +4 -0
  89. package/.claude/skills/user-stories/scripts/validate-stories.ts +13 -0
  90. package/.claude/skills/user-stories/templates/story-template.md +38 -0
  91. package/.claude/skills/ux-design/SKILL.md +107 -0
  92. package/.claude/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  93. package/.claude/skills/writing-for-agents/SKILL.md +81 -0
  94. package/.claude/tsconfig.json +15 -0
  95. package/.opencode/agents/acceptance-tester.md +64 -0
  96. package/.opencode/agents/code-reviewer.md +69 -0
  97. package/.opencode/agents/domain-architect.md +59 -0
  98. package/.opencode/agents/lead-dev.md +67 -0
  99. package/.opencode/agents/product-owner.md +59 -0
  100. package/.opencode/agents/repo-analyst.md +86 -0
  101. package/.opencode/agents/requirements-engineer.md +58 -0
  102. package/.opencode/agents/ux-designer.md +83 -0
  103. package/.opencode/commands/adopt.md +7 -0
  104. package/.opencode/commands/backlog-sync.md +7 -0
  105. package/.opencode/commands/bootstrap.md +7 -0
  106. package/.opencode/commands/event-storming.md +7 -0
  107. package/.opencode/commands/feature.md +7 -0
  108. package/.opencode/commands/grill-me.md +7 -0
  109. package/.opencode/commands/grill-with-docs.md +7 -0
  110. package/.opencode/commands/groom-backlog.md +7 -0
  111. package/.opencode/commands/implement.md +7 -0
  112. package/.opencode/commands/improve-codebase-architecture.md +7 -0
  113. package/.opencode/commands/retro.md +7 -0
  114. package/.opencode/commands/review-stories.md +7 -0
  115. package/.opencode/commands/shape.md +7 -0
  116. package/.opencode/opencode.jsonc +15 -0
  117. package/.opencode/plugins/kataster/index.ts +283 -0
  118. package/AGENTS.md +21 -0
  119. package/CHANGELOG.md +91 -0
  120. package/LICENSE +21 -0
  121. package/README.md +331 -2
  122. package/bin/kataster.mjs +7 -0
  123. package/extras/skills/shadcn/SKILL.md +277 -0
  124. package/extras/skills/shadcn/agents/openai.yml +5 -0
  125. package/extras/skills/shadcn/assets/shadcn-small.png +0 -0
  126. package/extras/skills/shadcn/assets/shadcn.png +0 -0
  127. package/extras/skills/shadcn/cli.md +290 -0
  128. package/extras/skills/shadcn/customization.md +209 -0
  129. package/extras/skills/shadcn/evals/evals.json +77 -0
  130. package/extras/skills/shadcn/mcp.md +105 -0
  131. package/extras/skills/shadcn/registry.md +277 -0
  132. package/extras/skills/shadcn/rules/base-vs-radix.md +306 -0
  133. package/extras/skills/shadcn/rules/chat.md +250 -0
  134. package/extras/skills/shadcn/rules/composition.md +213 -0
  135. package/extras/skills/shadcn/rules/forms.md +192 -0
  136. package/extras/skills/shadcn/rules/icons.md +101 -0
  137. package/extras/skills/shadcn/rules/styling.md +185 -0
  138. package/guide/README.md +9 -0
  139. package/guide/brownfield.md +242 -0
  140. package/guide/concepts.md +109 -0
  141. package/guide/greenfield.md +84 -0
  142. package/guide/install.md +144 -0
  143. package/guide/release.md +92 -0
  144. package/package.json +56 -4
  145. package/src/cli.mjs +302 -0
  146. package/src/detect.mjs +237 -0
  147. package/src/install.mjs +427 -0
  148. package/src/repo.mjs +129 -0
  149. package/src/util.mjs +110 -0
  150. package/templates/CONTEXT.md +21 -0
  151. package/templates/conventions.md +63 -0
  152. package/templates/docs/adr/README.md +7 -0
  153. package/templates/docs/architecture/data-model.md +31 -0
  154. package/templates/docs/domain/context-map.md +21 -0
  155. package/templates/docs/domain/events.yaml +23 -0
  156. package/templates/docs/product/initiatives/README.md +41 -0
  157. package/templates/docs/product/ux-guidelines.md +27 -0
  158. package/templates/docs/product/vision.md +36 -0
  159. package/templates/docs/reviews/.gitkeep +0 -0
  160. package/templates/docs/stories/OPEN_QUESTIONS.md +8 -0
  161. package/templates/docs/stories/README.md +26 -0
  162. package/templates/docs/workflow.md +135 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,91 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1 – 2026-10-31
4
+
5
+ - Releases are published from CI with npm trusted publishing (OIDC): pushing a `v*` tag runs the type check and the
6
+ test suite, verifies that the tag matches `package.json`, and publishes with provenance attestations – no token
7
+ in the repository, no one-time password. `guide/release.md` documents the setup and the manual fallback.
8
+ - The repository is maintained in the open: `CONTRIBUTING.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`, issue and pull
9
+ request templates, Dependabot for the tooling dependencies and a protected `main` (pull request required, green
10
+ CI, squash only).
11
+
12
+ ## 0.2.0 – 2026-10-31
13
+
14
+ - **Renamed from La Guardia to Kataster.** The CLI is `npx kataster`, the state directory is `.kataster/`, the
15
+ managed block markers are `kataster:*`, the OpenCode adapter lives in `.opencode/plugins/kataster/`, the env var is
16
+ `KATASTER_NODE` and the default backlog label prefix is `kataster`. `upgrade` migrates an existing installation in
17
+ place (state directory, plugin path, markers in `AGENTS.md`/`CLAUDE.md`, `.gitignore`); `doctor` reports leftovers.
18
+ An existing `.claude/project.json` keeps its own `backlog.labelPrefix`, so labels already in GitHub or Jira stay
19
+ valid – rename them by hand if you want them to follow.
20
+
21
+ - New `/shape` skill: the step between an idea and `/feature`. It grills a large idea, places it (existing or new
22
+ bounded context, shared library), maps change vs. new work, slices it, and produces a cost range with basis and
23
+ confidence. It creates no stories; the brief lives in `docs/product/initiatives/<slug>.md` and ends with one
24
+ recommendation (go / slice 1 / spike / discover / park / no-go). `--dry-run` writes nothing. A partially adopted
25
+ repository or an analogous service is used as evidence, never as a template.
26
+ - `/feature` accepts a reference: `ST-NNN`, `#issue`, a Jira key or URL, or a Jira issue exported through MCP.
27
+ A read-only `feature/scripts/intake.ts` resolves it, finds the linked local story by id or `external`, and returns a
28
+ route – continue a draft, review, implement, treat finished behaviour as a new story, send a bug to a regression
29
+ story, or run the feature pipeline. The ticket is evidence, not a specification: criteria are grilled, the source
30
+ is recorded in the story, and `external` stays owned by the backlog sync.
31
+ - Brownfield adoption in slices: `/adopt` now builds a deterministic repository map first
32
+ (`docs/architecture/repo-map.json`/`.md`), then adopts one domain plus at most one shared library per session.
33
+ The map knows packages, internal dependencies, consumers and an adoption ranking.
34
+ - Monorepo tooling detection (Nx, Turborepo, Bazel, pnpm/npm/yarn workspaces, Go, Cargo, Gradle, Maven) in
35
+ `.claude/project.json` → `repo.tooling`; commands per package and affected tests use that tool.
36
+ - Per-package docs: `<package>/AGENTS.md` (purpose, entities or public API, interfaces, pitfalls, boundaries) plus
37
+ a one-line `<package>/CLAUDE.md` importing it, so Claude Code and OpenCode load them only when working there.
38
+ The root `AGENTS.md` stays free of domain and keeps structure, commands and hard conventions.
39
+ - An existing `CLAUDE.md` now gets the `@AGENTS.md` import without losing its house rules; without the import,
40
+ Claude Code would read only the project's own file and never load the workflow instructions.
41
+ - Brownfield adoption no longer creates stories by default. It records a gap register in the adoption report;
42
+ `/adopt <scope> --stories` turns the selected gaps into a backlog when the user wants one.
43
+ - The installer preserves project hooks under `.claude/hooks/` on upgrade; only its own exact hook commands are
44
+ replaced.
45
+ - `verify.ts` warns when the generated repository map is stale.
46
+ - Architecture boundaries as data: `docs/architecture/boundaries.yaml` (first matching `from` → `to` rule wins),
47
+ a JS/TS import scanner or a `command` engine for dependency-cruiser, Nx, Bazel, ArchUnit, import-linter, and
48
+ `docs/architecture/boundaries.baseline.json` for baseline/ratchet. `--init` writes a proposal; existing
49
+ violations are frozen; only new ones fail.
50
+ - `docs/engineering/checks.yaml` and the `project-check.ts` dispatcher: project-owned checks run at edit time
51
+ (changed file only) and at Stop/CI. Wired once in Claude Code and OpenCode, never per package.
52
+ - `rule-doc.ts` scaffolds and validates `.claude/rules/*.md` with `paths:` frontmatter; directory rules stay in
53
+ `<dir>/AGENTS.md` so both harnesses load them on demand.
54
+ - Turborepo tool graph: `repo-map.ts` asks `turbo run <task> --dry=json` for the real package/task edges and stores
55
+ them as an optional `toolGraph`; without Turbo it falls back to manifests. `affected.ts` maps changed files (or
56
+ `--base`) to affected packages, follows dependents of shared libraries, and emits the native Turbo/Nx/Bazel/pnpm
57
+ command; `--run` executes it. `/implement` uses it for the fast loop, `verify.ts` remains the full gate.
58
+ - Nx and Bazel tool graphs: `nx graph --file=<temp>` is resolved to package names (Nx project names need not match,
59
+ e.g. `billing` vs `@acme/billing`) and kept in `toolGraph.projectNames` so `affected.ts` emits
60
+ `nx run-many -p billing,…`; Bazel packages and edges come from the `deps` attributes in `BUILD`/`BUILD.bazel`,
61
+ so no Bazel server or toolchain is needed. Both stay enrichment: no tool, no graph, manifest fallback.
62
+ - Path-scoped rules in both harnesses: `.claude/rules/*.md` stays the single source of truth, Claude Code scopes
63
+ it natively by `paths:`, and the OpenCode plugin calls the new `path-rules.ts` hook whenever a file is read or
64
+ written to attach each matching rule once per session as a keyed instruction entry. The rule body is sent
65
+ without its frontmatter; the scope is stated in the first line.
66
+ - Backlog backends: stories can stay local (default), live in GitHub Issues (`gh`) or in Jira (`mcp-atlassian`).
67
+ With a tracker, `docs/stories/` is a synchronized local mirror, `ST-NNN` stays the stable id and the tracker key
68
+ lives in `external`. Only the backlog core syncs; reviews and open questions stay local.
69
+ - New `backlog` skill and `/backlog-sync` command: status, pull and push, with conflict detection, backups and a
70
+ three-way sync state. GitHub syncs deterministically; Jira is driven through MCP with plan/record/import scripts.
71
+ - `kataster init --backlog local|github|jira`, provider config in `.claude/project.json`, `doctor` checks for `gh`,
72
+ the Jira project and the MCP server.
73
+ - Story schema and validator understand `external` and refuse a `ready`/`in-progress`/`done` mirror story without a
74
+ tracker link.
75
+
76
+ ## 0.1.0 – 2026-10-29
77
+
78
+ First standalone release.
79
+
80
+ - `kataster init | upgrade | doctor` with stack detection, project profile and idempotent install
81
+ - Merges into existing `AGENTS.md`, `.claude/settings.json`, `.opencode/opencode.jsonc` and `.gitignore`
82
+ - Greenfield entry point `/bootstrap`: vision grilling → event storming → domain model → architecture → UX →
83
+ foundation stories
84
+ - Brownfield entry point `/adopt`: five parallel `repo-analyst` lenses → evidence-based domain draft → grilling →
85
+ gap stories
86
+ - `repo-analyst` agent (read-only) for OpenCode and Claude Code
87
+ - Project profile `.claude/project.json` replaces hardcoded project assumptions; `verify.ts` runs its commands
88
+ - `docs/engineering/conventions.md` replaces the project-specific conventions skill; the original is kept in
89
+ `examples/` as a reference
90
+ - Optional `shadcn` skill moved to `extras/` (`--with shadcn`)
91
+ - Guardrails generalized: deploy providers, database tools, default branch from the profile
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kataster contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,332 @@
1
- # Temporary Holding Version
1
+ # Kataster
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **An agent workflow for domain-driven discovery and delivery.** Drop it into a repository, and the agent builds the
4
+ domain with you – by grilling, not by guessing – then carries it through stories, test-first implementation and
5
+ review.
6
+
7
+ The name is the German word for the official register of land parcels and their boundaries – a map that is
8
+ maintained, not invented. The domain model is that register: bounded contexts are the parcels, the glossary and the
9
+ data model are the entries, and nothing goes in without evidence.
10
+
11
+ Works in two situations:
12
+
13
+ - **Brownfield** – the repository already has code. `/adopt` analyses code, docs, tests, schema and git history,
14
+ drafts the domain model with evidence, and grills you to correct it. No rewrite, no invented domain.
15
+ - **Greenfield** – nothing but an idea. `/bootstrap` grills the vision, runs an event storming, builds contexts,
16
+ aggregates, the data model and the ADRs, and derives the foundation stories and first vertical slice.
17
+
18
+ The same workflow then handles every large idea (`/shape`), every feature (`/feature`), every story review
19
+ (`/review-stories`), implementation (`/implement`) and backlog care (`/groom-backlog`, `/retro`).
20
+
21
+ ```bash
22
+ npx kataster init
23
+ ```
24
+
25
+ That is the whole installation. It writes `.claude/`, `.opencode/`, `AGENTS.md` and a `docs/` skeleton into the
26
+ current repository, detects the stack, and asks four questions – the last one is whether stories stay local or live
27
+ in GitHub Issues or Jira (and if so, for the project or repository).
28
+
29
+ ---
30
+
31
+ ## Why this exists
32
+
33
+ Agents are good at writing code and bad at knowing what the words mean. A repository without a domain model produces
34
+ code that is locally plausible and globally inconsistent: three names for one concept, rules enforced only in the UI,
35
+ features nobody can place. Kataster makes the domain a first-class artifact – glossary, events, contexts,
36
+ aggregates, invariants – and makes the agent earn every statement in it from the user or from evidence.
37
+
38
+ Two rules run through everything:
39
+
40
+ 1. **Facts are the agent's job, decisions are the user's.** The agent looks things up; it never invents a domain
41
+ term, a rule or a boundary.
42
+ 2. **The user confirms, the agent writes.** Grilling works in rounds on the *frontier*: every question whose
43
+ prerequisites are settled, each with a recommended answer. Nothing is assumed silently.
44
+
45
+ ## Requirements
46
+
47
+ - Node.js **22.18+** (the tooling runs TypeScript directly, no build step)
48
+ - Git
49
+ - An agent harness: **OpenCode** or **Claude Code**
50
+ - Optional: `gh` for pull requests and a GitHub Issues backlog, the `mcp-atlassian` MCP server for a Jira backlog,
51
+ a preview provider (Vercel, Netlify, …) for acceptance testing
52
+
53
+ ## Quick start
54
+
55
+ ```bash
56
+ # existing repository
57
+ npx kataster init --brownfield
58
+ # new project
59
+ npx kataster init --greenfield
60
+ # stories in GitHub Issues or Jira
61
+ npx kataster init --backlog github --github-repo acme/shop
62
+ npx kataster init --backlog jira --jira-project PROJ
63
+ ```
64
+
65
+ Then open the repository in your agent harness and run `/adopt` or `/bootstrap`.
66
+
67
+ Non-interactive (CI, scripts):
68
+
69
+ ```bash
70
+ npx kataster init . --yes --name "Acme" --ui-language de --artifacts en
71
+ ```
72
+
73
+ ## What gets installed
74
+
75
+ ```
76
+ .claude/
77
+ project.json project profile – name, stack, languages, commands, backlog backend (edit this)
78
+ skills/ the workflow skills (grilling, event-storming, domain-model, architect, backlog, …)
79
+ skills/adopt/scripts/ repository map and per-package docs for brownfield adoption
80
+ skills/feature/scripts/ read-only intake: story, GitHub/Jira ticket or URL → route
81
+ agents/ review agents for Claude Code
82
+ hooks/ plain-Node guardrails and validators
83
+ lib/ deterministic domain/story/backlog logic
84
+ .opencode/
85
+ commands/ the slash commands
86
+ agents/ the same agents for OpenCode
87
+ plugins/kataster/ adapter that runs the .claude hooks in OpenCode
88
+ AGENTS.md short entry point for every session (merged, never clobbered)
89
+ CLAUDE.md imports AGENTS.md for Claude Code (created, or the import added to an existing file)
90
+ CONTEXT.md the glossary – starts as a template
91
+ docs/
92
+ workflow.md the map: sources of truth, commands, phases, rules
93
+ product/vision.md the vision, grilled with you
94
+ product/initiatives/ proposals for large ideas from /shape (no stories)
95
+ domain/events.yaml the event storming model (empty is valid)
96
+ domain/context-map.md
97
+ architecture/data-model.md
98
+ architecture/repo-map.* generated by /adopt: packages, edges, adoption ranking
99
+ engineering/conventions.md how this repo builds code + the seam catalog
100
+ stories/ the backlog – or the local mirror of GitHub/Jira
101
+ adr/ architecture decisions
102
+ reviews/ story reviews and adoption reports
103
+ ```
104
+
105
+ Existing `AGENTS.md`, `.claude/settings.json` and `.opencode/opencode.jsonc` are **merged**, not overwritten.
106
+ Existing `CONTEXT.md` and `docs/` are never touched.
107
+
108
+ ## The commands
109
+
110
+ | Command | What it does |
111
+ |---|---|
112
+ | `/adopt [scope] [--stories]` | Brownfield: repository map → one slice (domain + shared library) → evidence → grilling → package docs and checks → gap register; stories only with `--stories`; repeat per slice |
113
+ | `/bootstrap` | Greenfield: vision → event storming → domain model → architecture → UX → foundation stories |
114
+ | `/grill-me` | Relentless interview on a plan, decision or idea |
115
+ | `/grill-with-docs` | The same, writing glossary and ADRs as you go |
116
+ | `/event-storming [process]` | Big-picture or single-process event storming |
117
+ | `/feature <idea \| ST-NNN \| #123 \| PROJ-123>` | New feature from an idea, an existing story or a ticket: intake and routing, grilling, focused storming, model, stories, review; bugs become a regression story |
118
+ | `/shape <idea \| ticket> [--dry-run]` | Before a large feature: frame, place (existing/new context, shared library), impact, slices, rough cost range, recommendation; creates no stories |
119
+ | `/review-stories [ST-…]` | One lead-dev pass (value, build, UX) before a story is `ready` |
120
+ | `/backlog-sync [status\|pull\|push]` | Keep `docs/stories/` in sync with GitHub Issues or Jira |
121
+ | `/groom-backlog [scope]` | Periodic challenge: is this backlog still worth building? |
122
+ | `/implement [ST-NNN]` | Test-first implementation of one story, review, refactor, PR |
123
+ | `/improve-codebase-architecture` | Scan for deepening opportunities, present them, grill one |
124
+ | `/retro` | Retrospective on a session, proposing rule changes |
125
+
126
+ ### Starting from a ticket
127
+
128
+ `/feature` also accepts a reference: `/feature #123` (GitHub), `/feature PROJ-123` (Jira, with the issue fetched
129
+ through MCP), `/feature https://…` or `/feature ST-042`. A read-only intake resolves it and returns a route: an
130
+ existing `draft`/`review` story is revised, a `ready`/`in-progress` one goes to `/implement`, a finished one becomes a
131
+ new story, and a bug becomes one regression story instead of a feature. The ticket is **evidence, not a
132
+ specification** – its acceptance criteria are grilled, contradictions with the model are findings, and the source is
133
+ recorded in each story. `external` is still written only by the backlog sync.
134
+
135
+ ### Shaping a large idea
136
+
137
+ `/shape` is the step between an idea and `/feature`. It grills the problem, decides where the work belongs – an
138
+ existing bounded context, a new one, or a shared library – maps what changes vs. what is built new, proposes 2–5
139
+ slices, and gives a rough **cost range with confidence and basis**. It ends with one recommendation: go, go with
140
+ slice 1, spike first, needs discovery, park or no-go. It creates **no stories**; each slice goes to `/feature`.
141
+
142
+ ```bash
143
+ /shape "shop products with variants and channel prices"
144
+ /shape PROJ-123
145
+ /shape --dry-run "a new service next to the existing one" # test the method, write nothing
146
+ ```
147
+
148
+ The brief lands in `docs/product/initiatives/<slug>.md` (`proposed` until you accept it). A new service in an
149
+ existing monorepo is treated as a new context in an existing landscape, not as a greenfield project; a similar
150
+ service is used as evidence and as the cost anchor, never as a template.
151
+
152
+ ## Greenfield, end to end
153
+
154
+ 1. `npx kataster init --greenfield` → review `.claude/project.json`.
155
+ 2. `/bootstrap` → vision grilled, event storming, contexts/aggregates/data model, tech-stack ADR, UX guidelines.
156
+ 3. `/review-stories` → the first foundation tech tasks and the first vertical slice become `ready`.
157
+ 4. `/implement` → one story at a time, test-first, reviewed, merged by you.
158
+ 5. `/feature <idea>` for everything after that.
159
+
160
+ ## Brownfield, end to end
161
+
162
+ 1. `npx kataster init --brownfield` → the profile is filled from the detected stack and monorepo tooling
163
+ (`repo.tooling`: Nx, Turborepo, Bazel, workspaces, Go, Cargo, Gradle, Maven).
164
+ 2. `/adopt` → a deterministic **repository map** (`docs/architecture/repo-map.md`, `.json`) with packages,
165
+ dependency edges, consumers and an adoption ranking. No questions, no hand-scanning.
166
+ 3. `/adopt [scope]` → **one slice** (one domain plus at most one shared library): two or three `repo-analyst`
167
+ subagents return evidence (five lenses for a small single-package repository); the main session drafts `CONTEXT.md`, `events.yaml`, context map, as-is data model,
168
+ conventions and de-facto ADRs; it writes `<package>/AGENTS.md` + `<package>/CLAUDE.md`, then grills you.
169
+ 4. The safety net turns confirmed rules into checks (types, lint/boundary, tests, hooks) – report-only with a
170
+ baseline first, so a brownfield repository does not start red.
171
+ 5. The gap analysis records **contradictions, missing behaviour and dead code** in the adoption report. It creates
172
+ **no stories by default** – what already works is documented, not re-storied. `/adopt <scope> --stories` turns
173
+ the selected gaps into a backlog when you want one.
174
+ 6. `/adopt <next path>` for the next slice; `/adopt <scope> --stories`, `/review-stories`, then `/implement`.
175
+
176
+ Adopt in slices: one bounded context completely beats the whole repository shallowly. The root `AGENTS.md` stays
177
+ free of domain; the package docs are loaded only when someone works in that package.
178
+
179
+ ## Monorepos
180
+
181
+ The installer detects the build tool (Nx, Turborepo, Bazel, pnpm/npm/yarn workspaces, Go, Cargo, Gradle, Maven)
182
+ and stores it in `.claude/project.json` → `repo.tooling`. `/adopt` builds the repository map once, then adopts
183
+ **one domain plus at most one shared library per session**. Every adopted package gets an `AGENTS.md` with its
184
+ purpose, entities or public API, interfaces and pitfalls – plus a one-line `CLAUDE.md` so Claude Code loads it on
185
+ demand; OpenCode loads the nested `AGENTS.md` itself. The root `AGENTS.md` stays short and free of domain.
186
+
187
+ Commands use the detected tool instead of assuming a single package: `nx affected -t test`,
188
+ `turbo run test --filter=<package>`, `bazel test //<package>/...`, `pnpm --filter <package> test`. The map also
189
+ stores the tool's own graph – Turborepo via `turbo run <task> --dry=json`, Nx via `nx graph`, Bazel from the
190
+ `BUILD` deps – and `affected.ts` turns changed files into the affected packages plus the native filter command,
191
+ following shared-library dependents:
192
+
193
+ ```bash
194
+ node .claude/skills/implement/scripts/affected.ts --changed libs/shared-kernel/src/index.ts
195
+ node .claude/skills/implement/scripts/affected.ts --base origin/main
196
+ ```
197
+
198
+ ## The project profile
199
+
200
+ `.claude/project.json` is the single place for project facts. Skills, hooks and scripts read it instead of assuming
201
+ `main`, `npm` or a language.
202
+
203
+ ```jsonc
204
+ {
205
+ "name": "Acme",
206
+ "kind": "brownfield",
207
+ "languages": { "artifacts": "en", "ui": "de" },
208
+ "stack": { "summary": "TypeScript, Next.js, PostgreSQL" },
209
+ "repo": {
210
+ "defaultBranch": "main",
211
+ "codeRoots": ["apps", "libs"],
212
+ "tooling": {
213
+ "kind": "nx",
214
+ "config": "nx.json",
215
+ "workspaces": ["apps/*", "libs/*"],
216
+ "manager": "pnpm",
217
+ "monorepo": true
218
+ }
219
+ },
220
+ "commands": { "lint": "npm run lint", "typecheck": "npm run typecheck", "test": "npm test" },
221
+ "review": { "preview": "vercel", "pullRequest": "gh" },
222
+ "backlog": {
223
+ "provider": "local",
224
+ "github": { "repo": "", "labelPrefix": "kataster" },
225
+ "jira": {
226
+ "mcpServer": "mcp-atlassian",
227
+ "project": "PROJ",
228
+ "issueType": "Story",
229
+ "statusMap": { "draft": "To Do", "ready": "Ready", "done": "Done" },
230
+ "priorityMap": { "must": "Highest", "should": "High" }
231
+ }
232
+ }
233
+ }
234
+ ```
235
+
236
+ `verify.ts` runs exactly these commands. `/adopt` fills them from the code; edit them if the detection is wrong.
237
+
238
+ ## Backlog backends
239
+
240
+ Stories live in one of three places, chosen at install with `--backlog` and stored in `.claude/project.json`:
241
+
242
+ | Provider | Source of truth | Transport |
243
+ |---|---|---|
244
+ | `local` (default) | `docs/stories/` | the Markdown files |
245
+ | `github` | GitHub Issues | `gh` CLI – deterministic, works from scripts |
246
+ | `jira` | Jira | `mcp-atlassian` – MCP is agent-only |
247
+
248
+ With a tracker, **the tracker leads** and `docs/stories/` is a synchronized local mirror. That keeps the deterministic
249
+ parts – validation, `BACKLOG.md`, scenario ↔ test traceability, `next-story` – working offline, while the team works in
250
+ the tracker.
251
+
252
+ - Each story keeps its stable `ST-NNN` id; the tracker key lives in `external: { provider, key, url }`. Test titles do
253
+ not change.
254
+ - Only the backlog core syncs: story content, status, priority, size, risk, context, type, dependencies and labels.
255
+ Reviews and `OPEN_QUESTIONS.md` stay local.
256
+ - A story must be linked before it reaches `ready` – the validator refuses an unlinked mirror story.
257
+ - On a conflict the tracker wins; the local file is backed up to `.kataster/backup/backlog/` first. GitHub's `push`
258
+ refuses a story whose remote side changed; the Jira plan cannot see Jira, so pull before planning a push.
259
+ - GitHub issues are closed for `done`/`superseded`; Jira uses the configured status names and transitions.
260
+
261
+ ```bash
262
+ node .claude/skills/backlog/scripts/backlog-status.ts # what is linked, what drifted
263
+ node .claude/skills/backlog/scripts/backlog-push.ts # mirror → tracker (GitHub)
264
+ node .claude/skills/backlog/scripts/backlog-pull.ts # tracker → mirror (GitHub)
265
+ ```
266
+
267
+ For Jira, `jira-plan.ts` prints the exact MCP calls, `jira-record.ts` writes the returned keys back, and
268
+ `backlog-pull.ts --from issues.json` imports what the agent fetched through MCP. The `backlog` skill has the full flow.
269
+
270
+ ## Quality gates
271
+
272
+ - **Hooks** validate `docs/domain/events.yaml` and stories after every write, format and lint changed code, block
273
+ edits to generated files and accepted ADRs, and stop force pushes, production deploys and destructive database
274
+ commands.
275
+ - **Path-scoped rules** live in `.claude/rules/*.md` with `paths:` frontmatter – for patterns a directory cannot
276
+ express. Claude Code loads them natively; in OpenCode the plugin attaches the matching rule to the session as
277
+ soon as a file under its globs is read or written, so one file serves both harnesses.
278
+ - **Architecture boundaries** are data: `docs/architecture/boundaries.yaml` lists allowed/forbidden edges (first
279
+ match wins), `boundary-check.ts` enforces them, and `boundaries.baseline.json` freezes existing debt so only
280
+ new violations fail. `docs/engineering/checks.yaml` decides what runs at edit time and at Stop/CI; the
281
+ `project-check.ts` dispatcher is wired once, not per package.
282
+
283
+ ```bash
284
+ node .claude/skills/adopt/scripts/boundary-check.ts --init
285
+ node .claude/skills/adopt/scripts/boundary-check.ts # fail on new violations
286
+ node .claude/skills/adopt/scripts/boundary-check.ts --update-baseline
287
+ ```
288
+ - **`verify.ts`** is the one gate: project checks, artifact validity, scenario ↔ test traceability, domain IDs in
289
+ the code, glossary language.
290
+ - **Review agents** never write code: `code-reviewer` and `acceptance-tester` report, the acceptance verdict decides
291
+ whether a story is `done`.
292
+
293
+ ## Upgrading
294
+
295
+ ```bash
296
+ npx kataster upgrade
297
+ npx kataster doctor
298
+ ```
299
+
300
+ `upgrade` replaces workflow files, keeps project content (`CONTEXT.md`, `docs/`, `project.json`) and refuses to
301
+ overwrite files you changed locally – it lists them instead. `--force` overwrites and writes a backup to
302
+ `.kataster/backup/`.
303
+
304
+ ## Optional extras
305
+
306
+ - `--with shadcn` installs the shadcn/ui skill for projects that use it.
307
+
308
+ ## Design notes
309
+
310
+ - **`.claude/` is the source of truth.** OpenCode and Claude Code share skills, agents and hooks; `.opencode/` is an
311
+ adapter, not a second workflow.
312
+ - **Plain Node, no build step.** Hooks and validators run on Node 22.18+ with one runtime dependency (`yaml`).
313
+ - **Generated files stay generated.** `BACKLOG.md` and `event-storming.md` are rendered; edit the sources.
314
+ - **The backlog is local by default.** One Markdown file per story; no issue tracker required. GitHub Issues and Jira
315
+ are opt-in, and `docs/stories/` stays the mirror that validation and traceability run on.
316
+
317
+ ## Name
318
+
319
+ The name is a historical reference, not a domain: the workflow has none of its own. Everything project-specific
320
+ was removed when the package was extracted – the examples are neutral, the stack is detected, and the language is
321
+ yours.
322
+
323
+ ## Contributing
324
+
325
+ The toolkit is maintained in the open: bug reports, a skill that fills a real gap and sharper prompts are welcome.
326
+ [CONTRIBUTING.md](CONTRIBUTING.md) has the setup, the payload rules and the release process;
327
+ [SECURITY.md](SECURITY.md) is the way to report a vulnerability privately. Participation is covered by the
328
+ [Code of Conduct](CODE_OF_CONDUCT.md).
329
+
330
+ ## License
331
+
332
+ MIT
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { main } from "../src/cli.mjs";
3
+
4
+ main(process.argv.slice(2)).catch((error) => {
5
+ console.error(error instanceof Error ? error.message : String(error));
6
+ process.exit(1);
7
+ });