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.
- package/LICENSE +27 -0
- package/README.md +567 -0
- package/bin/install.js +348 -0
- package/commands/gywd/add-phase.md +207 -0
- package/commands/gywd/anticipate.md +271 -0
- package/commands/gywd/bootstrap.md +336 -0
- package/commands/gywd/challenge.md +344 -0
- package/commands/gywd/check-drift.md +144 -0
- package/commands/gywd/complete-milestone.md +106 -0
- package/commands/gywd/consider-issues.md +202 -0
- package/commands/gywd/context.md +93 -0
- package/commands/gywd/create-roadmap.md +115 -0
- package/commands/gywd/deps.md +169 -0
- package/commands/gywd/digest.md +138 -0
- package/commands/gywd/discuss-milestone.md +47 -0
- package/commands/gywd/discuss-phase.md +60 -0
- package/commands/gywd/execute-plan.md +161 -0
- package/commands/gywd/extract-decisions.md +325 -0
- package/commands/gywd/health.md +150 -0
- package/commands/gywd/help.md +556 -0
- package/commands/gywd/history.md +278 -0
- package/commands/gywd/impact.md +317 -0
- package/commands/gywd/init.md +95 -0
- package/commands/gywd/insert-phase.md +227 -0
- package/commands/gywd/list-phase-assumptions.md +50 -0
- package/commands/gywd/map-codebase.md +84 -0
- package/commands/gywd/memory.md +159 -0
- package/commands/gywd/new-milestone.md +59 -0
- package/commands/gywd/new-project.md +315 -0
- package/commands/gywd/pause-work.md +123 -0
- package/commands/gywd/plan-fix.md +205 -0
- package/commands/gywd/plan-phase.md +93 -0
- package/commands/gywd/preview-plan.md +139 -0
- package/commands/gywd/profile.md +363 -0
- package/commands/gywd/progress.md +317 -0
- package/commands/gywd/remove-phase.md +338 -0
- package/commands/gywd/research-phase.md +91 -0
- package/commands/gywd/resume-work.md +40 -0
- package/commands/gywd/rollback.md +179 -0
- package/commands/gywd/status.md +42 -0
- package/commands/gywd/sync-github.md +234 -0
- package/commands/gywd/verify-work.md +71 -0
- package/commands/gywd/why.md +251 -0
- package/docs/COMMANDS.md +722 -0
- package/docs/CONTRIBUTING.md +342 -0
- package/docs/EXAMPLES.md +535 -0
- package/docs/GETTING-STARTED.md +262 -0
- package/docs/README.md +55 -0
- package/docs/RELEASING.md +159 -0
- package/get-your-work-done/core/agent-patterns.md +331 -0
- package/get-your-work-done/core/architecture.md +334 -0
- package/get-your-work-done/core/context-model-schema.json +154 -0
- package/get-your-work-done/core/decisions-schema.json +193 -0
- package/get-your-work-done/core/learning-state-schema.json +133 -0
- package/get-your-work-done/core/profile-schema.json +257 -0
- package/get-your-work-done/references/adaptive-decomposition.md +175 -0
- package/get-your-work-done/references/checkpoints.md +287 -0
- package/get-your-work-done/references/confidence-scoring.md +169 -0
- package/get-your-work-done/references/continuation-format.md +255 -0
- package/get-your-work-done/references/git-integration.md +254 -0
- package/get-your-work-done/references/plan-format.md +428 -0
- package/get-your-work-done/references/principles.md +157 -0
- package/get-your-work-done/references/questioning.md +162 -0
- package/get-your-work-done/references/research-pitfalls.md +215 -0
- package/get-your-work-done/references/scope-estimation.md +172 -0
- package/get-your-work-done/references/tdd.md +263 -0
- package/get-your-work-done/templates/codebase/architecture.md +255 -0
- package/get-your-work-done/templates/codebase/concerns.md +310 -0
- package/get-your-work-done/templates/codebase/conventions.md +307 -0
- package/get-your-work-done/templates/codebase/integrations.md +280 -0
- package/get-your-work-done/templates/codebase/stack.md +186 -0
- package/get-your-work-done/templates/codebase/structure.md +285 -0
- package/get-your-work-done/templates/codebase/testing.md +480 -0
- package/get-your-work-done/templates/config.json +18 -0
- package/get-your-work-done/templates/context.md +161 -0
- package/get-your-work-done/templates/continue-here.md +78 -0
- package/get-your-work-done/templates/discovery.md +146 -0
- package/get-your-work-done/templates/issues.md +32 -0
- package/get-your-work-done/templates/milestone-archive.md +123 -0
- package/get-your-work-done/templates/milestone-context.md +93 -0
- package/get-your-work-done/templates/milestone.md +115 -0
- package/get-your-work-done/templates/phase-prompt.md +303 -0
- package/get-your-work-done/templates/project.md +184 -0
- package/get-your-work-done/templates/research.md +529 -0
- package/get-your-work-done/templates/roadmap.md +196 -0
- package/get-your-work-done/templates/state.md +210 -0
- package/get-your-work-done/templates/summary.md +273 -0
- package/get-your-work-done/templates/uat-issues.md +143 -0
- package/get-your-work-done/workflows/complete-milestone.md +643 -0
- package/get-your-work-done/workflows/create-milestone.md +416 -0
- package/get-your-work-done/workflows/create-roadmap.md +481 -0
- package/get-your-work-done/workflows/discovery-phase.md +293 -0
- package/get-your-work-done/workflows/discuss-milestone.md +236 -0
- package/get-your-work-done/workflows/discuss-phase.md +247 -0
- package/get-your-work-done/workflows/execute-phase.md +1625 -0
- package/get-your-work-done/workflows/list-phase-assumptions.md +178 -0
- package/get-your-work-done/workflows/map-codebase.md +434 -0
- package/get-your-work-done/workflows/plan-phase.md +488 -0
- package/get-your-work-done/workflows/research-phase.md +436 -0
- package/get-your-work-done/workflows/resume-project.md +287 -0
- package/get-your-work-done/workflows/transition.md +580 -0
- package/get-your-work-done/workflows/verify-work.md +202 -0
- package/lib/automation/dependency-analyzer.js +635 -0
- package/lib/automation/doc-generator.js +643 -0
- package/lib/automation/index.js +42 -0
- package/lib/automation/test-generator.js +628 -0
- package/lib/context/context-analyzer.js +554 -0
- package/lib/context/context-cache.js +426 -0
- package/lib/context/context-predictor.js +622 -0
- package/lib/context/index.js +44 -0
- package/lib/memory/confidence-calibrator.js +484 -0
- package/lib/memory/feedback-collector.js +551 -0
- package/lib/memory/global-memory.js +465 -0
- package/lib/memory/index.js +75 -0
- package/lib/memory/pattern-aggregator.js +487 -0
- package/lib/memory/team-sync.js +501 -0
- package/lib/profile/index.js +24 -0
- package/lib/profile/pattern-learner.js +303 -0
- package/lib/profile/profile-manager.js +445 -0
- package/lib/questioning/index.js +49 -0
- package/lib/questioning/question-engine.js +311 -0
- package/lib/questioning/question-templates.js +315 -0
- package/lib/validators/command-validator.js +188 -0
- package/lib/validators/index.js +29 -0
- package/lib/validators/schema-validator.js +183 -0
- package/package.json +61 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: GYWD:anticipate
|
|
3
|
+
description: Predictive development - AI that knows what you'll need before you ask
|
|
4
|
+
argument-hint: "[--for <context>] [--depth shallow|deep]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- Task
|
|
11
|
+
- Write
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<objective>
|
|
15
|
+
Proactively prepare context, patterns, and suggestions BEFORE you need them.
|
|
16
|
+
|
|
17
|
+
Current AI is reactive: you ask, it responds.
|
|
18
|
+
Predictive AI anticipates: it knows what you'll need next.
|
|
19
|
+
|
|
20
|
+
Based on:
|
|
21
|
+
- What you're currently working on
|
|
22
|
+
- Patterns from your history
|
|
23
|
+
- Common sequences in similar projects
|
|
24
|
+
- Your personal development patterns
|
|
25
|
+
</objective>
|
|
26
|
+
|
|
27
|
+
<philosophy>
|
|
28
|
+
From cognitive research: "Experts spend more time on 'define problem' phase and more often activate prior knowledge before searching."
|
|
29
|
+
|
|
30
|
+
Experts anticipate. They gather context before they need it.
|
|
31
|
+
AI should do the same.
|
|
32
|
+
</philosophy>
|
|
33
|
+
|
|
34
|
+
<prediction_types>
|
|
35
|
+
## What We Anticipate
|
|
36
|
+
|
|
37
|
+
### 1. Pattern Predictions
|
|
38
|
+
**Signal**: You're building X
|
|
39
|
+
**Anticipate**: Common patterns that follow X
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Detected: Implementing user authentication
|
|
43
|
+
Anticipated needs:
|
|
44
|
+
├── Password hashing patterns
|
|
45
|
+
├── JWT token structure
|
|
46
|
+
├── Session management approaches
|
|
47
|
+
├── Rate limiting for auth endpoints
|
|
48
|
+
├── Password reset flow
|
|
49
|
+
└── OAuth integration patterns
|
|
50
|
+
|
|
51
|
+
Pre-loaded: Security best practices for auth
|
|
52
|
+
Pre-loaded: Common vulnerabilities (OWASP auth)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. File Predictions
|
|
56
|
+
**Signal**: You're editing X
|
|
57
|
+
**Anticipate**: Files that usually change with X
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Detected: Editing src/models/user.ts
|
|
61
|
+
Co-change patterns from history:
|
|
62
|
+
├── src/services/userService.ts (95% co-change)
|
|
63
|
+
├── src/api/users.ts (87% co-change)
|
|
64
|
+
├── tests/user.test.ts (82% co-change)
|
|
65
|
+
└── prisma/schema.prisma (45% co-change)
|
|
66
|
+
|
|
67
|
+
Pre-loaded: These files are in context
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 3. Dependency Predictions
|
|
71
|
+
**Signal**: You're adding library X
|
|
72
|
+
**Anticipate**: Configuration, patterns, gotchas
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Detected: Adding 'stripe' package
|
|
76
|
+
Anticipated needs:
|
|
77
|
+
├── Stripe API patterns for this stack
|
|
78
|
+
├── Webhook handling setup
|
|
79
|
+
├── Test mode vs live mode config
|
|
80
|
+
├── Common Stripe errors and handling
|
|
81
|
+
├── PCI compliance considerations
|
|
82
|
+
└── Idempotency key patterns
|
|
83
|
+
|
|
84
|
+
Pre-loaded: Stripe integration checklist
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 4. Problem Predictions
|
|
88
|
+
**Signal**: Error patterns in current work
|
|
89
|
+
**Anticipate**: Similar bugs from history
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Detected: TypeScript error TS2322 in async function
|
|
93
|
+
Similar bugs from your history:
|
|
94
|
+
├── 2024-01-15: Same error, solution was Promise<T> return type
|
|
95
|
+
├── 2024-02-03: Same error, solution was await missing
|
|
96
|
+
└── 2023-11-20: Same error, solution was generic constraint
|
|
97
|
+
|
|
98
|
+
Pre-loaded: Your past solutions to this error
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 5. Flow Predictions
|
|
102
|
+
**Signal**: Entering deep work
|
|
103
|
+
**Anticipate**: Don't interrupt, batch for later
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Detected: Flow state (15+ min focused editing)
|
|
107
|
+
Actions:
|
|
108
|
+
├── Batching non-critical suggestions
|
|
109
|
+
├── Suppressing optional notifications
|
|
110
|
+
├── Preparing summary for when you pause
|
|
111
|
+
└── Tracking questions you might have after
|
|
112
|
+
|
|
113
|
+
On pause: Here's what accumulated while you were focused
|
|
114
|
+
```
|
|
115
|
+
</prediction_types>
|
|
116
|
+
|
|
117
|
+
<process>
|
|
118
|
+
## Anticipation Engine
|
|
119
|
+
|
|
120
|
+
### 1. Context Detection
|
|
121
|
+
|
|
122
|
+
Monitor for signals:
|
|
123
|
+
```python
|
|
124
|
+
signals = {
|
|
125
|
+
"file_edit": detect_file_edit_patterns(),
|
|
126
|
+
"search_query": detect_search_patterns(),
|
|
127
|
+
"error_occurrence": detect_error_patterns(),
|
|
128
|
+
"package_add": detect_dependency_changes(),
|
|
129
|
+
"time_of_day": get_time_patterns(),
|
|
130
|
+
"session_duration": get_focus_duration(),
|
|
131
|
+
"commit_patterns": get_recent_commit_context()
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 2. Pattern Matching
|
|
136
|
+
|
|
137
|
+
Match signals to predictions:
|
|
138
|
+
```
|
|
139
|
+
IF editing auth-related file AND morning session:
|
|
140
|
+
PREDICT: Security-focused work
|
|
141
|
+
ANTICIPATE: Auth patterns, security checklist
|
|
142
|
+
|
|
143
|
+
IF TypeScript error AND similar to past error:
|
|
144
|
+
PREDICT: Known issue
|
|
145
|
+
ANTICIPATE: Past solutions
|
|
146
|
+
|
|
147
|
+
IF new feature file AND tests don't exist:
|
|
148
|
+
PREDICT: Will need tests soon
|
|
149
|
+
ANTICIPATE: Test patterns for this file type
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3. Pre-loading
|
|
153
|
+
|
|
154
|
+
Based on predictions, pre-load:
|
|
155
|
+
```
|
|
156
|
+
context.preload({
|
|
157
|
+
patterns: relevant_code_patterns(),
|
|
158
|
+
decisions: related_decisions(),
|
|
159
|
+
history: similar_past_work(),
|
|
160
|
+
warnings: potential_pitfalls(),
|
|
161
|
+
suggestions: likely_next_steps()
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 4. Delivery
|
|
166
|
+
|
|
167
|
+
Deliver anticipations appropriately:
|
|
168
|
+
- **Immediate**: Critical warnings (security issues)
|
|
169
|
+
- **Available**: Ready when you ask (patterns in context)
|
|
170
|
+
- **Batched**: Non-urgent (suggestions for later)
|
|
171
|
+
- **Hidden**: Background prep (pre-indexed context)
|
|
172
|
+
</process>
|
|
173
|
+
|
|
174
|
+
<output_format>
|
|
175
|
+
## When Running Manually
|
|
176
|
+
|
|
177
|
+
```markdown
|
|
178
|
+
## Anticipation Report
|
|
179
|
+
|
|
180
|
+
**Context**: Working on payment integration
|
|
181
|
+
**Confidence**: 85%
|
|
182
|
+
|
|
183
|
+
### Ready for You
|
|
184
|
+
|
|
185
|
+
**Patterns pre-loaded:**
|
|
186
|
+
- Stripe payment intent flow
|
|
187
|
+
- Webhook signature verification
|
|
188
|
+
- Idempotency handling
|
|
189
|
+
|
|
190
|
+
**Relevant decisions:**
|
|
191
|
+
- DEC-015: "All payments use Result pattern"
|
|
192
|
+
- DEC-023: "Log all payment state changes"
|
|
193
|
+
|
|
194
|
+
**Similar past work:**
|
|
195
|
+
- 2024-01: Subscription billing (same patterns)
|
|
196
|
+
- Your solution: src/services/subscriptionPayment.ts
|
|
197
|
+
|
|
198
|
+
### Potential Issues Ahead
|
|
199
|
+
|
|
200
|
+
⚠️ **Webhook timing**: You'll likely hit race condition between
|
|
201
|
+
payment confirmation and order creation. See how you solved
|
|
202
|
+
this in orders.ts:142
|
|
203
|
+
|
|
204
|
+
⚠️ **Test mode gotcha**: Stripe test webhooks have different
|
|
205
|
+
signatures. Past you spent 2 hours on this.
|
|
206
|
+
|
|
207
|
+
### Suggested Next Steps
|
|
208
|
+
|
|
209
|
+
Based on your typical flow:
|
|
210
|
+
1. Create payment intent endpoint (you usually start here)
|
|
211
|
+
2. Add webhook handler (you always forget this initially)
|
|
212
|
+
3. Write integration tests (you defer but always need)
|
|
213
|
+
```
|
|
214
|
+
</output_format>
|
|
215
|
+
|
|
216
|
+
<learning>
|
|
217
|
+
## How Anticipate Learns
|
|
218
|
+
|
|
219
|
+
### From Your Behavior
|
|
220
|
+
- Which anticipations you used vs ignored
|
|
221
|
+
- What you searched for after anticipations
|
|
222
|
+
- What was missing from predictions
|
|
223
|
+
|
|
224
|
+
### From Outcomes
|
|
225
|
+
- Did anticipated patterns help?
|
|
226
|
+
- Did warnings prevent issues?
|
|
227
|
+
- Were suggestions relevant?
|
|
228
|
+
|
|
229
|
+
### Feedback Loop
|
|
230
|
+
```
|
|
231
|
+
anticipation.record({
|
|
232
|
+
prediction: "Will need webhook handler",
|
|
233
|
+
actual: "Created webhook handler 10 min later",
|
|
234
|
+
useful: true
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
# Next time: Higher confidence for this prediction
|
|
238
|
+
```
|
|
239
|
+
</learning>
|
|
240
|
+
|
|
241
|
+
<integration>
|
|
242
|
+
## Auto-Anticipate Mode
|
|
243
|
+
|
|
244
|
+
Enable in config.json:
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"anticipate": {
|
|
248
|
+
"enabled": true,
|
|
249
|
+
"auto_preload": true,
|
|
250
|
+
"flow_protection": true,
|
|
251
|
+
"learning": true
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
When enabled:
|
|
257
|
+
- Background anticipation runs continuously
|
|
258
|
+
- Context is pre-loaded without explicit command
|
|
259
|
+
- Flow state is protected automatically
|
|
260
|
+
- System learns from your patterns
|
|
261
|
+
</integration>
|
|
262
|
+
|
|
263
|
+
<success_criteria>
|
|
264
|
+
- [ ] Detects current work context accurately
|
|
265
|
+
- [ ] Predicts likely next needs
|
|
266
|
+
- [ ] Pre-loads relevant patterns and decisions
|
|
267
|
+
- [ ] Respects flow state (doesn't interrupt)
|
|
268
|
+
- [ ] Learns from behavior over time
|
|
269
|
+
- [ ] Surfaces warnings proactively
|
|
270
|
+
- [ ] Batches non-urgent suggestions
|
|
271
|
+
</success_criteria>
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: GYWD:bootstrap
|
|
3
|
+
description: Initialize GYWD v2.0 core on any codebase - full decision intelligence
|
|
4
|
+
argument-hint: "[--deep] [--quick]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Task
|
|
12
|
+
- WebFetch
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Bootstrap the complete GYWD v2.0 intelligence system on any codebase.
|
|
17
|
+
|
|
18
|
+
This is the "one command to rule them all" - it:
|
|
19
|
+
1. Maps the codebase structure
|
|
20
|
+
2. Extracts the decision graph from history
|
|
21
|
+
3. Builds the context intelligence model
|
|
22
|
+
4. Creates the developer profile
|
|
23
|
+
5. Initializes the learning system
|
|
24
|
+
|
|
25
|
+
After bootstrap, GYWD understands your codebase at a decision level,
|
|
26
|
+
not just a file level.
|
|
27
|
+
</objective>
|
|
28
|
+
|
|
29
|
+
<philosophy>
|
|
30
|
+
v1.x required running multiple commands:
|
|
31
|
+
- /gywd:map-codebase
|
|
32
|
+
- /gywd:new-project
|
|
33
|
+
- /gywd:create-roadmap
|
|
34
|
+
- /gywd:extract-decisions
|
|
35
|
+
|
|
36
|
+
v2.0 does it all intelligently with one command.
|
|
37
|
+
</philosophy>
|
|
38
|
+
|
|
39
|
+
<modes>
|
|
40
|
+
## Bootstrap Modes
|
|
41
|
+
|
|
42
|
+
### Quick Mode (--quick)
|
|
43
|
+
- Shallow git history (last 100 commits)
|
|
44
|
+
- Essential codebase mapping only
|
|
45
|
+
- Skip detailed decision extraction
|
|
46
|
+
- ~2 minutes
|
|
47
|
+
|
|
48
|
+
### Standard Mode (default)
|
|
49
|
+
- Full git history analysis
|
|
50
|
+
- Complete codebase mapping
|
|
51
|
+
- Full decision extraction
|
|
52
|
+
- Developer profile initialization
|
|
53
|
+
- ~5-10 minutes
|
|
54
|
+
|
|
55
|
+
### Deep Mode (--deep)
|
|
56
|
+
- Exhaustive history analysis
|
|
57
|
+
- Cross-reference with issues/PRs if available
|
|
58
|
+
- Multiple pass decision extraction
|
|
59
|
+
- Adversarial validation of decisions
|
|
60
|
+
- ~15-30 minutes
|
|
61
|
+
</modes>
|
|
62
|
+
|
|
63
|
+
<process>
|
|
64
|
+
## Phase 1: Codebase Analysis
|
|
65
|
+
|
|
66
|
+
Spawn parallel agents:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Agent 1: Structure Analysis
|
|
70
|
+
├── Directory layout
|
|
71
|
+
├── Entry points
|
|
72
|
+
├── Module organization
|
|
73
|
+
└── Key files identification
|
|
74
|
+
|
|
75
|
+
Agent 2: Stack Detection
|
|
76
|
+
├── Languages and frameworks
|
|
77
|
+
├── Dependencies
|
|
78
|
+
├── Build system
|
|
79
|
+
└── Test setup
|
|
80
|
+
|
|
81
|
+
Agent 3: Pattern Recognition
|
|
82
|
+
├── Coding conventions
|
|
83
|
+
├── Architectural patterns
|
|
84
|
+
├── Common idioms
|
|
85
|
+
└── Anti-patterns present
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Output: `.planning/codebase/` populated
|
|
89
|
+
|
|
90
|
+
## Phase 2: Decision Extraction
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
1. Parse git history
|
|
94
|
+
├── Commit messages
|
|
95
|
+
├── Merge commits (PRs)
|
|
96
|
+
└── Refactoring patterns
|
|
97
|
+
|
|
98
|
+
2. Analyze documentation
|
|
99
|
+
├── README files
|
|
100
|
+
├── Architecture docs
|
|
101
|
+
├── ADRs if present
|
|
102
|
+
└── Code comments
|
|
103
|
+
|
|
104
|
+
3. Infer from code
|
|
105
|
+
├── Consistent patterns → implicit decisions
|
|
106
|
+
├── Unusual choices → explicit decisions likely
|
|
107
|
+
└── Tech stack choices → architectural decisions
|
|
108
|
+
|
|
109
|
+
4. Build graph
|
|
110
|
+
├── Link related decisions
|
|
111
|
+
├── Identify decision chains
|
|
112
|
+
└── Detect conflicts
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Output: `.planning/core/decisions.json` + `.planning/codebase/DECISIONS.md`
|
|
116
|
+
|
|
117
|
+
## Phase 3: Context Model
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
1. Analyze file relationships
|
|
121
|
+
├── Import/dependency graph
|
|
122
|
+
├── Co-change patterns (files that change together)
|
|
123
|
+
└── Ownership patterns (who works on what)
|
|
124
|
+
|
|
125
|
+
2. Build context predictions
|
|
126
|
+
├── If working on X, likely need Y
|
|
127
|
+
├── If error in A, check B
|
|
128
|
+
└── If adding feature like C, pattern is D
|
|
129
|
+
|
|
130
|
+
3. Initialize context budget
|
|
131
|
+
├── Estimate token usage per area
|
|
132
|
+
├── Identify high-value context
|
|
133
|
+
└── Set compression strategies
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Output: `.planning/core/context-model.json`
|
|
137
|
+
|
|
138
|
+
## Phase 4: Developer Profile
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
1. Analyze git contributions
|
|
142
|
+
├── Areas of focus
|
|
143
|
+
├── Commit patterns
|
|
144
|
+
└── Time patterns
|
|
145
|
+
|
|
146
|
+
2. Infer preferences
|
|
147
|
+
├── Code style from samples
|
|
148
|
+
├── Naming conventions used
|
|
149
|
+
└── Architectural preferences
|
|
150
|
+
|
|
151
|
+
3. Create initial profile
|
|
152
|
+
├── Expertise topology (inferred)
|
|
153
|
+
├── Work patterns (from git)
|
|
154
|
+
└── Preferences (from code)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Output: `.planning/profile/`
|
|
158
|
+
|
|
159
|
+
## Phase 5: Learning System Init
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
1. Create learning state
|
|
163
|
+
├── Initialize feedback tracking
|
|
164
|
+
├── Set up pattern recognition
|
|
165
|
+
└── Prepare adaptation mechanisms
|
|
166
|
+
|
|
167
|
+
2. Baseline metrics
|
|
168
|
+
├── Current decision confidence levels
|
|
169
|
+
├── Context prediction accuracy baseline
|
|
170
|
+
└── Profile accuracy baseline
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Output: `.planning/core/learning-state.json`
|
|
174
|
+
|
|
175
|
+
## Phase 6: Project Setup
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
1. Create PROJECT.md if not exists
|
|
179
|
+
├── Extract purpose from README
|
|
180
|
+
├── Infer goals from code structure
|
|
181
|
+
└── Identify constraints from patterns
|
|
182
|
+
|
|
183
|
+
2. Create ROADMAP.md if not exists
|
|
184
|
+
├── Analyze recent work for current phase
|
|
185
|
+
├── Infer upcoming work from TODOs
|
|
186
|
+
└── Identify technical debt as potential phases
|
|
187
|
+
|
|
188
|
+
3. Create STATE.md
|
|
189
|
+
├── Current position in inferred roadmap
|
|
190
|
+
├── Recent decisions
|
|
191
|
+
└── Active areas
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Output: `.planning/PROJECT.md`, `.planning/ROADMAP.md`, `.planning/STATE.md`
|
|
195
|
+
</process>
|
|
196
|
+
|
|
197
|
+
<output_format>
|
|
198
|
+
## Bootstrap Report
|
|
199
|
+
|
|
200
|
+
```markdown
|
|
201
|
+
# GYWD v2.0 Bootstrap Complete
|
|
202
|
+
|
|
203
|
+
**Codebase:** {name}
|
|
204
|
+
**Mode:** {quick|standard|deep}
|
|
205
|
+
**Duration:** {time}
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Codebase Understanding
|
|
210
|
+
|
|
211
|
+
| Metric | Value |
|
|
212
|
+
|--------|-------|
|
|
213
|
+
| Files analyzed | 234 |
|
|
214
|
+
| Lines of code | 45,000 |
|
|
215
|
+
| Languages | TypeScript, Python |
|
|
216
|
+
| Framework | Next.js, FastAPI |
|
|
217
|
+
|
|
218
|
+
## Decision Graph
|
|
219
|
+
|
|
220
|
+
| Metric | Value |
|
|
221
|
+
|--------|-------|
|
|
222
|
+
| Decisions extracted | 67 |
|
|
223
|
+
| Explicit (documented) | 23 |
|
|
224
|
+
| Inferred (from patterns) | 44 |
|
|
225
|
+
| High confidence (>80%) | 34 |
|
|
226
|
+
| Decision chains found | 8 |
|
|
227
|
+
| Conflicts detected | 2 |
|
|
228
|
+
|
|
229
|
+
## Context Intelligence
|
|
230
|
+
|
|
231
|
+
| Metric | Value |
|
|
232
|
+
|--------|-------|
|
|
233
|
+
| File relationships mapped | 156 |
|
|
234
|
+
| Co-change patterns found | 23 |
|
|
235
|
+
| Context predictions ready | 45 |
|
|
236
|
+
| Estimated context budget | 42% |
|
|
237
|
+
|
|
238
|
+
## Developer Profile
|
|
239
|
+
|
|
240
|
+
| Dimension | Status |
|
|
241
|
+
|-----------|--------|
|
|
242
|
+
| Expertise topology | Inferred from history |
|
|
243
|
+
| Work patterns | Detected |
|
|
244
|
+
| Preferences | Baseline created |
|
|
245
|
+
| Ready for learning | Yes |
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Key Decisions Found
|
|
250
|
+
|
|
251
|
+
### Architectural
|
|
252
|
+
1. **DEC-001: Monorepo structure** [89%]
|
|
253
|
+
2. **DEC-002: API-first design** [92%]
|
|
254
|
+
3. **DEC-003: PostgreSQL over MongoDB** [76%]
|
|
255
|
+
|
|
256
|
+
### Conventions
|
|
257
|
+
1. **DEC-010: Functional React components** [95%]
|
|
258
|
+
2. **DEC-011: Result pattern for errors** [88%]
|
|
259
|
+
|
|
260
|
+
### Constraints
|
|
261
|
+
1. **DEC-020: No ORM, raw SQL only** [72%]
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Conflicts Detected
|
|
266
|
+
|
|
267
|
+
⚠️ **DEC-015 vs DEC-023**
|
|
268
|
+
- DEC-015: "Always use async/await"
|
|
269
|
+
- DEC-023: "Sync operations for simplicity in utils"
|
|
270
|
+
- Resolution needed: Clarify scope boundaries
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## What GYWD Now Understands
|
|
275
|
+
|
|
276
|
+
✅ Why the code is structured this way
|
|
277
|
+
✅ What decisions led to current patterns
|
|
278
|
+
✅ Where conflicts and inconsistencies exist
|
|
279
|
+
✅ How files relate to each other
|
|
280
|
+
✅ What context is needed for what tasks
|
|
281
|
+
✅ Your working patterns (initial baseline)
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Next Steps
|
|
286
|
+
|
|
287
|
+
1. **Review conflicts:** `/gywd:why DEC-015` vs `/gywd:why DEC-023`
|
|
288
|
+
2. **Explore decisions:** `/gywd:why <any file or pattern>`
|
|
289
|
+
3. **Start working:** GYWD will provide decision-aware assistance
|
|
290
|
+
4. **Plan new work:** `/gywd:plan-phase` now understands existing decisions
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
*GYWD v2.0 is ready. Your codebase is now understood at the decision level.*
|
|
295
|
+
```
|
|
296
|
+
</output_format>
|
|
297
|
+
|
|
298
|
+
<error_handling>
|
|
299
|
+
## Common Issues
|
|
300
|
+
|
|
301
|
+
### No Git History
|
|
302
|
+
```
|
|
303
|
+
Warning: No git history found.
|
|
304
|
+
- Decision extraction limited to documentation and code patterns
|
|
305
|
+
- Confidence scores will be lower
|
|
306
|
+
- Consider initializing git and making initial commit
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Large Repository
|
|
310
|
+
```
|
|
311
|
+
Note: Large repository detected (>100k files)
|
|
312
|
+
- Using sampling strategy for initial analysis
|
|
313
|
+
- Full analysis available with --deep flag
|
|
314
|
+
- Bootstrap will take longer but be more accurate
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### No Documentation
|
|
318
|
+
```
|
|
319
|
+
Note: Limited documentation found.
|
|
320
|
+
- Relying heavily on code pattern inference
|
|
321
|
+
- Decision confidence will be lower
|
|
322
|
+
- Consider adding ARCHITECTURE.md or ADRs
|
|
323
|
+
```
|
|
324
|
+
</error_handling>
|
|
325
|
+
|
|
326
|
+
<success_criteria>
|
|
327
|
+
- [ ] Codebase structure fully mapped
|
|
328
|
+
- [ ] Decision graph extracted and linked
|
|
329
|
+
- [ ] Context model initialized
|
|
330
|
+
- [ ] Developer profile created
|
|
331
|
+
- [ ] Learning system ready
|
|
332
|
+
- [ ] PROJECT.md exists (created or preserved)
|
|
333
|
+
- [ ] STATE.md reflects current position
|
|
334
|
+
- [ ] User can immediately use /gywd:why
|
|
335
|
+
- [ ] All v1.x commands now decision-aware
|
|
336
|
+
</success_criteria>
|