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,251 @@
1
+ ---
2
+ name: GYWD:why
3
+ description: Ask why code exists - trace to decisions
4
+ argument-hint: "<file|function|pattern> [--deep]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ ---
12
+
13
+ <objective>
14
+ Answer the question every developer asks: "Why does this code exist?"
15
+
16
+ Not "what does it do" - that's obvious from reading.
17
+ WHY. What decision led to this? What problem was it solving?
18
+ What alternatives were considered? What constraints applied?
19
+
20
+ This is the killer feature of decision-aware development.
21
+ </objective>
22
+
23
+ <philosophy>
24
+ "Code is crystallized decisions."
25
+
26
+ Every function, every pattern, every weird workaround exists because
27
+ someone made a decision. Often that decision made sense at the time.
28
+ Sometimes it no longer does. But you can't know unless you understand
29
+ the original reasoning.
30
+ </philosophy>
31
+
32
+ <process>
33
+ ## Query Flow
34
+
35
+ 1. **Parse target:**
36
+ - File path → Why does this file exist?
37
+ - Function name → Why is this implemented this way?
38
+ - Pattern → Why do we use this approach?
39
+ - Line range → Why is this specific code here?
40
+
41
+ 2. **Search decision sources:**
42
+
43
+ **Explicit sources:**
44
+ - Decision graph (from /gywd:extract-decisions)
45
+ - ADRs and documentation
46
+ - PR descriptions mentioning the target
47
+ - Commit messages for the file/function
48
+
49
+ **Implicit sources:**
50
+ - Code comments with "why" language
51
+ - Related issues in issue tracker
52
+ - Temporal context (what changed around it)
53
+
54
+ 3. **Construct narrative:**
55
+ - When was this created/last significantly changed?
56
+ - Who made the decision?
57
+ - What was the context?
58
+ - What alternatives existed?
59
+ - What trade-offs were accepted?
60
+
61
+ 4. **Assess confidence:**
62
+ - Explicit documentation = high confidence
63
+ - Inferred from patterns = low confidence
64
+ - Unknown = flag as gap
65
+ </process>
66
+
67
+ <examples>
68
+ ## Example Queries
69
+
70
+ ### /gywd:why src/utils/result.ts
71
+
72
+ ```markdown
73
+ ## Why: src/utils/result.ts
74
+
75
+ **Answer:** This file implements the Result pattern for type-safe error handling.
76
+
77
+ ### The Decision
78
+
79
+ **When:** March 2024
80
+ **Who:** @alice (PR #47)
81
+ **Confidence:** 94% (explicitly documented)
82
+
83
+ ### The Problem Being Solved
84
+
85
+ > "We kept losing error context in async chains. Try-catch was verbose
86
+ > and types weren't helping us catch missing error handling."
87
+ > — PR #47 description
88
+
89
+ ### The Choice
90
+
91
+ Implemented Result<T, E> pattern instead of:
92
+ - try-catch blocks (rejected: verbose, no type safety)
93
+ - null returns (rejected: ambiguous, TypeScript couldn't help)
94
+ - Error subclasses (considered but Result was simpler)
95
+
96
+ ### The Trade-offs Accepted
97
+
98
+ ✅ Type-safe error propagation
99
+ ✅ Compiler catches missing error handling
100
+ ⚠️ More verbose call sites (.map, .mapErr, .unwrap)
101
+ ⚠️ Team needed to learn the pattern
102
+
103
+ ### Current Status
104
+
105
+ - Used in 47 files
106
+ - No attempts to revert or replace
107
+ - Decision appears stable
108
+
109
+ ### Related Decisions
110
+
111
+ - DEC-015: "All service functions return Result"
112
+ - DEC-018: "Never throw in business logic layer"
113
+ ```
114
+
115
+ ---
116
+
117
+ ### /gywd:why "the weird retry logic in payments"
118
+
119
+ ```markdown
120
+ ## Why: Retry Logic in src/services/payment.ts
121
+
122
+ **Answer:** This handles a specific Stripe API quirk that caused duplicate charges.
123
+
124
+ ### The Decision
125
+
126
+ **When:** January 2024
127
+ **Who:** @bob (commit def456)
128
+ **Confidence:** 87% (commit message + inline comment)
129
+
130
+ ### The Problem Being Solved
131
+
132
+ > "Stripe can return 500 but still process the charge. Simple retry
133
+ > was causing duplicate payments. Lost $4,200 before we caught it."
134
+ > — Post-mortem #23
135
+
136
+ ### Why It Looks Weird
137
+
138
+ The logic:
139
+ 1. Creates idempotency key before call
140
+ 2. On 500, waits 2 seconds
141
+ 3. Queries Stripe for existing charge before retry
142
+ 4. Only retries if no charge found
143
+
144
+ This isn't standard retry logic because standard logic was wrong for this case.
145
+
146
+ ### Alternatives Considered
147
+
148
+ - Don't retry on 500 (rejected: real failures would break checkout)
149
+ - Always retry with idempotency key (rejected: Stripe's implementation has edge cases)
150
+ - Use webhook confirmation only (rejected: too slow for UX)
151
+
152
+ ### Current Status
153
+
154
+ - No duplicate charges since implementation
155
+ - Decision explicitly marked as "DO NOT SIMPLIFY" in comment
156
+ - Related: DEC-031 "Payment operations require explicit acknowledgment"
157
+
158
+ ### Warning
159
+
160
+ ⚠️ If you're thinking about "cleaning up" this code, read post-mortem #23 first.
161
+ ```
162
+
163
+ ---
164
+
165
+ ### /gywd:why --deep src/api/orders.ts:142-158
166
+
167
+ ```markdown
168
+ ## Why: Lines 142-158 in src/api/orders.ts
169
+
170
+ **Answer:** This is an optimistic locking implementation to prevent race conditions.
171
+
172
+ ### Deep Trace
173
+
174
+ ```
175
+ Line 142-158: Optimistic lock check
176
+
177
+ Commit abc123 (Feb 2024): "Fix race condition in order updates"
178
+
179
+ Issue #89: "Orders sometimes have wrong totals"
180
+
181
+ Incident #12: P2 outage, concurrent cart modifications
182
+
183
+ Root cause: No locking on order updates
184
+
185
+ Decision: Add optimistic locking with version field
186
+ ```
187
+
188
+ ### The Full Story
189
+
190
+ **February 5, 2024:** Customer reports order total was wrong.
191
+ **February 6, 2024:** Reproduced - concurrent cart updates overwrote each other.
192
+ **February 7, 2024:** Incident declared, quick fix deployed (mutex).
193
+ **February 12, 2024:** Proper fix - optimistic locking with version field.
194
+
195
+ ### The Implementation Choice
196
+
197
+ Why optimistic locking (not pessimistic):
198
+ - Cart updates are high-volume (234K/day)
199
+ - Conflicts are rare (< 0.1%)
200
+ - Pessimistic locks would hurt latency significantly
201
+ - Retry on conflict is acceptable UX
202
+
203
+ ### Related Code
204
+
205
+ - Line 12: Version field in Order type
206
+ - Line 89: incrementVersion() helper
207
+ - tests/orders.test.ts:234: Concurrency test
208
+ ```
209
+ </examples>
210
+
211
+ <fallbacks>
212
+ ## When No Decision Found
213
+
214
+ ```markdown
215
+ ## Why: src/legacy/oldModule.ts
216
+
217
+ **Answer:** Unknown. No decision record found.
218
+
219
+ ### What We Know
220
+
221
+ - Created: 2019-03-12
222
+ - Author: @former_employee (no longer with company)
223
+ - Last modified: 2021-08-15
224
+ - No PR description (direct push to main)
225
+ - No comments explaining purpose
226
+
227
+ ### What The Code Does
228
+
229
+ [Brief description of functionality]
230
+
231
+ ### Recommendation
232
+
233
+ This code has no documented purpose. Consider:
234
+ 1. Asking team members who might remember
235
+ 2. Tracing usage to understand current purpose
236
+ 3. Documenting discovery if you figure it out
237
+ 4. Flagging for potential removal if unused
238
+
239
+ Would you like to add a decision record for this code?
240
+ ```
241
+ </fallbacks>
242
+
243
+ <success_criteria>
244
+ - [ ] Parses natural language queries about code
245
+ - [ ] Traces to decision records when available
246
+ - [ ] Falls back to git history and inference
247
+ - [ ] Shows confidence level in answers
248
+ - [ ] Provides full context (problem, alternatives, trade-offs)
249
+ - [ ] Identifies gaps in documentation
250
+ - [ ] Suggests documentation when gaps found
251
+ </success_criteria>