prjct-cli 0.5.0 → 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.
Files changed (45) hide show
  1. package/CHANGELOG.md +169 -1
  2. package/CLAUDE.md +43 -28
  3. package/README.md +4 -4
  4. package/bin/prjct +78 -63
  5. package/core/agent-generator.js +19 -10
  6. package/core/ascii-graphics.js +433 -0
  7. package/core/command-registry.js +553 -0
  8. package/core/commands.js +274 -62
  9. package/core/task-schema.js +342 -0
  10. package/package.json +4 -3
  11. package/templates/agents/AGENTS.md +79 -101
  12. package/templates/agents/be.template.md +14 -29
  13. package/templates/agents/coordinator.template.md +34 -0
  14. package/templates/agents/data.template.md +14 -28
  15. package/templates/agents/devops.template.md +14 -28
  16. package/templates/agents/fe.template.md +14 -29
  17. package/templates/agents/mobile.template.md +14 -28
  18. package/templates/agents/qa.template.md +14 -41
  19. package/templates/agents/scribe.template.md +15 -81
  20. package/templates/agents/security.template.md +14 -28
  21. package/templates/agents/ux.template.md +14 -36
  22. package/templates/commands/analyze.md +36 -239
  23. package/templates/commands/build.md +41 -0
  24. package/templates/commands/cleanup.md +24 -87
  25. package/templates/commands/context.md +24 -93
  26. package/templates/commands/design.md +20 -98
  27. package/templates/commands/done.md +16 -181
  28. package/templates/commands/fix.md +27 -66
  29. package/templates/commands/git.md +33 -60
  30. package/templates/commands/help.md +18 -52
  31. package/templates/commands/idea.md +11 -36
  32. package/templates/commands/init.md +30 -277
  33. package/templates/commands/next.md +20 -62
  34. package/templates/commands/now.md +18 -22
  35. package/templates/commands/progress.md +23 -78
  36. package/templates/commands/recap.md +22 -74
  37. package/templates/commands/roadmap.md +21 -90
  38. package/templates/commands/ship.md +26 -161
  39. package/templates/commands/status.md +40 -0
  40. package/templates/commands/stuck.md +21 -33
  41. package/templates/commands/sync.md +19 -209
  42. package/templates/commands/task.md +18 -80
  43. package/templates/commands/test.md +23 -72
  44. package/templates/commands/workflow.md +20 -212
  45. package/templates/agents/pm.template.md +0 -84
@@ -1,259 +1,56 @@
1
1
  ---
2
2
  allowed-tools: [Read, Grep, Glob, Bash, TodoWrite]
3
- description: "Analyze current repository and generate comprehensive project summary"
3
+ description: "Analyze repository and generate summary"
4
4
  ---
5
5
 
6
- ## Global Architecture
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:analyze
11
7
 
