prjct-cli 0.4.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 (71) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/CLAUDE.md +300 -0
  3. package/LICENSE +21 -0
  4. package/README.md +424 -0
  5. package/bin/prjct +214 -0
  6. package/core/agent-detector.js +249 -0
  7. package/core/agents/claude-agent.js +250 -0
  8. package/core/agents/codex-agent.js +256 -0
  9. package/core/agents/terminal-agent.js +465 -0
  10. package/core/analyzer.js +596 -0
  11. package/core/animations-simple.js +240 -0
  12. package/core/animations.js +277 -0
  13. package/core/author-detector.js +218 -0
  14. package/core/capability-installer.js +190 -0
  15. package/core/command-installer.js +775 -0
  16. package/core/commands.js +2050 -0
  17. package/core/config-manager.js +335 -0
  18. package/core/migrator.js +784 -0
  19. package/core/path-manager.js +324 -0
  20. package/core/project-capabilities.js +144 -0
  21. package/core/session-manager.js +439 -0
  22. package/core/version.js +107 -0
  23. package/core/workflow-engine.js +213 -0
  24. package/core/workflow-prompts.js +192 -0
  25. package/core/workflow-rules.js +147 -0
  26. package/package.json +80 -0
  27. package/scripts/install.sh +433 -0
  28. package/scripts/verify-installation.sh +158 -0
  29. package/templates/agents/AGENTS.md +164 -0
  30. package/templates/commands/analyze.md +125 -0
  31. package/templates/commands/cleanup.md +102 -0
  32. package/templates/commands/context.md +105 -0
  33. package/templates/commands/design.md +113 -0
  34. package/templates/commands/done.md +44 -0
  35. package/templates/commands/fix.md +87 -0
  36. package/templates/commands/git.md +79 -0
  37. package/templates/commands/help.md +72 -0
  38. package/templates/commands/idea.md +50 -0
  39. package/templates/commands/init.md +237 -0
  40. package/templates/commands/next.md +74 -0
  41. package/templates/commands/now.md +35 -0
  42. package/templates/commands/progress.md +92 -0
  43. package/templates/commands/recap.md +86 -0
  44. package/templates/commands/roadmap.md +107 -0
  45. package/templates/commands/ship.md +41 -0
  46. package/templates/commands/stuck.md +48 -0
  47. package/templates/commands/task.md +97 -0
  48. package/templates/commands/test.md +94 -0
  49. package/templates/commands/workflow.md +224 -0
  50. package/templates/examples/natural-language-examples.md +320 -0
  51. package/templates/mcp-config.json +8 -0
  52. package/templates/workflows/analyze.md +159 -0
  53. package/templates/workflows/cleanup.md +73 -0
  54. package/templates/workflows/context.md +72 -0
  55. package/templates/workflows/design.md +88 -0
  56. package/templates/workflows/done.md +20 -0
  57. package/templates/workflows/fix.md +201 -0
  58. package/templates/workflows/git.md +192 -0
  59. package/templates/workflows/help.md +13 -0
  60. package/templates/workflows/idea.md +22 -0
  61. package/templates/workflows/init.md +80 -0
  62. package/templates/workflows/natural-language-handler.md +183 -0
  63. package/templates/workflows/next.md +44 -0
  64. package/templates/workflows/now.md +19 -0
  65. package/templates/workflows/progress.md +113 -0
  66. package/templates/workflows/recap.md +66 -0
  67. package/templates/workflows/roadmap.md +95 -0
  68. package/templates/workflows/ship.md +18 -0
  69. package/templates/workflows/stuck.md +25 -0
  70. package/templates/workflows/task.md +109 -0
  71. package/templates/workflows/test.md +243 -0
