prjct-cli 0.4.8 โ 0.5.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/CHANGELOG.md +337 -0
- package/CLAUDE.md +109 -3
- package/README.md +228 -93
- package/core/agent-detector.js +55 -122
- package/core/agent-generator.js +516 -0
- package/core/command-installer.js +109 -806
- package/core/commands.js +5 -34
- package/core/editors-config.js +9 -28
- package/core/git-integration.js +401 -0
- package/package.json +10 -7
- package/scripts/install.sh +0 -1
- package/templates/agents/be.template.md +42 -0
- package/templates/agents/data.template.md +41 -0
- package/templates/agents/devops.template.md +41 -0
- package/templates/agents/fe.template.md +42 -0
- package/templates/agents/mobile.template.md +41 -0
- package/templates/agents/pm.template.md +84 -0
- package/templates/agents/qa.template.md +54 -0
- package/templates/agents/scribe.template.md +95 -0
- package/templates/agents/security.template.md +41 -0
- package/templates/agents/ux.template.md +49 -0
- package/templates/commands/analyze.md +137 -3
- package/templates/commands/done.md +154 -5
- package/templates/commands/init.md +61 -3
- package/templates/commands/ship.md +146 -6
- package/templates/commands/sync.md +220 -0
- package/templates/examples/natural-language-examples.md +234 -22
- package/core/agents/codex-agent.js +0 -256
- package/core/agents/terminal-agent.js +0 -465
- package/templates/workflows/analyze.md +0 -159
- package/templates/workflows/cleanup.md +0 -73
- package/templates/workflows/context.md +0 -72
- package/templates/workflows/design.md +0 -88
- package/templates/workflows/done.md +0 -20
- package/templates/workflows/fix.md +0 -201
- package/templates/workflows/git.md +0 -192
- package/templates/workflows/help.md +0 -13
- package/templates/workflows/idea.md +0 -22
- package/templates/workflows/init.md +0 -80
- package/templates/workflows/natural-language-handler.md +0 -183
- package/templates/workflows/next.md +0 -44
- package/templates/workflows/now.md +0 -19
- package/templates/workflows/progress.md +0 -113
- package/templates/workflows/recap.md +0 -66
- package/templates/workflows/roadmap.md +0 -95
- package/templates/workflows/ship.md +0 -18
- package/templates/workflows/stuck.md +0 -25
- package/templates/workflows/task.md +0 -109
- package/templates/workflows/test.md +0 -243
|
@@ -1,243 +0,0 @@
|
|
|
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
|