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,342 @@
1
+ # Contributing to GYWD
2
+
3
+ Thank you for your interest in contributing to GYWD!
4
+
5
+ ## Table of Contents
6
+
7
+ - [Code of Conduct](#code-of-conduct)
8
+ - [Getting Started](#getting-started)
9
+ - [Development Setup](#development-setup)
10
+ - [Code Conventions](#code-conventions)
11
+ - [Error Handling](#error-handling)
12
+ - [Testing](#testing)
13
+ - [Pull Request Guidelines](#pull-request-guidelines)
14
+
15
+ ---
16
+
17
+ ## Code of Conduct
18
+
19
+ - Be respectful and inclusive
20
+ - Focus on constructive feedback
21
+ - Help others learn
22
+
23
+ ---
24
+
25
+ ## Getting Started
26
+
27
+ 1. Fork the repository
28
+ 2. Clone your fork
29
+ 3. Install dependencies: `npm install`
30
+ 4. Run tests: `npm test`
31
+
32
+ ---
33
+
34
+ ## Development Setup
35
+
36
+ ```bash
37
+ # Clone and install
38
+ git clone https://github.com/YOUR_USERNAME/pmp-gywd.git
39
+ cd pmp-gywd
40
+ npm install
41
+
42
+ # Run tests
43
+ npm test
44
+
45
+ # Run linter
46
+ npm run lint
47
+
48
+ # Run all checks (before committing)
49
+ npm run precommit
50
+ ```
51
+
52
+ ### Project Structure
53
+
54
+ ```
55
+ pmp-gywd/
56
+ ├── commands/gywd/ # Slash command definitions
57
+ ├── lib/ # JavaScript modules
58
+ │ ├── automation/ # DependencyAnalyzer, TestGenerator, DocGenerator
59
+ │ ├── brain/ # Core intelligence
60
+ │ ├── context/ # ContextAnalyzer, ContextPredictor, ContextCache
61
+ │ ├── memory/ # GlobalMemory, PatternAggregator, TeamSync
62
+ │ ├── profile/ # ProfileManager, PatternLearner
63
+ │ ├── questioning/ # QuestionEngine
64
+ │ └── validators/ # Schema and command validators
65
+ ├── get-your-work-done/ # Workflow definitions
66
+ ├── tests/ # Jest test suites
67
+ └── docs/ # Documentation
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Code Conventions
73
+
74
+ ### General
75
+
76
+ - Use `'use strict';` at the top of all JS files
77
+ - Use JSDoc comments for all public functions
78
+ - Zero external runtime dependencies in lib/
79
+ - Keep functions focused and small
80
+
81
+ ### Naming
82
+
83
+ ```javascript
84
+ // Classes: PascalCase
85
+ class PatternAggregator {}
86
+
87
+ // Functions/methods: camelCase
88
+ function calculateConfidence() {}
89
+
90
+ // Constants: SCREAMING_SNAKE_CASE
91
+ const MAX_PATTERNS = 1000;
92
+
93
+ // Files: kebab-case
94
+ // pattern-aggregator.js
95
+ ```
96
+
97
+ ### Module Exports
98
+
99
+ ```javascript
100
+ // Each module has index.js that exports public API
101
+ module.exports = {
102
+ ClassName,
103
+ functionName,
104
+ CONSTANT_NAME,
105
+ };
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Error Handling
111
+
112
+ GYWD uses specific patterns for error handling. **Follow these conventions.**
113
+
114
+ ### Pattern 1: Result Objects for Validation
115
+
116
+ Return `{valid, error, data}` objects instead of throwing:
117
+
118
+ ```javascript
119
+ // ✅ Good - Result pattern
120
+ function validateConfig(config) {
121
+ if (!config.name) {
122
+ return { valid: false, error: 'Missing required field: name' };
123
+ }
124
+ return { valid: true, data: config };
125
+ }
126
+
127
+ // ❌ Bad - Throwing
128
+ function validateConfig(config) {
129
+ if (!config.name) {
130
+ throw new Error('Missing required field: name');
131
+ }
132
+ return config;
133
+ }
134
+ ```
135
+
136
+ ### Pattern 2: Safe Defaults for File Operations
137
+
138
+ Use try/catch with sensible defaults:
139
+
140
+ ```javascript
141
+ // ✅ Good - Safe loading with default
142
+ function loadConfig(filePath) {
143
+ try {
144
+ if (fs.existsSync(filePath)) {
145
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
146
+ }
147
+ } catch (error) {
148
+ // Log but don't crash
149
+ console.warn(`Could not load ${filePath}: ${error.message}`);
150
+ }
151
+ return {}; // Return safe default
152
+ }
153
+
154
+ // ❌ Bad - Crashes on missing/invalid file
155
+ function loadConfig(filePath) {
156
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
157
+ }
158
+ ```
159
+
160
+ ### Pattern 3: Error Arrays for Multiple Issues
161
+
162
+ When validating complex objects, collect all errors:
163
+
164
+ ```javascript
165
+ // ✅ Good - Collect all errors
166
+ function validateSchema(schema) {
167
+ const errors = [];
168
+
169
+ if (!schema.title) errors.push('Missing title');
170
+ if (!schema.type) errors.push('Missing type');
171
+ if (schema.required && !Array.isArray(schema.required)) {
172
+ errors.push('Required must be an array');
173
+ }
174
+
175
+ return { valid: errors.length === 0, errors };
176
+ }
177
+ ```
178
+
179
+ ### Pattern 4: Graceful Degradation
180
+
181
+ Operations should degrade gracefully, not fail completely:
182
+
183
+ ```javascript
184
+ // ✅ Good - Graceful degradation
185
+ function getPatterns(projectPath) {
186
+ const patterns = [];
187
+
188
+ // Try global patterns
189
+ try {
190
+ patterns.push(...loadGlobalPatterns());
191
+ } catch (e) {
192
+ // Continue without global patterns
193
+ }
194
+
195
+ // Try project patterns
196
+ try {
197
+ patterns.push(...loadProjectPatterns(projectPath));
198
+ } catch (e) {
199
+ // Continue without project patterns
200
+ }
201
+
202
+ return patterns; // Always returns array, possibly empty
203
+ }
204
+ ```
205
+
206
+ ### Error Message Guidelines
207
+
208
+ - Be specific: `"Missing required field: name"` not `"Invalid input"`
209
+ - Include context: `"Could not load config from /path/to/file"`
210
+ - Suggest fixes: `"Run /gywd:init to create missing .planning/ directory"`
211
+ - Use consistent format: `"[Module] Error: description"`
212
+
213
+ ---
214
+
215
+ ## Testing
216
+
217
+ ### Requirements
218
+
219
+ - All PRs must pass the full test suite (557 tests)
220
+ - New features need tests
221
+ - Bug fixes need regression tests
222
+
223
+ ### Running Tests
224
+
225
+ ```bash
226
+ # Run all tests
227
+ npm test
228
+
229
+ # Run specific test file
230
+ npm test -- tests/memory.test.js
231
+
232
+ # Run with coverage
233
+ npm test -- --coverage
234
+
235
+ # Run in watch mode
236
+ npm test -- --watch
237
+ ```
238
+
239
+ ### Test Structure
240
+
241
+ ```javascript
242
+ describe('ModuleName', () => {
243
+ describe('functionName', () => {
244
+ it('should handle normal input', () => {
245
+ // Test normal case
246
+ });
247
+
248
+ it('should handle edge case', () => {
249
+ // Test edge case
250
+ });
251
+
252
+ it('should return error for invalid input', () => {
253
+ // Test error handling
254
+ });
255
+ });
256
+ });
257
+ ```
258
+
259
+ ### What to Test
260
+
261
+ - Normal operation (happy path)
262
+ - Edge cases (empty input, large input, special characters)
263
+ - Error conditions (invalid input, missing files)
264
+ - Boundary conditions (min/max values)
265
+
266
+ ### Test Coverage
267
+
268
+ Current coverage (v3.2):
269
+
270
+ | Metric | Coverage |
271
+ |--------|----------|
272
+ | Statements | 77.6% |
273
+ | Branches | 64.7% |
274
+ | Functions | 85.4% |
275
+ | Lines | 79.5% |
276
+
277
+ **Check coverage:**
278
+ ```bash
279
+ npm run test:coverage
280
+ ```
281
+
282
+ **Priority areas for improvement:**
283
+ - `lib/memory/` — Branch coverage ~63%
284
+ - `lib/automation/doc-generator.js` — Error paths
285
+
286
+ **Coverage goals:**
287
+ - Maintain >75% line coverage
288
+ - Improve branch coverage toward 70%
289
+
290
+ ---
291
+
292
+ ## Pull Request Guidelines
293
+
294
+ ### Before Submitting
295
+
296
+ 1. Run `npm run precommit` (tests + lint)
297
+ 2. Update documentation if needed
298
+ 3. Add tests for new features
299
+ 4. Keep PRs focused (one feature/fix per PR)
300
+
301
+ ### PR Title Format
302
+
303
+ ```
304
+ type(scope): description
305
+
306
+ Examples:
307
+ feat(memory): add pattern expiration
308
+ fix(validators): handle empty schema
309
+ docs(readme): update installation steps
310
+ test(context): add cache invalidation tests
311
+ ```
312
+
313
+ Types: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`
314
+
315
+ ### PR Description
316
+
317
+ Include:
318
+ - What the PR does
319
+ - Why it's needed
320
+ - How to test it
321
+ - Any breaking changes
322
+
323
+ ### Review Process
324
+
325
+ 1. Automated checks must pass
326
+ 2. At least one maintainer review
327
+ 3. Address feedback promptly
328
+ 4. Squash commits before merge
329
+
330
+ ---
331
+
332
+ ## Questions?
333
+
334
+ - Open an issue for bugs or feature requests
335
+ - Check existing issues before creating new ones
336
+ - Use discussions for questions
337
+
338
+ ---
339
+
340
+ *See also: [Commands](COMMANDS.md) | [Examples](EXAMPLES.md) | [Getting Started](GETTING-STARTED.md)*
341
+
342
+ *Thank you for contributing to GYWD!*