@@ -0,0 +1,109 @@
1
+ ---
2
+ title: prjct task
3
+ invocable_name: p:task
4
+ description: Break down and execute complex tasks systematically using global prjct architecture
5
+ ---
6
+
7
+ # Steps
8
+
9
+ 1. Read project config from `.prjct/prjct.config.json`
10
+ 2. Extract `projectId` and `author` from config
11
+ 3. Parse task description from arguments
12
+ 4. Analyze task complexity and requirements
13
+ 5. Break down into subtasks with dependencies
14
+ 6. Create task breakdown in `~/.prjct-cli/projects/{projectId}/planning/tasks/{task-id}.md`
15
+ 7. Add subtasks to `~/.prjct-cli/projects/{projectId}/core/next.md` with priority
16
+ 8. Set first subtask to `~/.prjct-cli/projects/{projectId}/core/now.md`
17
+ 9. Log task creation to memory
18
+ 10. Display execution plan
19
+
20
+ # Response Format
21
+
22
+ ```
23
+ 📋 Task Breakdown: {task description}
24
+
25
+ 🔍 Analysis:
26
+ - Complexity: {High/Medium/Low}
27
+ - Estimated Time: {timeframe}
28
+ - Dependencies: {list or "None"}
29
+
30
+ 📦 Subtasks Created:
31
+
32
+ 1. 🎯 {subtask 1} (Starting now)
33
+ - Why: {reason}
34
+ - Deliverable: {outcome}
35
+ - Estimate: {time}
36
+
37
+ 2. ⏳ {subtask 2}
38
+ - Why: {reason}
39
+ - Deliverable: {outcome}
40
+ - Estimate: {time}
41
+ - Depends on: #1
42
+
43
+ 3. ⏳ {subtask 3}
44
+ - Why: {reason}
45
+ - Deliverable: {outcome}
46
+ - Estimate: {time}
47
+ - Depends on: #2
48
+
49
+ Total Estimate: {total time}
50
+
51
+ ✅ Actions Taken:
52
+ - Created task breakdown file
53
+ - Added subtasks to priority queue
54
+ - Set first subtask as current focus
55
+
56
+ 🎯 Let's start! Current task:
57
+ {subtask 1 description}
58
+
59
+ Use /p:done when complete to move to next subtask.
60
+ ```
61
+
62
+ # Task Breakdown Strategy
63
+
64
+ 1. **Understand Requirements**: Analyze what needs to be done
65
+ 2. **Identify Dependencies**: What must happen first?
66
+ 3. **Define Milestones**: Key deliverables within the task
67
+ 4. **Chunk into Subtasks**: Each subtask should be ~1-4 hours
68
+ 5. **Sequence Execution**: Order by dependencies and logic
69
+ 6. **Estimate Effort**: Realistic time estimates per subtask
70
+
71
+ # Subtask Characteristics
72
+
73
+ Good subtasks are:
74
+ - **Atomic**: Can be completed in one session
75
+ - **Testable**: Clear success criteria
76
+ - **Valuable**: Produces tangible progress
77
+ - **Independent**: Minimal blocking dependencies
78
+ - **Sized Right**: 1-4 hours of focused work
79
+
80
+ # Task Tracking
81
+
82
+ Task breakdown file created at:
83
+ `~/.prjct-cli/projects/{id}/planning/tasks/{task-id}.md`
84
+
85
+ Contains:
86
+ - Original task description
87
+ - Analysis and breakdown
88
+ - Subtask list with status
89
+ - Dependencies map
90
+ - Progress tracking
91
+ - Completion notes
92
+
93
+ # Progress Workflow
94
+
95
+ 1. `/p:task "Complex feature"` - Break down
96
+ 2. `/p:now` shows first subtask (auto-set)
97
+ 3. `/p:done` when complete → auto-advances to next subtask
98
+ 4. Repeat until all subtasks complete
99
+ 5. Final `/p:done` marks entire task complete
100
+ 6. `/p:ship` to celebrate the feature
101
+
102
+ # Global Architecture Notes
103
+
104
+ - **Task Files**: `~/.prjct-cli/projects/{id}/planning/tasks/*.md`
105
+ - **Queue Integration**: `~/.prjct-cli/projects/{id}/core/next.md`
106
+ - **Current Task**: `~/.prjct-cli/projects/{id}/core/now.md`
107
+ - **Memory Logging**: `~/.prjct-cli/projects/{id}/memory/context.jsonl`
108
+ - **Config Location**: `{project}/.prjct/prjct.config.json`
109
+ - **Use Case**: Complex features, refactoring, large implementations
@@ -0,0 +1,243 @@
1
+ ---
2
+ title: prjct test
3
+ invocable_name: p:test
4
+ description: Execute tests with reporting and coverage tracking using global prjct architecture
5
+ ---
6
+
7
+ # Steps
8
+
9
+ 1. Read project config from `.prjct/prjct.config.json`
10
+ 2. Extract `projectId` and `author` from config
11
+ 3. Parse test type and arguments (unit, integration, e2e, all)
12
+ 4. Detect test framework from project analysis
13
+ 5. Execute appropriate test suite
14
+ 6. Collect test results:
15
+ - Pass/fail counts
16
+ - Coverage metrics
17
+ - Failed test details
18
+ - Performance metrics
19
+ 7. Update test metrics in `~/.prjct-cli/projects/{projectId}/progress/metrics.md`
20
+ 8. Log test execution to memory
21
+ 9. Display formatted results
22
+ 10. Provide actionable suggestions
23
+
24
+ # Response Format
25
+
26
+ ```
27
+ 🧪 Test Execution: {test-type}
28
+
29
+ Framework: {jest/vitest/pytest/etc}
30
+ Environment: {node-version/python-version}
31
+
32
+ 📊 Results:
33
+ ✅ Passed: X tests
34
+ ❌ Failed: Y tests
35
+ ⏭️ Skipped: Z tests
36
+ ⏱️ Duration: A.Bs
37
+
38
+ 📈 Coverage:
39
+ - Statements: {X}%
40
+ - Branches: {Y}%
41
+ - Functions: {Z}%
42
+ - Lines: {A}%
43
+
44
+ {if-coverage-change}
45
+ Coverage Change: {+/-}% from last run
46
+ {endif}
47
+
48
+ {if-failures}
49
+ ❌ Failed Tests:
50
+
51
+ 1. {test-name}
52
+ File: {file-path}:{line}
53
+ Error: {error-message}
54
+
55
+ 2. {test-name}
56
+ File: {file-path}:{line}
57
+ Error: {error-message}
58
+
59
+ 🔧 Quick Fixes:
60
+ - Review failing test: {file-path}
61
+ - Check recent changes: git diff
62
+ - Debug: npm test -- --watch
63
+ - Get help: /p:stuck "Test failing: {test-name}"
64
+ {endif}
65
+
66
+ {if-all-passed}
67
+ ✅ All Tests Passed!
68
+
69
+ 🎉 Great work! Test suite is green.
70
+
71
+ {if-coverage-improved}
72
+ 📈 Coverage improved by {X}%!
73
+ {endif}
74
+
75
+ Next Steps:
76
+ - Ship this: /p:ship "{feature-name}"
77
+ - Mark done: /p:done
78
+ - Continue work: /p:now
79
+ {endif}
80
+
81
+ 💡 Suggestions:
82
+ {coverage-suggestions}
83
+ {performance-suggestions}
84
+ ```
85
+
86
+ # Test Types
87
+
88
+ ## unit (default)
89
+ ```
90
+ npm test
91
+ # or
92
+ pytest tests/unit
93
+ # or
94
+ go test ./...
95
+ ```
96
+
97
+ ## integration
98
+ ```
99
+ npm test -- tests/integration
100
+ # or
101
+ pytest tests/integration
102
+ ```
103
+
104
+ ## e2e
105
+ ```
106
+ npm run test:e2e
107
+ # or
108
+ playwright test
109
+ # or
110
+ cypress run
111
+ ```
112
+
113
+ ## all
114
+ ```
115
+ npm run test:all
116
+ # or run all test suites sequentially
117
+ ```
118
+
119
+ ## watch
120
+ ```
121
+ npm test -- --watch
122
+ # Interactive test watcher
123
+ ```
124
+
125
+ ## coverage
126
+ ```
127
+ npm test -- --coverage
128
+ # Detailed coverage report
129
+ ```
130
+
131
+ # Framework Detection
132
+
133
+ Auto-detect test framework:
134
+ - **JavaScript/TypeScript**: Jest, Vitest, Mocha, Jasmine
135
+ - **Python**: Pytest, Unittest, Nose
136
+ - **Go**: Go test
137
+ - **Rust**: Cargo test
138
+ - **Ruby**: RSpec, Minitest
139
+
140
+ Auto-detect commands from:
141
+ - package.json scripts
142
+ - Makefile
143
+ - Test configuration files
144
+
145
+ # Coverage Analysis
146
+
147
+ **Good Coverage**:
148
+ - Statements: >80%
149
+ - Branches: >75%
150
+ - Functions: >80%
151
+ - Lines: >80%
152
+
153
+ **Suggestions Based on Coverage**:
154
+ - <50%: "Critical: Add basic tests for core functionality"
155
+ - 50-70%: "Add tests for edge cases and error paths"
156
+ - 70-85%: "Good coverage! Focus on complex branches"
157
+ - >85%: "Excellent! Maintain this level"
158
+
159
+ # Performance Metrics
160
+
161
+ Track:
162
+ - Total test duration
163
+ - Slowest tests (top 5)
164
+ - Flaky tests (inconsistent results)
165
+ - Test suite trends over time
166
+
167
+ Suggestions:
168
+ - Tests >5s: "Consider splitting or optimizing"
169
+ - Flaky tests: "Investigate timing or async issues"
170
+ - Growing duration: "Review test efficiency"
171
+
172
+ # Test Failure Analysis
173
+
174
+ For each failure:
175
+ 1. **Extract Error**: Parse error message and stack trace
176
+ 2. **Locate Code**: Find relevant source code
177
+ 3. **Check Recent Changes**: Review related commits
178
+ 4. **Suggest Fix**: Provide debugging guidance
179
+
180
+ Common Failure Types:
181
+ - **Assertion Failed**: Expected vs. actual mismatch
182
+ - **Timeout**: Async operation took too long
183
+ - **Exception**: Unhandled error in test
184
+ - **Setup Failed**: Test environment issue
185
+
186
+ # Continuous Integration
187
+
188
+ If in CI environment:
189
+ - Adjust output format for CI
190
+ - Generate CI-specific reports
191
+ - Set appropriate exit codes
192
+ - Provide machine-readable output
193
+
194
+ # Integration with Workflow
195
+
196
+ ## Before Ship
197
+ ```
198
+ /p:test all
199
+ # Ensure all tests pass before shipping
200
+ ```
201
+
202
+ ## During Development
203
+ ```
204
+ /p:test watch
205
+ # Run tests continuously during development
206
+ ```
207
+
208
+ ## After Refactoring
209
+ ```
210
+ /p:test coverage
211
+ # Ensure coverage didn't drop
212
+ ```
213
+
214
+ ## Debug Failures
215
+ ```
216
+ /p:test unit
217
+ # Failed? Use /p:stuck "Test failing: {name}"
218
+ ```
219
+
220
+ # Metrics Tracking
221
+
222
+ Update `~/.prjct-cli/projects/{id}/progress/metrics.md`:
223
+ ```markdown
224
+ ## Test Metrics
225
+
226
+ Last Run: {timestamp}
227
+ - Pass Rate: {X}%
228
+ - Coverage: {Y}%
229
+ - Duration: {Z}s
230
+
231
+ Historical:
232
+ - {date}: {pass-rate}% pass, {coverage}% coverage
233
+ - {date}: {pass-rate}% pass, {coverage}% coverage
234
+ ```
235
+
236
+ # Global Architecture Notes
237
+
238
+ - **Metrics Location**: `~/.prjct-cli/projects/{id}/progress/metrics.md`
239
+ - **Memory Logging**: `~/.prjct-cli/projects/{id}/memory/context.jsonl`
240
+ - **Config Source**: `{project}/.prjct/prjct.config.json`
241
+ - **Integration**: Part of quality gates before shipping
242
+ - **Trend Analysis**: Track test health over time
243
+ - **Use Case**: Quality assurance, regression prevention, coverage tracking