domain-knowledge-kit 0.2.15 → 0.2.19

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 (210) hide show
  1. package/README.md +4 -0
  2. package/dist/cli.js +24 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/features/agent/commands/init.d.ts +90 -1
  5. package/dist/features/agent/commands/init.d.ts.map +1 -1
  6. package/dist/features/agent/commands/init.js +328 -32
  7. package/dist/features/agent/commands/init.js.map +1 -1
  8. package/dist/features/agent/commands/prime.d.ts +11 -0
  9. package/dist/features/agent/commands/prime.d.ts.map +1 -1
  10. package/dist/features/agent/commands/prime.js +105 -8
  11. package/dist/features/agent/commands/prime.js.map +1 -1
  12. package/dist/features/agent/commands/update.d.ts +27 -0
  13. package/dist/features/agent/commands/update.d.ts.map +1 -0
  14. package/dist/features/agent/commands/update.js +316 -0
  15. package/dist/features/agent/commands/update.js.map +1 -0
  16. package/dist/features/agent/dkk-artifacts.d.ts +76 -0
  17. package/dist/features/agent/dkk-artifacts.d.ts.map +1 -0
  18. package/dist/features/agent/dkk-artifacts.js +328 -0
  19. package/dist/features/agent/dkk-artifacts.js.map +1 -0
  20. package/dist/features/agent/install-mode.d.ts +34 -0
  21. package/dist/features/agent/install-mode.d.ts.map +1 -0
  22. package/dist/features/agent/install-mode.js +78 -0
  23. package/dist/features/agent/install-mode.js.map +1 -0
  24. package/dist/features/agent/mcp-register.d.ts +20 -0
  25. package/dist/features/agent/mcp-register.d.ts.map +1 -0
  26. package/dist/features/agent/mcp-register.js +116 -0
  27. package/dist/features/agent/mcp-register.js.map +1 -0
  28. package/dist/features/agent/settings-prune.d.ts +29 -0
  29. package/dist/features/agent/settings-prune.d.ts.map +1 -0
  30. package/dist/features/agent/settings-prune.js +70 -0
  31. package/dist/features/agent/settings-prune.js.map +1 -0
  32. package/dist/features/agent/tests/settings-prune.test.d.ts +2 -0
  33. package/dist/features/agent/tests/settings-prune.test.d.ts.map +1 -0
  34. package/dist/features/agent/tests/settings-prune.test.js +118 -0
  35. package/dist/features/agent/tests/settings-prune.test.js.map +1 -0
  36. package/dist/features/federation/commands/consumers.d.ts +40 -0
  37. package/dist/features/federation/commands/consumers.d.ts.map +1 -0
  38. package/dist/features/federation/commands/consumers.js +126 -0
  39. package/dist/features/federation/commands/consumers.js.map +1 -0
  40. package/dist/features/federation/commands/peers-add.d.ts +14 -0
  41. package/dist/features/federation/commands/peers-add.d.ts.map +1 -0
  42. package/dist/features/federation/commands/peers-add.js +79 -0
  43. package/dist/features/federation/commands/peers-add.js.map +1 -0
  44. package/dist/features/federation/commands/peers-list.d.ts +8 -0
  45. package/dist/features/federation/commands/peers-list.d.ts.map +1 -0
  46. package/dist/features/federation/commands/peers-list.js +51 -0
  47. package/dist/features/federation/commands/peers-list.js.map +1 -0
  48. package/dist/features/federation/commands/peers-status.d.ts +8 -0
  49. package/dist/features/federation/commands/peers-status.d.ts.map +1 -0
  50. package/dist/features/federation/commands/peers-status.js +78 -0
  51. package/dist/features/federation/commands/peers-status.js.map +1 -0
  52. package/dist/features/federation/commands/pull.d.ts +18 -0
  53. package/dist/features/federation/commands/pull.d.ts.map +1 -0
  54. package/dist/features/federation/commands/pull.js +153 -0
  55. package/dist/features/federation/commands/pull.js.map +1 -0
  56. package/dist/features/federation/git-fetcher.d.ts +45 -0
  57. package/dist/features/federation/git-fetcher.d.ts.map +1 -0
  58. package/dist/features/federation/git-fetcher.js +70 -0
  59. package/dist/features/federation/git-fetcher.js.map +1 -0
  60. package/dist/features/federation/loader.d.ts +60 -0
  61. package/dist/features/federation/loader.d.ts.map +1 -0
  62. package/dist/features/federation/loader.js +193 -0
  63. package/dist/features/federation/loader.js.map +1 -0
  64. package/dist/features/federation/lock.d.ts +12 -0
  65. package/dist/features/federation/lock.d.ts.map +1 -0
  66. package/dist/features/federation/lock.js +48 -0
  67. package/dist/features/federation/lock.js.map +1 -0
  68. package/dist/features/federation/tests/git-fetcher.test.d.ts +2 -0
  69. package/dist/features/federation/tests/git-fetcher.test.d.ts.map +1 -0
  70. package/dist/features/federation/tests/git-fetcher.test.js +167 -0
  71. package/dist/features/federation/tests/git-fetcher.test.js.map +1 -0
  72. package/dist/features/federation/tests/loader.test.d.ts +2 -0
  73. package/dist/features/federation/tests/loader.test.d.ts.map +1 -0
  74. package/dist/features/federation/tests/loader.test.js +144 -0
  75. package/dist/features/federation/tests/loader.test.js.map +1 -0
  76. package/dist/features/federation/tests/phase5.test.d.ts +2 -0
  77. package/dist/features/federation/tests/phase5.test.d.ts.map +1 -0
  78. package/dist/features/federation/tests/phase5.test.js +137 -0
  79. package/dist/features/federation/tests/phase5.test.js.map +1 -0
  80. package/dist/features/federation/tests/schema-load.test.d.ts +2 -0
  81. package/dist/features/federation/tests/schema-load.test.d.ts.map +1 -0
  82. package/dist/features/federation/tests/schema-load.test.js +97 -0
  83. package/dist/features/federation/tests/schema-load.test.js.map +1 -0
  84. package/dist/features/federation/tests/validator.test.d.ts +2 -0
  85. package/dist/features/federation/tests/validator.test.d.ts.map +1 -0
  86. package/dist/features/federation/tests/validator.test.js +319 -0
  87. package/dist/features/federation/tests/validator.test.js.map +1 -0
  88. package/dist/features/mcp/commands/serve.d.ts +10 -0
  89. package/dist/features/mcp/commands/serve.d.ts.map +1 -0
  90. package/dist/features/mcp/commands/serve.js +12 -0
  91. package/dist/features/mcp/commands/serve.js.map +1 -0
  92. package/dist/features/mcp/server.d.ts +15 -0
  93. package/dist/features/mcp/server.d.ts.map +1 -0
  94. package/dist/features/mcp/server.js +438 -0
  95. package/dist/features/mcp/server.js.map +1 -0
  96. package/dist/features/pipeline/commands/validate.d.ts.map +1 -1
  97. package/dist/features/pipeline/commands/validate.js +7 -0
  98. package/dist/features/pipeline/commands/validate.js.map +1 -1
  99. package/dist/features/pipeline/indexer.d.ts +28 -2
  100. package/dist/features/pipeline/indexer.d.ts.map +1 -1
  101. package/dist/features/pipeline/indexer.js +82 -27
  102. package/dist/features/pipeline/indexer.js.map +1 -1
  103. package/dist/features/pipeline/validator.d.ts +10 -0
  104. package/dist/features/pipeline/validator.d.ts.map +1 -1
  105. package/dist/features/pipeline/validator.js +274 -27
  106. package/dist/features/pipeline/validator.js.map +1 -1
  107. package/dist/features/query/commands/list.d.ts +10 -0
  108. package/dist/features/query/commands/list.d.ts.map +1 -1
  109. package/dist/features/query/commands/list.js +1 -1
  110. package/dist/features/query/commands/list.js.map +1 -1
  111. package/dist/features/query/commands/locate.d.ts +1 -0
  112. package/dist/features/query/commands/locate.d.ts.map +1 -1
  113. package/dist/features/query/commands/locate.js +1 -1
  114. package/dist/features/query/commands/locate.js.map +1 -1
  115. package/dist/features/query/commands/search.d.ts.map +1 -1
  116. package/dist/features/query/commands/search.js +2 -0
  117. package/dist/features/query/commands/search.js.map +1 -1
  118. package/dist/features/query/commands/show.d.ts +15 -0
  119. package/dist/features/query/commands/show.d.ts.map +1 -1
  120. package/dist/features/query/commands/show.js +116 -58
  121. package/dist/features/query/commands/show.js.map +1 -1
  122. package/dist/features/query/commands/story.d.ts +70 -0
  123. package/dist/features/query/commands/story.d.ts.map +1 -1
  124. package/dist/features/query/commands/story.js +2 -2
  125. package/dist/features/query/commands/story.js.map +1 -1
  126. package/dist/features/query/commands/summary.d.ts +3 -0
  127. package/dist/features/query/commands/summary.d.ts.map +1 -1
  128. package/dist/features/query/commands/summary.js +1 -1
  129. package/dist/features/query/commands/summary.js.map +1 -1
  130. package/dist/features/query/searcher.d.ts +18 -1
  131. package/dist/features/query/searcher.d.ts.map +1 -1
  132. package/dist/features/query/searcher.js +11 -2
  133. package/dist/features/query/searcher.js.map +1 -1
  134. package/dist/features/scaffold/commands/new-domain.d.ts +22 -0
  135. package/dist/features/scaffold/commands/new-domain.d.ts.map +1 -1
  136. package/dist/features/scaffold/commands/new-domain.js +44 -28
  137. package/dist/features/scaffold/commands/new-domain.js.map +1 -1
  138. package/dist/features/scaffold/commands/service-init.d.ts +12 -0
  139. package/dist/features/scaffold/commands/service-init.d.ts.map +1 -0
  140. package/dist/features/scaffold/commands/service-init.js +69 -0
  141. package/dist/features/scaffold/commands/service-init.js.map +1 -0
  142. package/dist/shared/graph.d.ts +8 -0
  143. package/dist/shared/graph.d.ts.map +1 -1
  144. package/dist/shared/graph.js +180 -112
  145. package/dist/shared/graph.js.map +1 -1
  146. package/dist/shared/index.d.ts +4 -1
  147. package/dist/shared/index.d.ts.map +1 -1
  148. package/dist/shared/index.js +6 -1
  149. package/dist/shared/index.js.map +1 -1
  150. package/dist/shared/loader.d.ts +22 -0
  151. package/dist/shared/loader.d.ts.map +1 -1
  152. package/dist/shared/loader.js +31 -1
  153. package/dist/shared/loader.js.map +1 -1
  154. package/dist/shared/paths.d.ts +59 -7
  155. package/dist/shared/paths.d.ts.map +1 -1
  156. package/dist/shared/paths.js +93 -11
  157. package/dist/shared/paths.js.map +1 -1
  158. package/dist/shared/refs.d.ts +96 -0
  159. package/dist/shared/refs.d.ts.map +1 -0
  160. package/dist/shared/refs.js +182 -0
  161. package/dist/shared/refs.js.map +1 -0
  162. package/dist/shared/service-id.d.ts +11 -0
  163. package/dist/shared/service-id.d.ts.map +1 -0
  164. package/dist/shared/service-id.js +64 -0
  165. package/dist/shared/service-id.js.map +1 -0
  166. package/dist/shared/tests/paths.test.d.ts +2 -0
  167. package/dist/shared/tests/paths.test.d.ts.map +1 -0
  168. package/dist/shared/tests/paths.test.js +111 -0
  169. package/dist/shared/tests/paths.test.js.map +1 -0
  170. package/dist/shared/tests/refs.test.d.ts +2 -0
  171. package/dist/shared/tests/refs.test.d.ts.map +1 -0
  172. package/dist/shared/tests/refs.test.js +104 -0
  173. package/dist/shared/tests/refs.test.js.map +1 -0
  174. package/dist/shared/types/domain.d.ts +14 -0
  175. package/dist/shared/types/domain.d.ts.map +1 -1
  176. package/dist/shared/types/federation.d.ts +60 -0
  177. package/dist/shared/types/federation.d.ts.map +1 -0
  178. package/dist/shared/types/federation.js +12 -0
  179. package/dist/shared/types/federation.js.map +1 -0
  180. package/dist/version.d.ts +4 -0
  181. package/dist/version.d.ts.map +1 -0
  182. package/dist/version.js +15 -0
  183. package/dist/version.js.map +1 -0
  184. package/package.json +8 -5
  185. package/tools/dkk/claude/agents/dkk-domain-reviewer.md +69 -0
  186. package/tools/dkk/claude/commands/dkk-adr.md +11 -0
  187. package/tools/dkk/claude/commands/dkk-impact.md +34 -0
  188. package/tools/dkk/claude/commands/dkk-implement.md +12 -0
  189. package/tools/dkk/claude/commands/dkk-prime.md +6 -0
  190. package/tools/dkk/claude/commands/dkk-review.md +12 -0
  191. package/tools/dkk/claude/commands/dkk-story.md +12 -0
  192. package/tools/dkk/claude/hooks/post-edit-validate.mjs +68 -0
  193. package/tools/dkk/claude/hooks/pre-edit-block-generated.mjs +39 -0
  194. package/tools/dkk/claude/hooks/session-start-prime.mjs +20 -0
  195. package/tools/dkk/claude/hooks/stop-validate.mjs +67 -0
  196. package/tools/dkk/claude/settings.json +62 -0
  197. package/tools/dkk/claude/skills/dkk-adr-author/SKILL.md +54 -0
  198. package/tools/dkk/claude/skills/dkk-flow-implementer/SKILL.md +51 -0
  199. package/tools/dkk/claude/skills/dkk-story-analyst/SKILL.md +108 -0
  200. package/tools/dkk/schema/actors.schema.json +1 -1
  201. package/tools/dkk/schema/adr-frontmatter.schema.json +4 -4
  202. package/tools/dkk/schema/aggregate.schema.json +1 -1
  203. package/tools/dkk/schema/command.schema.json +1 -1
  204. package/tools/dkk/schema/event.schema.json +1 -1
  205. package/tools/dkk/schema/federation.schema.json +71 -0
  206. package/tools/dkk/schema/glossary.schema.json +1 -1
  207. package/tools/dkk/schema/index.schema.json +2 -2
  208. package/tools/dkk/schema/policy.schema.json +1 -1
  209. package/tools/dkk/schema/read-model.schema.json +1 -1
  210. package/tools/dkk/schema/service.schema.json +30 -0
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: dkk-story-analyst
3
+ description: Generate, split, or reshape user stories and epics from the local Domain Knowledge Pack. Use when the user asks to write, draft, refine, or split a user story or epic for a feature that maps to a DKK flow or command.
4
+ ---
5
+
6
+ # Story Analyst
7
+
8
+ Use this skill whenever the user asks to **write, draft, generate, refine, or split a user story or epic** in a project that has a Domain Knowledge Pack (`.dkk/`).
9
+
10
+ > **"User stories" and "epics" here are behavioral requirements derived from the local DDD/Event-Storming model in `.dkk/`.** Do not consult external trackers (Jira, GitHub Issues, Linear, Trello, etc.). The MCP `dkk` server (or the `dkk` CLI as fallback) is the only source of truth.
11
+
12
+ ## Preferred tools
13
+
14
+ 1. `mcp__dkk__story` — aggregate a flow's full context (actors, steps, policies, BDD examples, ADRs, downstream effects) in one call
15
+ 2. `mcp__dkk__list` filtered by `type: flow` — discover available flows
16
+ 3. `mcp__dkk__search` — locate a flow or command from a feature name
17
+ 4. `mcp__dkk__show` — fall back when no flow exists, to read a command directly
18
+ 5. `mcp__dkk__related` — to gather neighbours when working from a command instead of a flow
19
+
20
+ Use the corresponding `dkk` shell commands only if the MCP server is unavailable.
21
+
22
+ ## Workflow
23
+
24
+ 1. **Identify the flow.** Normalize the id (`flow.<Name>` or bare `<Name>`). If the user gave a feature name instead, call `mcp__dkk__search` to locate a matching flow or root command.
25
+ 2. **Retrieve context.** Call `mcp__dkk__story` with the flow id. The response contains actors, ordered steps, triggered policies, BDD examples, ADRs, and downstream effects.
26
+ 3. **Clarify scope.** Ask **1–7 clarifying questions** before drafting. Derive every question, its options, and your recommended default from the actual story output and the project's conventions — never use a fixed list. Each question must offer concrete options with one marked as recommended. **Skip the questions entirely** for trivial flows (≤2 steps, 1 actor, no ambiguity). Target product behavior and story scope, e.g.:
27
+ - Which user-facing outcome matters most?
28
+ - Confirmation/feedback on success — how should it surface?
29
+ - On failure or rejection, what does the user experience?
30
+ - Optional steps that can be skipped, or strictly linear?
31
+ - Happy path only, or include edge cases?
32
+ 4. **Map to story format.**
33
+ - **As a** `<Actor from "Actors" section>`
34
+ - **I want to** `<Command description from Steps>`
35
+ - **So that** `<Flow description>`
36
+ 5. **Write acceptance criteria** from the policies and BDD examples in the output:
37
+ - Policies → Given/When/Then: *When [triggering event] → Then [consequent command]*
38
+ - BDD examples on commands and events are pre-written scenarios — use them directly or expand
39
+ 6. **Add an Architectural Constraints section** listing every ADR (`adr-NNNN — title — status`). Developers must respect these.
40
+ 7. **Add an Implementation Notes section** from the downstream effects: read models to update, secondary policies that fire.
41
+
42
+ ## Noun enforcement (mandatory)
43
+
44
+ Use only the terminology in the `mcp__dkk__story` output. Do not:
45
+
46
+ - Invent entity, command, or event names not present
47
+ - Rename domain terms (if DKK says `OrderBasket`, the story says `OrderBasket`)
48
+ - Reference bounded contexts not mentioned in the step refs
49
+ - Pull names from external APIs or trackers
50
+
51
+ If unsure whether a term is canonical, run `mcp__dkk__search` to verify.
52
+
53
+ ## Epic vs. story decision rules
54
+
55
+ After retrieving the flow context:
56
+
57
+ - **Single story** when the flow has ≤3 command steps and spans ≤1 bounded context.
58
+ - **Epic with story slices** when the flow has >3 command steps **or** spans >1 bounded context. Slice by:
59
+ 1. Group consecutive steps that share the same context prefix (all `ordering.*` steps → Story 1)
60
+ 2. Each policy trigger becomes its own story ("As a system, when X happens, I want Y to be triggered, so that Z")
61
+ 3. Each slice that produces an event consumed by a read model must include updating that read model in its scope or acceptance criteria
62
+
63
+ When recommending an epic breakdown, present the slice boundaries and explain which downstream effects belong to each slice based on the model.
64
+
65
+ ## Story reshaping
66
+
67
+ When asked to refine, split, or revise an existing story:
68
+
69
+ 1. Call `mcp__dkk__story` for the relevant flow to get current domain truth
70
+ 2. Compare the story's terminology to the output
71
+ 3. Flag mismatches: invented terms, missing actors, acceptance criteria that contradict policies
72
+ 4. Suggest corrections using exact DKK terminology
73
+ 5. Ensure the reshaped story still covers all downstream effects
74
+
75
+ ## Fallback: no flow exists
76
+
77
+ If no flow has been modeled for the requested feature:
78
+
79
+ 1. Locate the most relevant command: `mcp__dkk__search` with `type: command`
80
+ 2. Get its full definition: `mcp__dkk__show`
81
+ 3. Get its neighbours: `mcp__dkk__related` with `depth: 2`
82
+ 4. Assemble the story from:
83
+ - Command `actor` → "As a..."
84
+ - Command `description` → "I want to..."
85
+ - Command `preconditions`, `rejections`, `examples` → acceptance criteria
86
+ - Neighbouring policies and read models → downstream effects
87
+ 5. Note in the story that no formal flow has been modeled, and recommend the team define one.
88
+
89
+ ## Output format
90
+
91
+ ```markdown
92
+ ## [Story Title]
93
+
94
+ **As a** [Actor], **I want to** [action], **so that** [business value].
95
+
96
+ ### Acceptance Criteria
97
+
98
+ - **Given** [precondition], **When** [command/event], **Then** [outcome]
99
+ - (repeat for each policy rule and BDD example)
100
+
101
+ ### Architectural Constraints
102
+
103
+ - [adr-NNNN]: [title] ([status])
104
+
105
+ ### Implementation Notes
106
+
107
+ - [Downstream read models, secondary policy triggers, cross-context effects]
108
+ ```
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "adr_refs": {
39
39
  "type": "array",
40
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
40
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
41
41
  "uniqueItems": true,
42
42
  "description": "Related ADR identifiers"
43
43
  }
