prjct-cli 0.5.1 → 0.6.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 +153 -1
- package/CLAUDE.md +43 -28
- package/README.md +1 -1
- package/bin/prjct +78 -63
- package/core/agent-generator.js +19 -10
- package/core/ascii-graphics.js +433 -0
- package/core/command-registry.js +553 -0
- package/core/commands.js +203 -4
- package/core/task-schema.js +342 -0
- package/package.json +2 -1
- package/templates/agents/AGENTS.md +79 -101
- package/templates/agents/be.template.md +14 -29
- package/templates/agents/coordinator.template.md +34 -0
- package/templates/agents/data.template.md +14 -28
- package/templates/agents/devops.template.md +14 -28
- package/templates/agents/fe.template.md +14 -29
- package/templates/agents/mobile.template.md +14 -28
- package/templates/agents/qa.template.md +14 -41
- package/templates/agents/scribe.template.md +15 -81
- package/templates/agents/security.template.md +14 -28
- package/templates/agents/ux.template.md +14 -36
- package/templates/commands/analyze.md +36 -239
- package/templates/commands/build.md +41 -0
- package/templates/commands/cleanup.md +24 -87
- package/templates/commands/context.md +24 -93
- package/templates/commands/design.md +20 -98
- package/templates/commands/done.md +16 -181
- package/templates/commands/fix.md +27 -66
- package/templates/commands/git.md +33 -60
- package/templates/commands/help.md +18 -52
- package/templates/commands/idea.md +11 -36
- package/templates/commands/init.md +30 -277
- package/templates/commands/next.md +20 -62
- package/templates/commands/now.md +18 -22
- package/templates/commands/progress.md +23 -78
- package/templates/commands/recap.md +22 -74
- package/templates/commands/roadmap.md +21 -90
- package/templates/commands/ship.md +26 -161
- package/templates/commands/status.md +40 -0
- package/templates/commands/stuck.md +21 -33
- package/templates/commands/sync.md +19 -209
- package/templates/commands/task.md +18 -80
- package/templates/commands/test.md +23 -72
- package/templates/commands/workflow.md +20 -212
- package/templates/agents/pm.template.md +0 -84
|
@@ -1,105 +1,36 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read
|
|
3
|
-
description: "
|
|
2
|
+
allowed-tools: [Read]
|
|
3
|
+
description: "Project context and activity"
|
|
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:context
|
|
11
7
|
|
|
8
|
+
## Flow
|
|
9
|
+
1. Read: all layers (core, analysis, planning, progress, memory)
|
|
10
|
+
2. Aggregate: project overview + recent activity
|
|
11
|
+
3. Display: comprehensive context
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
# /p:context - Project Context
|
|
15
|
-
|
|
16
|
-
## Purpose
|
|
17
|
-
Display project context including type, current task, and recent activity.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
```
|
|
21
|
-
/p:context
|
|
13
|
+
## Response
|
|
22
14
|
```
|
|
15
|
+
🌍 PROJECT CONTEXT
|
|
16
|
+
━━━━━━━━━━━━━━━━━
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
3. Show current task and planning alignment
|
|
28
|
-
4. Display recent activity from memory layer
|
|
29
|
-
5. Provide cross-layer insights and suggestions
|
|
30
|
-
|
|
31
|
-
## Implementation
|
|
32
|
-
|
|
33
|
-
1. **Layer aggregation**:
|
|
34
|
-
- **Core Layer**: Current task from `.prjct/core/now.md`, queue from `.prjct/core/next.md`
|
|
35
|
-
- **Analysis Layer**: Project insights from `.prjct/analysis/repo-summary.md`
|
|
36
|
-
- **Planning Layer**: Roadmap status from `.prjct/planning/roadmap.md`
|
|
37
|
-
- **Progress Layer**: Recent metrics from `.prjct/progress/metrics.md`
|
|
38
|
-
- **Memory Layer**: Activity history from `.prjct/memory/context.jsonl`
|
|
39
|
-
|
|
40
|
-
2. **Enhanced context reading**:
|
|
41
|
-
- Project type and architecture from analysis layer
|
|
42
|
-
- Strategic alignment from planning layer
|
|
43
|
-
- Performance metrics from progress layer
|
|
44
|
-
- Decision history from memory layer
|
|
18
|
+
📦 PROJECT
|
|
19
|
+
Type: {type}
|
|
20
|
+
Stack: {stack}
|
|
45
21
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
━━━━━━━━━━━━━━━━━━━━━━━
|
|
22
|
+
🎯 CURRENT FOCUS
|
|
23
|
+
Task: {task}
|
|
24
|
+
Started: {time_ago}
|
|
50
25
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Framework: React 18, TypeScript
|
|
55
|
-
Architecture: [from analysis layer]
|
|
26
|
+
🔄 RECENT ACTIVITY
|
|
27
|
+
• {event}: {desc} ({time_ago})
|
|
28
|
+
• {event}: {desc} ({time_ago})
|
|
56
29
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Strategic alignment: High (roadmap priority #2)
|
|
30
|
+
💡 PLANNING
|
|
31
|
+
Queue: {N} tasks
|
|
32
|
+
Ideas: {M} captured
|
|
61
33
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Streak: 5 days shipping
|
|
65
|
-
Quality: 95% success rate
|
|
66
|
-
|
|
67
|
-
🔄 RECENT ACTIVITY (from memory layer):
|
|
68
|
-
• shipped: Authentication system (2h ago)
|
|
69
|
-
• done: API endpoints (3h ago)
|
|
70
|
-
• idea: Add real-time updates (4h ago)
|
|
71
|
-
• now: Building user dashboard (45m ago)
|
|
72
|
-
• decision: Chose Next.js over Nuxt (yesterday)
|
|
73
|
-
|
|
74
|
-
💡 PLANNING STATUS
|
|
75
|
-
Queue: 3 tasks pending
|
|
76
|
-
Ideas: 7 captured
|
|
77
|
-
Roadmap progress: 23% complete
|
|
78
|
-
|
|
79
|
-
🧠 KEY INSIGHTS
|
|
80
|
-
Recent decisions: 3 logged
|
|
81
|
-
Learning areas: Architecture patterns
|
|
82
|
-
Growth momentum: +15% complexity handling
|
|
83
|
-
|
|
84
|
-
📂 LAYER NAVIGATION:
|
|
85
|
-
- Core: .prjct/core/ (focus & priorities)
|
|
86
|
-
- Analysis: .prjct/analysis/ (technical insights)
|
|
87
|
-
- Planning: .prjct/planning/ (strategy & roadmap)
|
|
88
|
-
- Progress: .prjct/progress/ (metrics & shipped)
|
|
89
|
-
- Memory: .prjct/memory/ (decisions & history)
|
|
90
|
-
|
|
91
|
-
🎯 NEXT SUGGESTED ACTION:
|
|
92
|
-
Continue with current task or /p:done if complete
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
4. **Project insights**:
|
|
96
|
-
- Dependencies summary
|
|
97
|
-
- Test coverage if available
|
|
98
|
-
- Build status
|
|
99
|
-
- Last deploy info
|
|
34
|
+
/p:now | /p:status
|
|
35
|
+
```
|
|
100
36
|
|
|
101
|
-
5. **Smart suggestions**:
|
|
102
|
-
Based on context, suggest:
|
|
103
|
-
- "Long task - consider breaking down"
|
|
104
|
-
- "Good time to ship and take a break"
|
|
105
|
-
- "Review queue priorities"
|
|
@@ -1,113 +1,35 @@
|
|
|
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
|
-
|
|
12
|
-
```
|
|
13
|
-
/p:design [target] [--type architecture|api|component|database|flow] [--format diagram|spec|code|all]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Global Architecture
|
|
17
|
-
|
|
18
|
-
This command operates on global data stored in `~/.prjct-cli/projects/{project-id}/`.
|
|
19
|
-
|
|
20
|
-
### Steps
|
|
21
|
-
|
|
22
|
-
1. Parse design target and type (architecture, api, component, database, flow)
|
|
23
|
-
2. Generate appropriate ASCII diagrams and visual representations
|
|
24
|
-
3. Create technical specifications with technology stack and patterns
|
|
25
|
-
4. Generate implementation templates and interfaces
|
|
26
|
-
5. Save designs to `~/.prjct-cli/projects/{id}/designs/` directory
|
|
27
|
-
6. Display formatted design with overview, specs, and implementation guide
|
|
28
|
-
7. Link designs to tasks and track implementation progress
|
|
29
|
-
|
|
30
|
-
## Response Format
|
|
31
|
-
|
|
32
9
|
```
|
|
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]"
|
|
10
|
+
/p:design [target] [--type architecture|api|component|database|flow]
|
|
59
11
|
```
|
|
60
12
|
|
|
61
|
-
##
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
80
|
-
|
|
81
|
-
### Database
|
|
82
|
-
- Schema design
|
|
83
|
-
- Entity relationships
|
|
84
|
-
- Indexing strategy
|
|
85
|
-
- Migration plans
|
|
13
|
+
## Flow
|
|
14
|
+
1. Parse: target + type
|
|
15
|
+
2. Generate: ASCII diagrams
|
|
16
|
+
3. Create: specifications
|
|
17
|
+
4. Save: `designs/{target}-{type}.md`
|
|
86
18
|
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
19
|
+
## Types
|
|
20
|
+
- **architecture**: System design, components, data flow
|
|
21
|
+
- **api**: Endpoint specs, schemas, auth
|
|
22
|
+
- **component**: Interfaces, props, state
|
|
23
|
+
- **database**: Schema, relationships, indexes
|
|
24
|
+
- **flow**: User journeys, workflows
|
|
92
25
|
|
|
93
|
-
##
|
|
94
|
-
|
|
95
|
-
Design system architecture:
|
|
96
|
-
```
|
|
97
|
-
/p:design authentication --type architecture
|
|
26
|
+
## Response
|
|
98
27
|
```
|
|
28
|
+
🎨 Design complete!
|
|
99
29
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/p:design user-management --type api --format spec
|
|
103
|
-
```
|
|
30
|
+
📐 {target} - {type}
|
|
31
|
+
📄 Saved: designs/{target}-{type}.md
|
|
104
32
|
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
/p:design products --type database --format diagram
|
|
33
|
+
/p:now "Implement {target}"
|
|
108
34
|
```
|
|
109
35
|
|
|
110
|
-
Complete design with all formats:
|
|
111
|
-
```
|
|
112
|
-
/p:design payment-system --type architecture --format all
|
|
113
|
-
```
|
|
@@ -1,193 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write
|
|
2
|
+
allowed-tools: [Read, Write]
|
|
3
3
|
description: "Complete task, clear focus"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /p:done
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Validation
|
|
9
|
+
- Requires: `.prjct/prjct.config.json` exists
|
|
10
|
+
- Requires: `core/now.md` has content
|
|
11
|
+
- Else: "Not working on anything. Use /p:now or /p:next"
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
## Flow
|
|
14
|
+
1. Read: `core/now.md` → calculate duration
|
|
15
|
+
2. Clear: `core/now.md`
|
|
16
|
+
3. Update: `progress/metrics.md`, `core/context.md`
|
|
17
|
+
4. Log: `memory/context.jsonl`
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
## Response
|
|
15
20
|
```
|
|
16
|
-
|
|
21
|
+
✅ {task} ({duration})
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
•
|
|
20
|
-
•
|
|
21
|
-
•
|
|
22
|
-
|
|
23
|
-
Let's ship something!
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Validation happens automatically through CLAUDE.md instructions - Claude checks context before executing!**
|
|
27
|
-
|
|
28
|
-
## Usage
|
|
29
|
-
```
|
|
30
|
-
/p:done
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Execution
|
|
34
|
-
|
|
35
|
-
**Only runs if context validation passes ✅**
|
|
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).
|
|
23
|
+
Next?
|
|
24
|
+
• "start {task}" → work
|
|
25
|
+
• "ship {feature}" → celebrate
|
|
26
|
+
• /p:now | /p:ship
|
|
104
27
|
```
|
|
105
28
|
|
|
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
|
|
@@ -1,87 +1,48 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read,
|
|
3
|
-
description: "Quick troubleshooting and
|
|
2
|
+
allowed-tools: [Read, Bash, Edit]
|
|
3
|
+
description: "Quick troubleshooting 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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# /p:fix - Quick Fix & Troubleshooting
|
|
15
|
-
|
|
16
|
-
## Purpose
|
|
17
|
-
Instantly diagnose and fix common issues. Get unstuck in seconds, not minutes.
|
|
6
|
+
# /p:fix
|
|
18
7
|
|
|
19
8
|
## Usage
|
|
20
9
|
```
|
|
21
|
-
/p:fix
|
|
10
|
+
/p:fix # Diagnose current issue
|
|
11
|
+
/p:fix [error] # Fix specific error
|
|
22
12
|
```
|
|
23
13
|
|
|
24
|
-
##
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
29
|
-
5.
|
|
14
|
+
## Flow
|
|
15
|
+
1. Read: `core/now.md` → get context
|
|
16
|
+
2. Parse: error message OR diagnose current state
|
|
17
|
+
3. Detect: common patterns (deps, config, syntax, tests)
|
|
18
|
+
4. Apply: automatic fix OR suggest solution
|
|
19
|
+
5. Verify: test fix works
|
|
20
|
+
6. Log: `memory/context.jsonl`
|
|
30
21
|
|
|
31
22
|
## Common Fixes
|
|
23
|
+
- **Dependencies**: `npm install` missing packages
|
|
24
|
+
- **Config**: Fix malformed JSON/YAML
|
|
25
|
+
- **Syntax**: ESLint/Prettier auto-fix
|
|
26
|
+
- **Tests**: Update snapshots, fix imports
|
|
27
|
+
- **Git**: Resolve merge conflicts
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
- Missing semicolons, brackets, quotes
|
|
35
|
-
- Import statements for undefined variables
|
|
36
|
-
- Package.json dependencies
|
|
37
|
-
- Simple type errors
|
|
38
|
-
- Linting issues
|
|
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
|
|
29
|
+
## Response (auto-fixed)
|
|
55
30
|
```
|
|
31
|
+
✅ Fixed: {error_type}
|
|
56
32
|
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
🔧 Fixed automatically!
|
|
33
|
+
{fix_details}
|
|
60
34
|
|
|
61
|
-
|
|
62
|
-
Solution: Added import from 'react'
|
|
63
|
-
File: components/UserForm.tsx:1
|
|
64
|
-
|
|
65
|
-
✅ Error resolved - continue working!
|
|
35
|
+
Verify: {command_to_test}
|
|
66
36
|
```
|
|
67
37
|
|
|
68
|
-
|
|
38
|
+
## Response (manual)
|
|
69
39
|
```
|
|
70
|
-
🔍
|
|
71
|
-
|
|
72
|
-
📍 Location: services/auth.js:45
|
|
73
|
-
🐛 Cause: user might be null
|
|
40
|
+
🔍 Diagnosed: {issue}
|
|
74
41
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
42
|
+
Suggested fixes:
|
|
43
|
+
1. {fix_option_1}
|
|
44
|
+
2. {fix_option_2}
|
|
79
45
|
|
|
80
|
-
|
|
46
|
+
/p:done after fixing
|
|
81
47
|
```
|
|
82
48
|
|
|
83
|
-
## Smart Features
|
|
84
|
-
- Learns from previous fixes
|
|
85
|
-
- Suggests preventive measures
|
|
86
|
-
- Links to relevant documentation
|
|
87
|
-
- Tracks fix patterns in memory
|