@juancr11/sibu 0.6.0 → 0.8.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 (69) hide show
  1. package/bin/admin/changelog.js +155 -0
  2. package/bin/admin/release.js +217 -0
  3. package/bin/entrypoints/cli/create-program.js +1 -1
  4. package/bin/entrypoints/cli/execute-command.js +6 -6
  5. package/bin/modules/interactive-guidance/index.js +1 -0
  6. package/bin/{shared → modules/interactive-guidance}/prompts.js +17 -1
  7. package/bin/modules/maintainer-release-support/generate-changelog/changelog-format.js +213 -0
  8. package/bin/modules/maintainer-release-support/generate-changelog/changelog-writer.js +91 -0
  9. package/bin/modules/maintainer-release-support/generate-changelog/git-history.js +93 -0
  10. package/bin/modules/maintainer-release-support/generate-changelog/handler.js +167 -0
  11. package/bin/modules/maintainer-release-support/generate-changelog/semver.js +40 -0
  12. package/bin/modules/maintainer-release-support/index.js +2 -0
  13. package/bin/modules/maintainer-release-support/release-workflow/git-release.js +114 -0
  14. package/bin/modules/maintainer-release-support/release-workflow/handler.js +369 -0
  15. package/bin/modules/maintainer-release-support/release-workflow/package-json.js +181 -0
  16. package/bin/modules/maintainer-release-support/release-workflow/release-plan.js +87 -0
  17. package/bin/{features/init-project → modules/project-adoption}/handler.js +7 -5
  18. package/bin/modules/project-adoption/index.js +1 -0
  19. package/bin/modules/skill-selection-management/index.js +3 -0
  20. package/bin/{features → modules/skill-selection-management}/list-skills/handler.js +14 -4
  21. package/bin/{features → modules/skill-selection-management}/stop-managing-file/handler.js +15 -8
  22. package/bin/modules/skill-selection-management/use-skill/command.js +1 -0
  23. package/bin/{features → modules/skill-selection-management}/use-skill/handler.js +42 -8
  24. package/bin/{features/sync-project → modules/sync-review}/apply-action.js +5 -3
  25. package/bin/modules/sync-review/command.js +1 -0
  26. package/bin/{features/sync-project → modules/sync-review}/handler.js +4 -4
  27. package/bin/modules/sync-review/index.js +5 -0
  28. package/bin/{shared → modules/sync-review}/sync-preview.js +11 -7
  29. package/bin/modules/template-catalog-rendering/index.js +1 -0
  30. package/bin/modules/template-catalog-rendering/templates.js +60 -0
  31. package/bin/modules/version-advisory/index.js +1 -0
  32. package/bin/{shared → modules/version-advisory}/npm-version.js +29 -2
  33. package/bin/modules/workflow-health-diagnosis/command.js +1 -0
  34. package/bin/{features/doctor-project → modules/workflow-health-diagnosis}/handler.js +13 -7
  35. package/bin/modules/workflow-health-diagnosis/index.js +1 -0
  36. package/bin/modules/workflow-mutation-readiness/index.js +1 -0
  37. package/bin/{shared → modules/workflow-mutation-readiness}/workflow-mutation-readiness.js +3 -3
  38. package/bin/modules/workflow-state-registry/index.js +1 -0
  39. package/bin/{shared → modules/workflow-state-registry}/state.js +3 -1
  40. package/bin/modules/workflow-target-planning/catalog.js +252 -0
  41. package/bin/modules/workflow-target-planning/index.js +2 -0
  42. package/bin/modules/workflow-target-planning/workflow-targets.js +130 -0
  43. package/bin/shared/catalog.js +0 -253
  44. package/bin/shared/paths.js +1 -12
  45. package/bin/shared/workflow-targets.js +3 -2
  46. package/package.json +4 -2
  47. package/templates/AGENTS.md +3 -3
  48. package/templates/manifest.json +38 -27
  49. package/templates/skills/ai-implementation-plan-executor/SKILL.md +74 -70
  50. package/templates/skills/ai-implementation-planner/SKILL.md +24 -17
  51. package/templates/skills/architecture/command-pattern/SKILL.md +32 -20
  52. package/templates/skills/architecture/ddd-hexagonal/SKILL.md +14 -9
  53. package/templates/skills/deep-module-map-writer/SKILL.md +241 -0
  54. package/templates/skills/feature-brief-writer/SKILL.md +24 -24
  55. package/templates/skills/postgresql-expert/SKILL.md +72 -0
  56. package/templates/skills/product-vision-writer/SKILL.md +2 -2
  57. package/templates/skills/scrum-master-planner/SKILL.md +2 -2
  58. package/templates/skills/technical-design-writer/SKILL.md +15 -15
  59. package/templates/skills/ux-expert/SKILL.md +1 -1
  60. package/bin/features/sync-project/preview.js +0 -1
  61. package/templates/skills/product-context-map-writer/SKILL.md +0 -211
  62. /package/bin/{features/doctor-project/command.js → modules/cli-command-surface/index.js} +0 -0
  63. /package/bin/{features/init-project → modules/maintainer-release-support/generate-changelog}/command.js +0 -0
  64. /package/bin/{features/list-skills → modules/maintainer-release-support/release-workflow}/command.js +0 -0
  65. /package/bin/{features/stop-managing-file → modules/project-adoption}/command.js +0 -0
  66. /package/bin/{features/sync-project → modules/skill-selection-management/list-skills}/command.js +0 -0
  67. /package/bin/{features/use-skill → modules/skill-selection-management/stop-managing-file}/command.js +0 -0
  68. /package/bin/{features/sync-project → modules/sync-review}/action-prompt.js +0 -0
  69. /package/bin/{features/sync-project → modules/sync-review}/log-preview.js +0 -0
