ragarciaruben 1.20.7

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 (184) hide show
  1. package/.github/copilot-context/README.md +313 -0
  2. package/.github/copilot-context/agents/executor.agent.md +59 -0
  3. package/.github/copilot-context/agents/planner.agent.md +58 -0
  4. package/.github/copilot-context/agents/verifier.agent.md +68 -0
  5. package/.github/copilot-context/hooks/hooks.json +11 -0
  6. package/.github/copilot-context/hooks/inject-context.js +107 -0
  7. package/.github/copilot-context/instructions/architecture.instructions.md +33 -0
  8. package/.github/copilot-context/instructions/concerns.instructions.md +30 -0
  9. package/.github/copilot-context/instructions/conventions.instructions.md +25 -0
  10. package/.github/copilot-context/instructions/integrations.instructions.md +30 -0
  11. package/.github/copilot-context/instructions/stack.instructions.md +30 -0
  12. package/.github/copilot-context/instructions/structure.instructions.md +32 -0
  13. package/.github/copilot-context/instructions/testing.instructions.md +25 -0
  14. package/.github/copilot-context/prompts/execute-phase.prompt.md +148 -0
  15. package/.github/copilot-context/prompts/map-codebase.prompt.md +115 -0
  16. package/.github/copilot-context/prompts/new-project.prompt.md +85 -0
  17. package/.github/copilot-context/prompts/pause-work.prompt.md +104 -0
  18. package/.github/copilot-context/prompts/plan-phase.prompt.md +137 -0
  19. package/.github/copilot-context/prompts/progress.prompt.md +69 -0
  20. package/.github/copilot-context/prompts/resume-work.prompt.md +74 -0
  21. package/.github/copilot-context/prompts/sync-instructions.prompt.md +86 -0
  22. package/.github/copilot-context/prompts/verify-work.prompt.md +126 -0
  23. package/.github/copilot-context/skills/map-codebase/SKILL.md +49 -0
  24. package/.github/copilot-context/skills/project-history/SKILL.md +46 -0
  25. package/.github/copilot-instructions.md +68 -0
  26. package/.planning/PROJECT.md +61 -0
  27. package/.planning/REQUIREMENTS.md +70 -0
  28. package/.planning/ROADMAP.md +75 -0
  29. package/.planning/STATE.md +75 -0
  30. package/.planning/codebase/ARCHITECTURE.md +76 -0
  31. package/.planning/codebase/CONCERNS.md +102 -0
  32. package/.planning/codebase/CONVENTIONS.md +119 -0
  33. package/.planning/codebase/INTEGRATIONS.md +114 -0
  34. package/.planning/codebase/STACK.md +78 -0
  35. package/.planning/codebase/STRUCTURE.md +75 -0
  36. package/.planning/codebase/TESTING.md +157 -0
  37. package/.planning/continue-here.md +44 -0
  38. package/.vscode/settings.json +16 -0
  39. package/LICENSE +21 -0
  40. package/README.md +704 -0
  41. package/agents/gsd-codebase-mapper.md +764 -0
  42. package/agents/gsd-debugger.md +1246 -0
  43. package/agents/gsd-executor.md +469 -0
  44. package/agents/gsd-integration-checker.md +443 -0
  45. package/agents/gsd-phase-researcher.md +546 -0
  46. package/agents/gsd-plan-checker.md +690 -0
  47. package/agents/gsd-planner.md +1275 -0
  48. package/agents/gsd-project-researcher.md +621 -0
  49. package/agents/gsd-research-synthesizer.md +239 -0
  50. package/agents/gsd-roadmapper.md +642 -0
  51. package/agents/gsd-verifier.md +573 -0
  52. package/bin/install.js +2091 -0
  53. package/bin/setup-copilot-context.js +180 -0
  54. package/commands/gsd/add-phase.md +43 -0
  55. package/commands/gsd/add-tests.md +41 -0
  56. package/commands/gsd/add-todo.md +47 -0
  57. package/commands/gsd/audit-milestone.md +36 -0
  58. package/commands/gsd/check-todos.md +45 -0
  59. package/commands/gsd/cleanup.md +18 -0
  60. package/commands/gsd/complete-milestone.md +136 -0
  61. package/commands/gsd/debug.md +167 -0
  62. package/commands/gsd/discuss-phase.md +83 -0
  63. package/commands/gsd/execute-phase.md +41 -0
  64. package/commands/gsd/health.md +22 -0
  65. package/commands/gsd/help.md +22 -0
  66. package/commands/gsd/insert-phase.md +32 -0
  67. package/commands/gsd/join-discord.md +18 -0
  68. package/commands/gsd/list-phase-assumptions.md +46 -0
  69. package/commands/gsd/map-codebase.md +71 -0
  70. package/commands/gsd/new-milestone.md +44 -0
  71. package/commands/gsd/new-project.md +42 -0
  72. package/commands/gsd/new-project.md.bak +1041 -0
  73. package/commands/gsd/pause-work.md +38 -0
  74. package/commands/gsd/plan-milestone-gaps.md +34 -0
  75. package/commands/gsd/plan-phase.md +45 -0
  76. package/commands/gsd/progress.md +24 -0
  77. package/commands/gsd/quick.md +41 -0
  78. package/commands/gsd/reapply-patches.md +110 -0
  79. package/commands/gsd/remove-phase.md +31 -0
  80. package/commands/gsd/research-phase.md +189 -0
  81. package/commands/gsd/resume-work.md +40 -0
  82. package/commands/gsd/set-profile.md +34 -0
  83. package/commands/gsd/settings.md +36 -0
  84. package/commands/gsd/update.md +37 -0
  85. package/commands/gsd/verify-work.md +38 -0
  86. package/get-shit-done/bin/gsd-tools.cjs +585 -0
  87. package/get-shit-done/bin/lib/commands.cjs +553 -0
  88. package/get-shit-done/bin/lib/config.cjs +162 -0
  89. package/get-shit-done/bin/lib/core.cjs +411 -0
  90. package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  91. package/get-shit-done/bin/lib/init.cjs +710 -0
  92. package/get-shit-done/bin/lib/milestone.cjs +215 -0
  93. package/get-shit-done/bin/lib/phase.cjs +870 -0
  94. package/get-shit-done/bin/lib/roadmap.cjs +298 -0
  95. package/get-shit-done/bin/lib/state.cjs +521 -0
  96. package/get-shit-done/bin/lib/template.cjs +222 -0
  97. package/get-shit-done/bin/lib/verify.cjs +772 -0
  98. package/get-shit-done/references/checkpoints.md +776 -0
  99. package/get-shit-done/references/continuation-format.md +249 -0
  100. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  101. package/get-shit-done/references/git-integration.md +248 -0
  102. package/get-shit-done/references/git-planning-commit.md +38 -0
  103. package/get-shit-done/references/model-profile-resolution.md +34 -0
  104. package/get-shit-done/references/model-profiles.md +92 -0
  105. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  106. package/get-shit-done/references/planning-config.md +196 -0
  107. package/get-shit-done/references/questioning.md +145 -0
  108. package/get-shit-done/references/tdd.md +263 -0
  109. package/get-shit-done/references/ui-brand.md +160 -0
  110. package/get-shit-done/references/verification-patterns.md +612 -0
  111. package/get-shit-done/templates/DEBUG.md +164 -0
  112. package/get-shit-done/templates/UAT.md +247 -0
  113. package/get-shit-done/templates/VALIDATION.md +76 -0
  114. package/get-shit-done/templates/codebase/architecture.md +255 -0
  115. package/get-shit-done/templates/codebase/concerns.md +310 -0
  116. package/get-shit-done/templates/codebase/conventions.md +307 -0
  117. package/get-shit-done/templates/codebase/integrations.md +280 -0
  118. package/get-shit-done/templates/codebase/stack.md +186 -0
  119. package/get-shit-done/templates/codebase/structure.md +285 -0
  120. package/get-shit-done/templates/codebase/testing.md +480 -0
  121. package/get-shit-done/templates/config.json +37 -0
  122. package/get-shit-done/templates/context.md +283 -0
  123. package/get-shit-done/templates/continue-here.md +78 -0
  124. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  125. package/get-shit-done/templates/discovery.md +146 -0
  126. package/get-shit-done/templates/milestone-archive.md +123 -0
  127. package/get-shit-done/templates/milestone.md +115 -0
  128. package/get-shit-done/templates/phase-prompt.md +569 -0
  129. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  130. package/get-shit-done/templates/project.md +184 -0
  131. package/get-shit-done/templates/requirements.md +231 -0
  132. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  133. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  134. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  135. package/get-shit-done/templates/research-project/STACK.md +120 -0
  136. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  137. package/get-shit-done/templates/research.md +552 -0
  138. package/get-shit-done/templates/retrospective.md +54 -0
  139. package/get-shit-done/templates/roadmap.md +202 -0
  140. package/get-shit-done/templates/state.md +176 -0
  141. package/get-shit-done/templates/summary-complex.md +59 -0
  142. package/get-shit-done/templates/summary-minimal.md +41 -0
  143. package/get-shit-done/templates/summary-standard.md +48 -0
  144. package/get-shit-done/templates/summary.md +248 -0
  145. package/get-shit-done/templates/user-setup.md +311 -0
  146. package/get-shit-done/templates/verification-report.md +322 -0
  147. package/get-shit-done/workflows/add-phase.md +111 -0
  148. package/get-shit-done/workflows/add-tests.md +350 -0
  149. package/get-shit-done/workflows/add-todo.md +157 -0
  150. package/get-shit-done/workflows/audit-milestone.md +297 -0
  151. package/get-shit-done/workflows/check-todos.md +176 -0
  152. package/get-shit-done/workflows/cleanup.md +152 -0
  153. package/get-shit-done/workflows/complete-milestone.md +763 -0
  154. package/get-shit-done/workflows/diagnose-issues.md +219 -0
  155. package/get-shit-done/workflows/discovery-phase.md +289 -0
  156. package/get-shit-done/workflows/discuss-phase.md +542 -0
  157. package/get-shit-done/workflows/execute-phase.md +449 -0
  158. package/get-shit-done/workflows/execute-plan.md +448 -0
  159. package/get-shit-done/workflows/health.md +156 -0
  160. package/get-shit-done/workflows/help.md +489 -0
  161. package/get-shit-done/workflows/insert-phase.md +129 -0
  162. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  163. package/get-shit-done/workflows/map-codebase.md +315 -0
  164. package/get-shit-done/workflows/new-milestone.md +382 -0
  165. package/get-shit-done/workflows/new-project.md +1116 -0
  166. package/get-shit-done/workflows/pause-work.md +122 -0
  167. package/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
  168. package/get-shit-done/workflows/plan-phase.md +569 -0
  169. package/get-shit-done/workflows/progress.md +381 -0
  170. package/get-shit-done/workflows/quick.md +453 -0
  171. package/get-shit-done/workflows/remove-phase.md +154 -0
  172. package/get-shit-done/workflows/research-phase.md +73 -0
  173. package/get-shit-done/workflows/resume-project.md +306 -0
  174. package/get-shit-done/workflows/set-profile.md +80 -0
  175. package/get-shit-done/workflows/settings.md +213 -0
  176. package/get-shit-done/workflows/transition.md +544 -0
  177. package/get-shit-done/workflows/update.md +219 -0
  178. package/get-shit-done/workflows/verify-phase.md +242 -0
  179. package/get-shit-done/workflows/verify-work.md +569 -0
  180. package/hooks/dist/gsd-check-update.js +62 -0
  181. package/hooks/dist/gsd-context-monitor.js +122 -0
  182. package/hooks/dist/gsd-statusline.js +108 -0
  183. package/package.json +54 -0
  184. package/scripts/build-hooks.js +43 -0
