prjct-cli 0.5.1 → 0.7.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 +220 -7
- package/CLAUDE.md +476 -55
- package/README.md +48 -55
- package/bin/prjct +170 -225
- package/core/agentic/command-executor.js +113 -0
- package/core/agentic/context-builder.js +85 -0
- package/core/agentic/prompt-builder.js +86 -0
- package/core/agentic/template-loader.js +104 -0
- package/core/agentic/tool-registry.js +117 -0
- package/core/command-registry.js +597 -0
- package/core/commands.js +2046 -2028
- package/core/domain/agent-generator.js +118 -0
- package/core/domain/analyzer.js +211 -0
- package/core/domain/architect-session.js +300 -0
- package/core/{agents → infrastructure/agents}/claude-agent.js +16 -13
- package/core/{author-detector.js → infrastructure/author-detector.js} +3 -1
- package/core/{capability-installer.js → infrastructure/capability-installer.js} +3 -6
- package/core/{command-installer.js → infrastructure/command-installer.js} +4 -2
- package/core/{config-manager.js → infrastructure/config-manager.js} +4 -4
- package/core/{editors-config.js → infrastructure/editors-config.js} +2 -10
- package/core/{migrator.js → infrastructure/migrator.js} +34 -19
- package/core/{path-manager.js → infrastructure/path-manager.js} +20 -44
- package/core/{session-manager.js → infrastructure/session-manager.js} +45 -105
- package/core/{update-checker.js → infrastructure/update-checker.js} +67 -67
- package/core/{animations-simple.js → utils/animations.js} +3 -23
- package/core/utils/date-helper.js +238 -0
- package/core/utils/file-helper.js +327 -0
- package/core/utils/jsonl-helper.js +206 -0
- package/core/{project-capabilities.js → utils/project-capabilities.js} +21 -22
- package/core/utils/session-helper.js +277 -0
- package/core/{version.js → utils/version.js} +1 -1
- package/package.json +5 -12
- package/templates/agents/AGENTS.md +151 -99
- package/templates/analysis/analyze.md +84 -0
- package/templates/commands/analyze.md +37 -233
- package/templates/commands/bug.md +79 -0
- package/templates/commands/build.md +44 -0
- package/templates/commands/cleanup.md +24 -84
- package/templates/commands/design.md +20 -95
- package/templates/commands/done.md +17 -180
- package/templates/commands/feature.md +113 -0
- package/templates/commands/fix.md +58 -66
- package/templates/commands/git.md +35 -57
- package/templates/commands/help.md +18 -52
- package/templates/commands/idea.md +18 -34
- package/templates/commands/init.md +65 -257
- package/templates/commands/next.md +20 -60
- package/templates/commands/now.md +21 -23
- package/templates/commands/progress.md +40 -73
- package/templates/commands/recap.md +52 -75
- package/templates/commands/roadmap.md +30 -85
- package/templates/commands/ship.md +93 -126
- package/templates/commands/status.md +42 -0
- package/templates/commands/sync.md +19 -205
- package/templates/commands/task.md +19 -79
- package/templates/commands/test.md +25 -71
- package/templates/commands/workflow.md +20 -210
- package/core/agent-generator.js +0 -516
- package/core/analyzer.js +0 -600
- package/core/animations.js +0 -277
- package/core/git-integration.js +0 -401
- package/core/workflow-engine.js +0 -213
- package/core/workflow-prompts.js +0 -192
- package/core/workflow-rules.js +0 -147
- package/scripts/post-install.js +0 -121
- package/scripts/preuninstall.js +0 -94
- package/scripts/verify-installation.sh +0 -158
- package/templates/agents/be.template.md +0 -42
- package/templates/agents/data.template.md +0 -41
- package/templates/agents/devops.template.md +0 -41
- package/templates/agents/fe.template.md +0 -42
- package/templates/agents/mobile.template.md +0 -41
- package/templates/agents/pm.template.md +0 -84
- package/templates/agents/qa.template.md +0 -54
- package/templates/agents/scribe.template.md +0 -95
- package/templates/agents/security.template.md +0 -41
- package/templates/agents/ux.template.md +0 -49
- package/templates/commands/context.md +0 -105
- package/templates/commands/stuck.md +0 -48
- package/templates/examples/natural-language-examples.md +0 -532
- /package/core/{agent-detector.js → infrastructure/agent-detector.js} +0 -0
|
@@ -1,113 +1,38 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
description: Design
|
|
2
|
+
allowed-tools: [Read, Write]
|
|
3
|
+
description: 'Design architecture and APIs'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /p:design
|
|
7
|
-
|
|
8
|
-
Create technical designs with visual diagrams and implementation guides for system architecture, APIs, components, databases, and user flows.
|
|
6
|
+
# /p:design
|
|
9
7
|
|
|
10
8
|
## Usage
|
|
11
9
|
|
|
12
10
|
```
|
|
13
|
-
/p:design [target] [--type architecture|api|component|database|flow]
|
|
11
|
+
/p:design [target] [--type architecture|api|component|database|flow]
|
|
14
12
|
```
|
|
15
13
|
|
|
16
|
-
##
|
|
14
|
+
## Flow
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
1. Parse: target + type
|
|
17
|
+
2. Generate: ASCII diagrams
|
|
18
|
+
3. Create: specifications
|
|
19
|
+
4. Save: `designs/{target}-{type}.md`
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
## Types
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
6. Display formatted design with overview, specs, and implementation guide
|
|
28
|
-
7. Link designs to tasks and track implementation progress
|
|
23
|
+
- **architecture**: System design, components, data flow
|
|
24
|
+
- **api**: Endpoint specs, schemas, auth
|
|
25
|
+
- **component**: Interfaces, props, state
|
|
26
|
+
- **database**: Schema, relationships, indexes
|
|
27
|
+
- **flow**: User journeys, workflows
|
|
29
28
|
|
|
30
|
-
## Response
|
|
29
|
+
## Response
|
|
31
30
|
|
|
32
31
|
```
|
|
33
|
-
🎨
|
|
34
|
-
|
|
35
|
-
📐 Design: [Target Name]
|
|
36
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
37
|
-
|
|
38
|
-
🏗️ Architecture Overview:
|
|
39
|
-
[ASCII diagram or description]
|
|
40
|
-
|
|
41
|
-
📋 Technical Specifications:
|
|
42
|
-
• Technology Stack: [stack details]
|
|
43
|
-
• Design Patterns: [patterns used]
|
|
44
|
-
• Key Components: [component list]
|
|
45
|
-
|
|
46
|
-
📦 Implementation Guide:
|
|
47
|
-
1. Set up project structure
|
|
48
|
-
2. Implement core models
|
|
49
|
-
3. Build API endpoints
|
|
50
|
-
4. Create UI components
|
|
51
|
-
|
|
52
|
-
📁 Files Created:
|
|
53
|
-
• ~/.prjct-cli/projects/{id}/designs/[target]-architecture.md
|
|
54
|
-
|
|
55
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
56
|
-
✅ Design ready for implementation!
|
|
57
|
-
|
|
58
|
-
💡 Next: /p:now "Implement [target]"
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Design Types
|
|
62
|
-
|
|
63
|
-
### Architecture
|
|
64
|
-
- System architecture diagrams
|
|
65
|
-
- Component relationships
|
|
66
|
-
- Data flow and communication patterns
|
|
67
|
-
- Scalability considerations
|
|
68
|
-
|
|
69
|
-
### API
|
|
70
|
-
- Endpoint specifications
|
|
71
|
-
- Request/response schemas
|
|
72
|
-
- Authentication and authorization
|
|
73
|
-
- Rate limiting and caching
|
|
74
|
-
|
|
75
|
-
### Component
|
|
76
|
-
- Component interfaces
|
|
77
|
-
- Props and state management
|
|
78
|
-
- Lifecycle and hooks
|
|
79
|
-
- Styling and theming
|
|
32
|
+
🎨 Design complete!
|
|
80
33
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- Entity relationships
|
|
84
|
-
- Indexing strategy
|
|
85
|
-
- Migration plans
|
|
34
|
+
📐 {target} - {type}
|
|
35
|
+
📄 Saved: designs/{target}-{type}.md
|
|
86
36
|
|
|
87
|
-
|
|
88
|
-
- User journey diagrams
|
|
89
|
-
- State machine flows
|
|
90
|
-
- Process workflows
|
|
91
|
-
- Integration flows
|
|
92
|
-
|
|
93
|
-
## Examples
|
|
94
|
-
|
|
95
|
-
Design system architecture:
|
|
96
|
-
```
|
|
97
|
-
/p:design authentication --type architecture
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Design API endpoints:
|
|
101
|
-
```
|
|
102
|
-
/p:design user-management --type api --format spec
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Design database schema:
|
|
106
|
-
```
|
|
107
|
-
/p:design products --type database --format diagram
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Complete design with all formats:
|
|
111
|
-
```
|
|
112
|
-
/p:design payment-system --type architecture --format all
|
|
37
|
+
/p:now "Implement {target}"
|
|
113
38
|
```
|
|
@@ -1,193 +1,30 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write
|
|
3
|
-
description:
|
|
2
|
+
allowed-tools: [Read, Write]
|
|
3
|
+
description: 'Complete task, clear focus'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /p:done
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Validation
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
10
|
+
- Requires: `.prjct/prjct.config.json` exists
|
|
11
|
+
- Requires: `core/now.md` has content
|
|
12
|
+
- Else: "Not working on anything. Use /p:now or /p:next"
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
✨ You're not working on anything right now!
|
|
17
|
-
|
|
18
|
-
Want to start something?
|
|
19
|
-
• Tell me what you want to build
|
|
20
|
-
• Say "show me what's next"
|
|
21
|
-
• Or use: /p:now | /p:next
|
|
14
|
+
## Flow
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
1. Read: `core/now.md` → calculate duration
|
|
17
|
+
2. Clear: `core/now.md`
|
|
18
|
+
3. Update: `progress/metrics.md`, `core/context.md`
|
|
19
|
+
4. Log: `memory/context.jsonl`
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
## Response
|
|
27
22
|
|
|
28
|
-
## Usage
|
|
29
|
-
```
|
|
30
|
-
/p:done
|
|
31
23
|
```
|
|
24
|
+
✅ {task} ({duration})
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
1. Read task from `~/.prjct-cli/projects/{id}/core/now.md`, calculate duration
|
|
38
|
-
2. Clear `core/now.md`
|
|
39
|
-
3. **Trigger Scribe Agent** (Documentation):
|
|
40
|
-
- Get git changes since task started: `git diff --name-only`
|
|
41
|
-
- Invoke Scribe agent to document changes
|
|
42
|
-
- Show documentation draft to user
|
|
43
|
-
- **Request confirmation** before saving
|
|
44
|
-
- Save to `analysis/task-docs/[task-id].md` if confirmed
|
|
45
|
-
4. Update `progress/metrics.md`, `core/context.md`
|
|
46
|
-
5. Log to `memory/context.jsonl`:
|
|
47
|
-
```json
|
|
48
|
-
{"action":"done","task":"[task]","started":"[t1]","completed":"[t2]","duration":"[min]","documented":true,"layer":"core"}
|
|
49
|
-
```
|
|
50
|
-
6. Response:
|
|
51
|
-
```
|
|
52
|
-
✅ [task description] ([duration])
|
|
53
|
-
|
|
54
|
-
What's next?
|
|
55
|
-
• "start [next task]" → Begin working
|
|
56
|
-
• "ship this feature" → Track & celebrate
|
|
57
|
-
• "add new idea" → Brainstorm
|
|
58
|
-
|
|
59
|
-
Or use: /p:now | /p:ship | /p:idea
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Or if queue empty:
|
|
63
|
-
```
|
|
64
|
-
✅ [task description] ([duration])
|
|
65
|
-
|
|
66
|
-
Queue is empty! What now?
|
|
67
|
-
• "add a task" → Plan next work
|
|
68
|
-
• "brainstorm ideas" → Creative mode
|
|
69
|
-
• "see my progress" → View achievements
|
|
70
|
-
|
|
71
|
-
Or: /p:idea | /p:next | /p:recap
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Scribe Agent Workflow
|
|
75
|
-
|
|
76
|
-
When a task is completed, the Scribe agent is automatically invoked to document changes:
|
|
77
|
-
|
|
78
|
-
### Step 1: Detect Changes
|
|
79
|
-
```javascript
|
|
80
|
-
const gitIntegration = require('../core/git-integration')
|
|
81
|
-
const taskStartTime = readTaskStartTime()
|
|
82
|
-
|
|
83
|
-
// Get files changed since task started
|
|
84
|
-
const changes = await gitIntegration.getChangesSince(taskStartTime)
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Step 2: Generate Documentation
|
|
88
|
-
Invoke Scribe agent with prompt:
|
|
89
|
-
```
|
|
90
|
-
Document the following task completion:
|
|
91
|
-
|
|
92
|
-
Task: "[task description]"
|
|
93
|
-
Duration: [duration]
|
|
94
|
-
Files changed:
|
|
95
|
-
${changes.files.join('\n')}
|
|
96
|
-
|
|
97
|
-
Generate documentation including:
|
|
98
|
-
1. Brief summary of what was implemented
|
|
99
|
-
2. Key technical decisions
|
|
100
|
-
3. Files affected and their purpose
|
|
101
|
-
4. Any breaking changes or important notes
|
|
102
|
-
|
|
103
|
-
Keep it concise (< 200 words).
|
|
26
|
+
Next?
|
|
27
|
+
• "start {task}" → work
|
|
28
|
+
• "ship {feature}" → celebrate
|
|
29
|
+
• /p:now | /p:ship
|
|
104
30
|
```
|
|
105
|
-
|
|
106
|
-
### Step 3: Show Draft & Request Confirmation
|
|
107
|
-
```
|
|
108
|
-
📝 Scribe Agent Documentation Draft
|
|
109
|
-
|
|
110
|
-
## Task: [task description]
|
|
111
|
-
|
|
112
|
-
**Implemented**: [date]
|
|
113
|
-
**Duration**: [duration]
|
|
114
|
-
|
|
115
|
-
**Summary**:
|
|
116
|
-
[AI-generated summary]
|
|
117
|
-
|
|
118
|
-
**Technical Details**:
|
|
119
|
-
- [Key decisions]
|
|
120
|
-
- [Files modified]
|
|
121
|
-
|
|
122
|
-
**Usage**:
|
|
123
|
-
[Examples if applicable]
|
|
124
|
-
|
|
125
|
-
─────────────────────────────────────
|
|
126
|
-
|
|
127
|
-
Save this documentation? (y/n): _
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Step 4: Save if Confirmed
|
|
131
|
-
```javascript
|
|
132
|
-
if (userConfirms) {
|
|
133
|
-
const docPath = `~/.prjct-cli/projects/{id}/analysis/task-docs/${taskId}.md`
|
|
134
|
-
await saveDocumentation(docPath, documentation)
|
|
135
|
-
console.log('✅ Documentation saved!')
|
|
136
|
-
} else {
|
|
137
|
-
console.log('ℹ️ Documentation discarded')
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## Example with Scribe
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
/p:done
|
|
145
|
-
|
|
146
|
-
✅ implement login authentication (2h 15m)
|
|
147
|
-
|
|
148
|
-
📝 Scribe Agent is documenting your changes...
|
|
149
|
-
|
|
150
|
-
─────────────────────────────────────────────
|
|
151
|
-
|
|
152
|
-
## Task: implement login authentication
|
|
153
|
-
|
|
154
|
-
**Implemented**: 2025-10-02
|
|
155
|
-
**Duration**: 2h 15m
|
|
156
|
-
|
|
157
|
-
**Summary**:
|
|
158
|
-
Implemented JWT-based authentication system with login and registration endpoints. Added middleware for protected routes and session management.
|
|
159
|
-
|
|
160
|
-
**Technical Details**:
|
|
161
|
-
- Added auth service with bcrypt password hashing
|
|
162
|
-
- Created login/register API endpoints in auth.controller.ts
|
|
163
|
-
- Implemented JWT middleware for route protection
|
|
164
|
-
- Added user session management with Redis
|
|
165
|
-
|
|
166
|
-
**Files Modified**:
|
|
167
|
-
- src/features/auth/auth.service.ts (new)
|
|
168
|
-
- src/features/auth/auth.controller.ts (new)
|
|
169
|
-
- src/middleware/jwt.middleware.ts (new)
|
|
170
|
-
- src/config/redis.config.ts (modified)
|
|
171
|
-
|
|
172
|
-
**Breaking Changes**: None
|
|
173
|
-
|
|
174
|
-
─────────────────────────────────────────────
|
|
175
|
-
|
|
176
|
-
Save this documentation? (y/n): y
|
|
177
|
-
|
|
178
|
-
✅ Documentation saved to task-docs!
|
|
179
|
-
|
|
180
|
-
What's next?
|
|
181
|
-
• "start next task" → Begin working
|
|
182
|
-
• "ship authentication" → Track & celebrate
|
|
183
|
-
|
|
184
|
-
Or use: /p:now | /p:ship
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
## Notes
|
|
188
|
-
|
|
189
|
-
- Scribe agent uses git history to understand changes
|
|
190
|
-
- Documentation is saved per-task for reference
|
|
191
|
-
- User confirmation prevents unwanted docs
|
|
192
|
-
- Can skip documentation by saying "no"
|
|
193
|
-
- Documentation helps with onboarding and code reviews
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read, Write, Bash]
|
|
3
|
+
description: 'Value analysis + roadmap + task breakdown + auto-start'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /p:feature
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
/p:feature "<description>"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What It Does
|
|
15
|
+
|
|
16
|
+
1. **Value analysis**: Impact/effort/timing analysis
|
|
17
|
+
2. **Roadmap**: Positioning in project roadmap
|
|
18
|
+
3. **Task breakdown**: Smart breakdown into logical tasks
|
|
19
|
+
4. **Auto-start**: First task starts automatically
|
|
20
|
+
|
|
21
|
+
## Flow
|
|
22
|
+
|
|
23
|
+
1. Analyze value (impact/effort/timing)
|
|
24
|
+
2. Position in roadmap
|
|
25
|
+
3. Break down into logical tasks (as many as needed)
|
|
26
|
+
4. **Write to session**: Append to `planning/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`
|
|
27
|
+
5. **Update index**: Add to `planning/roadmap.md` (lightweight, last 30 days only)
|
|
28
|
+
6. **Queue tasks**: Write to `core/next.md`
|
|
29
|
+
7. Auto-start first task
|
|
30
|
+
|
|
31
|
+
## Session Log Format
|
|
32
|
+
|
|
33
|
+
Append to `planning/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`:
|
|
34
|
+
|
|
35
|
+
```jsonl
|
|
36
|
+
{"ts":"2025-10-04T14:30:00Z","type":"feature_add","name":"{feature}","tasks":{N},"impact":"{high/med/low}","effort":"{Xh}","status":"queued"}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Index Update
|
|
40
|
+
|
|
41
|
+
Append to `planning/roadmap.md` (keep only last 30 days):
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## Queued
|
|
45
|
+
- [ ] {feature_name} ({N} tasks, {Xh} estimated) - Added 2025-10-04
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If roadmap.md > 30 days old entries, archive them to `planning/archive/roadmap-{YYYY-MM}.md`
|
|
49
|
+
|
|
50
|
+
## Value Analysis
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Feature: {description}
|
|
54
|
+
|
|
55
|
+
Value Analysis:
|
|
56
|
+
• Impact: {high/medium/low}
|
|
57
|
+
• Effort: {hours estimation}
|
|
58
|
+
• Timing: {now/later/blocked_by}
|
|
59
|
+
• Recommendation: {do_now/defer/needs_X_first}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Task Breakdown
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Roadmap: {feature_name}
|
|
66
|
+
|
|
67
|
+
Tasks:
|
|
68
|
+
1. [ ] {task_1}
|
|
69
|
+
2. [ ] {task_2}
|
|
70
|
+
3. [ ] {task_3}
|
|
71
|
+
... (as many as needed)
|
|
72
|
+
|
|
73
|
+
Estimated: {total_hours}h
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Response
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
✅ Feature roadmap created!
|
|
80
|
+
|
|
81
|
+
{feature_name}
|
|
82
|
+
📊 Value: {impact} | Effort: {hours}h
|
|
83
|
+
⏰ Recommendation: {timing_advice}
|
|
84
|
+
|
|
85
|
+
Tasks:
|
|
86
|
+
1. {task_1}
|
|
87
|
+
2. {task_2}
|
|
88
|
+
...
|
|
89
|
+
|
|
90
|
+
¿Empezamos con tarea 1?
|
|
91
|
+
|
|
92
|
+
/p:done (when task complete) | /p:ship (when feature complete)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Example
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
User: p. feature "agregar unit testing"
|
|
99
|
+
|
|
100
|
+
Claude analyzes:
|
|
101
|
+
- Impact: HIGH (quality improvement)
|
|
102
|
+
- Effort: 8h
|
|
103
|
+
- Timing: NOW (before shipping more features)
|
|
104
|
+
|
|
105
|
+
Tasks created:
|
|
106
|
+
1. Setup Jest/Vitest configuration
|
|
107
|
+
2. Write tests for core utilities
|
|
108
|
+
3. Write tests for components
|
|
109
|
+
4. Add CI/CD test runner
|
|
110
|
+
5. Update docs with testing guide
|
|
111
|
+
|
|
112
|
+
"¿Empezamos con tarea 1: Setup Jest/Vitest?"
|
|
113
|
+
```
|
|
@@ -1,87 +1,79 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read,
|
|
3
|
-
description:
|
|
2
|
+
allowed-tools: [Read, Bash, Edit]
|
|
3
|
+
description: 'Troubleshooting, guidance, and fixes'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
This command uses the global prjct architecture:
|
|
8
|
-
- Data stored in: `~/.prjct-cli/projects/{id}/`
|
|
9
|
-
- Config stored in: `{project}/.prjct/prjct.config.json`
|
|
10
|
-
- Commands synchronized across all editors
|
|
6
|
+
# /p:fix
|
|
11
7
|
|
|
8
|
+
## Usage
|
|
12
9
|
|
|
10
|
+
```
|
|
11
|
+
/p:fix # Diagnose current issue or get unstuck
|
|
12
|
+
/p:fix [error] # Fix specific error
|
|
13
|
+
/p:stuck [issue] # Alias for fix (guidance mode)
|
|
14
|
+
```
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
## Flow
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
1. Read: `core/now.md` + `analysis/` → get context
|
|
19
|
+
2. Parse: error message OR issue description
|
|
20
|
+
3. Detect: issue type (error/bug/design/perf/feature/blocked)
|
|
21
|
+
4. Apply: automatic fix OR provide guidance
|
|
22
|
+
5. Verify: test fix works (if auto-fix)
|
|
23
|
+
6. Log: `memory/context.jsonl`
|
|
18
24
|
|
|
19
|
-
##
|
|
20
|
-
```
|
|
21
|
-
/p:fix [error message or description]
|
|
22
|
-
```
|
|
25
|
+
## Auto-Fix (Technical Errors)
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
**
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
**Guided fixes**:
|
|
41
|
-
- Null/undefined errors → Add null checks
|
|
42
|
-
- Module not found → Install package or fix path
|
|
43
|
-
- Build failures → Check configs and deps
|
|
44
|
-
- Test failures → Show diff and fix approach
|
|
45
|
-
|
|
46
|
-
## Implementation
|
|
47
|
-
|
|
48
|
-
**Error detection**:
|
|
49
|
-
```bash
|
|
50
|
-
# Check for common issues
|
|
51
|
-
- npm run lint 2>&1
|
|
52
|
-
- npm run typecheck 2>&1
|
|
53
|
-
- Check recent git changes
|
|
54
|
-
- Analyze error stack trace
|
|
55
|
-
```
|
|
27
|
+
- **Dependencies**: `npm install` missing packages
|
|
28
|
+
- **Config**: Fix malformed JSON/YAML
|
|
29
|
+
- **Syntax**: ESLint/Prettier auto-fix
|
|
30
|
+
- **Tests**: Update snapshots, fix imports
|
|
31
|
+
- **Git**: Resolve merge conflicts
|
|
32
|
+
|
|
33
|
+
## Guidance (When Stuck)
|
|
34
|
+
|
|
35
|
+
- **Bug**: 🔍 Check logs → Isolate → Search error → Test fix
|
|
36
|
+
- **Design**: 🎨 Define requirements → Start simple → Ship MVP → Iterate
|
|
37
|
+
- **Performance**: ⚡ Profile first → Fix slowest → Cache ops → Measure
|
|
38
|
+
- **Blocked**: 💡 Break into tasks → Start smallest → Ship incrementally
|
|
39
|
+
- **Default**: Break down → Prioritize → Start → Ship
|
|
40
|
+
|
|
41
|
+
## Response (auto-fixed)
|
|
56
42
|
|
|
57
|
-
**Response format for auto-fix**:
|
|
58
43
|
```
|
|
59
|
-
|
|
44
|
+
✅ Fixed: {error_type}
|
|
45
|
+
|
|
46
|
+
{fix_details}
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
Solution: Added import from 'react'
|
|
63
|
-
File: components/UserForm.tsx:1
|
|
48
|
+
Verify: {command_to_test}
|
|
64
49
|
|
|
65
|
-
|
|
50
|
+
/p:test | /p:done
|
|
66
51
|
```
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
## Response (guidance)
|
|
54
|
+
|
|
69
55
|
```
|
|
70
|
-
|
|
56
|
+
💡 {type_guidance}
|
|
57
|
+
|
|
58
|
+
Let's break it down:
|
|
59
|
+
1. {subtask} (~{time})
|
|
60
|
+
2. {subtask} (~{time})
|
|
61
|
+
3. {subtask} (~{time})
|
|
71
62
|
|
|
72
|
-
|
|
73
|
-
🐛 Cause: user might be null
|
|
63
|
+
Start with: /p:now "{first_subtask}"
|
|
74
64
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
/p:now | /p:task
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Response (manual diagnosis)
|
|
79
69
|
|
|
80
|
-
Apply with: /p:fix apply
|
|
81
70
|
```
|
|
71
|
+
🔍 Diagnosed: {issue}
|
|
82
72
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
Suggested fixes:
|
|
74
|
+
1. {fix_option_1}
|
|
75
|
+
2. {fix_option_2}
|
|
76
|
+
3. {fix_option_3}
|
|
77
|
+
|
|
78
|
+
/p:done after fixing
|
|
79
|
+
```
|