12
- ## Agent Workflow
13
- This command activates the AI agent workflow for comprehensive project analysis. When you run `/p:analyze`, you as the AI agent should follow the complete workflow instructions below to provide deep analysis of the codebase.
14
-
15
-
16
-
17
- # /p:analyze - Repository Analysis
18
-
19
- ## Purpose
20
- Automatically analyze the current codebase and generate a comprehensive summary of the repository including technologies, architecture, and project structure.
21
-
22
- ## Usage
23
- ```
24
- /p:analyze
25
- ```
26
-
27
- ## Execution
28
- 1. **Scan project structure** - Analyze directories and file types
29
- 2. **Identify technologies** - Detect frameworks, languages, tools
30
- 3. **Analyze architecture** - Understand project organization and patterns
31
- 4. **Git integration** - Validate repository state against claims
32
- 5. **Detect required agents** - Determine which specialists are needed
33
- 6. **Generate summary** - Create detailed analysis report
34
- 7. **Save to analysis** - Store results in `.prjct/analysis/repo-summary.md`
35
-
36
- ## Implementation
37
-
38
- When this command is triggered:
39
-
40
- 1. **Create analysis directory**:
41
- ```bash
42
- mkdir -p .prjct/analysis
43
- ```
44
-
45
- 2. **Scan project structure**:
46
- - Use Glob to find all files and directories
47
- - Identify main directories (src, lib, components, etc.)
48
- - Count files by type (.js, .ts, .py, .go, etc.)
49
-
50
- 3. **Technology detection**:
51
- - Check package.json for JavaScript/Node.js projects
52
- - Check requirements.txt, Pipfile for Python projects
53
- - Check go.mod for Go projects
54
- - Check Cargo.toml for Rust projects
55
- - Detect frameworks (React, Vue, Angular, Express, FastAPI, etc.)
56
-
57
- 4. **Architecture analysis**:
58
- - Identify entry points (main.js, app.py, main.go)
59
- - Analyze import/require patterns
60
- - Detect architectural patterns (MVC, microservices, monolith)
61
- - Identify configuration files
62
-
63
- 5. **Generate comprehensive report**:
64
- ```markdown
65
- # Repository Analysis Report
66
-
67
- ## Project Overview
68
- - **Name**: [Detected from package.json or directory name]
69
- - **Type**: [Web app, Library, CLI tool, etc.]
70
- - **Primary Language**: [JavaScript, Python, Go, etc.]
71
- - **Framework**: [React, Express, FastAPI, etc.]
72
-
73
- ## Structure Analysis
74
- - **Total Files**: [count]
75
- - **Main Directories**: [list]
76
- - **Entry Points**: [main files]
77
-
78
- ## Technologies Detected
79
- - **Languages**: [list with percentages]
80
- - **Frameworks**: [list]
81
- - **Tools**: [build tools, testing, etc.]
82
- - **Dependencies**: [key dependencies]
83
-
84
- ## Architecture
85
- - **Pattern**: [MVC, Component-based, etc.]
86
- - **File Organization**: [description]
87
- - **Key Components**: [main modules/components]
88
-
89
- ## Recommendations
90
- - [Suggestions for improvements]
91
- - [Best practices to consider]
92
-
93
- **Generated**: [timestamp]
94
- ```
95
-
96
- 6. **Save analysis**:
97
- Write the complete analysis to `.prjct/analysis/repo-summary.md`
98
-
99
- 7. **Provide summary**:
100
- Display key findings and next suggested actions
101
-
102
- ## Example Workflow
103
-
104
- ```bash
105
- # Run analysis
106
- /p:analyze
107
-
108
- # Results saved to:
109
- # .prjct/analysis/repo-summary.md
110
-
111
- # Example output:
112
- 🔍 **Repository Analysis Complete**
113
-
114
- **Project**: prjct-cli (CLI Tool)
115
- **Language**: JavaScript (Node.js)
116
- **Structure**: 45 files across 8 directories
117
- **Dependencies**: 12 packages detected
118
-
119
- 📄 **Full report**: `.prjct/analysis/repo-summary.md`
120
-
121
- **Next steps**:
122
- - `/p:roadmap` - Plan development roadmap
123
- - `/p:now "implement feature X"` - Set current focus
124
- ```
125
-
126
- ## Git Integration
127
-
128
- When analyzing the repository, also integrate git information:
129
-
130
- 1. **Check if git repository**:
131
- ```javascript
132
- const gitIntegration = require('../core/git-integration')
133
- const isGit = await gitIntegration.isGitRepo()
134
- ```
135
-
136
- 2. **Get git statistics**:
137
- ```javascript
138
- const gitStats = await gitIntegration.getGitStats()
139
- ```
140
-
141
- 3. **Include in analysis report**:
142
- - Last commit information
143
- - Working directory status
144
- - Total commits
145
- - Contributors
146
- - Branch information
147
-
148
- 4. **Validation baseline**:
149
- - Last commit = source of truth
150
- - Working directory changes = unverified work
151
- - Use for validating user claims later
152
-
153
- ## Agent Detection
154
-
155
- Based on the project analysis, determine which AI agents should be generated:
156
-
157
- ### Base Agents (Always)
158
- - **PM**: Project Manager - Always needed
159
- - **UX**: UX Designer - Always needed
160
- - **FE**: Frontend Engineer - Always needed
161
- - **BE**: Backend Engineer - Always needed
162
- - **QA**: QA Engineer - Always needed
163
- - **Scribe**: Documentation - Always needed
164
-
165
- ### Conditional Agents
166
-
167
- **Security Agent** - Generate if:
168
- - Project type is 'web' or 'webapp'
169
- - Authentication detected (JWT, OAuth, sessions)
170
- - Has API endpoints
171
- - Security-sensitive data handling
172
-
173
- **DevOps Agent** - Generate if:
174
- - Dockerfile or docker-compose.yml found
175
- - Kubernetes configs found (k8s/, *.yaml with apiVersion)
176
- - CI/CD configs (`.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`)
177
- - Deployment scripts detected
178
-
179
- **Mobile Agent** - Generate if:
180
- - React Native detected (`react-native` in package.json)
181
- - Flutter detected (`pubspec.yaml`)
182
- - Expo detected (`expo` in package.json)
183
- - Ionic detected (`@ionic` in package.json)
184
-
185
- **Data Science Agent** - Generate if:
186
- - ML libraries (`tensorflow`, `pytorch`, `scikit-learn`)
187
- - Data libraries (`pandas`, `numpy`)
188
- - Jupyter notebooks (`.ipynb` files)
189
- - Data pipeline files
190
-
191
- ## Updated Analysis Report Format
8
+ ## Flow
9
+ 1. Scan: project structure (Glob)
10
+ 2. Detect: technologies (package.json, requirements.txt, etc.)
11
+ 3. Analyze: architecture patterns
12
+ 4. Git: status and stats
13
+ 5. Generate: comprehensive report
14
+ 6. Save: `analysis/repo-summary.md`
192
15
 