@@ -34,16 +34,16 @@
34
34
  "type": "array",
35
35
  "items": {
36
36
  "type": "string",
37
- "pattern": "^[a-z][a-z0-9-]*\\.[A-Za-z][A-Za-z0-9]*$",
38
- "description": "Domain item reference in context.Name format (e.g. ordering.OrderPlaced)"
37
+ "pattern": "^([a-z][a-z0-9-]*:)?[a-z][a-z0-9-]*\\.[A-Za-z][A-Za-z0-9]*$",
38
+ "description": "Domain item reference in context.Name format (e.g. ordering.OrderPlaced, or service:context.Name for federated refs)"
39
39
  },
40
40
  "uniqueItems": true,
41
41
  "description": "Domain items related to this decision"
42
42
  },
43
43
  "superseded_by": {
44
44
  "type": "string",
45
- "pattern": "^adr-\\d{4}$",
46
- "description": "ID of the ADR that supersedes this one"
45
+ "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$",
46
+ "description": "ID of the ADR that supersedes this one (optionally service-qualified for peer ADRs)"
47
47
  }
48
48
  },
49
49
  "required": ["id", "title", "status", "date"],
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "adr_refs": {
50
50
  "type": "array",
51
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
51
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
52
52
  "uniqueItems": true,
53
53
  "description": "Related ADR identifiers"
54
54
  }
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "adr_refs": {
68
68
  "type": "array",
69
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
69
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
70
70
  "uniqueItems": true,
71
71
  "description": "Related ADR identifiers"
72
72
  }
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "adr_refs": {
58
58
  "type": "array",
59
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
59
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
60
60
  "uniqueItems": true,
61
61
  "description": "Related ADR identifiers"
62
62
  }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "federation.schema.json",
