pmp-gywd 3.3.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 (126) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +567 -0
  3. package/bin/install.js +348 -0
  4. package/commands/gywd/add-phase.md +207 -0
  5. package/commands/gywd/anticipate.md +271 -0
  6. package/commands/gywd/bootstrap.md +336 -0
  7. package/commands/gywd/challenge.md +344 -0
  8. package/commands/gywd/check-drift.md +144 -0
  9. package/commands/gywd/complete-milestone.md +106 -0
  10. package/commands/gywd/consider-issues.md +202 -0
  11. package/commands/gywd/context.md +93 -0
  12. package/commands/gywd/create-roadmap.md +115 -0
  13. package/commands/gywd/deps.md +169 -0
  14. package/commands/gywd/digest.md +138 -0
  15. package/commands/gywd/discuss-milestone.md +47 -0
  16. package/commands/gywd/discuss-phase.md +60 -0
  17. package/commands/gywd/execute-plan.md +161 -0
  18. package/commands/gywd/extract-decisions.md +325 -0
  19. package/commands/gywd/health.md +150 -0
  20. package/commands/gywd/help.md +556 -0
  21. package/commands/gywd/history.md +278 -0
  22. package/commands/gywd/impact.md +317 -0
  23. package/commands/gywd/init.md +95 -0
  24. package/commands/gywd/insert-phase.md +227 -0
  25. package/commands/gywd/list-phase-assumptions.md +50 -0
  26. package/commands/gywd/map-codebase.md +84 -0
  27. package/commands/gywd/memory.md +159 -0
  28. package/commands/gywd/new-milestone.md +59 -0
  29. package/commands/gywd/new-project.md +315 -0
  30. package/commands/gywd/pause-work.md +123 -0
  31. package/commands/gywd/plan-fix.md +205 -0
  32. package/commands/gywd/plan-phase.md +93 -0
  33. package/commands/gywd/preview-plan.md +139 -0
  34. package/commands/gywd/profile.md +363 -0
  35. package/commands/gywd/progress.md +317 -0
  36. package/commands/gywd/remove-phase.md +338 -0
  37. package/commands/gywd/research-phase.md +91 -0
  38. package/commands/gywd/resume-work.md +40 -0
  39. package/commands/gywd/rollback.md +179 -0
  40. package/commands/gywd/status.md +42 -0
  41. package/commands/gywd/sync-github.md +234 -0
  42. package/commands/gywd/verify-work.md +71 -0
  43. package/commands/gywd/why.md +251 -0
  44. package/docs/COMMANDS.md +722 -0
  45. package/docs/CONTRIBUTING.md +342 -0
  46. package/docs/EXAMPLES.md +535 -0
  47. package/docs/GETTING-STARTED.md +262 -0
  48. package/docs/README.md +55 -0
  49. package/docs/RELEASING.md +159 -0
  50. package/get-your-work-done/core/agent-patterns.md +331 -0
  51. package/get-your-work-done/core/architecture.md +334 -0
  52. package/get-your-work-done/core/context-model-schema.json +154 -0
  53. package/get-your-work-done/core/decisions-schema.json +193 -0
  54. package/get-your-work-done/core/learning-state-schema.json +133 -0
  55. package/get-your-work-done/core/profile-schema.json +257 -0
  56. package/get-your-work-done/references/adaptive-decomposition.md +175 -0
  57. package/get-your-work-done/references/checkpoints.md +287 -0
  58. package/get-your-work-done/references/confidence-scoring.md +169 -0
  59. package/get-your-work-done/references/continuation-format.md +255 -0
  60. package/get-your-work-done/references/git-integration.md +254 -0
  61. package/get-your-work-done/references/plan-format.md +428 -0
  62. package/get-your-work-done/references/principles.md +157 -0
  63. package/get-your-work-done/references/questioning.md +162 -0
  64. package/get-your-work-done/references/research-pitfalls.md +215 -0
  65. package/get-your-work-done/references/scope-estimation.md +172 -0
  66. package/get-your-work-done/references/tdd.md +263 -0
  67. package/get-your-work-done/templates/codebase/architecture.md +255 -0
  68. package/get-your-work-done/templates/codebase/concerns.md +310 -0
  69. package/get-your-work-done/templates/codebase/conventions.md +307 -0
  70. package/get-your-work-done/templates/codebase/integrations.md +280 -0
  71. package/get-your-work-done/templates/codebase/stack.md +186 -0
  72. package/get-your-work-done/templates/codebase/structure.md +285 -0
  73. package/get-your-work-done/templates/codebase/testing.md +480 -0
  74. package/get-your-work-done/templates/config.json +18 -0
  75. package/get-your-work-done/templates/context.md +161 -0
  76. package/get-your-work-done/templates/continue-here.md +78 -0
  77. package/get-your-work-done/templates/discovery.md +146 -0
  78. package/get-your-work-done/templates/issues.md +32 -0
  79. package/get-your-work-done/templates/milestone-archive.md +123 -0
  80. package/get-your-work-done/templates/milestone-context.md +93 -0
  81. package/get-your-work-done/templates/milestone.md +115 -0
  82. package/get-your-work-done/templates/phase-prompt.md +303 -0
  83. package/get-your-work-done/templates/project.md +184 -0
  84. package/get-your-work-done/templates/research.md +529 -0
  85. package/get-your-work-done/templates/roadmap.md +196 -0
  86. package/get-your-work-done/templates/state.md +210 -0
  87. package/get-your-work-done/templates/summary.md +273 -0
  88. package/get-your-work-done/templates/uat-issues.md +143 -0
  89. package/get-your-work-done/workflows/complete-milestone.md +643 -0
  90. package/get-your-work-done/workflows/create-milestone.md +416 -0
  91. package/get-your-work-done/workflows/create-roadmap.md +481 -0
  92. package/get-your-work-done/workflows/discovery-phase.md +293 -0
  93. package/get-your-work-done/workflows/discuss-milestone.md +236 -0
  94. package/get-your-work-done/workflows/discuss-phase.md +247 -0
  95. package/get-your-work-done/workflows/execute-phase.md +1625 -0
  96. package/get-your-work-done/workflows/list-phase-assumptions.md +178 -0
  97. package/get-your-work-done/workflows/map-codebase.md +434 -0
  98. package/get-your-work-done/workflows/plan-phase.md +488 -0
  99. package/get-your-work-done/workflows/research-phase.md +436 -0
  100. package/get-your-work-done/workflows/resume-project.md +287 -0
  101. package/get-your-work-done/workflows/transition.md +580 -0
  102. package/get-your-work-done/workflows/verify-work.md +202 -0
  103. package/lib/automation/dependency-analyzer.js +635 -0
  104. package/lib/automation/doc-generator.js +643 -0
  105. package/lib/automation/index.js +42 -0
  106. package/lib/automation/test-generator.js +628 -0
  107. package/lib/context/context-analyzer.js +554 -0
  108. package/lib/context/context-cache.js +426 -0
  109. package/lib/context/context-predictor.js +622 -0
  110. package/lib/context/index.js +44 -0
  111. package/lib/memory/confidence-calibrator.js +484 -0
  112. package/lib/memory/feedback-collector.js +551 -0
  113. package/lib/memory/global-memory.js +465 -0
  114. package/lib/memory/index.js +75 -0
  115. package/lib/memory/pattern-aggregator.js +487 -0
  116. package/lib/memory/team-sync.js +501 -0
  117. package/lib/profile/index.js +24 -0
  118. package/lib/profile/pattern-learner.js +303 -0
  119. package/lib/profile/profile-manager.js +445 -0
  120. package/lib/questioning/index.js +49 -0
  121. package/lib/questioning/question-engine.js +311 -0
  122. package/lib/questioning/question-templates.js +315 -0
  123. package/lib/validators/command-validator.js +188 -0
  124. package/lib/validators/index.js +29 -0
  125. package/lib/validators/schema-validator.js +183 -0
  126. package/package.json +61 -0
