kataster 0.0.0-stage → 0.2.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 (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 +82 -0
  120. package/LICENSE +21 -0
  121. package/README.md +324 -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 +62 -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
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Project profile and backlog configuration.
3
+ *
4
+ * `.claude/project.json` is the only place for project facts. The backlog section says where stories live:
5
+ *
6
+ * local – `docs/stories/` is the backlog (the default, no tracker)
7
+ * github – GitHub Issues are the source of truth, `docs/stories/` is the local mirror
8
+ * jira – Jira is the source of truth, `docs/stories/` is the local mirror
9
+ *
10
+ * Only runtime dependency: Node >= 22.18 (type stripping). No imports from discovery.ts – that would create a
11
+ * cycle, because discovery.ts reads the backlog configuration to validate mirrored stories.
12
+ */
13
+ import { readFileSync } from "node:fs";
14
+ import { join, resolve } from "node:path";
15
+
16
+ export const ROOT = resolve(import.meta.dirname, "..", "..");
17
+
18
+ export type BacklogProvider = "local" | "github" | "jira";
19
+
20
+ export interface GitHubConfig {
21
+ /** `owner/name`; empty means "the repository gh is run in". */
22
+ repo: string;
23
+ /** Prefix of the labels the sync manages (`kataster-status-ready`, `kataster-priority-must`, …). */
24
+ labelPrefix: string;
25
+ }
26
+
27
+ export interface JiraConfig {
28
+ /** Name of the MCP server as configured in the harness, normally `mcp-atlassian`. */
29
+ mcpServer: string;
30
+ /** Jira project key, e.g. `PROJ`. */
31
+ project: string;
32
+ /** Issue type used for stories, e.g. `Story`, `Task` or `Bug`. */
33
+ issueType: string;
34
+ labelPrefix: string;
35
+ /** Local workflow status → Jira status name. Must match the project's workflow. */
36
+ statusMap: Record<string, string>;
37
+ /** Local MoSCoW priority → Jira priority name. */
38
+ priorityMap: Record<string, string>;
39
+ }
40
+
41
+ export interface BacklogConfig {
42
+ provider: BacklogProvider;
43
+ github: GitHubConfig;
44
+ jira: JiraConfig;
45
+ }
46
+
47
+ export const DEFAULT_LABEL_PREFIX = "kataster";
48
+
49
+ export const DEFAULT_STATUS_MAP: Record<string, string> = {
50
+ draft: "To Do",
51
+ review: "In Review",
52
+ ready: "Ready",
53
+ "in-progress": "In Progress",
54
+ done: "Done",
55
+ superseded: "Won't Do",
56
+ };
57
+
58
+ export const DEFAULT_PRIORITY_MAP: Record<string, string> = {
59
+ must: "Highest",
60
+ should: "High",
61
+ could: "Medium",
62
+ wont: "Lowest",
63
+ };
64
+
65
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
+ export type Obj = Record<string, any>;
67
+
68
+ /** The project profile, or an empty object when it is missing or unreadable. */
69
+ export function loadProfile(): Obj {
70
+ try {
71
+ const data = JSON.parse(readFileSync(join(ROOT, ".claude", "project.json"), "utf8"));
72
+ return data !== null && typeof data === "object" && !Array.isArray(data) ? data : {};
73
+ } catch {
74
+ return {};
75
+ }
76
+ }
77
+
78
+ function provider(value: unknown): BacklogProvider {
79
+ return value === "github" || value === "jira" ? value : "local";
80
+ }
81
+
82
+ function str(value: unknown, fallback: string): string {
83
+ return typeof value === "string" && value.trim() ? value.trim() : fallback;
84
+ }
85
+
86
+ function map(value: unknown, fallback: Record<string, string>): Record<string, string> {
87
+ return value !== null && typeof value === "object" && !Array.isArray(value)
88
+ ? { ...fallback, ...(value as Record<string, string>) }
89
+ : { ...fallback };
90
+ }
91
+
92
+ /** Reads `.claude/project.json` → `backlog`. Missing values fall back to the local provider. */
93
+ export function loadBacklogConfig(): BacklogConfig {
94
+ const raw = (loadProfile().backlog ?? {}) as Obj;
95
+ const github = (raw.github ?? {}) as Obj;
96
+ const jira = (raw.jira ?? {}) as Obj;
97
+ return {
98
+ provider: provider(raw.provider),
99
+ github: {
100
+ repo: str(github.repo, ""),
101
+ labelPrefix: str(github.labelPrefix, DEFAULT_LABEL_PREFIX),
102
+ },
103
+ jira: {
104
+ mcpServer: str(jira.mcpServer, "mcp-atlassian"),
105
+ project: str(jira.project, ""),
106
+ issueType: str(jira.issueType, "Story"),
107
+ labelPrefix: str(jira.labelPrefix, DEFAULT_LABEL_PREFIX),
108
+ statusMap: map(jira.statusMap, DEFAULT_STATUS_MAP),
109
+ priorityMap: map(jira.priorityMap, DEFAULT_PRIORITY_MAP),
110
+ },
111
+ };
112
+ }
113
+
114
+ /** Prefix used by the active provider's managed labels. */
115
+ export function labelPrefix(cfg: BacklogConfig): string {
116
+ return cfg.provider === "jira" ? cfg.jira.labelPrefix : cfg.github.labelPrefix;
117
+ }
118
+
119
+ /** A label the sync owns; stories may not use it themselves. */
120
+ export function isManagedLabel(label: string, prefix: string): boolean {
121
+ return label === prefix || label.startsWith(`${prefix}-`);
122
+ }