16
+ ## Report Format
193
17
  ```markdown
194
- # Repository Analysis Report
195
-
196
- **Generated**: [timestamp]
197
- **Project**: [name]
18
+ # Repository Analysis
198
19
 
199
- ## Project Overview
200
- - **Type**: [Web app, CLI tool, Library, etc.]
201
- - **Primary Language**: [JavaScript, Python, Go, etc.]
202
- - **Framework**: [React, Express, FastAPI, etc.]
20
+ ## Overview
21
+ - Type: {type}
22
+ - Language: {lang}
23
+ - Framework: {framework}
203
24
 
204
25
  ## Git Status
205
- - **Repository**: [Yes/No]
206
- - **Last Commit**: [hash] "[message]" ([time ago])
207
- - **Author**: [name]
208
- - **Total Commits**: [count]
209
- - **Contributors**: [list]
210
- - **Current Branch**: [branch name]
26
+ - Last commit: {hash} "{msg}" ({time_ago})
27
+ - Status: {clean/has_changes}
211
28
 
212
- ## Working Directory
213
- - **Status**: [Clean / Has changes]
214
- - **Modified Files**: [count]
215
- - **New Files**: [count]
216
- - **Deleted Files**: [count]
217
-
218
- ⚠️ **Validation Note**: Last commit is the source of truth. Use this to validate user claims about completed work.
219
-
220
- ## Stack Detection
221
- - **Languages**: [list with file counts]
222
- - **Frameworks**: [list]
223
- - **Build Tools**: [Vite, Webpack, etc.]
224
- - **Package Manager**: [npm, yarn, pnpm, pip, etc.]
225
- - **Dependencies**: [count] packages
29
+ ## Stack
30
+ - Languages: {list}
31
+ - Frameworks: {list}
32
+ - Dependencies: {count}
226
33
 
227
34
  ## Architecture
228
- - **Pattern**: [MVC, Feature-based, Microservices, etc.]
229
- - **Structure**: [description of directory organization]
230
- - **Entry Points**: [main files]
231
- - **Key Directories**: [list]
35
+ - Pattern: {pattern}
36
+ - Entry points: {files}
232
37
 
233
38
  ## Recommended Agents
234
- ✅ **Base Agents** (6): PM, UX, FE, BE, QA, Scribe
235
- ✅ **Additional Agents**: [List conditional agents with reason]
39
+ Base (6): PM, UX, FE, BE, QA, Scribe
40
+ Additional: {conditional_agents}
41
+
42
+ Generated: {timestamp}
43
+ ```
44
+
45
+ ## Response
46
+ ```
47
+ 🔍 Analysis complete!
236
48
 
237
- Example:
238
- - Security (web app with authentication detected)
239
- - DevOps (Docker + GitHub Actions found)
49
+ Project: {name} ({type})
50
+ Stack: {stack}
240
51
 
241
- ## Analysis Details
242
- - **Total Files**: [count]
243
- - **Code Files**: [count]
244
- - **Test Files**: [count]
245
- - **Config Files**: [count]
52
+ 📄 Full report: analysis/repo-summary.md
246
53
 
247
- ## Next Steps
248
- 1. Run `/p:init` to generate agents based on this analysis
249
- 2. Use `/p:now "task"` to start working
250
- 3. Use `/p:sync` to update agents when stack changes
54
+ /p:roadmap | /p:now
251
55
  ```