@@ -0,0 +1,278 @@
1
+ ---
2
+ name: GYWD:history
3
+ description: Query codebase temporal history - understand evolution, not just state
4
+ argument-hint: "<query> [--file <path>] [--since <date>] [--author <name>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ ---
12
+
13
+ <objective>
14
+ Enable natural language queries against codebase history.
15
+
16
+ Current tools show you snapshots. This shows you the **timeline**.
17
+
18
+ Every version of your code exists simultaneously in understanding. Query the evolution, not just the current state.
19
+ </objective>
20
+
21
+ <philosophy>
22
+ Understanding code requires understanding its history:
23
+
24
+ - Why did this change from X to Y?
25
+ - What problems did the old approach have?
26
+ - What patterns have emerged over time?
27
+ - What refactorings have been attempted and reverted?
28
+ - What areas are volatile vs stable?
29
+
30
+ The temporal dimension is where decisions become visible.
31
+ </philosophy>
32
+
33
+ <query_types>
34
+ ## Supported Query Patterns
35
+
36
+ ### Evolution Queries
37
+ - "When did we start using this pattern?"
38
+ - "What did authentication look like before the rewrite?"
39
+ - "How has this file evolved over time?"
40
+ - "What was removed in the last major refactor?"
41
+
42
+ ### Causation Queries
43
+ - "Why did we change the error handling?"
44
+ - "What bug led to this fix?"
45
+ - "What drove the migration from X to Y?"
46
+
47
+ ### Pattern Queries
48
+ - "What files always change together?"
49
+ - "Who usually works on this area?"
50
+ - "What's the typical commit pattern here?"
51
+
52
+ ### Stability Queries
53
+ - "What areas have been most volatile?"
54
+ - "What hasn't changed in 6 months?"
55
+ - "What gets reverted most often?"
56
+
57
+ ### Prediction Queries
58
+ - "Based on evolution, what will need work soon?"
59
+ - "What patterns suggest technical debt?"
60
+ - "What areas are due for refactoring?"
61
+ </query_types>
62
+
63
+ <process>
64
+ ## Query Processing
65
+
66
+ 1. **Parse query intent:**
67
+ ```
68
+ Query: "Why did we stop using Redux?"
69
+
70
+ Intent: causation
71
+ Subject: "Redux"
72
+ Timeframe: historical (removal)
73
+ Output: decision context
74
+ ```
75
+
76
+ 2. **Gather temporal data:**
77
+
78
+ ```bash
79
+ # Find when Redux was removed
80
+ git log -p --all -S "redux" -- "*.ts" "*.tsx"
81
+
82
+ # Find related commits
83
+ git log --grep="redux\|state management" --oneline
84
+
85
+ # Find PR/issue references
86
+ git log --format="%s %b" | grep -i "redux"
87
+ ```
88
+
89
+ 3. **Build timeline:**
90
+ ```
91
+ Timeline: Redux Usage
92
+ ├── 2023-01-15: Added Redux (commit abc)
93
+ │ └── "Initial state management setup"
94
+ ├── 2023-06-20: Redux Toolkit migration (commit def)
95
+ │ └── "Simplify Redux boilerplate"
96
+ ├── 2024-02-10: Zustand experiment (branch feature/zustand)
97
+ │ └── "Testing lighter alternative"
98
+ ├── 2024-03-01: Redux removed (commit ghi)
99
+ │ └── "Migrated to Zustand - 60% less code"
100
+ └── Current: Zustand in use
101
+ ```
102
+
103
+ 4. **Extract decision context:**
104
+ - Commit messages explaining why
105
+ - PR descriptions with rationale
106
+ - Issue references
107
+ - Code comments during transition
108
+
109
+ 5. **Generate response:**
110
+ ```markdown
111
+ ## Why We Stopped Using Redux
112
+
113
+ **Timeline:** Redux was used from Jan 2023 to Mar 2024 (14 months)
114
+
115
+ **The Decision:**
116
+ In March 2024, Redux was replaced with Zustand (commit ghi, PR #234).
117
+
118
+ **Why:**
119
+ - "60% less boilerplate code" (PR description)
120
+ - "Simpler mental model for new developers" (commit message)
121
+ - "No more action/reducer ceremony" (code comment)
122
+
123
+ **The Trigger:**
124
+ Issue #189: "State management complexity slowing onboarding"
125
+
126
+ **What Changed:**
127
+ - Removed: redux, react-redux, @reduxjs/toolkit
128
+ - Added: zustand
129
+ - Modified: 34 files
130
+ - Net: -2,400 lines
131
+
132
+ **Related Decisions:**
133
+ - DEC-023: "Prefer simplicity over enterprise patterns"
134
+ ```
135
+ </process>
136
+
137
+ <commands>
138
+ ## Subcommands
139
+
140
+ ### /gywd:history <query>
141
+ Natural language query against history.
142
+
143
+ ```
144
+ /gywd:history "When did we add TypeScript?"
145
+ /gywd:history "What did the API layer look like before microservices?"
146
+ /gywd:history "Why was the cache layer removed?"
147
+ ```
148
+
149
+ ### /gywd:history --file <path>
150
+ Show evolution of specific file.
151
+
152
+ ```
153
+ /gywd:history --file src/auth/login.ts
154
+
155
+ Output:
156
+ ## Evolution: src/auth/login.ts
157
+
158
+ Created: 2023-02-10 by @alice
159
+ Total commits: 47
160
+ Major rewrites: 2
161
+
162
+ Timeline:
163
+ ├── v1 (Feb-Jun 2023): Basic username/password
164
+ ├── v2 (Jul 2023): Added OAuth providers
165
+ ├── v3 (Jan 2024): Complete rewrite for SSO
166
+ └── Current: SSO with fallback to OAuth
167
+
168
+ Stability: Medium (12 changes in last 6 months)
169
+ Volatility trend: Decreasing ↓
170
+ ```
171
+
172
+ ### /gywd:history --author <name>
173
+ Show developer's contribution patterns.
174
+
175
+ ```
176
+ /gywd:history --author alice
177
+
178
+ Output:
179
+ ## Contribution Pattern: @alice
180
+
181
+ Active: 2023-01 to present
182
+ Total commits: 234
183
+ Primary areas: auth/, api/, tests/
184
+
185
+ Expertise signals:
186
+ - 80% of auth/ commits
187
+ - Original author of OAuth integration
188
+ - Primary reviewer for security PRs
189
+
190
+ Typical patterns:
191
+ - Commits in morning (9-11am)
192
+ - Large refactors on Fridays
193
+ - Always includes tests
194
+ ```
195
+
196
+ ### /gywd:history --hotspots
197
+ Show volatile areas that may need attention.
198
+
199
+ ```
200
+ /gywd:history --hotspots
201
+
202
+ Output:
203
+ ## Code Hotspots (Last 90 Days)
204
+
205
+ | File | Changes | Authors | Churn | Risk |
206
+ |------|---------|---------|-------|------|
207
+ | src/api/orders.ts | 23 | 5 | High | 🔴 |
208
+ | src/utils/date.ts | 18 | 3 | High | 🟠 |
209
+ | src/auth/session.ts | 15 | 2 | Med | 🟡 |
210
+
211
+ Patterns detected:
212
+ - orders.ts: Possible design instability
213
+ - date.ts: Edge case fixes (consider library)
214
+ - session.ts: Feature additions (healthy)
215
+ ```
216
+
217
+ ### /gywd:history --predict
218
+ Predict future changes based on patterns.
219
+
220
+ ```
221
+ /gywd:history --predict
222
+
223
+ Output:
224
+ ## Predicted Changes (Next 30 Days)
225
+
226
+ Based on evolution patterns:
227
+
228
+ 1. **src/api/payments.ts** (78% confidence)
229
+ - Pattern: Similar evolution to orders.ts
230
+ - Trigger: Usually follows order system changes
231
+ - Prediction: Refactoring needed
232
+
233
+ 2. **src/models/user.ts** (65% confidence)
234
+ - Pattern: Quarterly schema updates
235
+ - Last change: 85 days ago
236
+ - Prediction: Due for update
237
+
238
+ 3. **tests/integration/** (60% confidence)
239
+ - Pattern: Test updates lag feature changes
240
+ - Pending: 12 untested features
241
+ - Prediction: Test sprint coming
242
+ ```
243
+ </commands>
244
+
245
+ <output_format>
246
+ Responses should be:
247
+ - **Contextual**: Answer the actual question, not just dump data
248
+ - **Temporal**: Show timelines, not just snapshots
249
+ - **Causal**: Link changes to reasons when possible
250
+ - **Actionable**: Suggest what to do with the information
251
+
252
+ Use visual timelines for evolution:
253
+ ```
254
+ ├── Date: Event
255
+ │ └── Context/reason
256
+ ```
257
+
258
+ Use tables for comparisons:
259
+ ```
260
+ | Metric | Then | Now | Δ |
261
+ ```
262
+
263
+ Use risk indicators:
264
+ - 🔴 High risk/volatility
265
+ - 🟠 Medium risk
266
+ - 🟡 Low risk
267
+ - 🟢 Stable
268
+ </output_format>
269
+
270
+ <success_criteria>
271
+ - [ ] Parses natural language history queries
272
+ - [ ] Builds timelines from git history
273
+ - [ ] Extracts decision context from commits/PRs
274
+ - [ ] Identifies hotspots and stability patterns
275
+ - [ ] Makes predictions based on evolution
276
+ - [ ] Links to decision graph when available
277
+ - [ ] Provides actionable insights
278
+ </success_criteria>
@@ -0,0 +1,317 @@
1
+ ---
2
+ name: GYWD:impact
3
+ description: Reality integration - connect code to real-world outcomes
4
+ argument-hint: "[file/function/feature] [--metrics] [--cost] [--incidents]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ - Write
12
+ - WebFetch
13
+ ---
14
+
15
+ <objective>
16
+ Connect code to its real-world impact.
17
+
18
+ Current AI has no concept of production reality. It generates code in a vacuum.
19
+
20
+ Reality-Grounded Development links:
21
+ - Code → Production metrics
22
+ - Features → Business outcomes
23
+ - Architecture → Infrastructure costs
24
+ - Code paths → Incident history
25
+
26
+ Decisions become informed by reality, not just code aesthetics.
27
+ </objective>
28
+
29
+ <philosophy>
30
+ Code exists to produce outcomes.
31
+
32
+ A function that runs 1M times/day matters more than one that runs once/month.
33
+ A feature that drives 20% of revenue deserves more attention.
34
+ An endpoint that caused 3 outages needs more care.
35
+
36
+ Without this context, all code looks equally important.
37
+ With it, priorities become obvious.
38
+ </philosophy>
39
+
40
+ <reference>
41
+ See `.planning/config.json` for data source configuration and integration setup.
42
+ </reference>
43
+
44
+ <data_sources>
45
+ ## Reality Data Sources
46
+
47
+ ### Production Metrics
48
+ - Request volumes per endpoint
49
+ - Error rates per function
50
+ - Latency percentiles
51
+ - Resource consumption
52
+
53
+ Integration points:
54
+ - Datadog, New Relic, Prometheus
55
+ - Application logs
56
+ - APM traces
57
+
58
+ ### Business Metrics
59
+ - Feature → Revenue correlation
60
+ - User engagement by feature
61
+ - Conversion impact
62
+ - Retention correlation
63
+
64
+ Integration points:
65
+ - Analytics platforms (Amplitude, Mixpanel)
66
+ - Business dashboards
67
+ - A/B test results
68
+
69
+ ### Cost Data
70
+ - Compute costs by service
71
+ - Storage costs by table
72
+ - Network costs by endpoint
73
+ - Third-party API costs
74
+
75
+ Integration points:
76
+ - AWS Cost Explorer
77
+ - Cloud billing APIs
78
+ - Vendor invoices
79
+
80
+ ### Incident History
81
+ - Outages linked to code changes
82
+ - Error spikes by file
83
+ - On-call pages by service
84
+ - Post-mortems by feature
85
+
86
+ Integration points:
87
+ - PagerDuty, Opsgenie
88
+ - Incident management systems
89
+ - Post-mortem databases
90
+ </data_sources>
91
+
92
+ <commands>
93
+ ## Subcommands
94
+
95
+ ### /gywd:impact <target>
96
+ Show impact profile for file, function, or feature.
97
+
98
+ ```markdown
99
+ ## Impact Profile: src/api/checkout.ts
100
+
101
+ ### Production Metrics
102
+ | Metric | Value | Trend |
103
+ |--------|-------|-------|
104
+ | Requests/day | 47,000 | ↑ 12% |
105
+ | Error rate | 0.3% | → stable |
106
+ | P50 latency | 120ms | → stable |
107
+ | P99 latency | 890ms | ↓ improved |
108
+
109
+ ### Business Impact
110
+ - **Revenue attribution**: 34% of daily revenue
111
+ - **Conversion impact**: Critical path for purchase
112
+ - **User sessions**: 23% of all sessions touch this
113
+
114
+ ### Cost Profile
115
+ - **Compute**: $340/month (2.1% of total)
116
+ - **Database**: 12% of read queries
117
+ - **External APIs**: $89/month (Stripe calls)
118
+
119
+ ### Incident History
120
+ | Date | Severity | Cause | Duration |
121
+ |------|----------|-------|----------|
122
+ | 2024-01-15 | P1 | Race condition | 45 min |
123
+ | 2023-11-03 | P2 | Timeout spike | 20 min |
124
+
125
+ ### Risk Assessment
126
+ 🔴 **High impact surface**: Outage here affects revenue
127
+ 🟠 **Moderate stability**: 2 incidents in 6 months
128
+ 🟢 **Good performance**: Latency within SLO
129
+
130
+ ### Recommendations
131
+ 1. Add circuit breaker (high impact, no protection)
132
+ 2. Increase test coverage (currently 62%)
133
+ 3. Consider caching (high volume, stable data)
134
+ ```
135
+
136
+ ### /gywd:impact --metrics
137
+ Show production metrics across codebase.
138
+
139
+ ```markdown
140
+ ## Production Metrics Overview
141
+
142
+ ### Top Traffic (Requests/Day)
143
+ | Endpoint | Requests | Errors | P99 |
144
+ |----------|----------|--------|-----|
145
+ | GET /api/products | 892K | 0.1% | 45ms |
146
+ | POST /api/cart | 234K | 0.2% | 120ms |
147
+ | POST /api/checkout | 47K | 0.3% | 890ms |
148
+ | GET /api/user | 1.2M | 0.05% | 30ms |
149
+
150
+ ### Error Hotspots
151
+ | File | Error Rate | Volume | Trend |
152
+ |------|------------|--------|-------|
153
+ | src/services/payment.ts | 1.2% | 12K/day | ↑ |
154
+ | src/api/orders.ts | 0.8% | 89K/day | → |
155
+ | src/utils/shipping.ts | 0.6% | 34K/day | ↓ |
156
+
157
+ ### Performance Concerns
158
+ | Endpoint | P99 | SLO | Status |
159
+ |----------|-----|-----|--------|
160
+ | POST /api/search | 2.3s | 1s | 🔴 Violation |
161
+ | GET /api/recommendations | 1.8s | 2s | 🟡 Warning |
162
+ ```
163
+
164
+ ### /gywd:impact --cost
165
+ Show infrastructure costs by code area.
166
+
167
+ ```markdown
168
+ ## Cost Attribution
169
+
170
+ **Total Monthly**: $12,400
171
+
172
+ ### By Service
173
+ | Service | Monthly | % | Trend |
174
+ |---------|---------|---|-------|
175
+ | API Server | $4,200 | 34% | ↑ |
176
+ | Database | $3,100 | 25% | → |
177
+ | Cache (Redis) | $890 | 7% | → |
178
+ | Storage (S3) | $2,100 | 17% | ↑ |
179
+ | CDN | $1,200 | 10% | → |
180
+ | External APIs | $910 | 7% | ↓ |
181
+
182
+ ### Cost Drivers
183
+ 1. **Image processing** (S3 + compute): $2,800/month
184
+ - Opportunity: Optimize before upload, save ~40%
185
+
186
+ 2. **Search indexing** (compute): $1,200/month
187
+ - Opportunity: Batch updates, save ~30%
188
+
189
+ 3. **Payment retries** (Stripe API): $340/month
190
+ - Opportunity: Better retry logic, save ~50%
191
+
192
+ ### Cost Anomalies
193
+ ⚠️ Database reads up 45% but traffic up only 12%
194
+ Likely cause: Missing index or N+1 query
195
+ ```
196
+
197
+ ### /gywd:impact --incidents
198
+ Show incident history and patterns.
199
+
200
+ ```markdown
201
+ ## Incident Analysis
202
+
203
+ ### Last 6 Months
204
+ | Severity | Count | MTTR | Trend |
205
+ |----------|-------|------|-------|
206
+ | P1 (Critical) | 2 | 52 min | → |
207
+ | P2 (Major) | 7 | 23 min | ↓ |
208
+ | P3 (Minor) | 15 | 45 min | → |
209
+
210
+ ### By Code Area
211
+ | Area | Incidents | Last | Risk |
212
+ |------|-----------|------|------|
213
+ | src/api/checkout/ | 4 | 2 weeks | 🔴 High |
214
+ | src/services/payment/ | 3 | 1 month | 🟠 Medium |
215
+ | src/api/orders/ | 2 | 3 months | 🟡 Low |
216
+
217
+ ### Root Cause Patterns
218
+ | Pattern | Count | Example |
219
+ |---------|-------|---------|
220
+ | Race condition | 3 | Concurrent cart updates |
221
+ | External service timeout | 3 | Stripe API latency |
222
+ | Database deadlock | 2 | Order + inventory lock |
223
+ | Memory exhaustion | 1 | Large export without streaming |
224
+
225
+ ### Recommendations
226
+ 1. **Add timeout handling** to all external calls
227
+ 2. **Implement optimistic locking** for cart operations
228
+ 3. **Add circuit breakers** to payment service
229
+ ```
230
+ </commands>
231
+
232
+ <integration>
233
+ ## How Impact Integrates
234
+
235
+ ### During Planning
236
+ ```markdown
237
+ Planning Phase 4: Checkout Optimization
238
+
239
+ Impact context loaded:
240
+ - 47K requests/day (high impact changes)
241
+ - 2 P1 incidents in area (proceed carefully)
242
+ - $340/month in compute (optimization opportunity)
243
+
244
+ Recommendations:
245
+ - Add comprehensive tests before changes
246
+ - Implement feature flag for gradual rollout
247
+ - Have rollback plan ready
248
+ ```
249
+
250
+ ### During Review
251
+ ```markdown
252
+ /gywd:challenge src/api/checkout.ts
253
+
254
+ Additional context from Impact:
255
+ - This file is in critical revenue path
256
+ - Last change caused P2 incident
257
+ - Suggest extra scrutiny on error paths
258
+ ```
259
+
260
+ ### During Decisions
261
+ ```markdown
262
+ Decision: Add caching to product API
263
+
264
+ Impact analysis:
265
+ - Current: 892K requests/day at $0.0001/request
266
+ - With cache: ~70% cache hit expected
267
+ - Savings: ~$200/month
268
+ - Risk: Stale data, complexity
269
+
270
+ Recommendation: Proceed with 1-hour TTL
271
+ ```
272
+ </integration>
273
+
274
+ <configuration>
275
+ ## Setup
276
+
277
+ Configure data sources in `.planning/config.json`:
278
+
279
+ ```json
280
+ {
281
+ "impact": {
282
+ "metrics": {
283
+ "provider": "datadog",
284
+ "api_key_env": "DD_API_KEY",
285
+ "service_tag": "myapp"
286
+ },
287
+ "costs": {
288
+ "provider": "aws",
289
+ "profile": "production"
290
+ },
291
+ "incidents": {
292
+ "provider": "pagerduty",
293
+ "api_key_env": "PD_API_KEY"
294
+ },
295
+ "analytics": {
296
+ "provider": "amplitude",
297
+ "api_key_env": "AMPLITUDE_KEY"
298
+ }
299
+ }
300
+ }
301
+ ```
302
+
303
+ If no integrations configured, falls back to:
304
+ - Git history analysis
305
+ - Manual annotations
306
+ - Estimated impact from code analysis
307
+ </configuration>
308
+
309
+ <success_criteria>
310
+ - [ ] Retrieves production metrics per endpoint/file
311
+ - [ ] Shows business impact attribution
312
+ - [ ] Displays cost breakdown by code area
313
+ - [ ] Surfaces incident history
314
+ - [ ] Identifies patterns and anomalies
315
+ - [ ] Integrates with planning and review
316
+ - [ ] Falls back gracefully without integrations
317
+ </success_criteria>
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: GYWD:init
3
+ description: Quick project initialization with minimal questions
4
+ argument-hint: "[project-name] [optional: --type greenfield|brownfield]"
5
+ ---
6
+
7
+ <objective>
8
+ Fast-track project initialization for users who know what they want.
9
+
10
+ Unlike /gywd:new-project which asks many questions, /gywd:init gets you started quickly with sensible defaults.
11
+ </objective>
12
+
13
+ <context>
14
+ This is the "I just want to start coding" option. Use when:
15
+ - You have a clear idea already
16
+ - You want to skip extensive questioning
17
+ - You'll fill in details as you go
18
+ </context>
19
+
20
+ <process>
21
+ 1. Parse arguments:
22
+ - `$ARGUMENTS` may contain: project name, --type flag
23
+ - Default type: auto-detect (brownfield if code exists, greenfield if empty)
24
+
25
+ 2. If brownfield detected and no codebase map exists:
26
+ - Ask: "Existing code detected. Map codebase first? [Y/n]"
27
+ - If yes: Run /gywd:map-codebase, then continue
28
+ - If no: Continue without mapping
29
+
30
+ 3. Create minimal PROJECT.md:
31
+ ```markdown
32
+ # PROJECT: {name}
33
+
34
+ ## What This Is
35
+ {One-line description from user or "To be defined"}
36
+
37
+ ## Core Value
38
+ To be defined during development.
39
+
40
+ ## Requirements
41
+ - [ ] To be captured as development progresses
42
+
43
+ ## Constraints
44
+ None defined yet.
45
+
46
+ ---
47
+ *Quick-initialized. Expand as needed.*
48
+ ```
49
+
50
+ 4. Create config.json with defaults:
51
+ ```json
52
+ {
53
+ "mode": "interactive",
54
+ "planning_depth": "standard"
55
+ }
56
+ ```
57
+
58
+ 5. Initialize git if not already initialized
59
+
60
+ 6. Commit initialization files
61
+
62
+ 7. Output:
63
+ ```
64
+ ✓ Project initialized: {name}
65
+
66
+ Next steps:
67
+ - /gywd:create-roadmap - Plan your phases
68
+ - Edit .planning/PROJECT.md - Add details anytime
69
+ ```
70
+ </process>
71
+
72
+ <examples>
73
+ Quick init with name:
74
+ ```
75
+ /gywd:init my-saas-app
76
+ ```
77
+
78
+ Force greenfield (ignore existing code):
79
+ ```
80
+ /gywd:init api-service --type greenfield
81
+ ```
82
+
83
+ Force brownfield mapping:
84
+ ```
85
+ /gywd:init legacy-app --type brownfield
86
+ ```
87
+ </examples>
88
+
89
+ <success_criteria>
90
+ - [ ] PROJECT.md created with minimal content
91
+ - [ ] config.json created with defaults
92
+ - [ ] Git initialized (if needed)
93
+ - [ ] User knows next step
94
+ - [ ] Total time: under 30 seconds
95
+ </success_criteria>