opencode-goopspec 0.1.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 (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +650 -0
  3. package/agents/goop-debugger.md +265 -0
  4. package/agents/goop-designer.md +244 -0
  5. package/agents/goop-executor.md +217 -0
  6. package/agents/goop-explorer.md +252 -0
  7. package/agents/goop-librarian.md +197 -0
  8. package/agents/goop-orchestrator.md +224 -0
  9. package/agents/goop-planner.md +231 -0
  10. package/agents/goop-researcher.md +246 -0
  11. package/agents/goop-tester.md +245 -0
  12. package/agents/goop-verifier.md +266 -0
  13. package/agents/goop-writer.md +293 -0
  14. package/agents/memory-distiller.md +226 -0
  15. package/commands/goop-accept.md +183 -0
  16. package/commands/goop-amend.md +175 -0
  17. package/commands/goop-complete.md +206 -0
  18. package/commands/goop-debug.md +318 -0
  19. package/commands/goop-discuss.md +138 -0
  20. package/commands/goop-execute.md +137 -0
  21. package/commands/goop-help.md +82 -0
  22. package/commands/goop-map-codebase.md +501 -0
  23. package/commands/goop-memory.md +66 -0
  24. package/commands/goop-milestone.md +213 -0
  25. package/commands/goop-pause.md +61 -0
  26. package/commands/goop-plan.md +78 -0
  27. package/commands/goop-quick.md +165 -0
  28. package/commands/goop-recall.md +48 -0
  29. package/commands/goop-remember.md +71 -0
  30. package/commands/goop-research.md +98 -0
  31. package/commands/goop-resume.md +57 -0
  32. package/commands/goop-setup.md +208 -0
  33. package/commands/goop-specify.md +145 -0
  34. package/commands/goop-status.md +153 -0
  35. package/dist/index.js +31017 -0
  36. package/dist/memory/index.js +48752 -0
  37. package/package.json +73 -0
  38. package/references/agent-patterns.md +334 -0
  39. package/references/boundary-system.md +141 -0
  40. package/references/deviation-rules.md +80 -0
  41. package/references/dispatch-patterns.md +176 -0
  42. package/references/model-profiles.md +109 -0
  43. package/references/orchestrator-philosophy.md +280 -0
  44. package/references/security-checklist.md +163 -0
  45. package/references/subagent-protocol.md +393 -0
  46. package/references/tdd.md +231 -0
  47. package/references/ui-brand.md +261 -0
  48. package/references/workflow-accept.md +325 -0
  49. package/references/workflow-execute.md +315 -0
  50. package/references/workflow-plan.md +179 -0
  51. package/references/workflow-research.md +234 -0
  52. package/references/workflow-specify.md +278 -0
  53. package/skills/README.md +362 -0
  54. package/skills/accessibility/skill.md +41 -0
  55. package/skills/accessibility-testing/skill.md +47 -0
  56. package/skills/api-docs/skill.md +50 -0
  57. package/skills/architecture-design/skill.md +168 -0
  58. package/skills/atomic-commits/skill.md +53 -0
  59. package/skills/code-review/skill.md +59 -0
  60. package/skills/codebase-mapping/skill.md +54 -0
  61. package/skills/convention-detection/skill.md +68 -0
  62. package/skills/debugging/skill.md +59 -0
  63. package/skills/deviation-handling/skill.md +187 -0
  64. package/skills/documentation/skill.md +213 -0
  65. package/skills/goop-core/skill.md +383 -0
  66. package/skills/memory-usage/skill.md +208 -0
  67. package/skills/parallel-planning/skill.md +170 -0
  68. package/skills/pattern-extraction/skill.md +73 -0
  69. package/skills/performance-optimization/skill.md +188 -0
  70. package/skills/playwright/skill.md +69 -0
  71. package/skills/playwright-testing/skill.md +93 -0
  72. package/skills/progress-tracking/skill.md +155 -0
  73. package/skills/readme-generation/skill.md +87 -0
  74. package/skills/research/skill.md +161 -0
  75. package/skills/responsive-design/skill.md +76 -0
  76. package/skills/scientific-method/skill.md +67 -0
  77. package/skills/security-audit/skill.md +152 -0
  78. package/skills/task-decomposition/skill.md +153 -0
  79. package/skills/task-delegation/skill.md +127 -0
  80. package/skills/technical-writing/skill.md +69 -0
  81. package/skills/testing/skill.md +202 -0
  82. package/skills/ui-design/skill.md +73 -0
  83. package/skills/ux-patterns/skill.md +82 -0
  84. package/skills/verification/skill.md +178 -0
  85. package/skills/visual-regression/skill.md +86 -0
  86. package/templates/blueprint.md +141 -0
  87. package/templates/chronicle.md +156 -0
  88. package/templates/milestone.md +131 -0
  89. package/templates/research.md +117 -0
  90. package/templates/retrospective.md +188 -0
  91. package/templates/spec.md +103 -0
  92. package/templates/summary.md +202 -0
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: goop-execute
3
+ description: Start the Execute phase - wave-based implementation
4
+ ---
5
+
6
+ # GoopSpec Execute
7
+
8
+ Implement the specification through wave-based task execution with orchestrated subagents.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /goop-execute
14
+ ```
15
+
16
+ ## Workflow Position
17
+
18
+ ```
19
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
20
+ │ PLAN │ ──▶ │ RESEARCH │ ──▶ │ SPECIFY │
21
+ │ (Intent) │ │ (Explore) │ │ (Contract) │
22
+ └─────────────┘ └─────────────┘ └─────────────┘
23
+
24
+ ┌──────────────────────────────────────┘
25
+
26
+ ┌─────────────┐ ┌─────────────┐
27
+ │ EXECUTE │ ──▶ │ ACCEPT │
28
+ │ (Build) │ │ (Verify) │
29
+ └─────────────┘ └─────────────┘
30
+
31
+ (You are here)
32
+ ```
33
+
34
+ The Execute phase answers: **Build exactly what the spec says.**
35
+
36
+ ## What Happens
37
+
38
+ 1. **Wave-Based Execution** - Tasks grouped into sequential waves:
39
+ - **Wave 1: Foundation** - Setup, configuration, base structures
40
+ - **Wave 2: Core** - Main feature, business logic, data handling
41
+ - **Wave 3: Integration** - Connect components, wire to existing system
42
+ - **Wave 4: Polish** - Error handling, edge cases, documentation
43
+
44
+ 2. **Orchestrator Coordination** - Orchestrator acts as CONDUCTOR:
45
+ - Delegates tasks to specialized subagents
46
+ - Tracks progress in CHRONICLE.md
47
+ - Applies deviation rules automatically
48
+ - Handles blockers and checkpoints
49
+ - **NEVER writes code itself**
50
+
51
+ 3. **Task Execution** - For each task:
52
+ - Read from BLUEPRINT.md
53
+ - Check deviation rules
54
+ - Delegate to goop-executor agent
55
+ - Agent implements with memory protocol
56
+ - Atomic commit per task
57
+ - Update CHRONICLE.md
58
+ - Verify tests pass
59
+
60
+ 4. **Deviation Handling** - Auto-fix without asking:
61
+ - **Rule 1:** Bugs (type errors, logic errors, crashes)
62
+ - **Rule 2:** Missing critical functionality (validation, error handling)
63
+ - **Rule 3:** Blocking issues (missing deps, broken imports)
64
+ - **Rule 4:** STOP for architectural decisions (new tables, framework changes)
65
+
66
+ 5. **Checkpoint Handling** - Pause for user input when needed:
67
+ - `checkpoint:verify` - User verifies functionality
68
+ - `checkpoint:decision` - User makes decision
69
+ - `checkpoint:action` - User performs action
70
+
71
+ ## Wave Principles
72
+
73
+ 1. **Sequential waves** - Wave N completes before Wave N+1 starts
74
+ 2. **Vertical slices** - Each wave delivers working functionality
75
+ 3. **Atomic commits** - Each task = one commit
76
+ 4. **Verification gates** - Tests must pass between waves
77
+
78
+ ## Artifacts Created/Updated
79
+
80
+ - `CHRONICLE.md` - Real-time progress tracking:
81
+ - Current wave and task
82
+ - Completed tasks with commit hashes
83
+ - Deviations logged
84
+ - Blockers noted
85
+
86
+ - Git commits - One per task:
87
+ ```
88
+ feat(wave-task): description
89
+
90
+ - Change 1
91
+ - Change 2
92
+ ```
93
+
94
+ ## Example
95
+
96
+ After spec locked for authentication:
97
+
98
+ ```
99
+ /goop-execute
100
+ ```
101
+
102
+ Orchestrator executes:
103
+ - Wave 1: Setup auth directory, install jose library
104
+ - Wave 2: Implement login function, session management
105
+ - Wave 3: Wire to API routes, connect to user model
106
+ - Wave 4: Add error handling, write tests
107
+
108
+ Each task delegated to goop-executor, committed atomically.
109
+
110
+ ## Continuation Enforcement
111
+
112
+ The agent **CANNOT stop** with incomplete tasks:
113
+ - Incomplete todos = forced continuation
114
+ - Only checkpoints allow pause
115
+ - User must explicitly confirm completion
116
+ - Max continuation prompts before escalation
117
+
118
+ ## Next Steps
119
+
120
+ After execution:
121
+ - `/goop-accept` - Verify and accept completion (ACCEPTANCE GATE)
122
+
123
+ During execution:
124
+ - `/goop-status` - Check progress
125
+ - `/goop-pause` - Save checkpoint manually
126
+
127
+ ## Quick Mode Execution
128
+
129
+ For Quick tasks:
130
+ - Abbreviated waves (often just 1-2)
131
+ - Faster delegation
132
+ - Less formal tracking
133
+ - Direct to Accept phase
134
+
135
+ ---
136
+
137
+ **GoopSpec**: Execute with precision, deliver with confidence.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: goop-help
3
+ description: Show help and information about GoopSpec
4
+ ---
5
+
6
+ # GoopSpec Help
7
+
8
+ Display help information and available commands.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /goop-help
14
+ ```
15
+
16
+ ## Available Commands
17
+
18
+ **Project Management:**
19
+ - `/goop-status` - Show current status
20
+ - `/goop-milestone [name]` - Start a new milestone
21
+ - `/goop-complete` - Complete and archive a milestone
22
+
23
+ **Discovery:**
24
+ - `/goop-discuss [description]` - Capture user vision before planning
25
+ - `/goop-research` - Domain research for complex phases
26
+ - `/goop-map-codebase` - Brownfield codebase analysis
27
+
28
+ **Phase Workflow:**
29
+ - `/goop-plan [description]` - Plan a feature or phase
30
+ - `/goop-specify` - Lock the specification (CONTRACT GATE)
31
+ - `/goop-execute` - Execute wave-based implementation
32
+ - `/goop-accept` - Verify and accept completion (ACCEPTANCE GATE)
33
+ - `/goop-amend [change]` - Propose changes to locked spec
34
+ - `/goop-debug` - Debug with scientific method workflow
35
+ - `/goop-quick [description]` - Small tasks without full phase planning
36
+
37
+ **Session Management:**
38
+ - `/goop-pause [name]` - Save checkpoint
39
+ - `/goop-resume [id]` - Resume from checkpoint
40
+
41
+ **Memory:**
42
+ - `/goop-remember [content]` - Save to persistent memory
43
+ - `/goop-recall [query]` - Search persistent memory
44
+ - `/goop-memory` - View memory system status
45
+
46
+ **Setup:**
47
+ - `/goop-setup` - First-time setup wizard
48
+ - `/goop-help` - Show this help
49
+
50
+ **Quick Keywords:**
51
+ Say these in any message:
52
+ - `"goopspec"` or `"goop"` - Activate GoopSpec mode
53
+ - `"spec it"` - Create a spec for current task
54
+ - `"finish it"` - Enforced continuation mode (complete all)
55
+ - `"checkpoint"` - Save checkpoint
56
+
57
+ ## Concepts
58
+
59
+ **Enforced Task Continuation:** The agent keeps working until tasks are complete, with clear checkpoints for user confirmation.
60
+
61
+ **Spec-Driven Development:** Every task starts with a clear specification. The agent follows the spec, and changes require explicit agreement.
62
+
63
+ **Fresh Context:** Each phase uses fresh context to keep plans and execution precise and focused.
64
+
65
+ **Audit and Confirmation:** After execution, run verification and confirm with the user before planning the next phase.
66
+
67
+ ## Configuration
68
+
69
+ Edit `.goopspec/config.json` to customize:
70
+ - Enforced task continuation settings (max prompts, interval)
71
+ - Spec enforcement (strict mode)
72
+ - Agent models
73
+ - Auto-save options
74
+
75
+ ## Links
76
+
77
+ - GitHub: https://github.com/james/opencode-goopspec
78
+ - Documentation: See README.md
79
+
80
+ ---
81
+
82
+ **GoopSpec**: Spec-first execution with user confirmation gates.
@@ -0,0 +1,501 @@
1
+ ---
2
+ name: goop-map-codebase
3
+ description: Map an existing codebase for brownfield projects - understand architecture, stack, and conventions
4
+ tools:
5
+ read: true
6
+ write: true
7
+ bash: true
8
+ task: true
9
+ glob: true
10
+ grep: true
11
+ ---
12
+
13
+ <objective>
14
+ Map an existing codebase for brownfield projects.
15
+
16
+ Analyzes codebase with parallel Explore agents. Creates `.goopspec/codebase/` with 7 focused documents covering stack, architecture, structure, conventions, testing, integrations, and concerns.
17
+
18
+ Use before `/goop-new` on existing codebases. Provides the context needed to extend rather than replace.
19
+
20
+ **Creates:**
21
+ - `.goopspec/codebase/STACK.md` - Technology stack
22
+ - `.goopspec/codebase/ARCHITECTURE.md` - Architecture overview
23
+ - `.goopspec/codebase/STRUCTURE.md` - Directory structure
24
+ - `.goopspec/codebase/CONVENTIONS.md` - Code conventions
25
+ - `.goopspec/codebase/TESTING.md` - Testing approach
26
+ - `.goopspec/codebase/INTEGRATIONS.md` - External integrations
27
+ - `.goopspec/codebase/CONCERNS.md` - Known issues and tech debt
28
+ </objective>
29
+
30
+ <execution_context>
31
+ @/home/james/Documents/opencode-goopspec/templates/codebase/stack.md
32
+ @/home/james/Documents/opencode-goopspec/templates/codebase/architecture.md
33
+ @/home/james/Documents/opencode-goopspec/templates/codebase/conventions.md
34
+ </execution_context>
35
+
36
+ <process>
37
+ ## Phase 1: Setup
38
+
39
+ 1. **Check for existing codebase map**
40
+ ```bash
41
+ [ -d .goopspec/codebase ] && echo "Codebase map already exists"
42
+ ```
43
+
44
+ 2. **Initialize .goopspec if needed**
45
+ ```bash
46
+ mkdir -p .goopspec/codebase
47
+ ```
48
+
49
+ 3. **Detect project type**
50
+ ```bash
51
+ # Check for common project indicators
52
+ [ -f package.json ] && echo "Node.js project"
53
+ [ -f requirements.txt ] && echo "Python project"
54
+ [ -f Cargo.toml ] && echo "Rust project"
55
+ [ -f go.mod ] && echo "Go project"
56
+ [ -f pom.xml ] && echo "Java/Maven project"
57
+ [ -f build.gradle ] && echo "Java/Gradle project"
58
+ ls -la
59
+ ```
60
+
61
+ ## Phase 2: Parallel Exploration
62
+
63
+ Spawn 7 parallel explore agents via `task` tool:
64
+
65
+ ### Explorer 1: Stack Detection
66
+ ```
67
+ Analyze the technology stack of this codebase.
68
+ - Programming languages
69
+ - Frameworks and libraries
70
+ - Build tools
71
+ - Database
72
+ - Testing frameworks
73
+ - Dev tools (linting, formatting, etc.)
74
+
75
+ Create .goopspec/codebase/STACK.md
76
+ ```
77
+
78
+ ### Explorer 2: Architecture Analysis
79
+ ```
80
+ Analyze the architecture of this codebase.
81
+ - Overall pattern (MVC, layered, hexagonal, etc.)
82
+ - Component relationships
83
+ - Data flow
84
+ - Key abstractions
85
+ - Design patterns used
86
+
87
+ Create .goopspec/codebase/ARCHITECTURE.md
88
+ ```
89
+
90
+ ### Explorer 3: Structure Mapping
91
+ ```
92
+ Map the directory and file structure.
93
+ - Top-level organization
94
+ - Module/package boundaries
95
+ - Where different types of code live
96
+ - Configuration locations
97
+ - Asset locations
98
+
99
+ Create .goopspec/codebase/STRUCTURE.md
100
+ ```
101
+
102
+ ### Explorer 4: Conventions Discovery
103
+ ```
104
+ Identify code conventions and patterns.
105
+ - Naming conventions
106
+ - File organization
107
+ - Code style
108
+ - Import patterns
109
+ - Error handling patterns
110
+ - Documentation style
111
+
112
+ Create .goopspec/codebase/CONVENTIONS.md
113
+ ```
114
+
115
+ ### Explorer 5: Testing Analysis
116
+ ```
117
+ Analyze the testing approach.
118
+ - Testing frameworks used
119
+ - Test organization
120
+ - Coverage patterns
121
+ - Test types (unit, integration, e2e)
122
+ - Testing gaps
123
+
124
+ Create .goopspec/codebase/TESTING.md
125
+ ```
126
+
127
+ ### Explorer 6: Integrations Inventory
128
+ ```
129
+ Identify external integrations.
130
+ - APIs consumed
131
+ - Services used
132
+ - Third-party dependencies
133
+ - Environment requirements
134
+ - Secrets/configuration needed
135
+
136
+ Create .goopspec/codebase/INTEGRATIONS.md
137
+ ```
138
+
139
+ ### Explorer 7: Concerns & Debt
140
+ ```
141
+ Identify issues, concerns, and tech debt.
142
+ - Code smells
143
+ - Security concerns
144
+ - Performance issues
145
+ - Outdated dependencies
146
+ - Known bugs or limitations
147
+ - Areas needing attention
148
+
149
+ Create .goopspec/codebase/CONCERNS.md
150
+ ```
151
+
152
+ Wait for all explorers to complete.
153
+
154
+ ## Phase 3: Synthesize Findings
155
+
156
+ Collect and organize findings from all 7 explorers:
157
+
158
+ 1. Check for conflicts between explorers
159
+ 2. Identify the most critical insights
160
+ 3. Summarize for quick reference
161
+ 4. Flag areas needing clarification
162
+
163
+ ## Phase 4: Write Codebase Documents
164
+
165
+ ### STACK.md
166
+ ```markdown
167
+ # Technology Stack
168
+
169
+ **Analyzed:** [Date]
170
+ **Project Type:** [Detected type]
171
+
172
+ ## Languages
173
+ - [Language] [version] - [Primary use]
174
+
175
+ ## Frameworks & Libraries
176
+ ### Core
177
+ - [Framework] [version] - [Purpose]
178
+
179
+ ### Supporting
180
+ - [Library] [version] - [Purpose]
181
+
182
+ ## Build & Dev Tools
183
+ - [Tool] - [Purpose]
184
+
185
+ ## Database
186
+ - [Database] [version] - [Usage pattern]
187
+
188
+ ## Testing
189
+ - [Framework] - [Test types]
190
+
191
+ ## Key Dependencies
192
+ ```json
193
+ {
194
+ "critical": ["dep1", "dep2"],
195
+ "utility": ["dep3", "dep4"]
196
+ }
197
+ ```
198
+
199
+ ## Version Info
200
+ - Node/Python/Rust/etc: [version]
201
+ - Package manager: [npm/pip/cargo/etc]
202
+ ```
203
+
204
+ ### ARCHITECTURE.md
205
+ ```markdown
206
+ # Architecture Overview
207
+
208
+ **Pattern:** [MVC/Layered/Hexagonal/etc]
209
+ **Complexity:** [Simple/Moderate/Complex]
210
+
211
+ ## High-Level Structure
212
+
213
+ [Diagram or description of major components]
214
+
215
+ ## Component Relationships
216
+
217
+ ### [Component A]
218
+ - **Responsibility:** [What it does]
219
+ - **Depends on:** [Other components]
220
+ - **Used by:** [Other components]
221
+
222
+ ### [Component B]
223
+ - **Responsibility:** [What it does]
224
+ - **Depends on:** [Other components]
225
+ - **Used by:** [Other components]
226
+
227
+ ## Data Flow
228
+
229
+ [Description of how data moves through the system]
230
+
231
+ ## Key Abstractions
232
+
233
+ 1. **[Abstraction]** - [Purpose and usage]
234
+ 2. **[Abstraction]** - [Purpose and usage]
235
+
236
+ ## Design Patterns
237
+
238
+ - **[Pattern]** - [Where used and why]
239
+
240
+ ## Entry Points
241
+
242
+ - [Entry 1] - [Purpose]
243
+ - [Entry 2] - [Purpose]
244
+ ```
245
+
246
+ ### STRUCTURE.md
247
+ ```markdown
248
+ # Directory Structure
249
+
250
+ ```
251
+ project/
252
+ ├── [dir]/ # [Purpose]
253
+ │ ├── [subdir]/ # [Purpose]
254
+ │ └── ...
255
+ ├── [dir]/ # [Purpose]
256
+ └── ...
257
+ ```
258
+
259
+ ## Directory Purposes
260
+
261
+ ### /[directory]
262
+ - **Contains:** [What lives here]
263
+ - **Convention:** [How files organized]
264
+ - **Examples:** [Key files]
265
+
266
+ ## File Organization Patterns
267
+
268
+ - [Pattern 1]
269
+ - [Pattern 2]
270
+
271
+ ## Configuration Locations
272
+
273
+ - [Config 1] - [Purpose]
274
+ - [Config 2] - [Purpose]
275
+ ```
276
+
277
+ ### CONVENTIONS.md
278
+ ```markdown
279
+ # Code Conventions
280
+
281
+ ## Naming
282
+ - **Variables:** [convention]
283
+ - **Functions:** [convention]
284
+ - **Classes:** [convention]
285
+ - **Files:** [convention]
286
+
287
+ ## Code Style
288
+ - **Indentation:** [spaces/tabs, count]
289
+ - **Line length:** [max]
290
+ - **Quotes:** [single/double]
291
+ - **Semicolons:** [required/optional]
292
+
293
+ ## Organization
294
+ - **Imports:** [order and style]
295
+ - **Exports:** [pattern]
296
+ - **File length:** [typical max]
297
+
298
+ ## Patterns
299
+ - **Error handling:** [pattern]
300
+ - **Async:** [pattern - callbacks/promises/async-await]
301
+ - **Null checking:** [pattern]
302
+ - **Comments:** [style and when used]
303
+
304
+ ## Documentation
305
+ - **Required:** [what must be documented]
306
+ - **Style:** [JSDoc/TSDoc/etc]
307
+
308
+ ## Anti-Patterns Present
309
+ - [Anti-pattern] - [Where found]
310
+ ```
311
+
312
+ ### TESTING.md
313
+ ```markdown
314
+ # Testing Approach
315
+
316
+ ## Frameworks
317
+ - **[Framework]** - [Unit/Integration/E2E]
318
+
319
+ ## Test Organization
320
+ - **Location:** [Where tests live]
321
+ - **Naming:** [Test file naming]
322
+ - **Structure:** [Describe/It blocks, etc.]
323
+
324
+ ## Coverage
325
+ - **Current:** [Estimated % or "unknown"]
326
+ - **Gaps:** [Areas lacking tests]
327
+
328
+ ## Test Types
329
+ - **Unit:** [What gets unit tested]
330
+ - **Integration:** [What gets integration tested]
331
+ - **E2E:** [What gets E2E tested]
332
+
333
+ ## Running Tests
334
+ ```bash
335
+ [Command to run tests]
336
+ ```
337
+
338
+ ## Testing Gaps
339
+ - [Gap 1] - [Impact]
340
+ - [Gap 2] - [Impact]
341
+ ```
342
+
343
+ ### INTEGRATIONS.md
344
+ ```markdown
345
+ # External Integrations
346
+
347
+ ## APIs Consumed
348
+
349
+ ### [API Name]
350
+ - **Endpoint:** [URL]
351
+ - **Auth:** [Method]
352
+ - **Usage:** [How used in codebase]
353
+ - **Env vars:** [Required variables]
354
+
355
+ ## Services
356
+
357
+ ### [Service Name]
358
+ - **Type:** [Database/Cache/Queue/etc]
359
+ - **Provider:** [AWS/Railway/etc]
360
+ - **Connection:** [How connected]
361
+
362
+ ## Third-Party Libraries
363
+
364
+ ### Critical
365
+ - [Library] - [Purpose] - [Version constraint]
366
+
367
+ ### Nice-to-Have
368
+ - [Library] - [Purpose]
369
+
370
+ ## Environment Requirements
371
+
372
+ ### Required Variables
373
+ ```
374
+ VARIABLE_NAME=[description]
375
+ ```
376
+
377
+ ### Optional Variables
378
+ ```
379
+ OPTIONAL_VAR=[description]
380
+ ```
381
+
382
+ ## Secrets Management
383
+ - **Approach:** [How secrets handled]
384
+ - **Location:** [Where stored]
385
+ ```
386
+
387
+ ### CONCERNS.md
388
+ ```markdown
389
+ # Known Issues & Concerns
390
+
391
+ ## Code Smells
392
+
393
+ ### [Concern 1]
394
+ - **Location:** [Files affected]
395
+ - **Issue:** [Description]
396
+ - **Impact:** [Severity]
397
+ - **Recommendation:** [What to do]
398
+
399
+ ## Security Concerns
400
+
401
+ ### [Security Issue]
402
+ - **Risk:** [Description]
403
+ - **Severity:** [Critical/High/Medium/Low]
404
+ - **Mitigation:** [If any]
405
+
406
+ ## Performance Issues
407
+
408
+ ### [Performance Issue]
409
+ - **Symptom:** [What happens]
410
+ - **Cause:** [Root cause]
411
+ - **Impact:** [How bad]
412
+
413
+ ## Outdated Dependencies
414
+
415
+ - **[Dependency]** [current] -> [latest] - [Risk level]
416
+
417
+ ## Tech Debt
418
+
419
+ ### [Debt Item]
420
+ - **Description:** [What needs refactoring]
421
+ - **Effort:** [Estimated]
422
+ - **Priority:** [When to address]
423
+
424
+ ## Recommended Priorities
425
+
426
+ 1. **[Priority 1]** - [Why urgent]
427
+ 2. **[Priority 2]** - [Why important]
428
+ ```
429
+
430
+ ## Phase 5: Update State
431
+
432
+ Update STATE.md:
433
+ - Mark codebase as mapped
434
+ - Add timestamp
435
+ - Link to codebase docs
436
+
437
+ ## Phase 6: Offer Next Steps
438
+
439
+ ```
440
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
441
+ GOOPSPEC > CODEBASE MAPPED
442
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
443
+
444
+ **Codebase Analysis Complete**
445
+
446
+ 7 explorers analyzed your codebase:
447
+ - Stack identified
448
+ - Architecture mapped
449
+ - Structure documented
450
+ - Conventions discovered
451
+ - Testing analyzed
452
+ - Integrations inventoried
453
+ - Concerns flagged
454
+
455
+ Created in .goopspec/codebase/:
456
+ - STACK.md
457
+ - ARCHITECTURE.md
458
+ - STRUCTURE.md
459
+ - CONVENTIONS.md
460
+ - TESTING.md
461
+ - INTEGRATIONS.md
462
+ - CONCERNS.md
463
+
464
+ ───────────────────────────────────────────────────────────────
465
+
466
+ ## Next Up
467
+
468
+ **Initialize GoopSpec project** with brownfield context
469
+
470
+ /goop-new [project-name]
471
+
472
+ <sub>Will use codebase map to understand existing code</sub>
473
+
474
+ ───────────────────────────────────────────────────────────────
475
+
476
+ **Also available:**
477
+ - cat .goopspec/codebase/CONCERNS.md - Review issues first
478
+ - cat .goopspec/codebase/ARCHITECTURE.md - Understand structure
479
+
480
+ ───────────────────────────────────────────────────────────────
481
+ ```
482
+ </process>
483
+
484
+ <notes>
485
+ **When to map codebase:**
486
+ - Joining an existing project
487
+ - Before extending unfamiliar code
488
+ - When inheriting a codebase
489
+ - Before major refactoring
490
+
491
+ **What to do with concerns:**
492
+ - Review CONCERNS.md before planning
493
+ - Address critical security issues first
494
+ - Factor tech debt into phase planning
495
+ - Use as context for estimates
496
+
497
+ **Updating the map:**
498
+ - Re-run `/goop-map-codebase` periodically
499
+ - Update after major refactors
500
+ - Keep as living documentation
501
+ </notes>