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,181 +1,148 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write,
|
|
3
|
-
description:
|
|
2
|
+
allowed-tools: [Read, Write, Bash]
|
|
3
|
+
description: 'Ship feature with complete automated workflow'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /p:ship
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
|
+
|
|
9
10
|
```
|
|
10
|
-
/p:ship
|
|
11
|
+
/p:ship # Current task
|
|
12
|
+
/p:ship "<feature>" # Named feature
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
1. Add to `~/.prjct-cli/projects/{id}/progress/shipped.md`:
|
|
16
|
-
```markdown
|
|
17
|
-
## Week [W], [YEAR]
|
|
18
|
-
- ✅ [feature] ([timestamp])
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
2. **Trigger Scribe Agent** (Documentation):
|
|
22
|
-
- Get git changes for the feature: `git diff --name-only`
|
|
23
|
-
- Invoke Scribe agent to document the shipped feature
|
|
24
|
-
- Show documentation draft to user
|
|
25
|
-
- **Request confirmation** before saving
|
|
26
|
-
- Save to `analysis/feature-docs/[feature-id].md` if confirmed
|
|
27
|
-
|
|
28
|
-
3. Update `progress/metrics.md` (count, velocity, streak)
|
|
29
|
-
4. Update `core/context.md`
|
|
30
|
-
5. Log to `memory/context.jsonl`:
|
|
31
|
-
```json
|
|
32
|
-
{"action":"ship","feature":"[desc]","timestamp":"[ISO]","week":"[w]","layer":"progress","total":[n],"documented":true}
|
|
33
|
-
```
|
|
15
|
+
## Complete Workflow (Automated)
|
|
34
16
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
1. ✅ **Lint checks** → Run project linters
|
|
18
|
+
2. ✅ **Run tests** → Execute test suite (does NOT block if fail)
|
|
19
|
+
3. ✅ **Update docs** → Update relevant documentation
|
|
20
|
+
4. ✅ **Update version** → Bump version (patch/minor based on changes)
|
|
21
|
+
5. ✅ **Update CHANGELOG** → Add entry with changes
|
|
22
|
+
6. ✅ **Git commit** → Create commit with metadata
|
|
23
|
+
7. ✅ **Git push** → Push to remote
|
|
24
|
+
8. ✅ **Recommend compact** → Suggest conversation compacting
|
|
38
25
|
|
|
39
|
-
|
|
40
|
-
Velocity: [X] features/day
|
|
26
|
+
## Workflow Steps Detail
|
|
41
27
|
|
|
42
|
-
|
|
43
|
-
• "start next task" → Keep building
|
|
44
|
-
• "see my progress" → View stats
|
|
45
|
-
• "plan ahead" → Strategic thinking
|
|
28
|
+
### Step 1: Lint Checks
|
|
46
29
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
When a feature is shipped, the Scribe agent is automatically invoked to document changes:
|
|
30
|
+
```bash
|
|
31
|
+
npm run lint || yarn lint || pnpm lint
|
|
32
|
+
# If fails: Show errors but continue
|
|
33
|
+
```
|
|
53
34
|
|
|
54
|
-
### Step
|
|
55
|
-
```javascript
|
|
56
|
-
const gitIntegration = require('../core/git-integration')
|
|
35
|
+
### Step 2: Run Tests
|
|
57
36
|
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npm test || yarn test || pnpm test
|
|
39
|
+
# If fails: Show results but DO NOT block (no infinite loop)
|
|
40
|
+
# User decides if acceptable to ship
|
|
60
41
|
```
|
|
61
42
|
|
|
62
|
-
### Step
|
|
63
|
-
Invoke Scribe agent with prompt:
|
|
64
|
-
```
|
|
65
|
-
Document the following shipped feature:
|
|
43
|
+
### Step 3: Update Docs
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
${changes.files.join('\n')}
|
|
45
|
+
- Update README if needed
|
|
46
|
+
- Update API docs if endpoints changed
|
|
47
|
+
- Update component docs if UI changed
|
|
71
48
|
|
|
72
|
-
|
|
73
|
-
1. Feature overview and user impact
|
|
74
|
-
2. Technical implementation summary
|
|
75
|
-
3. Key files and components affected
|
|
76
|
-
4. Breaking changes or migration notes (if any)
|
|
77
|
-
5. Usage examples
|
|
49
|
+
### Step 4: Update Version
|
|
78
50
|
|
|
79
|
-
|
|
51
|
+
```json
|
|
52
|
+
// package.json
|
|
53
|
+
"version": "X.Y.Z" → "X.Y.(Z+1)" // patch for fixes
|
|
54
|
+
"version": "X.Y.Z" → "X.(Y+1).0" // minor for features
|
|
80
55
|
```
|
|
81
56
|
|
|
82
|
-
### Step
|
|
83
|
-
```
|
|
84
|
-
📝 Scribe Agent Feature Documentation
|
|
57
|
+
### Step 5: Update CHANGELOG
|
|
85
58
|
|
|
86
|
-
|
|
59
|
+
```markdown
|
|
60
|
+
## [X.Y.Z] - YYYY-MM-DD
|
|
87
61
|
|
|
88
|
-
|
|
89
|
-
**Impact**: [user-facing impact]
|
|
62
|
+
### Added / Changed / Fixed
|
|
90
63
|
|
|
91
|
-
|
|
92
|
-
|
|
64
|
+
- {feature_description}
|
|
65
|
+
- Agent: {agent}
|
|
66
|
+
- Time: {actual_time}
|
|
67
|
+
```
|
|
93
68
|
|
|
94
|
-
|
|
95
|
-
- [Implementation highlights]
|
|
96
|
-
- [Key components]
|
|
69
|
+
### Step 6-7: Git Commit + Push
|
|
97
70
|
|
|
98
|
-
|
|
99
|
-
[Examples if applicable]
|
|
71
|
+
Auto-commit with metadata and push
|
|
100
72
|
|
|
101
|
-
|
|
73
|
+
### Step 8: Log to Session
|
|
102
74
|
|
|
103
|
-
|
|
75
|
+
Append to `progress/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`:
|
|
104
76
|
|
|
105
|
-
|
|
77
|
+
```jsonl
|
|
78
|
+
{"ts":"2025-10-04T18:00:00Z","type":"feature_ship","name":"{feature}","tasks_done":{N},"duration":"{Xh}","agent":"{agent}","version":"{X.Y.Z}"}
|
|
106
79
|
```
|
|
107
80
|
|
|
108
|
-
### Step
|
|
109
|
-
```javascript
|
|
110
|
-
if (userConfirms) {
|
|
111
|
-
const docPath = `~/.prjct-cli/projects/{id}/analysis/feature-docs/${featureId}.md`
|
|
112
|
-
await saveDocumentation(docPath, documentation)
|
|
113
|
-
console.log('✅ Feature documentation saved!')
|
|
114
|
-
} else {
|
|
115
|
-
console.log('ℹ️ Documentation discarded')
|
|
116
|
-
}
|
|
117
|
-
```
|
|
81
|
+
### Step 9: Update Index
|
|
118
82
|
|
|
119
|
-
|
|
83
|
+
Prepend to `progress/shipped.md` (keep only last 30 days):
|
|
120
84
|
|
|
85
|
+
```markdown
|
|
86
|
+
## 2025-10-04
|
|
87
|
+
- ✅ {feature_name} ({Xh}, {N} tasks, v{X.Y.Z})
|
|
121
88
|
```
|
|
122
|
-
/p:ship "authentication system"
|
|
123
89
|
|
|
124
|
-
|
|
90
|
+
If shipped.md has entries > 30 days old, archive to `progress/archive/shipped-{YYYY-MM}.md`
|
|
125
91
|
|
|
126
|
-
|
|
92
|
+
### Step 10: Update Roadmap
|
|
127
93
|
|
|
128
|
-
|
|
94
|
+
Mark feature as complete in `planning/roadmap.md`:
|
|
129
95
|
|
|
130
|
-
|
|
96
|
+
```markdown
|
|
97
|
+
## Completed
|
|
98
|
+
- [x] {feature_name} - Shipped 2025-10-04
|
|
99
|
+
```
|
|
131
100
|
|
|
132
|
-
|
|
133
|
-
**Impact**: Users can now securely log in and manage sessions
|
|
101
|
+
### Step 11: Recommend Compact
|
|
134
102
|
|
|
135
|
-
|
|
136
|
-
Implemented JWT-based authentication with login, registration, and password reset. Added middleware for protected routes and session management with automatic token refresh.
|
|
103
|
+
Suggest compacting conversation after ship
|
|
137
104
|
|
|
138
|
-
|
|
139
|
-
- JWT authentication with bcrypt password hashing
|
|
140
|
-
- Login/register/reset endpoints in auth.controller.ts
|
|
141
|
-
- JWT middleware for route protection
|
|
142
|
-
- Redis-based session management with 7-day expiry
|
|
143
|
-
- Email verification workflow
|
|
105
|
+
## Commit Message Format
|
|
144
106
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
- src/features/auth/auth.controller.ts (new)
|
|
148
|
-
- src/middleware/jwt.middleware.ts (new)
|
|
149
|
-
- src/config/redis.config.ts (modified)
|
|
107
|
+
```
|
|
108
|
+
feat: {feature_name}
|
|
150
109
|
|
|
151
|
-
|
|
110
|
+
Agent: {agent}
|
|
111
|
+
Dev: @{github_dev}
|
|
112
|
+
Complexity: {complexity}
|
|
113
|
+
Time: {actual_time}
|
|
152
114
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// Protected route example
|
|
156
|
-
app.get('/api/profile', jwtMiddleware, profileController.get)
|
|
115
|
+
🤖 Generated with [p/](https://www.prjct.app/)
|
|
116
|
+
Designed for [Claude](https://www.anthropic.com/claude)
|
|
157
117
|
```
|
|
158
118
|
|
|
159
|
-
|
|
119
|
+
**IMPORTANT**: This footer format MUST be used in ALL commits made by prjct.
|
|
120
|
+
|
|
121
|
+
## Response
|
|
160
122
|
|
|
161
|
-
|
|
123
|
+
```
|
|
124
|
+
🚀 {feature} shipped!
|
|
162
125
|
|
|
163
|
-
|
|
126
|
+
Workflow completed:
|
|
127
|
+
✅ Lint checks: {pass/fail_continued}
|
|
128
|
+
✅ Tests: {pass/fail_continued}
|
|
129
|
+
✅ Docs: updated
|
|
130
|
+
✅ Version: {old} → {new}
|
|
131
|
+
✅ CHANGELOG: updated
|
|
132
|
+
✅ Git: committed + pushed
|
|
164
133
|
|
|
165
|
-
|
|
166
|
-
Velocity: 2.1 features/day
|
|
134
|
+
{agent_icon} {agent} • {actual_time}
|
|
167
135
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
• "see my progress" → View stats
|
|
136
|
+
💡 Recommendation: Compact conversation now
|
|
137
|
+
(Keeps context clean for next feature)
|
|
171
138
|
|
|
172
|
-
|
|
139
|
+
/p:feature | /p:done
|
|
173
140
|
```
|
|
174
141
|
|
|
175
|
-
## Notes
|
|
142
|
+
## Important Notes
|
|
176
143
|
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
144
|
+
- **Tests/Lint failures DO NOT block shipping**
|
|
145
|
+
- User sees results and decides
|
|
146
|
+
- Prevents infinite loop of "fix → test → fail → fix"
|
|
147
|
+
- ALWAYS updates version and CHANGELOG
|
|
148
|
+
- ALWAYS commits and pushes if workflow completes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read]
|
|
3
|
+
description: 'KPI dashboard with ASCII graphics'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /p:status
|
|
7
|
+
|
|
8
|
+
## Flow
|
|
9
|
+
|
|
10
|
+
1. Read: all core files + progress files
|
|
11
|
+
2. Calculate: metrics (sprint %, tasks complete, days since ship, etc.)
|
|
12
|
+
3. Render: `ASCIIGraphics.createDashboard(data)`
|
|
13
|
+
|
|
14
|
+
## Data Structure
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
{
|
|
18
|
+
sprintProgress: (complete / total) * 100,
|
|
19
|
+
tasksComplete: count,
|
|
20
|
+
tasksTotal: count,
|
|
21
|
+
ideasCount: count,
|
|
22
|
+
daysSinceShip: days,
|
|
23
|
+
currentTask: string,
|
|
24
|
+
taskTime: 'Xh Ym ago'
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Output (Catppuccin Mocha)
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─ Project Status ────────────────┐
|
|
32
|
+
│ Sprint Progress [████░] 80% │
|
|
33
|
+
│ Tasks Complete 12/15 │
|
|
34
|
+
│ Ideas Backlog 8 │
|
|
35
|
+
│ Days Since Ship 3 │
|
|
36
|
+
├─ Current Focus ─────────────────┤
|
|
37
|
+
│ → {current_task} │
|
|
38
|
+
│ Started: {time_ago} │
|
|
39
|
+
└─────────────────────────────────┘
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Colors**: Mauve borders, Teal progress, Sapphire highlights, Green/Yellow/Red for status
|
|
@@ -1,220 +1,34 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write, Bash,
|
|
3
|
-
description:
|
|
2
|
+
allowed-tools: [Read, Write, Bash, TodoWrite]
|
|
3
|
+
description: 'Sync project state and generate dynamic agents'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /p:sync
|
|
6
|
+
# /p:sync
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
Re-analyze the project and update all AI agents with current project state, stack changes, and new requirements.
|
|
8
|
+
## Flow
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- Agents updated in: `~/.claude/agents/`
|
|
10
|
+
1. Run: `/p:analyze` → get current state
|
|
11
|
+
2. **Read**: `analysis/repo-summary.md`
|
|
12
|
+
3. **Generate**: Dynamic agents for each technology
|
|
13
|
+
4. Log: changes to `memory/context.jsonl`
|
|
16
14
|
|
|
17
|
-
##
|
|
18
|
-
```
|
|
19
|
-
/p:sync
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## When to Run
|
|
23
|
-
- After major dependency changes
|
|
24
|
-
- When adding new frameworks or tools
|
|
25
|
-
- After significant architecture changes
|
|
26
|
-
- When project type changes (e.g., adding mobile support)
|
|
27
|
-
- Periodically to keep agents up-to-date
|
|
28
|
-
|
|
29
|
-
## Execution Flow
|
|
30
|
-
|
|
31
|
-
### 1. Re-run Project Analysis
|
|
32
|
-
|
|
33
|
-
Execute `/p:analyze` to get current project state:
|
|
34
|
-
```javascript
|
|
35
|
-
// This will:
|
|
36
|
-
// 1. Scan all files and directories
|
|
37
|
-
// 2. Detect current stack and frameworks
|
|
38
|
-
// 3. Check git status
|
|
39
|
-
// 4. Compare with previous analysis
|
|
40
|
-
// 5. Identify what changed
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### 2. Detect Changes
|
|
44
|
-
|
|
45
|
-
Compare new analysis with previous:
|
|
46
|
-
```javascript
|
|
47
|
-
const previousAnalysis = await readFile('.prjct/analysis/repo-summary.md')
|
|
48
|
-
const currentAnalysis = await runAnalyze()
|
|
49
|
-
|
|
50
|
-
const changes = {
|
|
51
|
-
newDependencies: [],
|
|
52
|
-
removedDependencies: [],
|
|
53
|
-
newFrameworks: [],
|
|
54
|
-
stackChanges: [],
|
|
55
|
-
structureChanges: []
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Detect what changed
|
|
59
|
-
if (currentAnalysis.frameworks !== previousAnalysis.frameworks) {
|
|
60
|
-
changes.newFrameworks = difference(current, previous)
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### 3. Update Existing Agents
|
|
65
|
-
|
|
66
|
-
Regenerate all current agents with new context:
|
|
67
|
-
```javascript
|
|
68
|
-
const agentGenerator = require('../core/agent-generator')
|
|
15
|
+
## Agent Generation
|
|
69
16
|
|
|
70
|
-
|
|
71
|
-
const updated = await agentGenerator.updateExistingAgents(currentAnalysis)
|
|
17
|
+
**See `templates/agents/AGENTS.md` for complete reference** with examples and guidelines.
|
|
72
18
|
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### 4. Add New Agents
|
|
77
|
-
|
|
78
|
-
Generate any newly required agents:
|
|
79
|
-
```javascript
|
|
80
|
-
// Detect newly required agents
|
|
81
|
-
const existingAgents = await listAgentFiles()
|
|
82
|
-
const requiredAgents = detectRequiredAgents(currentAnalysis)
|
|
83
|
-
const newAgents = requiredAgents.filter(a => !existingAgents.includes(a))
|
|
84
|
-
|
|
85
|
-
if (newAgents.length > 0) {
|
|
86
|
-
for (const agentType of newAgents) {
|
|
87
|
-
await agentGenerator.generateAgent(agentType, currentAnalysis)
|
|
88
|
-
console.log(`✅ Added ${agentType} agent`)
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### 5. Remove Obsolete Agents (Optional)
|
|
94
|
-
|
|
95
|
-
Ask user if agents should be removed:
|
|
96
|
-
```javascript
|
|
97
|
-
const obsoleteAgents = existingAgents.filter(a => !requiredAgents.includes(a))
|
|
19
|
+
Use `generator.generateDynamicAgent(name, config)` for each specialist.
|
|
98
20
|
|
|
99
|
-
|
|
100
|
-
console.log(`\n⚠️ The following agents may no longer be needed:`)
|
|
101
|
-
obsoleteAgents.forEach(a => console.log(` - ${a}`))
|
|
21
|
+
## Response
|
|
102
22
|
|
|
103
|
-
const shouldRemove = await confirmWithUser('\nRemove these agents? (y/n): ')
|
|
104
|
-
|
|
105
|
-
if (shouldRemove) {
|
|
106
|
-
await agentGenerator.cleanupObsoleteAgents(requiredAgents)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
23
|
```
|
|
24
|
+
🔄 Sync complete!
|
|
110
25
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
# Backup previous analysis
|
|
116
|
-
cp .prjct/analysis/repo-summary.md .prjct/analysis/repo-summary.backup.md
|
|
117
|
-
|
|
118
|
-
# Save new analysis
|
|
119
|
-
# (already saved by /p:analyze)
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### 7. Update Memory Log
|
|
123
|
-
|
|
124
|
-
Log sync action:
|
|
125
|
-
```jsonl
|
|
126
|
-
{"timestamp":"2025-10-02T14:30:00Z","action":"sync","author":"Name","changes":{"addedAgents":["mobile"],"updatedAgents":["fe","be"],"removedAgents":[],"stackChanges":["added react-native"]}}
|
|
127
|
-
```
|
|
26
|
+
🤖 Agents Generated:
|
|
27
|
+
• {agent_name_1} - {role}
|
|
28
|
+
• {agent_name_2} - {role}
|
|
128
29
|
|
|
129
|
-
|
|
30
|
+
📋 Based on: analysis/repo-summary.md
|
|
31
|
+
💡 See templates/agents/AGENTS.md for generation reference
|
|
130
32
|
|
|
131
|
-
|
|
33
|
+
/p:context
|
|
132
34
|
```
|
|
133
|
-
🔄 Syncing project state...
|
|
134
|
-
|
|
135
|
-
📊 Analysis Complete
|
|
136
|
-
No significant changes detected
|
|
137
|
-
|
|
138
|
-
🤖 Agents Status
|
|
139
|
-
✓ All 7 agents are up-to-date
|
|
140
|
-
|
|
141
|
-
✅ Sync complete! Everything is current.
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### With Changes
|
|
145
|
-
```
|
|
146
|
-
🔄 Syncing project state...
|
|
147
|
-
|
|
148
|
-
📊 Changes Detected
|
|
149
|
-
✅ New dependency: @tanstack/react-query
|
|
150
|
-
✅ New framework: Expo (React Native)
|
|
151
|
-
ℹ️ Architecture: Still feature-based
|
|
152
|
-
|
|
153
|
-
🤖 Agent Updates
|
|
154
|
-
↻ FE agent - Added React Query patterns
|
|
155
|
-
↻ BE agent - Updated API integration context
|
|
156
|
-
✅ Mobile agent - ADDED (React Native detected)
|
|
157
|
-
✓ Other agents - No changes needed
|
|
158
|
-
|
|
159
|
-
⚠️ Obsolete Agents
|
|
160
|
-
- devops (Docker removed from project)
|
|
161
|
-
|
|
162
|
-
Remove obsolete agents? (y/n): _
|
|
163
|
-
|
|
164
|
-
✅ Sync complete!
|
|
165
|
-
- 2 agents updated
|
|
166
|
-
- 1 agent added
|
|
167
|
-
- 1 agent removed
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Stack Migration
|
|
171
|
-
```
|
|
172
|
-
🔄 Syncing project state...
|
|
173
|
-
|
|
174
|
-
📊 Major Changes Detected
|
|
175
|
-
⚠️ Framework changed: Vue → React
|
|
176
|
-
⚠️ Build tool changed: Webpack → Vite
|
|
177
|
-
✅ New: TypeScript added
|
|
178
|
-
|
|
179
|
-
🤖 Full Agent Regeneration
|
|
180
|
-
↻ PM - Updated with React patterns
|
|
181
|
-
↻ UX - Updated component guidelines
|
|
182
|
-
↻ FE - COMPLETELY REGENERATED for React + TS
|
|
183
|
-
↻ BE - Updated API patterns
|
|
184
|
-
↻ QA - Updated test framework context
|
|
185
|
-
↻ Scribe - Updated documentation style
|
|
186
|
-
|
|
187
|
-
✅ Sync complete! All agents updated for new stack.
|
|
188
|
-
|
|
189
|
-
💡 Tip: Review agent descriptions to see new capabilities.
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Error Handling
|
|
193
|
-
|
|
194
|
-
- **No .prjct/**: Error - Project not initialized, run `/p:init` first
|
|
195
|
-
- **No analysis file**: Warning - Running first-time analysis
|
|
196
|
-
- **Agent generation fails**: Warn but continue with others
|
|
197
|
-
- **Permission issues**: Suggest checking `~/.claude/agents/` permissions
|
|
198
|
-
|
|
199
|
-
## Notes
|
|
200
|
-
|
|
201
|
-
- Sync is safe to run anytime
|
|
202
|
-
- Existing agents are updated, not deleted (unless confirmed)
|
|
203
|
-
- Git status is refreshed during sync
|
|
204
|
-
- Analysis diff helps track project evolution
|
|
205
|
-
- Agents get project-specific context from analysis
|
|
206
|
-
|
|
207
|
-
## Related Commands
|
|
208
|
-
|
|
209
|
-
- `/p:analyze` - Just analyze without updating agents
|
|
210
|
-
- `/p:init` - Initialize project (first-time setup)
|
|
211
|
-
- `/p:context` - View current project context
|
|
212
|
-
|
|
213
|
-
## Implementation Notes
|
|
214
|
-
|
|
215
|
-
The sync command should:
|
|
216
|
-
1. Be idempotent (safe to run multiple times)
|
|
217
|
-
2. Preserve manual agent customizations (warn if detected)
|
|
218
|
-
3. Create backups before major changes
|
|
219
|
-
4. Provide clear diff of what changed
|
|
220
|
-
5. Allow granular control (which agents to update)
|
|
@@ -1,97 +1,37 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write,
|
|
3
|
-
description:
|
|
2
|
+
allowed-tools: [Read, Write, TodoWrite]
|
|
3
|
+
description: 'Break down complex tasks'
|
|
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:task - Complex Task Execution
|
|
15
|
-
|
|
16
|
-
## Purpose
|
|
17
|
-
Handle complex features by breaking them down, executing systematically, and tracking progress. No overwhelm.
|
|
6
|
+
# /p:task
|
|
18
7
|
|
|
19
8
|
## Usage
|
|
9
|
+
|
|
20
10
|
```
|
|
21
11
|
/p:task <description>
|
|
22
12
|
```
|
|
23
13
|
|
|
24
|
-
##
|
|
25
|
-
1. Analyze task complexity
|
|
26
|
-
2. Break into 3-7 subtasks automatically
|
|
27
|
-
3. Create execution plan in `.prjct/planning/tasks/`
|
|
28
|
-
4. Execute each subtask with validation
|
|
29
|
-
5. Track progress and update metrics
|
|
14
|
+
## Flow
|
|
30
15
|
|
|
31
|
-
|
|
16
|
+
1. Analyze: task complexity
|
|
17
|
+
2. Break down: into 3-7 subtasks
|
|
18
|
+
3. Create: execution plan
|
|
19
|
+
4. Execute: each subtask with validation
|
|
20
|
+
5. Track: progress in `planning/tasks/`
|
|
32
21
|
|
|
33
|
-
|
|
34
|
-
- Identify main components needed
|
|
35
|
-
- Order by dependencies
|
|
36
|
-
- Estimate time for each
|
|
37
|
-
- Create actionable subtasks
|
|
22
|
+
## Response
|
|
38
23
|
|
|
39
|
-
**Example breakdown**:
|
|
40
24
|
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
📋 Task Plan Created:
|
|
44
|
-
|
|
45
|
-
1. Database schema (15 min)
|
|
46
|
-
- User table with email/password
|
|
47
|
-
- Sessions table
|
|
48
|
-
|
|
49
|
-
2. Auth middleware (30 min)
|
|
50
|
-
- JWT token generation
|
|
51
|
-
- Route protection
|
|
52
|
-
|
|
53
|
-
3. API endpoints (45 min)
|
|
54
|
-
- POST /auth/signup
|
|
55
|
-
- POST /auth/login
|
|
56
|
-
- POST /auth/logout
|
|
25
|
+
📋 Task Plan: {description}
|
|
57
26
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
27
|
+
Breakdown:
|
|
28
|
+
1. {subtask} (~{time})
|
|
29
|
+
2. {subtask} (~{time})
|
|
30
|
+
3. {subtask} (~{time})
|
|
61
31
|
|
|
62
|
-
|
|
63
|
-
- Auth flow tests
|
|
64
|
-
- Security tests
|
|
32
|
+
Est total: {total_time}
|
|
65
33
|
|
|
66
34
|
🚀 Starting execution...
|
|
67
|
-
[1/
|
|
68
|
-
[2/
|
|
35
|
+
[1/{N}] {subtask}... ✅
|
|
36
|
+
[2/{N}] {subtask}... 🔄
|
|
69
37
|
```
|
|
70
|
-
|
|
71
|
-
**Progress tracking**:
|
|
72
|
-
- Real-time status updates
|
|
73
|
-
- Save progress between sessions
|
|
74
|
-
- Resume interrupted tasks
|
|
75
|
-
- Log to `.prjct/memory/context.jsonl`
|
|
76
|
-
|
|
77
|
-
**Response format**:
|
|
78
|
-
```
|
|
79
|
-
✅ Task completed: User authentication
|
|
80
|
-
|
|
81
|
-
📊 Execution Summary:
|
|
82
|
-
• Time: 2h 15min (estimated 2h 20min)
|
|
83
|
-
• Subtasks: 5/5 completed
|
|
84
|
-
• Tests: All passing
|
|
85
|
-
• Files: 12 created/modified
|
|
86
|
-
|
|
87
|
-
📝 Logged to: .prjct/planning/tasks/auth_system.md
|
|
88
|
-
|
|
89
|
-
💡 Next: /p:ship "user authentication"
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Features
|
|
93
|
-
- Automatic task decomposition
|
|
94
|
-
- Progress persistence
|
|
95
|
-
- Time tracking
|
|
96
|
-
- Dependency management
|
|
97
|
-
- Smart validation gates
|