252
56
 
253
- ## Error Handling
254
- - Handle projects without clear package managers
255
- - Gracefully handle large repositories (>1000 files)
256
- - Provide meaningful analysis even for minimal projects
257
- - Skip binary files and common ignore patterns
258
- - Handle non-git repositories (skip git section)
259
- - Handle repositories without commits (note in report)
@@ -0,0 +1,41 @@
1
+ ---
2
+ allowed-tools: [Read, Write]
3
+ description: "Start task with agent assignment"
4
+ ---
5
+
6
+ # /p:build
7
+
8
+ ## Validation
9
+ - Blocks if: `core/now.md` has active task
10
+ - Error: "Complete current task first. Use /p:done"
11
+
12
+ ## Flow
13
+ 1. Parse: task desc OR queue # (1-5)
14
+ 2. Detect: `TaskSchema.detectAgent(task)` + complexity
15
+ 3. Get: GitHub dev from `git config user.name` + remote
16
+ 4. Create: task metadata with agent, complexity, estimate
17
+ 5. Write: `core/now.md` with frontmatter
18
+
19
+ ## Frontmatter
20
+ ```yaml
21
+ ---
22
+ id: task-{timestamp}
23
+ agent: {detected_agent}
24
+ dev: @{github_username}
25
+ complexity: {trivial|simple|moderate|complex|epic}
26
+ estimated: {time_range}
27
+ started: {iso_timestamp}
28
+ ---
29
+ {task_description}
30
+ ```
31
+
32
+ ## Response
33
+ ```
34
+ 🎯 {task}
35
+ {agent_icon} {agent_name}
36
+ Est: {time_estimate}
37
+ Complexity: {level}
38
+
39
+ /p:done when finished
40
+ ```
41
+
@@ -1,102 +1,39 @@
1
1
  ---
2
- name: p:cleanup
3
- description: Advanced code cleanup and optimization with backup capabilities
2
+ allowed-tools: [Read, Edit, Bash]
3
+ description: "Code cleanup and optimization"
4
4
  ---
5
5
 
6
- # /p:cleanup - Advanced Code Cleanup and Optimization
7
-
8
- Remove dead code, optimize imports, clean project structure, analyze unused dependencies, and clean up temporary files. Comprehensive cleanup with backup capabilities.
6
+ # /p:cleanup
9
7
 
10
8
  ## Usage
11
-
12
9
  ```
13
- /p:cleanup [target] [--type code|imports|files|deps|memory|all] [--safe|--aggressive] [--dry-run]
10
+ /p:cleanup [--type code|imports|files|deps|all] [--dry-run]
14
11
  ```
15
12
 
16
- ## Global Architecture
17
-
18
- This command operates on global data stored in `~/.prjct-cli/projects/{project-id}/`.
19
-
20
- ### Steps
13
+ ## Flow
14
+ 1. Parse: type + mode
15
+ 2. Backup: create if needed
16
+ 3. Execute: cleanup by type
17
+ 4. Validate: syntax check
18
+ 5. Log: `memory/cleanup-log.jsonl`
21
19
 