@@ -10,13 +10,15 @@ Use this skill to design and implement software features as independent, end-to-
10
10
 
11
11
  ---
12
12
 
13
- ## Product Context Compatibility
13
+ ## Deep Module Compatibility
14
14
 
15
- Product Contexts answer “where does this work belong?” Command Pattern guidance answers “how is that work structured as command-oriented vertical slices?”
15
+ Deep Modules answer “where does this implementation work belong?” Command Pattern guidance answers “how is that work structured as command-oriented vertical slices inside the selected module?”
16
16
 
17
- When `docs/product-context-map.md`, a feature brief, or a technical design names Product Contexts, place each vertical slice within or clearly under the relevant Product Context's ownership. The feature-local Command, Handler, Port, Adapter, and Result guidance still applies inside that context boundary.
17
+ When `docs/deep-module-map.md`, a feature brief, or a technical design names Deep Modules, place each vertical slice inside the relevant Deep Module. The feature-local Command, Handler, Port, Adapter, and Result guidance still applies inside that module boundary.
18
18
 
19
- Do not invent new Product Contexts during design or implementation. If work does not fit the approved contexts, stop and route the decision back to the `product-context-map-writer` workflow.
19
+ Do not invent new Deep Modules during design or implementation. If work does not fit the approved modules, stop and route the decision back to the `deep-module-map-writer` workflow.
20
+
21
+ Do not treat shallow technical buckets such as `utils`, `api`, `db`, or `services` as Deep Modules. A Deep Module should expose a small, stable interface while hiding meaningful implementation complexity; product alignment can help explain why work changes together, but product category alone does not make a module deep.
20
22
 
21
23
  ---
22
24
 
