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
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read, Bash]
|
|
3
|
+
description: 'Analyze codebase and generate comprehensive summary'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /p:analyze
|
|
7
|
+
|
|
8
|
+
## Instructions for Claude
|
|
9
|
+
|
|
10
|
+
You are analyzing a codebase to generate a comprehensive summary. **NO predetermined patterns** - analyze based on what you actually find.
|
|
11
|
+
|
|
12
|
+
## Your Task
|
|
13
|
+
|
|
14
|
+
1. **Read project files** using the analyzer helpers:
|
|
15
|
+
- package.json, Cargo.toml, go.mod, requirements.txt, etc.
|
|
16
|
+
- Directory structure
|
|
17
|
+
- Git history and stats
|
|
18
|
+
- Key source files
|
|
19
|
+
|
|
20
|
+
2. **Understand the stack** - DON'T use predetermined lists:
|
|
21
|
+
- What language(s) are used?
|
|
22
|
+
- What frameworks are used?
|
|
23
|
+
- What tools and libraries are important?
|
|
24
|
+
- What's the architecture?
|
|
25
|
+
|
|
26
|
+
3. **Identify features** - based on actual code, not assumptions:
|
|
27
|
+
- What has been built?
|
|
28
|
+
- What's the current state?
|
|
29
|
+
- What patterns do you see?
|
|
30
|
+
|
|
31
|
+
4. **Generate agents** - create specialists for THIS project:
|
|
32
|
+
- Read the stack you identified
|
|
33
|
+
- Create agents for each major technology
|
|
34
|
+
- Use descriptive names (e.g., 'express-backend', 'react-frontend', 'postgres-db')
|
|
35
|
+
- Include specific versions and tools found
|
|
36
|
+
|
|
37
|
+
## Guidelines
|
|
38
|
+
|
|
39
|
+
- **No assumptions** - only report what you find
|
|
40
|
+
- **No predefined maps** - don't assume express = "REST API server"
|
|
41
|
+
- **Read and understand** - look at actual code structure
|
|
42
|
+
- **Any stack works** - Elixir, Rust, Go, Python, Ruby, whatever exists
|
|
43
|
+
- **Be specific** - include versions, specific tools, actual patterns
|
|
44
|
+
|
|
45
|
+
## Output Format
|
|
46
|
+
|
|
47
|
+
Generate `analysis/repo-summary.md` with:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
# Project Analysis
|
|
51
|
+
|
|
52
|
+
## Stack
|
|
53
|
+
|
|
54
|
+
[What you found - languages, frameworks, tools with versions]
|
|
55
|
+
|
|
56
|
+
## Architecture
|
|
57
|
+
|
|
58
|
+
[How it's organized - based on actual structure]
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
[What has been built - based on code and git history]
|
|
63
|
+
|
|
64
|
+
## Statistics
|
|
65
|
+
|
|
66
|
+
- Total files: [count]
|
|
67
|
+
- Contributors: [count]
|
|
68
|
+
- Age: [age]
|
|
69
|
+
- Last activity: [date]
|
|
70
|
+
|
|
71
|
+
## Recommendations
|
|
72
|
+
|
|
73
|
+
[What agents to generate, what's next, etc.]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## After Analysis
|
|
77
|
+
|
|
78
|
+
1. Save summary to `analysis/repo-summary.md`
|
|
79
|
+
2. Generate agents using `generator.generateDynamicAgent()`
|
|
80
|
+
3. Report what was found
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
**Remember**: You decide EVERYTHING based on analysis. No if/else, no predetermined patterns.
|
|
@@ -1,259 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Grep, Glob, Bash, TodoWrite]
|
|
3
|
-
description:
|
|
3
|
+
description: 'Analyze repository and generate summary'
|
|
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:analyze
|
|
11
7
|
|
|
12
|
-
##
|
|
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.
|
|
8
|
+
## Flow
|
|
14
9
|
|
|
10
|
+
1. Scan: project structure (Glob)
|
|
11
|
+
2. Detect: technologies (package.json, requirements.txt, etc.)
|
|
12
|
+
3. Analyze: architecture patterns
|
|
13
|
+
4. Git: status and stats
|
|
14
|
+
5. Generate: comprehensive report
|
|
15
|
+
6. Save: `analysis/repo-summary.md`
|
|
15
16
|
|
|
17
|
+
## Report Format
|
|
16
18
|
|
|
17
|
-
|
|
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]
|
|
19
|
+
```markdown
|
|
20
|
+
# Repository Analysis
|
|
88
21
|
|
|
89
|
-
|
|
90
|
-
- [Suggestions for improvements]
|
|
91
|
-
- [Best practices to consider]
|
|
22
|
+
## Overview
|
|
92
23
|
|
|
93
|
-
|
|
94
|
-
|
|
24
|
+
- Type: {type}
|
|
25
|
+
- Language: {lang}
|
|
26
|
+
- Framework: {framework}
|
|
95
27
|
|
|
96
|
-
|
|
97
|
-
Write the complete analysis to `.prjct/analysis/repo-summary.md`
|
|
28
|
+
## Git Status
|
|
98
29
|
|
|
99
|
-
|
|
100
|
-
|
|
30
|
+
- Last commit: {hash} "{msg}" ({time_ago})
|
|
31
|
+
- Status: {clean/has_changes}
|
|
101
32
|
|
|
102
|
-
##
|
|
33
|
+
## Stack
|
|
103
34
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
35
|
+
- Languages: {list}
|
|
36
|
+
- Frameworks: {list}
|
|
37
|
+
- Dependencies: {count}
|
|
107
38
|
|
|
108
|
-
|
|
109
|
-
# .prjct/analysis/repo-summary.md
|
|
39
|
+
## Architecture
|
|
110
40
|
|
|
111
|
-
|
|
112
|
-
|
|
41
|
+
- Pattern: {pattern}
|
|
42
|
+
- Entry points: {files}
|
|
113
43
|
|
|
114
|
-
|
|
115
|
-
**Language**: JavaScript (Node.js)
|
|
116
|
-
**Structure**: 45 files across 8 directories
|
|
117
|
-
**Dependencies**: 12 packages detected
|
|
44
|
+
## Recommended Agents
|
|
118
45
|
|
|
119
|
-
|
|
46
|
+
Base (6): PM, UX, FE, BE, QA, Scribe
|
|
47
|
+
Additional: {conditional_agents}
|
|
120
48
|
|
|
121
|
-
|
|
122
|
-
- `/p:roadmap` - Plan development roadmap
|
|
123
|
-
- `/p:now "implement feature X"` - Set current focus
|
|
49
|
+
Generated: {timestamp}
|
|
124
50
|
```
|
|
125
51
|
|
|
126
|
-
##
|
|
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
|
|
52
|
+
## Response
|
|
147
53
|
|
|
148
|
-
|
|
149
|
-
|
|
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
|
|
192
|
-
|
|
193
|
-
```markdown
|
|
194
|
-
# Repository Analysis Report
|
|
195
|
-
|
|
196
|
-
**Generated**: [timestamp]
|
|
197
|
-
**Project**: [name]
|
|
198
|
-
|
|
199
|
-
## Project Overview
|
|
200
|
-
- **Type**: [Web app, CLI tool, Library, etc.]
|
|
201
|
-
- **Primary Language**: [JavaScript, Python, Go, etc.]
|
|
202
|
-
- **Framework**: [React, Express, FastAPI, etc.]
|
|
203
|
-
|
|
204
|
-
## 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]
|
|
211
|
-
|
|
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
|
|
226
|
-
|
|
227
|
-
## Architecture
|
|
228
|
-
- **Pattern**: [MVC, Feature-based, Microservices, etc.]
|
|
229
|
-
- **Structure**: [description of directory organization]
|
|
230
|
-
- **Entry Points**: [main files]
|
|
231
|
-
- **Key Directories**: [list]
|
|
232
|
-
|
|
233
|
-
## Recommended Agents
|
|
234
|
-
✅ **Base Agents** (6): PM, UX, FE, BE, QA, Scribe
|
|
235
|
-
✅ **Additional Agents**: [List conditional agents with reason]
|
|
54
|
+
```
|
|
55
|
+
🔍 Analysis complete!
|
|
236
56
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
- DevOps (Docker + GitHub Actions found)
|
|
57
|
+
Project: {name} ({type})
|
|
58
|
+
Stack: {stack}
|
|
240
59
|
|
|
241
|
-
|
|
242
|
-
- **Total Files**: [count]
|
|
243
|
-
- **Code Files**: [count]
|
|
244
|
-
- **Test Files**: [count]
|
|
245
|
-
- **Config Files**: [count]
|
|
60
|
+
📄 Full report: analysis/repo-summary.md
|
|
246
61
|
|
|
247
|
-
|
|
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
|
|
62
|
+
/p:roadmap | /p:now
|
|
251
63
|
```
|
|
252
|
-
|
|
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,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read, Write]
|
|
3
|
+
description: 'Report and track bugs with auto-prioritization'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /p:bug
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
/p:bug "<description>"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What It Does
|
|
15
|
+
|
|
16
|
+
1. **Severity detection**: Analyzes bug description for severity indicators
|
|
17
|
+
2. **Priority placement**: Adds to `core/next.md` based on severity
|
|
18
|
+
3. **Memory tracking**: Logs bug report to `memory/context.jsonl`
|
|
19
|
+
4. **Quick resolution**: Suggests immediate actions
|
|
20
|
+
|
|
21
|
+
## Severity Detection
|
|
22
|
+
|
|
23
|
+
Auto-detects severity from keywords:
|
|
24
|
+
|
|
25
|
+
- **Critical**: crash, down, broken, not working, production, urgent
|
|
26
|
+
- **High**: error, fail, issue, problem, major
|
|
27
|
+
- **Medium**: bug, incorrect, wrong, should
|
|
28
|
+
- **Low**: minor, small, cosmetic, typo
|
|
29
|
+
|
|
30
|
+
## Flow
|
|
31
|
+
|
|
32
|
+
1. Detect severity from description
|
|
33
|
+
2. Read `core/next.md`
|
|
34
|
+
3. Format bug entry: `🐛 [SEVERITY] description`
|
|
35
|
+
4. Insert at top if critical/high, bottom if medium/low
|
|
36
|
+
5. Write to `core/next.md`
|
|
37
|
+
6. Log to `memory/context.jsonl`
|
|
38
|
+
|
|
39
|
+
## Response Format
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
🐛 Bug reported: {severity}
|
|
43
|
+
|
|
44
|
+
{description}
|
|
45
|
+
|
|
46
|
+
Priority: {critical/high/medium/low}
|
|
47
|
+
Added to: core/next.md (position {top/bottom})
|
|
48
|
+
|
|
49
|
+
Quick actions:
|
|
50
|
+
• "start fixing" → /p:now "{description}"
|
|
51
|
+
• "show queue" → /p:next
|
|
52
|
+
|
|
53
|
+
/p:now | /p:next
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Example
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
User: p. bug "login button crashes on mobile"
|
|
60
|
+
|
|
61
|
+
Claude detects:
|
|
62
|
+
- Keywords: "crashes" → CRITICAL severity
|
|
63
|
+
- Action: Add to top of next.md
|
|
64
|
+
- Format: 🐛 [CRITICAL] login button crashes on mobile
|
|
65
|
+
|
|
66
|
+
Response:
|
|
67
|
+
🐛 Bug reported: CRITICAL
|
|
68
|
+
|
|
69
|
+
login button crashes on mobile
|
|
70
|
+
|
|
71
|
+
Priority: critical
|
|
72
|
+
Added to: core/next.md (top priority)
|
|
73
|
+
|
|
74
|
+
Quick actions:
|
|
75
|
+
• "start fixing" → /p:now "login button crashes on mobile"
|
|
76
|
+
• "show queue" → /p:next
|
|
77
|
+
|
|
78
|
+
/p:now | /p:next
|
|
79
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read, Write]
|
|
3
|
+
description: 'Start task with agent assignment'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /p:build
|
|
7
|
+
|
|
8
|
+
## Validation
|
|
9
|
+
|
|
10
|
+
- Blocks if: `core/now.md` has active task
|
|
11
|
+
- Error: "Complete current task first. Use /p:done"
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
|
|
15
|
+
1. Parse: task desc OR queue # (1-5)
|
|
16
|
+
2. Detect: `TaskSchema.detectAgent(task)` + complexity
|
|
17
|
+
3. Get: GitHub dev from `git config user.name` + remote
|
|
18
|
+
4. Create: task metadata with agent, complexity, estimate
|
|
19
|
+
5. Write: `core/now.md` with frontmatter
|
|
20
|
+
|
|
21
|
+
## Frontmatter
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
---
|
|
25
|
+
id: task-{timestamp}
|
|
26
|
+
agent: {detected_agent}
|
|
27
|
+
dev: @{github_username}
|
|
28
|
+
complexity: {trivial|simple|moderate|complex|epic}
|
|
29
|
+
estimated: {time_range}
|
|
30
|
+
started: {iso_timestamp}
|
|
31
|
+
---
|
|
32
|
+
{task_description}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Response
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
🎯 {task}
|
|
39
|
+
{agent_icon} {agent_name}
|
|
40
|
+
Est: {time_estimate}
|
|
41
|
+
Complexity: {level}
|
|
42
|
+
|
|
43
|
+
/p:done when finished
|
|
44
|
+
```
|
|
@@ -1,102 +1,42 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
description:
|
|
2
|
+
allowed-tools: [Read, Edit, Bash]
|
|
3
|
+
description: 'Code cleanup and optimization'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /p:cleanup
|
|
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
9
|
|
|
12
10
|
```
|
|
13
|
-
/p:cleanup [
|
|
11
|
+
/p:cleanup [--type code|imports|files|deps|all] [--dry-run]
|
|
14
12
|
```
|
|
15
13
|
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
This command operates on global data stored in `~/.prjct-cli/projects/{project-id}/`.
|
|
19
|
-
|
|
20
|
-
### Steps
|
|
21
|
-
|
|
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
|
|
38
|
-
|
|
39
|
-
```
|
|
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}
|
|
49
|
-
|
|
50
|
-
📦 Imports Optimized:
|
|
51
|
-
• Unused imports: {count} removed
|
|
52
|
-
• Files organized: {count}
|
|
53
|
-
|
|
54
|
-
📁 Files Cleaned:
|
|
55
|
-
• Temp files: {count} removed
|
|
56
|
-
• Empty files: {count} removed
|
|
57
|
-
• Space freed: {size} MB
|
|
14
|
+
## Flow
|
|
58
15
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
16
|
+
1. Parse: type + mode
|
|
17
|
+
2. Backup: create if needed
|
|
18
|
+
3. Execute: cleanup by type
|
|
19
|
+
4. Validate: syntax check
|
|
20
|
+
5. Log: `memory/cleanup-log.jsonl`
|
|
62
21
|
|
|
63
|
-
|
|
64
|
-
• Memory entries: {count} (older than 30 days)
|
|
22
|
+
## Types
|
|
65
23
|
|
|
66
|
-
|
|
67
|
-
|
|
24
|
+
- **code**: Remove console.logs, commented code, dead code
|
|
25
|
+
- **imports**: Remove unused, organize imports
|
|
26
|
+
- **files**: Remove temp files, empty files
|
|
27
|
+
- **deps**: Analyze unused dependencies
|
|
28
|
+
- **all**: All cleanup types
|
|
68
29
|
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
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
|
|
30
|
+
## Response
|
|
79
31
|
|
|
80
|
-
## Examples
|
|
81
|
-
|
|
82
|
-
Basic cleanup:
|
|
83
|
-
```
|
|
84
|
-
/p:cleanup
|
|
85
32
|
```
|
|
33
|
+
🧹 Cleanup complete!
|
|
86
34
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
```
|
|
35
|
+
📊 Results:
|
|
36
|
+
• Console.logs: {N} removed
|
|
37
|
+
• Dead code: {N} blocks
|
|
38
|
+
• Unused imports: {N}
|
|
39
|
+
• Space freed: {X} MB
|
|
93
40
|
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
/p:cleanup --dry-run
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Aggressive cleanup with backup:
|
|
100
|
-
```
|
|
101
|
-
/p:cleanup --aggressive --type all
|
|
41
|
+
/p:test | /p:ship
|
|
102
42
|
```
|