@@ -0,0 +1,61 @@
1
+ # [Project Name]
2
+
3
+ ## What This Is
4
+
5
+ [Current accurate description — 2-3 sentences. What does this product do and who is it for?
6
+ Update whenever the reality of the product drifts from this description.]
7
+
8
+ ## Core Value
9
+
10
+ [The ONE thing that matters most. If everything else fails, this must work.
11
+ One sentence that drives prioritization when tradeoffs arise.]
12
+
13
+ ## Requirements
14
+
15
+ ### Validated
16
+
17
+ <!-- Shipped and confirmed valuable. Move items here from Active once validated in production. -->
18
+
19
+ *(None yet — ship to validate)*
20
+
21
+ ### Active
22
+
23
+ <!-- Current scope. These are what we are building toward right now. -->
24
+
25
+ - [ ] [Requirement 1]
26
+ - [ ] [Requirement 2]
27
+ - [ ] [Requirement 3]
28
+
29
+ ### Out of Scope
30
+
31
+ <!-- Explicit boundaries. Include reasoning to prevent re-adding. -->
32
+
33
+ - [Exclusion 1] — [why excluded]
34
+ - [Exclusion 2] — [why excluded]
35
+
36
+ ## Context
37
+
38
+ [Background information that informs implementation:
39
+ - Technical environment or ecosystem
40
+ - Relevant prior work or existing architecture decisions
41
+ - Known constraints inherited from existing systems
42
+ - User research or feedback themes
43
+ - Known issues to address]
44
+
45
+ ## Constraints
46
+
47
+ - **[Type]**: [What] — [Why]
48
+ - **[Type]**: [What] — [Why]
49
+
50
+ *Common types: Tech Stack, Timeline, Budget, Dependencies, Compatibility, Performance, Security, Compliance*
51
+
52
+ ## Key Decisions
53
+
54
+ <!-- Decisions that constrain future work. Add throughout project lifecycle. -->
55
+
56
+ | Decision | Rationale | Outcome |
57
+ |----------|-----------|---------|
58
+ | [Choice] | [Why] | [✓ Good / ⚠️ Revisit / — Pending] |
59
+
60
+ ---
61
+ *Last updated: [date] after [trigger]*
@@ -0,0 +1,70 @@
1
+ # Requirements: [Project Name]
2
+
3
+ **Defined:** [date]
4
+ **Core Value:** [from PROJECT.md — one sentence]
5
+
6
+ ---
7
+
8
+ ## v1 Requirements
9
+
10
+ Requirements for initial release. Each has a unique ID and maps to a roadmap phase.
11
+
12
+ ### [Category 1 — e.g., Authentication]
13
+
14
+ - [ ] **AUTH-01**: [Description of what the user can do]
15
+ - [ ] **AUTH-02**: [Description]
16
+ - [ ] **AUTH-03**: [Description]
17
+
18
+ ### [Category 2 — e.g., Core Feature]
19
+
20
+ - [ ] **CORE-01**: [Description]
21
+ - [ ] **CORE-02**: [Description]
22
+ - [ ] **CORE-03**: [Description]
23
+
24
+ ### [Category 3]
25
+
26
+ - [ ] **[CAT]-01**: [Description]
27
+ - [ ] **[CAT]-02**: [Description]
28
+
29
+ ---
30
+
31
+ ## v2 Requirements
32
+
33
+ Deferred to future release. Tracked here to prevent scope creep contaminating v1.
34
+
35
+ ### [Category]
36
+
37
+ - **[CAT]-01**: [Description]
38
+ - **[CAT]-02**: [Description]
39
+
40
+ ---
41
+
42
+ ## Out of Scope
43
+
44
+ Explicitly excluded. Documented to prevent re-adding.
45
+
46
+ | Feature | Reason |
47
+ |---------|--------|
48
+ | [Feature] | [Why excluded] |
49
+ | [Feature] | [Why excluded] |
50
+
51
+ ---
52
+
53
+ ## Traceability
54
+
55
+ Which phases cover which requirements. Updated during roadmap creation.
56
+
57
+ | Requirement ID | Description (brief) | Phase | Status |
58
+ |----------------|---------------------|-------|--------|
59
+ | AUTH-01 | [Brief] | Phase 1 | Pending |
60
+ | AUTH-02 | [Brief] | Phase 1 | Pending |
61
+ | CORE-01 | [Brief] | Phase 2 | Pending |
62
+
63
+ **Coverage:**
64
+ - v1 requirements: [X] total
65
+ - Mapped to phases: [Y]
66
+ - Unmapped (need phase assignment): [Z] ⚠️
67
+
68
+ ---
69
+ *Requirements defined: [date]*
70
+ *Last updated: [date] after [trigger]*
@@ -0,0 +1,75 @@
1
+ # Roadmap: [Project Name]
2
+
3
+ ## Overview
4
+
5
+ [One paragraph describing the development journey from current state to v1 delivery. Mention the key phases and what each delivers.]
6
+
7
+ ---
8
+
9
+ ## Phase List
10
+
11
+ - [ ] **Phase 1: [Name]** — [One-line description of what this delivers]
12
+ - [ ] **Phase 2: [Name]** — [One-line description]
13
+ - [ ] **Phase 3: [Name]** — [One-line description]
14
+ - [ ] **Phase 4: [Name]** — [One-line description]
15
+
16
+ *Integer phases = planned milestone work. Decimal phases (e.g., 2.1) = urgent insertions between planned phases.*
17
+
18
+ ---
19
+
20
+ ## Phase Details
21
+
22
+ ### Phase 1: [Name]
23
+
24
+ **Goal**: [What this phase delivers — user-observable outcome]
25
+ **Depends on**: Nothing (first phase)
26
+ **Requirements covered**: [AUTH-01, AUTH-02, CORE-01]
27
+ **Success Criteria** (what must be TRUE when done):
28
+ 1. [Observable behavior or test result]
29
+ 2. [Observable behavior or test result]
30
+ 3. [Observable behavior or test result]
31
+
32
+ Plans:
33
+ - [ ] 01-01: [Brief description of first plan]
34
+ - [ ] 01-02: [Brief description of second plan]
35
+ - [ ] 01-03: [Brief description of third plan]
36
+
37
+ ---
38
+
39
+ ### Phase 2: [Name]
40
+
41
+ **Goal**: [What this phase delivers]
42
+ **Depends on**: Phase 1
43
+ **Requirements covered**: [CORE-02, CORE-03]
44
+ **Success Criteria** (what must be TRUE when done):
45
+ 1. [Observable behavior]
46
+ 2. [Observable behavior]
47
+
48
+ Plans:
49
+ - [ ] 02-01: [Brief description]
50
+ - [ ] 02-02: [Brief description]
51
+
52
+ ---
53
+
54
+ ### Phase 3: [Name]
55
+
56
+ **Goal**: [What this phase delivers]
57
+ **Depends on**: Phase 2
58
+ **Requirements covered**: [REQ-XX, REQ-XX]
59
+ **Success Criteria** (what must be TRUE when done):
60
+ 1. [Observable behavior]
61
+ 2. [Observable behavior]
62
+
63
+ Plans:
64
+ - [ ] 03-01: [Brief description]
65
+ - [ ] 03-02: [Brief description]
66
+
67
+ ---
68
+
69
+ ## Completed Phases
70
+
71
+ *(Move phases here with completion date when done)*
72
+
73
+ ---
74
+ *Roadmap created: [date]*
75
+ *Last updated: [date] after [trigger]*
@@ -0,0 +1,75 @@
1
+ # Project State
2
+
3
+ <!-- This is the living memory of the project. Keep it under 100 lines.
4
+ Update after every session and after each plan completion. -->
5
+
6
+ ## Project Reference
7
+
8
+ See: `.planning/PROJECT.md` (updated [date])
9
+
10
+ **Core value:** [One-liner from PROJECT.md Core Value section]
11
+ **Current focus:** [Current phase name and number]
12
+
13
+ ---
14
+
15
+ ## Current Position
16
+
17
+ ```
18
+ Phase: [X] of [Y] — [Phase Name]
19
+ Plan: [A] of [B] in current phase
20
+ Status: [Ready to plan / Planning / Ready to execute / In progress / Phase complete]
21
+ Last activity: [YYYY-MM-DD] — [What happened]
22
+
23
+ Progress: [░░░░░░░░░░] 0%
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Performance Metrics
29
+
30
+ **Velocity:**
31
+ - Total plans completed: [N]
32
+ - Total execution time: [X.X] hours
33
+
34
+ **By Phase:**
35
+
36
+ | Phase | Plans | Time | Avg/Plan |
37
+ |-------|-------|------|----------|
38
+ | — | — | — | — |
39
+
40
+ ---
41
+
42
+ ## Accumulated Context
43
+
44
+ ### Key Decisions (recent)
45
+
46
+ <!-- Detailed decisions live in PROJECT.md Key Decisions table.
47
+ List here only decisions affecting current/next work. -->
48
+
49
+ - [Phase X]: [Decision summary and its implication]
50
+
51
+ ### Blockers / Concerns
52
+
53
+ <!-- Issues that affect future work -->
54
+
55
+ *(None)*
56
+
57
+ ### Pending Ideas
58
+
59
+ <!-- Captured during sessions but deferred -->
60
+
61
+ *(None)*
62
+
63
+ ---
64
+
65
+ ## Session Continuity
66
+
67
+ ```
68
+ Last session: [YYYY-MM-DD HH:MM]
69
+ Stopped at: [Description of last completed action]
70
+ Resume file: [.planning/continue-here.md OR None]
71
+ Next action: [Exact next step to take]
72
+ ```
73
+
74
+ ---
75
+ *Updated: [date] after [trigger]*
@@ -0,0 +1,76 @@
1
+ # Architecture
2
+
3
+ <!-- Generated by /map-codebase. Describes conceptual code organization.
4
+ Update when architectural patterns change significantly.
5
+ Consumed by: plan-phase (API/backend/refactor work), execute-phase (layer boundaries). -->
6
+
7
+ ## System Overview
8
+
9
+ [2-3 sentences describing what this system does architecturally and how its major parts relate.]
10
+
11
+ ## Architectural Style
12
+
13
+ [e.g., Layered monolith / Microservices / Event-driven / Hexagonal / MVC / CQRS]
14
+
15
+ **Why:** [Rationale for this choice]
16
+
17
+ ## Layers / Components
18
+
19
+ ```
20
+ [Diagram or list of layers, e.g.:]
21
+
22
+ ┌─────────────────────────────────┐
23
+ │ Presentation Layer │ src/routes/, src/controllers/
24
+ │ (HTTP handlers, input parsing) │
25
+ ├─────────────────────────────────┤
26
+ │ Business Logic Layer │ src/services/
27
+ │ (Domain logic, orchestration) │
28
+ ├─────────────────────────────────┤
29
+ │ Data Access Layer │ src/repositories/, src/models/
30
+ │ (DB queries, ORM, caching) │
31
+ ├─────────────────────────────────┤
32
+ │ Infrastructure Layer │ src/config/, src/middleware/
33
+ │ (Auth, logging, external SDKs) │
34
+ └─────────────────────────────────┘
35
+ ```
36
+
37
+ ## Data Flow
38
+
39
+ [How a typical request flows through the system — trace 1-2 key paths]
40
+
41
+ **Example: User creates resource**
42
+ ```
43
+ POST /api/resource
44
+ → src/middleware/auth.ts (validate JWT)
45
+ → src/routes/resource.ts (parse + validate body)
46
+ → src/controllers/resource.controller.ts (orchestrate)
47
+ → src/services/resource.service.ts (business logic)
48
+ → src/repositories/resource.repository.ts (DB query)
49
+ → src/models/resource.model.ts (ORM entity)
50
+ ```
51
+
52
+ ## Key Abstractions
53
+
54
+ | Abstraction | File(s) | Purpose |
55
+ |-------------|---------|---------|
56
+ | [Name] | `src/[path]` | [What it does] |
57
+ | [Name] | `src/[path]` | [What it does] |
58
+
59
+ ## Entry Points
60
+
61
+ | Entry Point | File | Purpose |
62
+ |-------------|------|---------|
63
+ | HTTP server | `src/main.ts` | [Description] |
64
+ | Worker / Queue | `src/worker.ts` | [Description] |
65
+ | CLI | `src/cli/index.ts` | [Description] |
66
+
67
+ ## Cross-Cutting Concerns
68
+
69
+ - **Error handling:** [How errors propagate — e.g., "All service errors are Error subclasses, caught by `src/middleware/error.ts`"]
70
+ - **Logging:** [Library and pattern — e.g., "winston, structured JSON, request ID propagated via AsyncLocalStorage"]
71
+ - **Authentication:** [Strategy — e.g., "JWT validated in `src/middleware/auth.ts`, user attached to `req.user`"]
72
+ - **Validation:** [Where and how — e.g., "Zod schemas in `src/schemas/`, validated at route layer"]
73
+
74
+ ---
75
+ *Generated: [date]*
76
+ *Last updated: [date] after [trigger]*
@@ -0,0 +1,102 @@
1
+ # Concerns & Technical Debt
2
+
3
+ <!-- Generated by /map-codebase. Documents known issues, tech debt, fragile areas, and risks.
4
+ Consumed by: plan-phase (refactor/cleanup phases), execute-phase (when touching flagged areas).
5
+ Update as new issues are found or old ones are resolved. -->
6
+
7
+ ## Health Summary
8
+
9
+ | Severity | Count | Trend |
10
+ |----------|-------|-------|
11
+ | 🔴 Critical (blocks features / causes bugs) | [N] | [↑ ↓ →] |
12
+ | 🟡 High (significant friction / risk) | [N] | [↑ ↓ →] |
13
+ | 🟢 Medium (nice-to-fix, low urgency) | [N] | [↑ ↓ →] |
14
+
15
+ *Last assessed: [date]*
16
+
17
+ ---
18
+
19
+ ## 🔴 Critical Issues
20
+
21
+ ### [Issue Name]
22
+
23
+ - **Location:** `src/path/to/file.ts` (line ~[N])
24
+ - **Impact:** [What breaks or can break — be specific]
25
+ - **Root cause:** [Why this exists]
26
+ - **Fix approach:** [Concrete steps to fix]
27
+ - **Blocking:** [What feature or fix this blocks, if any]
28
+
29
+ ---
30
+
31
+ ## 🟡 High Priority Debt
32
+
33
+ ### [Issue Name]
34
+
35
+ - **Location:** `src/[path]`
36
+ - **Impact:** [Developer friction / performance / security risk / etc.]
37
+ - **Root cause:** [Why it happened]
38
+ - **Fix approach:** [How to fix]
39
+ - **Effort:** [Small (< 1 day) / Medium (1-3 days) / Large (> 3 days)]
40
+
41
+ ### [Another Issue]
42
+
43
+ - **Location:** `src/[path]`
44
+ - **Impact:** [Description]
45
+ - **Root cause:** [Description]
46
+ - **Fix approach:** [Description]
47
+ - **Effort:** [Size]
48
+
49
+ ---
50
+
51
+ ## 🟢 Medium Priority Debt
52
+
53
+ ### [Issue Name]
54
+
55
+ - **Location:** `src/[path]`
56
+ - **Impact:** [Minor friction]
57
+ - **Fix approach:** [Description]
58
+ - **Effort:** [Small]
59
+
60
+ ---
61
+
62
+ ## Known Fragile Areas
63
+
64
+ <!-- Code that works but is risky to modify. Warn future agents before touching these. -->
65
+
66
+ | Area | File(s) | Why Fragile | How to Proceed Safely |
67
+ |------|---------|------------|----------------------|
68
+ | [Area name] | `src/[path]` | [Why it's fragile] | [Safe approach] |
69
+ | [Area name] | `src/[path]` | [Why it's fragile] | [Safe approach] |
70
+
71
+ ---
72
+
73
+ ## Security Notes
74
+
75
+ <!-- Not a full security audit — track known issues and applied mitigations. -->
76
+
77
+ - **[Issue type]:** [Description and current mitigation]
78
+ - **Dependencies with known CVEs:** Run `npm audit` before each release
79
+ - **Secrets management:** [How secrets are handled — env vars, Vault, Secrets Manager, etc.]
80
+
81
+ ---
82
+
83
+ ## Performance Notes
84
+
85
+ - **[Bottleneck]:** `src/[path]` — [Description and known workaround]
86
+ - **[N+1 query]:** `src/[path]` — [Where it occurs, impact, fix plan]
87
+ - **Missing caching:** [What should be cached but isn't]
88
+
89
+ ---
90
+
91
+ ## Scaling Limits
92
+
93
+ [What will break at scale and at what threshold]
94
+
95
+ | Limit | Current capacity | Breaks at | Fix |
96
+ |-------|-----------------|-----------|-----|
97
+ | [DB connections] | [10 concurrent] | [~100 req/s] | [Connection pooling] |
98
+ | [File uploads] | [Local disk] | [Any horizontal scale] | [Migrate to S3] |
99
+
100
+ ---
101
+ *Generated: [date]*
102
+ *Last updated: [date] after [trigger]*
@@ -0,0 +1,119 @@
1
+ # Coding Conventions
2
+
3
+ <!-- Generated by /map-codebase. Prescriptive style guide derived from the actual codebase.
4
+ Consumed by: execute-phase (all work), plan-phase (UI/backend/refactor).
5
+ Auto-loaded by Copilot when editing source files via conventions.instructions.md. -->
6
+
7
+ ## Language & Formatting
8
+
9
+ - **Language:** [TypeScript strict mode / Python 3.12+ type-annotated / etc.]
10
+ - **Formatter:** [Prettier / Black / gofmt] — always run before committing
11
+ - **Line length:** [120 chars]
12
+ - **Indentation:** [2 spaces / 4 spaces / tabs]
13
+ - **Semicolons:** [Required / Omitted]
14
+ - **Quotes:** [Single / Double] for strings; [backticks for template literals]
15
+ - **Trailing commas:** [Always / ES5 / Never]
16
+
17
+ **Key formatter config (`.prettierrc`):**
18
+ ```json
19
+ {
20
+ "semi": true,
21
+ "singleQuote": true,
22
+ "tabWidth": 2,
23
+ "trailingComma": "es5"
24
+ }
25
+ ```
26
+
27
+ ## Naming Conventions
28
+
29
+ | Thing | Convention | Example |
30
+ |-------|-----------|---------|
31
+ | Variables | `camelCase` | `userId`, `isActive` |
32
+ | Functions | `camelCase` | `getUserById()`, `validateEmail()` |
33
+ | Classes | `PascalCase` | `UserService`, `AuthController` |
34
+ | Interfaces | `PascalCase` (no `I` prefix) | `User`, `CreateUserDto` |
35
+ | Types | `PascalCase` | `UserRole`, `ApiResponse<T>` |
36
+ | Constants | `SCREAMING_SNAKE_CASE` | `MAX_RETRY_COUNT`, `DEFAULT_PAGE_SIZE` |
37
+ | Files | `kebab-case.ts` or `camelCase.ts` | [specify your pattern] |
38
+ | Directories | `kebab-case` | `user-service/`, `api-routes/` |
39
+ | Database columns | `snake_case` | `created_at`, `user_id` |
40
+ | Environment variables | `SCREAMING_SNAKE_CASE` | `DATABASE_URL`, `API_SECRET` |
41
+
42
+ ## Import Ordering
43
+
44
+ Always arrange imports in this order (enforced by ESLint):
45
+ ```typescript
46
+ // 1. Node built-ins
47
+ import path from 'path';
48
+ import fs from 'fs';
49
+
50
+ // 2. External packages
51
+ import express from 'express';
52
+ import { z } from 'zod';
53
+
54
+ // 3. Internal absolute imports (using path aliases)
55
+ import { UserService } from '@/services/user.service';
56
+ import { db } from '@/config/database';
57
+
58
+ // 4. Relative imports
59
+ import { validateDto } from '../utils/validate';
60
+ import type { CreateUserDto } from './user.types';
61
+ ```
62
+
63
+ ## Error Handling
64
+
65
+ - **Never swallow errors silently** — always log or rethrow
66
+ - **Use custom error classes** for domain errors:
67
+ ```typescript
68
+ // Throw domain errors like:
69
+ throw new NotFoundError(`User ${id} not found`);
70
+ throw new ValidationError('Email is required');
71
+ throw new UnauthorizedError('Invalid token');
72
+ ```
73
+ - **Async functions:** always use `try/catch` or `.catch()` — never leave Promises unhandled
74
+ - **HTTP errors:** handled centrally by `src/middleware/error.ts` — don't send error responses manually in routes
75
+
76
+ ## Function & Method Patterns
77
+
78
+ - **Single responsibility:** one function does one thing
79
+ - **Max function length:** ~50 lines — extract if longer
80
+ - **Early returns** over deep nesting:
81
+ ```typescript
82
+ // Prefer:
83
+ if (!user) return null;
84
+ if (!user.isActive) throw new ForbiddenError('Account inactive');
85
+ return user;
86
+
87
+ // Over:
88
+ if (user) {
89
+ if (user.isActive) {
90
+ return user;
91
+ } else { ... }
92
+ } else { ... }
93
+ ```
94
+ - **Async/await** over raw Promises for readability
95
+
96
+ ## TypeScript Specifics
97
+
98
+ - **Always annotate function return types** — no implicit `any` returns
99
+ - **Avoid `any`** — use `unknown` and narrow with type guards if needed
100
+ - **Use `readonly`** for properties that should not be mutated
101
+ - **Prefer interfaces** for object shapes; prefer `type` for unions/computed types
102
+ - **Nullability:** use `| null` explicitly, not `| undefined` unless the value can be absent from an object
103
+
104
+ ## Comments
105
+
106
+ - **Write comments for WHY, not WHAT** — code explains what; comments explain why
107
+ - **Remove commented-out code** before committing
108
+ - **JSDoc** for all exported functions and classes:
109
+ ```typescript
110
+ /**
111
+ * Finds active user by email. Returns null if not found or deactivated.
112
+ */
113
+ async function findActiveUser(email: string): Promise<User | null>
114
+ ```
115
+ - **TODO comments:** include a ticket/issue reference: `// TODO(GH-123): refactor after auth migration`
116
+
117
+ ---
118
+ *Generated: [date]*
119
+ *Last updated: [date] after [trigger]*
@@ -0,0 +1,114 @@
1
+ # External Integrations
2
+
3
+ <!-- Generated by /map-codebase. Describes all external services, APIs, and infrastructure dependencies.
4
+ Consumed by: plan-phase (integration/API phases), execute-phase (when touching external services). -->
5
+
6
+ ## Summary
7
+
8
+ | Service | Type | SDK / Library | Purpose |
9
+ |---------|------|--------------|---------|
10
+ | [e.g., PostgreSQL] | Database | `prisma` | Primary data store |
11
+ | [e.g., Redis] | Cache | `ioredis` | Session storage, rate limiting |
12
+ | [e.g., Stripe] | Payment API | `stripe` | Subscription billing |
13
+ | [e.g., SendGrid] | Email | `@sendgrid/mail` | Transactional email |
14
+ | [e.g., S3] | Object storage | `@aws-sdk/client-s3` | File uploads |
15
+ | [e.g., Auth0] | Auth provider | `express-openid-connect` | User authentication |
16
+
17
+ ---
18
+
19
+ ## Database
20
+
21
+ **Type:** [PostgreSQL 15 / MySQL 8 / MongoDB 6 / SQLite]
22
+ **ORM/Client:** [Prisma / Drizzle / TypeORM / Mongoose]
23
+ **Connection config:** `src/config/database.ts`
24
+
25
+ ```typescript
26
+ // Connection pattern
27
+ import { PrismaClient } from '@prisma/client';
28
+ export const db = new PrismaClient();
29
+ ```
30
+
31
+ **Migrations:** [How to run — e.g., `npx prisma migrate dev`]
32
+ **Schema:** `[prisma/schema.prisma / src/models/ / migrations/]`
33
+
34
+ ---
35
+
36
+ ## Authentication Provider
37
+
38
+ **Provider:** [Auth0 / Clerk / NextAuth / custom JWT]
39
+ **Config file:** `src/config/auth.ts`
40
+ **Middleware:** `src/middleware/auth.ts`
41
+
42
+ **How auth works:**
43
+ [Describe the auth flow — e.g., "JWT issued by Auth0, validated via JWKS endpoint, user attached to req.user by middleware"]
44
+
45
+ **Required env vars:**
46
+ ```bash
47
+ AUTH_SECRET=
48
+ AUTH_PROVIDER_DOMAIN=
49
+ AUTH_PROVIDER_CLIENT_ID=
50
+ AUTH_PROVIDER_CLIENT_SECRET=
51
+ ```
52
+
53
+ ---
54
+
55
+ ## [Payment Service — e.g., Stripe]
56
+
57
+ **SDK:** `stripe` v[X.X]
58
+ **Client location:** `src/config/stripe.ts`
59
+
60
+ **Webhooks:** `POST /api/webhooks/stripe` — handled in `src/routes/webhooks/stripe.route.ts`
61
+
62
+ **Key operations:**
63
+ - Create checkout session: `src/services/billing.service.ts → createCheckoutSession()`
64
+ - Handle subscription events: `src/services/billing.service.ts → handleWebhookEvent()`
65
+
66
+ **Required env vars:**
67
+ ```bash
68
+ STRIPE_SECRET_KEY=
69
+ STRIPE_WEBHOOK_SECRET=
70
+ STRIPE_PRICE_ID_MONTHLY=
71
+ ```
72
+
73
+ ---
74
+
75
+ ## [Email Service — e.g., SendGrid / Resend]
76
+
77
+ **SDK:** `[package]` v[X]
78
+ **Client location:** `src/config/email.ts`
79
+ **Templates:** `src/email-templates/`
80
+
81
+ **Key operations:**
82
+ - `src/services/email.service.ts → sendWelcomeEmail(user)`
83
+ - `src/services/email.service.ts → sendPasswordReset(user, token)`
84
+
85
+ **Required env vars:**
86
+ ```bash
87
+ EMAIL_API_KEY=
88
+ EMAIL_FROM_ADDRESS=
89
+ EMAIL_FROM_NAME=
90
+ ```
91
+
92
+ ---
93
+
94
+ ## [Other External Services]
95
+
96
+ [Add sections for each external service: S3, Cloudinary, Twilio, OpenAI, etc. Follow the pattern above.]
97
+
98
+ ---
99
+
100
+ ## CI/CD
101
+
102
+ **Platform:** [GitHub Actions / GitLab CI / CircleCI]
103
+ **Config:** `.github/workflows/`
104
+
105
+ **Pipelines:**
106
+ | Workflow | Trigger | What it does |
107
+ |----------|---------|-------------|
108
+ | `ci.yml` | Push / PR | Lint, type-check, test |
109
+ | `deploy.yml` | Merge to main | Deploy to [env] |
110
+ | `release.yml` | Tag v* | Build + publish |
111
+
112
+ ---
113
+ *Generated: [date]*
114
+ *Last updated: [date] after [trigger]*