4
+ "title": "Federation Manifest",
5
+ "description": "Peer service manifest for multi-repo federation (.dkk/federation.yml). Each peer points at a filesystem path or a git URL+branch; the peer's `.dkk/` directory is loaded read-only alongside the local model.",
6
+ "type": "object",
7
+ "properties": {
8
+ "peers": {
9
+ "type": "array",
10
+ "items": { "$ref": "#/definitions/peer" },
11
+ "description": "Peer services whose .dkk/ should be loaded alongside the local model."
12
+ }
13
+ },
14
+ "required": ["peers"],
15
+ "additionalProperties": false,
16
+ "definitions": {
17
+ "peer": {
18
+ "type": "object",
19
+ "properties": {
20
+ "name": {
21
+ "type": "string",
22
+ "pattern": "^[a-z][a-z0-9-]*$",
23
+ "description": "Kebab-case peer service name (must match the peer's own service.yml)."
24
+ },
25
+ "source": {
26
+ "oneOf": [
27
+ { "$ref": "#/definitions/localSource" },
28
+ { "$ref": "#/definitions/gitSource" }
29
+ ]
30
+ }
31
+ },
32
+ "required": ["name", "source"],
33
+ "additionalProperties": false
34
+ },
35
+ "localSource": {
36
+ "type": "object",
37
+ "properties": {
38
+ "type": { "const": "local" },
39
+ "path": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "description": "Absolute or repo-root-relative path to the peer's repository root."
43
+ }
44
+ },
45
+ "required": ["type", "path"],
46
+ "additionalProperties": false
47
+ },
48
+ "gitSource": {
49
+ "type": "object",
50
+ "properties": {
51
+ "type": { "const": "git" },
52
+ "url": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "description": "Git URL (https or ssh)."
56
+ },
57
+ "branch": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "description": "Branch to track."
61
+ },
62
+ "path": {
63
+ "type": "string",
64
+ "description": "Optional sub-path inside the peer repo where .dkk/ lives (default: repo root)."
65
+ }
66
+ },
67
+ "required": ["type", "url", "branch"],
68
+ "additionalProperties": false
69
+ }
70
+ }
71
+ }
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "adr_refs": {
25
25
  "type": "array",
26
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
26
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
27
27
  "uniqueItems": true,
28
28
  "description": "Related ADR identifiers (e.g. adr-0001)"
29
29
  }