22
- 1. Read `.prjct/prjct.config.json` for project ID and author
23
- 2. Parse cleanup arguments (target, type, mode)
24
- 3. Create backup to `~/.prjct-cli/projects/{id}/backups/{timestamp}/` before aggressive cleanup
25
- 4. Execute cleanup by type:
26
- - **code**: Remove console.logs, commented code, dead code
27
- - **imports**: Remove unused imports, organize imports
28
- - **files**: Remove temp files, empty files, backups
29
- - **deps**: Analyze and remove unused npm dependencies
30
- - **memory**: Archive old memory entries (>30 days) to `~/.prjct-cli/projects/{id}/memory/archive/`
31
- - **all**: All cleanup types
32
- 5. Validate syntax after changes (JavaScript/TypeScript)
33
- 6. Log all changes to `~/.prjct-cli/projects/{id}/memory/cleanup-log.jsonl`
34
- 7. Log action with author to context.jsonl
35
- 8. Display cleanup results with metrics
36
-
37
- ## Response Format
20
+ ## Types
21
+ - **code**: Remove console.logs, commented code, dead code
22
+ - **imports**: Remove unused, organize imports
23
+ - **files**: Remove temp files, empty files
24
+ - **deps**: Analyze unused dependencies
25
+ - **all**: All cleanup types
38
26
 
27
+ ## Response
39
28
  ```
40
- 🧹 Cleanup Complete! ✨ 🧹
41
-
42
- 📊 Cleanup Results:
43
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
44
-
45
- 🗑️ Dead Code Removed:
46
- • Console.logs: {count} statements
47
- • Commented code: {count} blocks
48
- • Unused functions: {count}
29
+ 🧹 Cleanup complete!
49
30
 
50
- 📦 Imports Optimized:
51
- Unused imports: {count} removed
52
- Files organized: {count}
31
+ 📊 Results:
32
+ Console.logs: {N} removed
33
+ Dead code: {N} blocks
34
+ • Unused imports: {N}
35
+ • Space freed: {X} MB
53
36
 
54
- 📁 Files Cleaned:
55
- • Temp files: {count} removed
56
- • Empty files: {count} removed
57
- • Space freed: {size} MB
58
-
59
- 📚 Dependencies:
60
- • Unused packages: {count} removed
61
- • Size reduced: {size} MB
62
-
63
- 📦 Archived:
64
- • Memory entries: {count} (older than 30 days)
65
-
66
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
- ✨ Your project is clean and optimized!
68
-
69
- 💡 Tip: Run with --dry-run first to preview changes
37
+ /p:test | /p:ship
70
38
  ```
71
39
 
72
- ## Safety Measures
73
-
74
- - Create backup before aggressive cleanup
75
- - Log all changes to cleanup-log.jsonl
76
- - Validate syntax after modifications
77
- - Skip files with uncommitted git changes
78
- - Provide --dry-run option to preview
79
-
80
- ## Examples
81
-
82
- Basic cleanup:
83
- ```
84
- /p:cleanup
85
- ```
86
-
87
- Cleanup specific type:
88
- ```
89
- /p:cleanup --type code
90
- /p:cleanup --type imports
91
- /p:cleanup --type deps
92
- ```
93
-
94
- Preview changes:
95
- ```
96
- /p:cleanup --dry-run
97
- ```
98
-
99
- Aggressive cleanup with backup:
100
- ```
101
- /p:cleanup --aggressive --type all
102
- ```
@@ -1,105 +1,36 @@
1
1
  ---
2
- allowed-tools: [Read, Glob, Bash]
3
- description: "Show project context and recent activity"
2
+ allowed-tools: [Read]
3
+ description: "Project context and activity"
4
4
  ---
5
5
 
6
- ## Global Architecture
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
- ## Execution
25
- 1. Aggregate context from all project layers
26
- 2. Reference analysis for technical context
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
- 3. **Comprehensive response format**:
47
- ```
48
- 🌍 PROJECT CONTEXT
49
- ━━━━━━━━━━━━━━━━━━━━━━━
22
+ 🎯 CURRENT FOCUS
23
+ Task: {task}
24
+ Started: {time_ago}
50
25
 
51
- 📦 PROJECT OVERVIEW
52
- Type: Next.js Application
53
- Location: /Users/dev/projects/app
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
- 🎯 CURRENT FOCUS
58
- Task: Building user dashboard
59
- Started: 45 minutes ago
60
- Strategic alignment: High (roadmap priority #2)
30
+ 💡 PLANNING
31
+ Queue: {N} tasks
32
+ Ideas: {M} captured
61
33
 
62
- 📈 RECENT PROGRESS
63
- Velocity: 1.4 features/day
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"