@@ -37,20 +39,30 @@ Organize by Capability (what the system does) rather than Technical Layer (what
37
39
 
38
40
  ```text
39
41
  /src
40
- ├── /entrypoints # Driving Adapters (The "Edges")
41
- │ └── /cli # Parses flags/args -> creates Command -> calls Handler
42
- ├── /features # THE HEXAGON (Domain & Application Logic)
43
- │ └── /feature-name # e.g., "archive-project"
44
- ├── command # The Input DTO
45
- ├── handler # The Orchestration logic
46
- ├── ports # Interfaces required by the handler
47
- └── result # The Output DTO/Contract
48
- ├── /shared # Universal logic only
49
- ├── /domain # Global Entities (e.g., "User", "Project")
50
- └── /errors # Global error definitions
51
- └── /infrastructure # Driven Adapters (Implementation Details)
52
- ├── /persistence # DB implementations of feature Ports
53
- └── /clients # External API implementations of feature Ports
42
+ ├── /entrypoints # Driving Adapters (The "Edges")
43
+ │ └── /cli # Parses flags/args -> creates Command -> calls Handler
44
+ ├── /modules # Deep Modules from docs/deep-module-map.md
45
+ │ └── /module-slug # e.g., "workflow-adoption"
46
+ └── /feature-slice # e.g., "archive-project"
47
+ ├── command # The Input DTO
48
+ ├── handler # The Orchestration logic
49
+ ├── ports # Interfaces required by the handler
50
+ │ └── result # The Output DTO/Contract
51
+ ├── /shared # Universal logic only
52
+ ├── /domain # Global Entities (e.g., "User", "Project")
53
+ └── /errors # Global error definitions
54
+ └── /infrastructure # Driven Adapters (Implementation Details)
55
+ ├── /persistence # DB implementations of feature Ports
56
+ └── /clients # External API implementations of feature Ports
57
+ ```
58
+
59
+ Default slice paths:
60
+
61
+ ```text
62
+ /src/modules/<module-slug>/<feature-slice>/command
63
+ /src/modules/<module-slug>/<feature-slice>/handler
64
+ /src/modules/<module-slug>/<feature-slice>/ports
65
+ /src/modules/<module-slug>/<feature-slice>/result
54
66
  ```
55
67
 
56
68
  ---
@@ -58,7 +70,7 @@ Organize by Capability (what the system does) rather than Technical Layer (what
58
70
  ## 3. Operational Rules for Implementation
59
71
 
60
72
  ### Rule 1: Feature Isolation
61
- A feature folder must never import from another feature folder. If two features need the same logic, that logic must be promoted to the /shared directory.
73
+ A feature-slice folder must never import from another feature-slice folder. If two slices need the same logic, that logic must be promoted to the owning Deep Module or to /shared when it is truly universal.
62
74
 
63
75
  ### Rule 2: Dependency Inversion
64
76
  The Handler must never instantiate a database, a file system, or a network client. It must receive its dependencies (via Ports) through its constructor or initialization.
@@ -83,5 +95,5 @@ Entrypoints (CLI/API) are responsible for Syntactic Validation (is the input the
83
95
  ## 5. Constraint Checklist for Agent Reviews
84
96
  - [ ] Zero Leakage: Does the Handler contain CLI-specific code (like fmt.Printf or flags)?
85
97
  - [ ] Interface-Driven: Does the Handler depend on a concrete Database class or an Interface (Port)?
86
- - [ ] Folder Integrity: Does the feature folder contain the Command, Handler, and Ports?
98
+ - [ ] Folder Integrity: Does the Deep Module feature-slice folder contain the Command, Handler, and Ports?
87
99
  - [ ] Dependency Direction: Does the infrastructure layer depend on the feature ports, and not the other way around?
@@ -27,15 +27,17 @@ This skill is backend-focused. It does not cover frontend component architecture
27
27
 
28
28
  If a simpler structure preserves clear boundaries, prefer the simpler structure.
29
29
 
30
- ## Product Context compatibility
30
+ ## Deep Module compatibility
31
31
 
32
- Product Contexts answer “where does this work belong?” DDD + Hexagonal answers “how is that context structured internally?”
32
+ Deep Modules answer “where does this implementation work belong?” DDD + Hexagonal answers “how is that module structured internally?”
33
33
 
34
- When `docs/product-context-map.md`, a feature brief, or a technical design names Product Contexts, treat them as the first ownership boundary to preserve before choosing domain/application/infra placement. Prefer placing domain concepts, use cases, ports, and adapters under the selected context's ownership. If work crosses contexts, name the owning context for each part and keep dependencies explicit.
34
+ When `docs/deep-module-map.md`, a feature brief, or a technical design names Deep Modules, treat each selected Deep Module as the default top-level implementation boundary before choosing domain/application/infra placement. Prefer placing domain concepts, use cases, ports, and adapters under the selected module's ownership. If work crosses modules, name the owning module for each part and keep dependencies explicit.
35
35
 
36
- A Product Context may contain `domain`, `application`, and `infra`/adapter concerns, but the map remains architecture-agnostic: it is not a required DDD Bounded Context, folder structure, service boundary, or layer model.
36
+ A Deep Module may contain `domain`, `application`, and `infra`/adapter concerns, but it is not automatically a DDD Bounded Context, service, package, database boundary, or team boundary. Projects that already use DDD Bounded Contexts may align a Bounded Context one-to-one with a Deep Module when that preserves the model and language.
37
37
 
38
- Do not invent new Product Contexts during design or implementation. If work does not fit the approved contexts, stop and route the decision back to the `product-context-map-writer` workflow.
38
+ Do not invent new Deep Modules during design or implementation. If work does not fit the approved modules, stop and route the decision back to the `deep-module-map-writer` workflow.
39
+
40
+ Do not treat shallow technical buckets such as `utils`, `api`, `db`, or `services` as Deep Modules. A Deep Module should expose a small, stable interface while hiding meaningful implementation complexity; product alignment can help explain why work changes together, but product category alone does not make a module deep.
39
41
 
40
42
  ## The layers
41
43
 
@@ -130,10 +132,13 @@ Do not create an entity or value object when:
130
132
 
131
133
  Use this default mapping when the project does not already have a clearer convention:
132
134
 
133
- - `<feature-or-domain>/domain/**` → domain concepts and rules
134
- - `<feature-or-domain>/application/**` use cases and application orchestration
135
- - `<feature-or-domain>/infra/**` technical implementations and external integrations
136
- - entrypoints such as routes, jobs, or handlers → thin driving adapters that call application behavior
135
+ ```text
136
+ /src/modules/<module-slug>/domain/** # Domain concepts and rules
137
+ /src/modules/<module-slug>/application/** # Use cases and application orchestration
138
+ /src/modules/<module-slug>/infra/** # Technical implementations and external integrations
139
+ ```
140
+
141
+ Entrypoints such as routes, jobs, or handlers should remain thin driving adapters that call application behavior inside the selected Deep Module.
137
142
 
138
143
  ## Ports and adapters
139
144
 
@@ -0,0 +1,241 @@
1
+ ---
2
+ name: deep-module-map-writer
3
+ description: Create or update docs/deep-module-map.md as a map of deep, complexity-hiding implementation modules before feature brief work.
4
+ ---
5
+
6
+ # Deep Module Map Writer
7
+
8
+ ## Purpose
9
+
10
+ Create or update `docs/deep-module-map.md`, a technical design map of deep implementation modules that downstream technical designs, feature briefs, and implementation plans use to decide where code work belongs.
11
+
12
+ A Deep Module is primarily a technical design concept from software architecture: a module with a small, simple interface and a larger, more complex implementation hidden behind it. In this artifact, Deep Modules may align with product responsibilities, but their depth comes from technical abstraction and complexity hiding, not from being a product category, command, folder, service, or team boundary.
13
+
14
+ This skill owns the Deep Module Map only. It does not own feature briefs, technical designs, user stories, implementation plans, production code, or the internal architecture used inside each module.
15
+
16
+ ## Pipeline Contract
17
+
18
+ ### What this skill needs
19
+
20
+ - `docs/product-vision.md`.
21
+ - Existing `docs/deep-module-map.md` when revising the map.
22
+ - Enough user interview context to identify candidate technical modules, the simple interface each module should expose to the rest of the app, the complexity each module should hide, boundaries, scenarios, relationships, and cross-module rules.
23
+
24
+ ### What this skill writes
25
+
26
+ - `docs/deep-module-map.md`.
27
+
28
+ ### When this skill stops
29
+
30
+ - `docs/product-vision.md` is missing; tell the user to create it first with `product-vision-writer`.
31
+ - The request belongs to another pipeline stage, such as feature brief, technical design, UX design, Scrum planning, implementation planning, or implementation execution.
32
+ - User answers are still too vague to defend module depth, interfaces, hidden complexity, or boundaries; ask one focused question instead of drafting.
33
+
34
+ ### What this skill must not do
35
+
36
+ - Do not create feature briefs, technical designs, UX specs, Epics, User Stories, implementation plans, or production code.
37
+ - Do not choose a specific internal architecture, service split, database model, framework, or team ownership structure.
38
+ - Do not ask for or require a final confirmation summary before writing once enough Deep Module Map information is available.
39
+ - Do not invent Deep Modules without grounding them in the product vision, current system behavior, and user interview.
40
+ - Do not treat a command, screen, helper, folder, data object, or technical layer as a Deep Module merely because it exists.
41
+
42
+ ## What a Deep Module is
43
+
44
+ A Deep Module is a module whose interface is much simpler than its implementation.
45
+
46
+ Use this mental model:
47
+
48
+ ```txt
49
+ Deep Module = small/simple interface + substantial hidden implementation complexity
50
+ Shallow Module = interface nearly as complex as the implementation it hides
51
+ ```
52
+
53
+ A module can be a function, class, package, subsystem, CLI workflow, or top-level code area. Size alone does not make a module deep. A large module can be shallow if callers must understand many details to use it, and a small module can be deep if it creates useful semantic distance between caller intent and implementation details.
54
+
55
+ For this map, identify deep modules that are useful as durable technical implementation boundaries. Product responsibilities can help discover them, but the module is only valid if it hides meaningful technical complexity behind a simpler interface. A good entry should answer:
56
+
57
+ ```txt
58
+ What simple capability should the rest of the app be able to rely on, and what messy details should be hidden behind that capability?
59
+ ```
60
+
61
+ A Deep Module is not automatically:
62
+
63
+ - a one-off feature
64
+ - a screen
65
+ - a command
66
+ - a workflow step
67
+ - a generic technical bucket such as `utils`, `api`, `db`, `shared`, or `services`
68
+ - a technical layer
69
+ - a required DDD Bounded Context
70
+ - a required service, package, database, or team boundary
71
+
72
+ Good Deep Modules:
73
+
74
+ - expose a small, stable interface to callers or neighboring modules
75
+ - hide complex decisions, orchestration, data handling, validation, or edge cases
76
+ - reduce how much other code must know
77
+ - have clear semantic distance between the module name/interface and the internal work it performs
78
+ - are stable enough to absorb related changes over time
79
+ - are broad enough to own meaningful behavior and narrow enough that boundaries are defensible
80
+
81
+ Use these tests:
82
+
83
+ - If callers can say what they want without knowing how it is done, the module may be deep.
84
+ - If the module hides several details that would otherwise leak into many callers, it may be deep.
85
+ - If using the module requires understanding almost the same steps as implementing it, it is probably shallow.
86
+ - If it only renames one obvious operation, it is probably shallow unless the name adds important semantic meaning for callers.
87
+ - If it describes one command, page, database object, helper folder, or implementation mechanism, it is probably too small or too technical for this map.
88
+ - If it only says "user control," "quality," "security," or another value that applies everywhere, it is probably a cross-module rule instead of a module.
89
+ - If two candidates cannot explain what interface and hidden complexity they own differently, merge or rename them.
90
+ - If future feature work would routinely ask "does this code belong here or there?", keep clarifying the boundary.
91
+
92
+ ## Required source of truth
93
+
94
+ Before doing any Deep Module Map work, read:
95
+
96
+ ```txt
97
+ docs/product-vision.md
98
+ ```
99
+
100
+ Use the product vision as the source of truth for purpose, audience, positioning, principles, boundaries, trust expectations, and success signals.
101
+
102
+ ## Hard start rule
103
+
104
+ Do not create or update a Deep Module Map if `docs/product-vision.md` is missing.
105
+
106
+ If the product vision is missing:
107
+
108
+ 1. Stop.
109
+ 2. Tell the user that a Deep Module Map requires `docs/product-vision.md`.
110
+ 3. Instruct the user to create the product vision first with `product-vision-writer`.
111
+ 4. Do not draft, infer, or save a module map until the product vision exists.
112
+
113
+ ## Output location
114
+
115
+ Write the map to:
116
+
117
+ ```txt
118
+ docs/deep-module-map.md
119
+ ```
120
+
121
+ This file is user-owned product and implementation-boundary content created or updated by this skill. It is not a Sibu-managed workflow template.
122
+
123
+ ## Interview posture
124
+
125
+ Be deliberately interrogative before writing.
126
+
127
+ - Ask one focused question at a time.
128
+ - Ask as many one-at-a-time questions as needed to understand the app well enough to defend the map.
129
+ - Do not rush to draft after a single answer unless the answer already makes interfaces, hidden complexity, boundaries, scenarios, and relationships clear.
130
+ - Treat "enough context" as: candidate modules, suggested slugs, simple external interfaces, hidden implementation complexity, responsibilities, exclusions, scenarios, relationships, and cross-module rules are clear enough to defend.
131
+ - Do not ask the user to name the Deep Modules up front. Most users do not know what the modules should be yet.
132
+ - Extract modules by asking about caller intent, complexity that should be hidden, product jobs, decisions, promises, lifecycle moments, confusing boundaries, and where code should stay coherent over time.
133
+ - Teach briefly as needed. If the user seems unsure, explain that a Deep Module hides a lot of implementation behind a simple interface, then ask the next question.
134
+ - Do not create modules from vague labels without confirming what interface they expose and what complexity they hide.
135
+ - If the conversation stalls, propose one concise assumption for the next unresolved point and ask the user to confirm or correct it.
136
+
137
+ ## Interview method
138
+
139
+ Derive candidate modules from answers. Do not make the user design the map from scratch.
140
+
141
+ Prefer questions like:
142
+
143
+ - "What should the rest of the app be able to ask this area to do in one simple phrase?"
144
+ - "What messy details should callers not need to know?"
145
+ - "If this were a good abstraction, what would its small public interface look like conceptually?"
146
+ - "What steps, checks, edge cases, or policies would be hidden behind that interface?"
147
+ - "Where are callers currently forced to know too much?"
148
+ - "What behavior changes for the same product reason and should stay together?"
149
+ - "What decisions should this module own, and which decisions should it not own?"
150
+ - "Where do you expect future implementation work to create boundary confusion?"
151
+ - "Is this a deep module, or is it just a command/helper/folder that exposes nearly as much complexity as it hides?"
152
+ - "If this behavior changed, what other modules would need to know?"
153
+ - "What module slug would be clear in code without forcing a specific architecture?"
154
+
155
+ Avoid questions like:
156
+
157
+ - "What bounded contexts should we use?"
158
+ - "What services should exist?"
159
+ - "What database boundaries should exist?"
160
+ - "What layers should this module have?"
161
+ - "What framework structure do you want?"
162
+
163
+ When a user gives a feature, command, screen, template, or technical mechanism, translate it into the possible deep abstraction it suggests and ask the user to confirm or correct the interface and hidden complexity.
164
+
165
+ Example:
166
+
167
+ ```txt
168
+ User: "sibu doctor checks for drift."
169
+ Assistant: "That sounds like it may belong to a workflow health module. Its simple interface could be 'check workflow health,' while it hides state loading, manifest comparison, file hashing, missing-file detection, and update advice. Is that the right abstraction, or does it leak too much into sync/adoption?"
170
+ ```
171
+
172
+ Ask enough follow-up to fill these fields for each module:
173
+
174
+ - Module name
175
+ - Suggested module slug
176
+ - Simple interface / outside promise
177
+ - Hidden complexity
178
+ - Owns
179
+ - Does not own
180
+ - Key scenarios
181
+ - Related modules
182
+ - Boundary notes
183
+
184
+ Also identify cross-module rules, especially values and policies that apply everywhere, such as user ownership, safety, transparency, local customization, quality, validation, and read-only vs mutating behavior.
185
+
186
+ ## Deep Module principles
187
+
188
+ Deep Modules should be:
189
+
190
+ - complexity-hiding abstractions with simple external interfaces
191
+ - deep enough that callers do not need to understand internal orchestration, edge cases, or policies
192
+ - technical design boundaries first, with product alignment used only where it helps explain why code changes together
193
+ - durable enough to absorb related technical and product changes over time
194
+ - named in language useful across technical design, implementation planning, feature briefs, and code organization
195
+ - flexible internally so different projects can use layered, DDD, Hexagonal, command-oriented, MVC, functional, or other architectures inside them
196
+
197
+ Avoid shallow modules based on one feature, screen, command, workflow step, database table, generic helper folder, technical layer, or thin wrapper around an obvious operation.
198
+
199
+ ## Workflow
200
+
201
+ 1. Read `docs/product-vision.md`.
202
+ 2. Read existing `docs/deep-module-map.md` if it exists.
203
+ 3. Ask one focused question at a time until the module direction is clear.
204
+ 4. Keep asking focused follow-up questions until the simple interface and hidden complexity of each candidate module are defensible.
205
+ 5. Write or update `docs/deep-module-map.md` once enough context is available.
206
+
207
+ ## Recommended map structure
208
+
209
+ ```md
210
+ # Deep Module Map
211
+
212
+ ## Purpose
213
+ <How this map guides technical design, feature briefs, and implementation boundaries.>
214
+
215
+ ## Modules
216
+
217
+ ### <Module Name>
218
+ - Suggested module slug:
219
+ - Simple interface / outside promise:
220
+ - Hidden complexity:
221
+ - Owns:
222
+ - Does not own:
223
+ - Key scenarios:
224
+ - Related modules:
225
+ - Boundary notes:
226
+
227
+ ## Cross-Module Rules
228
+ - <Rules for work that spans modules or needs a new module.>
229
+ ```
230
+
231
+ Adapt the structure when useful, but keep the map concise and module-focused. Do not omit the simple interface/outside promise or hidden complexity fields unless the user explicitly asks for another format.
232
+
233
+ ## Final response behavior
234
+
235
+ After writing the file, final-answer with only the path created or updated:
236
+
237
+ ```txt
238
+ docs/deep-module-map.md
239
+ ```
240
+
241
+ Do not paste the map body, excerpt, outline, or section summaries unless the user explicitly asks for inline review in the current request.
@@ -16,8 +16,8 @@ This skill owns the product/business shape of a feature. It does not own UI inte
16
16
  ### What this skill needs
17
17
 
18
18
  - `docs/product-vision.md`.
19
- - `docs/product-context-map.md`.
20
- - Enough user-provided feature intent to define the feature problem, target user/scenario, business goal, MVP boundary, out-of-scope boundary, success signals, constraints, and Product Context fit.
19
+ - `docs/deep-module-map.md`.
20
+ - Enough user-provided feature intent to define the feature problem, target user/scenario, business goal, MVP boundary, out-of-scope boundary, success signals, constraints, and Deep Module fit.
21
21
 
22
22
  ### What this skill writes
23
23
 
@@ -27,15 +27,15 @@ This skill owns the product/business shape of a feature. It does not own UI inte
27
27
  ### When this skill stops
28
28
 
29
29
  - `docs/product-vision.md` is missing; tell the user to create it first with `product-vision-writer`.
30
- - `docs/product-context-map.md` is missing; tell the user to create it first with `product-context-map-writer`.
31
- - The feature appears to require a new or changed Product Context; direct the user back to `product-context-map-writer`.
30
+ - `docs/deep-module-map.md` is missing; tell the user to create it first with `deep-module-map-writer`.
31
+ - The feature appears to require a new or changed Deep Module; direct the user back to `deep-module-map-writer`.
32
32
  - The request belongs to another pipeline stage, such as technical design, UX design, Scrum planning, implementation planning, or implementation execution.
33
33
  - Current-stage feature intent is unclear; ask one focused question at a time until enough information is available.
34
34
 
35
35
  ### What this skill must not do
36
36
 
37
- - Do not create or update Product Context Maps, technical designs, UX specs, Epics, User Stories, implementation plans, or production code.
38
- - Do not invent Product Contexts or use contexts that are absent from `docs/product-context-map.md`.
37
+ - Do not create or update Deep Module Maps, technical designs, UX specs, Epics, User Stories, implementation plans, or production code.
38
+ - Do not invent Deep Modules or use modules that are absent from `docs/deep-module-map.md`.
39
39
  - Do not require a final confirmation summary before writing once enough feature brief context is available.
40
40
  - Do not duplicate or rewrite the product vision; apply only the relevant implications to the feature.
41
41
 
@@ -45,18 +45,18 @@ Before doing any feature-brief work, read:
45
45
 
46
46
  ```txt
47
47
  docs/product-vision.md
48
- docs/product-context-map.md
48
+ docs/deep-module-map.md
49
49
  ```
50
50
 
51
51
  Use the product vision as the source of truth for the product's purpose, audience, positioning, principles, voice, boundaries, trust expectations, and success signals.
52
52
 
53
- Use the Product Context Map as the source of truth for where feature work belongs. Product Contexts answer “where does this work belong?” Do not invent Product Contexts in a feature brief.
53
+ Use the Deep Module Map as the source of truth for where feature work belongs. Deep Modules answer “where does this work belong?” Do not invent Deep Modules in a feature brief.
54
54
 
55
55
  Do not duplicate or rewrite the product vision inside the feature brief. Apply it to the specific feature being defined.
56
56
 
57
57
  ## Hard start rule
58
58
 
59
- Do not start a feature brief if `docs/product-vision.md` or `docs/product-context-map.md` is missing.
59
+ Do not start a feature brief if `docs/product-vision.md` or `docs/deep-module-map.md` is missing.
60
60
 
61
61
  If the product vision is missing:
62
62
 
@@ -65,11 +65,11 @@ If the product vision is missing:
65
65
  3. Instruct the user to create the product vision first with the `product-vision-writer` skill.
66
66
  4. Do not draft, infer, or save a feature brief until the product vision exists.
67
67
 
68
- If the Product Context Map is missing:
68
+ If the Deep Module Map is missing:
69
69
 
70
70
  1. Stop.
71
- 2. Tell the user that a feature brief requires `docs/product-context-map.md`.
72
- 3. Instruct the user to create the map first with the `product-context-map-writer` skill.
71
+ 2. Tell the user that a feature brief requires `docs/deep-module-map.md`.
72
+ 3. Instruct the user to create the map first with the `deep-module-map-writer` skill.
73
73
  4. Do not draft, infer, or save a feature brief until the map exists.
74
74
 
75
75
  ## Use this skill for
@@ -102,13 +102,13 @@ Be deliberately interrogative before drafting. The feature brief should reflect
102
102
  - Keep asking until you have complete practical understanding and explicit user alignment.
103
103
  - Prefer follow-up questions over filling gaps with plausible invention.
104
104
  - Treat "100% understanding" as: feature intent, target user, scenario, user problem, business goal, MVP boundary, out-of-scope boundary, success signals, and known constraints are all clear enough to defend in the brief.
105
- - Treat "enough context" as: feature intent, target user/scenario, desired outcome, MVP boundary, out-of-scope boundary, success signals, constraints, and Product Context fit are clear enough to defend in the brief.
105
+ - Treat "enough context" as: feature intent, target user/scenario, desired outcome, MVP boundary, out-of-scope boundary, success signals, constraints, and Deep Module fit are clear enough to defend in the brief.
106
106
  - If the user gives a partial answer, acknowledge the useful part and ask the next most important unresolved question.
107
107
  - Do not ask a large questionnaire all at once.
108
108
 
109
109
  ## Workflow
110
110
 
111
- ### 1. Read the product vision and Product Context Map
111
+ ### 1. Read the product vision and Deep Module Map
112
112
 
113
113
  Read `docs/product-vision.md` first and identify:
114
114
 
@@ -122,16 +122,16 @@ Read `docs/product-vision.md` first and identify:
122
122
 
123
123
  Use these as constraints for the feature brief.
124
124
 
125
- Then read `docs/product-context-map.md` and identify which existing Product Contexts may own the requested feature. A feature brief must name one or more existing Product Contexts.
125
+ Then read `docs/deep-module-map.md` and identify which existing Deep Modules may own the requested feature. A feature brief must name one or more existing Deep Modules.
126
126
 
127
- If no existing Product Context fits:
127
+ If no existing Deep Module fits:
128
128
 
129
129
  1. Stop before drafting.
130
- 2. Tell the user the feature appears to require a Product Context Map update.
130
+ 2. Tell the user the feature appears to require a Deep Module Map update.
131
131
  3. Provide this suggested prompt, adapted to the user's feature:
132
132
 
133
133
  ```txt
134
- Use product-context-map-writer to update docs/product-context-map.md for this feature: <feature summary>. Decide whether it belongs in an existing Product Context or requires a new/changed context, then update the map only after confirming the responsibility boundary with me.
134
+ Use deep-module-map-writer to update docs/deep-module-map.md for this feature: <feature summary>. Decide whether it belongs in an existing Deep Module or requires a new/changed module, then update the map only after confirming the responsibility boundary with me.
135
135
  ```
136
136
 
137
137
  4. Do not draft, infer, or save a feature brief until the map is updated.
@@ -167,7 +167,7 @@ Ask every question needed to remove material ambiguity, but only one at a time.
167
167
  - what should stay out of scope
168
168
  - known constraints, risks, or open decisions
169
169
 
170
- Draft only once feature intent, target user/scenario, desired outcome, MVP boundary, out-of-scope boundary, success signals, constraints, and Product Context fit are clear enough to avoid invention.
170
+ Draft only once feature intent, target user/scenario, desired outcome, MVP boundary, out-of-scope boundary, success signals, constraints, and Deep Module fit are clear enough to avoid invention.
171
171
 
172
172
  If the conversation stalls, offer a concise default assumption for the next unresolved point and ask the user to confirm or correct it before proceeding.
173
173
 
@@ -186,8 +186,8 @@ Recommended structure:
186
186
  ## Product Vision Fit
187
187
  <How this feature supports the product vision, principles, audience, or positioning.>
188
188
 
189
- ## Product Context
190
- <One or more existing Product Contexts from docs/product-context-map.md that own this feature, with a brief fit rationale.>
189
+ ## Deep Module
190
+ <One or more existing Deep Modules from docs/deep-module-map.md that own this feature, with a brief fit rationale.>
191
191
 
192
192
  ## User / Customer Problem
193
193
  <The user need, pain, desire, or opportunity this feature addresses.>
@@ -251,7 +251,7 @@ If the file already exists, read it first. Treat the request as a revision when
251
251
  Aim for writing that is:
252
252
 
253
253
  - loyal to the required product vision
254
- - explicit about which existing Product Contexts own the feature
254
+ - explicit about which existing Deep Modules own the feature
255
255
  - specific to the user's feature
256
256
  - grounded in the product vision
257
257
  - concise
@@ -265,7 +265,7 @@ Avoid:
265
265
  - vague benefits without user or business grounding
266
266
  - feature lists without rationale
267
267
  - drafting from vague feature labels without discovery
268
- - inventing new Product Contexts instead of stopping for a map update
268
+ - inventing new Deep Modules instead of stopping for a map update
269
269
  - inventing certainty where the product vision or user input is unresolved
270
270
 
271
271
  ## Decision rule
@@ -273,7 +273,7 @@ Avoid:
273
273
  When shaping a feature brief, prefer:
274
274
 
275
275
  1. alignment with `docs/product-vision.md`
276
- 2. fit with existing Product Contexts from `docs/product-context-map.md`
276
+ 2. fit with existing Deep Modules from `docs/deep-module-map.md`
277
277
  3. clear user value
278
278
  4. clear business or product outcome
279
279
  5. simple MVP scope
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: postgresql-expert
3
+ description: Use this skill for PostgreSQL schema design, migrations, constraints, queries, indexing, and database tradeoffs when practical database judgment is needed.
4
+ ---
5
+
6
+ # PostgreSQL Expert
7
+
8
+ Use this skill when working with PostgreSQL database design or database-facing application changes.
9
+
10
+ Apply this skill together with `clean-code`. Keep the guidance practical: prefer the simplest database design that protects data integrity and supports the application's real access patterns.
11
+
12
+ ## Use this skill for
13
+
14
+ - designing or reviewing PostgreSQL schemas
15
+ - planning migrations and safe schema evolution
16
+ - choosing keys, constraints, relationships, and transactions
17
+ - reasoning about queries, access patterns, and indexes
18
+ - deciding whether PostgreSQL-specific features are worth using
19
+ - reviewing database-related tradeoffs in application code
20
+
21
+ ## Core principles
22
+
23
+ ### 1. Start with the product model
24
+ - Model the real domain concepts, not speculative future reporting or scaling needs.
25
+ - Prefer clear table and column names that match product language.
26
+ - Keep schemas boring until the product needs something more specialized.
27
+ - Do not add tables, abstractions, or generic metadata columns just in case.
28
+
29
+ ### 2. Protect data integrity in the database
30
+ - Use primary keys, foreign keys, `NOT NULL`, `UNIQUE`, and `CHECK` constraints when they express real invariants.
31
+ - Prefer database-enforced integrity over relying only on application checks for durable rules.
32
+ - Make deletion behavior explicit with appropriate foreign-key actions.
33
+ - Use transactions when a change must succeed or fail as one unit.
34
+
35
+ ### 3. Evolve schemas safely
36
+ - Treat migrations as production changes that need clear rollback or recovery thinking.
37
+ - Prefer small, reversible migration steps for risky changes.
38
+ - Avoid destructive changes until data has been backfilled, verified, and callers have moved over.
39
+ - Consider lock behavior and table size before changing large production tables.
40
+
41
+ ### 4. Design from access patterns, not guesses
42
+ - Understand the queries the application actually needs before optimizing.
43
+ - Keep common reads and writes straightforward before introducing denormalization.
44
+ - Use normalization for clarity and integrity; denormalize only for a measured or well-understood reason.
45
+ - Explain tradeoffs when choosing between simpler schema shape and query convenience.
46
+
47
+ ### 5. Add indexes only when justified
48
+ - Do not add indexes just because a column is used, foreign-keyed, or might be queried someday.
49
+ - Add an index when there is a clear query, filtering, joining, sorting, uniqueness, or constraint need.
50
+ - Remember that indexes speed some reads but add write cost, storage cost, and maintenance overhead.
51
+ - Prefer a small number of purposeful indexes over broad defensive indexing.
52
+
53
+ ### 6. Use PostgreSQL features with restraint
54
+ - Consider PostgreSQL capabilities such as JSONB, arrays, partial indexes, generated columns, enums, extensions, and full-text search when they simplify a real requirement.
55
+ - Do not use PostgreSQL-specific features to appear sophisticated when standard relational modeling is clearer.
56
+ - Be explicit about portability tradeoffs when choosing PostgreSQL-specific behavior.
57
+ - Prefer built-in PostgreSQL capabilities before adding extra infrastructure.
58
+
59
+ ### 7. Keep database advice actionable
60
+ - Tie recommendations to the schema, query, migration, or invariant at hand.
61
+ - Say what evidence would change the recommendation, such as query plans, row counts, write volume, or latency targets.
62
+ - When context is missing, ask for the relevant schema, migration, query, or access pattern instead of guessing.
63
+ - Avoid broad DBA checklists unless the task is explicitly about operations or performance investigation.
64
+
65
+ ## Decision rule
66
+
67
+ When unsure, prefer:
68
+ 1. simple schema design that matches current product needs
69
+ 2. explicit database constraints for real invariants
70
+ 3. safe, incremental migrations
71
+ 4. query-aware design over speculative optimization
72
+ 5. purposeful indexes over blanket indexing
@@ -28,11 +28,11 @@ Default output path: `docs/product-vision.md`.
28
28
 
29
29
  - The user's intent is too unclear to ask a useful discovery question.
30
30
  - Writing would overwrite an existing vision when the user appears to want a separate new vision.
31
- - The request is for a downstream artifact such as a Product Context Map, feature brief, technical design, UX spec, stories, implementation plan, or implementation work.
31
+ - The request is for a downstream artifact such as a Deep Module Map, feature brief, technical design, UX spec, stories, implementation plan, or implementation work.
32
32
 
33
33
  ### What this skill must not do
34
34
 
35
- - Do not create Product Context Maps, feature briefs, technical designs, UX specs, Epics, User Stories, implementation plans, or production code.
35
+ - Do not create Deep Module Maps, feature briefs, technical designs, UX specs, Epics, User Stories, implementation plans, or production code.
36
36
  - Do not require a final confirmation summary before writing once enough product vision context is available.
37
37
  - Do not pretend unresolved strategy questions are settled; ask a focused question or document a clear assumption.
38
38
 
@@ -35,9 +35,9 @@ This skill owns delivery planning artifacts. It does not own product vision, fea
35
35
 
36
36
  ### What this skill must not do
37
37
 
38
- - Do not create or update product visions, Product Context Maps, feature briefs, technical designs, UX specs, implementation plans, or production code.
38
+ - Do not create or update product visions, Deep Module Maps, feature briefs, technical designs, UX specs, implementation plans, or production code.
39
39
  - Do not modify prior-stage artifacts.
40
- - Do not reread `docs/product-context-map.md` by default; trust `technical_design.md` for implementation boundaries.
40
+ - Do not reread `docs/deep-module-map.md` by default; trust `technical_design.md` for Deep Module implementation boundaries.
41
41
  - Do not add product scope or architecture decisions absent from the feature brief and technical design.
42
42
 
43
43
  ## Required inputs