@@ -46,8 +46,8 @@
46
46
  "properties": {
47
47
  "ref": {
48
48
  "type": "string",
49
- "pattern": "^[a-z][a-z0-9-]*\\.[A-Za-z][A-Za-z0-9]*$",
50
- "description": "Domain item reference (context.Name)"
49
+ "pattern": "^([a-z][a-z0-9-]*:)?[a-z][a-z0-9-]*\\.[A-Za-z][A-Za-z0-9]*$",
50
+ "description": "Domain item reference (context.Name, or service:context.Name for federated refs)"
51
51
  },
52
52
  "type": {
53
53
  "type": "string",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "adr_refs": {
45
45
  "type": "array",
46
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
46
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
47
47
  "uniqueItems": true,
48
48
  "description": "Related ADR identifiers"
49
49
  }
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "adr_refs": {
45
45
  "type": "array",
46
- "items": { "type": "string", "pattern": "^adr-\\d{4}$" },
46
+ "items": { "type": "string", "pattern": "^([a-z][a-z0-9-]*:)?adr-\\d{4}$" },
47
47
  "uniqueItems": true,
48
48
  "description": "Related ADR identifiers"
49
49
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "service.schema.json",
4
+ "title": "Service Manifest",
5
+ "description": "Service identity for multi-repo federation (.dkk/service.yml). Declares this repo's service name and the bounded contexts it publishes for cross-repo consumption.",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "pattern": "^[a-z][a-z0-9-]*$",
11
+ "description": "Kebab-case service identifier (e.g. \"ordering\"). Globally unique within an org."
12
+ },
13
+ "exports": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "string",
17
+ "pattern": "^[a-z][a-z0-9-]*$"
18
+ },
19
+ "uniqueItems": true,
20
+ "description": "Bounded-context names this service publishes for federation."
21
+ },
22
+ "description": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "description": "Optional human-readable description of the service."
26
+ }
27
+ },
28
+ "required": ["name", "exports"],
29
+ "additionalProperties": false
30
+ }