prjct-cli 0.4.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 +312 -0
- package/CLAUDE.md +300 -0
- package/LICENSE +21 -0
- package/README.md +424 -0
- package/bin/prjct +214 -0
- package/core/agent-detector.js +249 -0
- package/core/agents/claude-agent.js +250 -0
- package/core/agents/codex-agent.js +256 -0
- package/core/agents/terminal-agent.js +465 -0
- package/core/analyzer.js +596 -0
- package/core/animations-simple.js +240 -0
- package/core/animations.js +277 -0
- package/core/author-detector.js +218 -0
- package/core/capability-installer.js +190 -0
- package/core/command-installer.js +775 -0
- package/core/commands.js +2050 -0
- package/core/config-manager.js +335 -0
- package/core/migrator.js +784 -0
- package/core/path-manager.js +324 -0
- package/core/project-capabilities.js +144 -0
- package/core/session-manager.js +439 -0
- package/core/version.js +107 -0
- package/core/workflow-engine.js +213 -0
- package/core/workflow-prompts.js +192 -0
- package/core/workflow-rules.js +147 -0
- package/package.json +80 -0
- package/scripts/install.sh +433 -0
- package/scripts/verify-installation.sh +158 -0
- package/templates/agents/AGENTS.md +164 -0
- package/templates/commands/analyze.md +125 -0
- package/templates/commands/cleanup.md +102 -0
- package/templates/commands/context.md +105 -0
- package/templates/commands/design.md +113 -0
- package/templates/commands/done.md +44 -0
- package/templates/commands/fix.md +87 -0
- package/templates/commands/git.md +79 -0
- package/templates/commands/help.md +72 -0
- package/templates/commands/idea.md +50 -0
- package/templates/commands/init.md +237 -0
- package/templates/commands/next.md +74 -0
- package/templates/commands/now.md +35 -0
- package/templates/commands/progress.md +92 -0
- package/templates/commands/recap.md +86 -0
- package/templates/commands/roadmap.md +107 -0
- package/templates/commands/ship.md +41 -0
- package/templates/commands/stuck.md +48 -0
- package/templates/commands/task.md +97 -0
- package/templates/commands/test.md +94 -0
- package/templates/commands/workflow.md +224 -0
- package/templates/examples/natural-language-examples.md +320 -0
- package/templates/mcp-config.json +8 -0
- package/templates/workflows/analyze.md +159 -0
- package/templates/workflows/cleanup.md +73 -0
- package/templates/workflows/context.md +72 -0
- package/templates/workflows/design.md +88 -0
- package/templates/workflows/done.md +20 -0
- package/templates/workflows/fix.md +201 -0
- package/templates/workflows/git.md +192 -0
- package/templates/workflows/help.md +13 -0
- package/templates/workflows/idea.md +22 -0
- package/templates/workflows/init.md +80 -0
- package/templates/workflows/natural-language-handler.md +183 -0
- package/templates/workflows/next.md +44 -0
- package/templates/workflows/now.md +19 -0
- package/templates/workflows/progress.md +113 -0
- package/templates/workflows/recap.md +66 -0
- package/templates/workflows/roadmap.md +95 -0
- package/templates/workflows/ship.md +18 -0
- package/templates/workflows/stuck.md +25 -0
- package/templates/workflows/task.md +109 -0
- package/templates/workflows/test.md +243 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct cleanup
|
|
3
|
+
invocable_name: p:cleanup
|
|
4
|
+
description: Advanced code cleanup and optimization with backup capabilities
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Read project config from `.prjct/prjct.config.json`
|
|
10
|
+
2. Extract `projectId` and `author` from config
|
|
11
|
+
3. Parse cleanup arguments (target, type, mode)
|
|
12
|
+
4. Create backup to `~/.prjct-cli/projects/{id}/backups/{timestamp}/` before aggressive cleanup
|
|
13
|
+
5. Execute cleanup by type:
|
|
14
|
+
- **code**: Remove console.logs, commented code, dead code
|
|
15
|
+
- **imports**: Remove unused imports, organize imports
|
|
16
|
+
- **files**: Remove temp files, empty files, backups
|
|
17
|
+
- **deps**: Analyze and remove unused npm dependencies
|
|
18
|
+
- **memory**: Archive old memory entries (>30 days) to `~/.prjct-cli/projects/{id}/memory/archive/`
|
|
19
|
+
- **all**: All cleanup types
|
|
20
|
+
6. Validate syntax after changes (JavaScript/TypeScript)
|
|
21
|
+
7. Log all changes to `~/.prjct-cli/projects/{id}/memory/cleanup-log.jsonl`
|
|
22
|
+
8. Log action with author to context.jsonl
|
|
23
|
+
9. Display cleanup results with metrics
|
|
24
|
+
|
|
25
|
+
# Response Format
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
๐งน โจ Cleanup Complete! โจ ๐งน
|
|
29
|
+
|
|
30
|
+
๐ Cleanup Results:
|
|
31
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
32
|
+
|
|
33
|
+
๐๏ธ Dead Code Removed:
|
|
34
|
+
โข Console.logs: {count} statements
|
|
35
|
+
โข Commented code: {count} blocks
|
|
36
|
+
โข Unused functions: {count}
|
|
37
|
+
|
|
38
|
+
๐ฆ Imports Optimized:
|
|
39
|
+
โข Unused imports: {count} removed
|
|
40
|
+
โข Files organized: {count}
|
|
41
|
+
|
|
42
|
+
๐ Files Cleaned:
|
|
43
|
+
โข Temp files: {count} removed
|
|
44
|
+
โข Empty files: {count} removed
|
|
45
|
+
โข Space freed: {size} MB
|
|
46
|
+
|
|
47
|
+
๐ Dependencies:
|
|
48
|
+
โข Unused packages: {count} removed
|
|
49
|
+
โข Size reduced: {size} MB
|
|
50
|
+
|
|
51
|
+
๐ฆ Archived:
|
|
52
|
+
โข Memory entries: {count} (older than 30 days)
|
|
53
|
+
|
|
54
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
55
|
+
โจ Your project is clean and optimized!
|
|
56
|
+
|
|
57
|
+
๐ก Tip: Run with --dry-run first to preview changes
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
# Safety Measures
|
|
61
|
+
|
|
62
|
+
- Create backup before aggressive cleanup
|
|
63
|
+
- Log all changes to cleanup-log.jsonl
|
|
64
|
+
- Validate syntax after modifications
|
|
65
|
+
- Skip files with uncommitted git changes
|
|
66
|
+
- Provide --dry-run option to preview
|
|
67
|
+
|
|
68
|
+
# Global Architecture Notes
|
|
69
|
+
|
|
70
|
+
- **Data Location**: `~/.prjct-cli/projects/{id}/`
|
|
71
|
+
- **Config Location**: `{project}/.prjct/prjct.config.json`
|
|
72
|
+
- **Backup Location**: `~/.prjct-cli/projects/{id}/backups/{timestamp}/`
|
|
73
|
+
- **Cleanup Log**: `~/.prjct-cli/projects/{id}/memory/cleanup-log.jsonl`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct context
|
|
3
|
+
invocable_name: p:context
|
|
4
|
+
description: Show project context and recent activity using global prjct architecture
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Read project config from `.prjct/prjct.config.json`
|
|
10
|
+
2. Extract all metadata: projectId, dataPath, author, timestamps
|
|
11
|
+
3. Read recent actions from `~/.prjct-cli/projects/{projectId}/memory/context.jsonl` (last 10)
|
|
12
|
+
4. Read current task from `~/.prjct-cli/projects/{projectId}/core/now.md`
|
|
13
|
+
5. Read project context from `~/.prjct-cli/projects/{projectId}/core/context.md`
|
|
14
|
+
6. Calculate summary statistics
|
|
15
|
+
7. Format and display comprehensive context
|
|
16
|
+
|
|
17
|
+
# Response Format
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
๐ Project Context
|
|
21
|
+
|
|
22
|
+
๐ Project: {project-id}
|
|
23
|
+
๐ค Author: {name} ({github-username})
|
|
24
|
+
๐ง Email: {email}
|
|
25
|
+
๐ Project Path: {absolute-path}
|
|
26
|
+
๐พ Data Location: ~/.prjct-cli/projects/{id}/
|
|
27
|
+
|
|
28
|
+
๐ Current State:
|
|
29
|
+
๐ฏ Focus: {current task or "No task set"}
|
|
30
|
+
๐ Queued: X tasks
|
|
31
|
+
๐ก Ideas: Y ideas captured
|
|
32
|
+
๐ Shipped: Z features (A this week)
|
|
33
|
+
|
|
34
|
+
๐ Recent Activity (Last 10 Actions):
|
|
35
|
+
- {timestamp} | {author}: {action 1}
|
|
36
|
+
- {timestamp} | {author}: {action 2}
|
|
37
|
+
- {timestamp} | {author}: {action 3}
|
|
38
|
+
- {timestamp} | {author}: {action 4}
|
|
39
|
+
- {timestamp} | {author}: {action 5}
|
|
40
|
+
- {timestamp} | {author}: {action 6}
|
|
41
|
+
- {timestamp} | {author}: {action 7}
|
|
42
|
+
- {timestamp} | {author}: {action 8}
|
|
43
|
+
- {timestamp} | {author}: {action 9}
|
|
44
|
+
- {timestamp} | {author}: {action 10}
|
|
45
|
+
|
|
46
|
+
โฑ๏ธ Session Info:
|
|
47
|
+
- Initialized: {created timestamp}
|
|
48
|
+
- Last Activity: {lastSync timestamp}
|
|
49
|
+
- Active Days: X days
|
|
50
|
+
|
|
51
|
+
๐ง Configuration:
|
|
52
|
+
- Version: 0.2.1
|
|
53
|
+
- Global Architecture: Enabled
|
|
54
|
+
- Multi-Editor Sync: Active
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
# Action Types in Memory Log
|
|
58
|
+
|
|
59
|
+
Log entries include:
|
|
60
|
+
- Task changes: now, done
|
|
61
|
+
- Feature ships: ship
|
|
62
|
+
- Idea captures: idea
|
|
63
|
+
- Context updates: context
|
|
64
|
+
- Progress checks: recap, progress
|
|
65
|
+
|
|
66
|
+
# Global Architecture Notes
|
|
67
|
+
|
|
68
|
+
- **Config Location**: `{project}/.prjct/prjct.config.json`
|
|
69
|
+
- **Memory Location**: `~/.prjct-cli/projects/{id}/memory/context.jsonl`
|
|
70
|
+
- **Context File**: `~/.prjct-cli/projects/{id}/core/context.md`
|
|
71
|
+
- **Author Tracking**: Every action includes author for team visibility
|
|
72
|
+
- **Use Case**: Team coordination, session restoration, debugging
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct design
|
|
3
|
+
invocable_name: p:design
|
|
4
|
+
description: Design system architecture, APIs, and component interfaces
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Read project config from `.prjct/prjct.config.json`
|
|
10
|
+
2. Extract `projectId` and `author` from config
|
|
11
|
+
3. Parse design target and type (architecture, api, component, database, flow)
|
|
12
|
+
4. Generate appropriate ASCII diagrams and visual representations
|
|
13
|
+
5. Create technical specifications with technology stack and patterns
|
|
14
|
+
6. Generate implementation templates and interfaces
|
|
15
|
+
7. Save designs to `~/.prjct-cli/projects/{id}/designs/` directory
|
|
16
|
+
8. Display formatted design with overview, specs, and implementation guide
|
|
17
|
+
9. Link designs to tasks and track implementation progress
|
|
18
|
+
10. Log design creation to memory with author and timestamp
|
|
19
|
+
|
|
20
|
+
# Response Format
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
๐จ โจ Design Complete! โจ ๐จ
|
|
24
|
+
|
|
25
|
+
๐ Design: [Target Name]
|
|
26
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
27
|
+
|
|
28
|
+
๐๏ธ Architecture Overview:
|
|
29
|
+
[ASCII diagram or description]
|
|
30
|
+
|
|
31
|
+
๐ Technical Specifications:
|
|
32
|
+
โข Technology Stack: [stack details]
|
|
33
|
+
โข Design Patterns: [patterns used]
|
|
34
|
+
โข Key Components: [component list]
|
|
35
|
+
|
|
36
|
+
๐ฆ Implementation Guide:
|
|
37
|
+
1. Set up project structure
|
|
38
|
+
2. Implement core models
|
|
39
|
+
3. Build API endpoints
|
|
40
|
+
4. Create UI components
|
|
41
|
+
|
|
42
|
+
๐ Files Created:
|
|
43
|
+
โข ~/.prjct-cli/projects/{id}/designs/[target]-architecture.md
|
|
44
|
+
|
|
45
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
46
|
+
โ
Design ready for implementation!
|
|
47
|
+
|
|
48
|
+
๐ก Next: /p:now "Implement [target]"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
# Design Types
|
|
52
|
+
|
|
53
|
+
### Architecture
|
|
54
|
+
- System architecture diagrams
|
|
55
|
+
- Component relationships
|
|
56
|
+
- Data flow and communication patterns
|
|
57
|
+
- Scalability considerations
|
|
58
|
+
|
|
59
|
+
### API
|
|
60
|
+
- Endpoint specifications
|
|
61
|
+
- Request/response schemas
|
|
62
|
+
- Authentication and authorization
|
|
63
|
+
- Rate limiting and caching
|
|
64
|
+
|
|
65
|
+
### Component
|
|
66
|
+
- Component interfaces
|
|
67
|
+
- Props and state management
|
|
68
|
+
- Lifecycle and hooks
|
|
69
|
+
- Styling and theming
|
|
70
|
+
|
|
71
|
+
### Database
|
|
72
|
+
- Schema design
|
|
73
|
+
- Entity relationships
|
|
74
|
+
- Indexing strategy
|
|
75
|
+
- Migration plans
|
|
76
|
+
|
|
77
|
+
### Flow
|
|
78
|
+
- User journey diagrams
|
|
79
|
+
- State machine flows
|
|
80
|
+
- Process workflows
|
|
81
|
+
- Integration flows
|
|
82
|
+
|
|
83
|
+
# Global Architecture Notes
|
|
84
|
+
|
|
85
|
+
- **Data Location**: `~/.prjct-cli/projects/{id}/designs/`
|
|
86
|
+
- **Config Location**: `{project}/.prjct/prjct.config.json`
|
|
87
|
+
- **Author Tracking**: All designs logged with author information
|
|
88
|
+
- **Design Versioning**: Designs linked to tasks for implementation tracking
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct done
|
|
3
|
+
invocable_name: p:done
|
|
4
|
+
description: Complete task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Get projectId + author from `.prjct/prjct.config.json`
|
|
10
|
+
2. Read + calculate duration from `~/.prjct-cli/projects/{id}/core/now.md`
|
|
11
|
+
3. Clear `core/now.md`
|
|
12
|
+
4. Update `progress/metrics.md`
|
|
13
|
+
5. Log to `memory/context.jsonl` with author + duration
|
|
14
|
+
6. Check `core/next.md` for next task
|
|
15
|
+
7. Response:
|
|
16
|
+
```
|
|
17
|
+
โ
{task} ({duration})
|
|
18
|
+
Next: {task}
|
|
19
|
+
โ /p:now {next}
|
|
20
|
+
```
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct fix
|
|
3
|
+
invocable_name: p:fix
|
|
4
|
+
description: Quick troubleshooting and automatic fixes using global prjct architecture
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Read project config from `.prjct/prjct.config.json`
|
|
10
|
+
2. Extract `projectId` and `author` from config
|
|
11
|
+
3. Parse issue description from arguments
|
|
12
|
+
4. Analyze problem type:
|
|
13
|
+
- Build/compilation errors
|
|
14
|
+
- Test failures
|
|
15
|
+
- Runtime errors
|
|
16
|
+
- Configuration issues
|
|
17
|
+
- Dependency problems
|
|
18
|
+
5. Read project context from `~/.prjct-cli/projects/{projectId}/analysis/repo-summary.md`
|
|
19
|
+
6. Read recent activity from `~/.prjct-cli/projects/{projectId}/memory/context.jsonl`
|
|
20
|
+
7. Identify potential causes and solutions
|
|
21
|
+
8. Apply automatic fixes where possible
|
|
22
|
+
9. Provide manual fix instructions for complex issues
|
|
23
|
+
10. Log fix attempt to memory
|
|
24
|
+
11. Display results and next steps
|
|
25
|
+
|
|
26
|
+
# Response Format
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
๐ง Quick Fix: {issue-description}
|
|
30
|
+
|
|
31
|
+
๐ Diagnosis:
|
|
32
|
+
Problem Type: {error-type}
|
|
33
|
+
Location: {file-or-component}
|
|
34
|
+
Severity: {High/Medium/Low}
|
|
35
|
+
|
|
36
|
+
{if-automatic-fix-available}
|
|
37
|
+
โ
Auto-Fix Applied:
|
|
38
|
+
|
|
39
|
+
Changes Made:
|
|
40
|
+
- {change-1}
|
|
41
|
+
- {change-2}
|
|
42
|
+
- {change-3}
|
|
43
|
+
|
|
44
|
+
Verification:
|
|
45
|
+
{run-verification-command}
|
|
46
|
+
|
|
47
|
+
Status: {Success/Partial/Failed}
|
|
48
|
+
{endif}
|
|
49
|
+
|
|
50
|
+
{if-manual-fix-needed}
|
|
51
|
+
๐ ๏ธ Manual Fix Required:
|
|
52
|
+
|
|
53
|
+
Steps to Fix:
|
|
54
|
+
1. {step-1}
|
|
55
|
+
2. {step-2}
|
|
56
|
+
3. {step-3}
|
|
57
|
+
|
|
58
|
+
Why This Fix:
|
|
59
|
+
{explanation-of-the-fix}
|
|
60
|
+
|
|
61
|
+
Verification:
|
|
62
|
+
{verification-commands}
|
|
63
|
+
{endif}
|
|
64
|
+
|
|
65
|
+
๐ Related Resources:
|
|
66
|
+
- {documentation-link}
|
|
67
|
+
- {stack-overflow-link}
|
|
68
|
+
- {similar-issue-in-memory}
|
|
69
|
+
|
|
70
|
+
๐ก Prevention:
|
|
71
|
+
{how-to-avoid-this-issue-in-future}
|
|
72
|
+
|
|
73
|
+
{if-fixed}
|
|
74
|
+
โ
Issue Resolved!
|
|
75
|
+
Ready to continue? Use /p:now
|
|
76
|
+
{endif}
|
|
77
|
+
|
|
78
|
+
{if-not-fixed}
|
|
79
|
+
๐ค Still having issues?
|
|
80
|
+
- Get more help: /p:stuck "{detailed-description}"
|
|
81
|
+
- Save for later: /p:idea "Investigate {issue}"
|
|
82
|
+
{endif}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
# Common Fixes
|
|
86
|
+
|
|
87
|
+
## Build Errors
|
|
88
|
+
|
|
89
|
+
**Missing Dependencies**:
|
|
90
|
+
```
|
|
91
|
+
Auto-Fix: npm install / yarn install
|
|
92
|
+
Verification: npm run build
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Type Errors**:
|
|
96
|
+
```
|
|
97
|
+
Analysis: Check type definitions
|
|
98
|
+
Manual Fix: Add type imports or fix type mismatches
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Import Errors**:
|
|
102
|
+
```
|
|
103
|
+
Auto-Fix: Update import paths
|
|
104
|
+
Verification: Check compilation
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Test Failures
|
|
108
|
+
|
|
109
|
+
**Outdated Snapshots**:
|
|
110
|
+
```
|
|
111
|
+
Auto-Fix: npm test -- -u
|
|
112
|
+
Verification: Run tests again
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Missing Mocks**:
|
|
116
|
+
```
|
|
117
|
+
Manual Fix: Add mock definitions
|
|
118
|
+
Guide: Provide mock template
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Async Issues**:
|
|
122
|
+
```
|
|
123
|
+
Analysis: Identify async/await problems
|
|
124
|
+
Manual Fix: Add proper async handling
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Runtime Errors
|
|
128
|
+
|
|
129
|
+
**Environment Variables**:
|
|
130
|
+
```
|
|
131
|
+
Auto-Check: .env file exists
|
|
132
|
+
Manual Fix: Add missing variables
|
|
133
|
+
Template: Provide .env.example
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**API Errors**:
|
|
137
|
+
```
|
|
138
|
+
Analysis: Check endpoint and auth
|
|
139
|
+
Debug Steps: Test with curl/Postman
|
|
140
|
+
Fix: Update API configuration
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Configuration Issues
|
|
144
|
+
|
|
145
|
+
**Linter Errors**:
|
|
146
|
+
```
|
|
147
|
+
Auto-Fix: npm run lint -- --fix
|
|
148
|
+
Verification: Check linter output
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Formatting**:
|
|
152
|
+
```
|
|
153
|
+
Auto-Fix: npm run format
|
|
154
|
+
Apply: Prettier/ESLint auto-fix
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Dependency Problems
|
|
158
|
+
|
|
159
|
+
**Version Conflicts**:
|
|
160
|
+
```
|
|
161
|
+
Analysis: Check package.json
|
|
162
|
+
Resolution: Update peer dependencies
|
|
163
|
+
Command: npm install --legacy-peer-deps
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Lock File Issues**:
|
|
167
|
+
```
|
|
168
|
+
Auto-Fix: Remove lock file, reinstall
|
|
169
|
+
Fresh Install: npm ci
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
# Fix Strategies
|
|
173
|
+
|
|
174
|
+
1. **Identify Root Cause**: Don't just fix symptoms
|
|
175
|
+
2. **Try Safe Fixes First**: Non-destructive approaches
|
|
176
|
+
3. **Verify Each Fix**: Test before moving on
|
|
177
|
+
4. **Document Solution**: Log to memory for future reference
|
|
178
|
+
5. **Prevent Recurrence**: Suggest preventive measures
|
|
179
|
+
|
|
180
|
+
# Safety Protocols
|
|
181
|
+
|
|
182
|
+
- **Backup First**: Suggest git commit before major fixes
|
|
183
|
+
- **Incremental**: Apply one fix at a time
|
|
184
|
+
- **Reversible**: Provide rollback instructions
|
|
185
|
+
- **Tested**: Verify each fix works
|
|
186
|
+
|
|
187
|
+
# Integration with Workflow
|
|
188
|
+
|
|
189
|
+
- If fix takes >15min, suggest `/p:task "Fix {issue}"`
|
|
190
|
+
- Log successful fixes for pattern recognition
|
|
191
|
+
- Update project analysis if configuration changes
|
|
192
|
+
- Suggest `/p:stuck` if automatic fix fails
|
|
193
|
+
|
|
194
|
+
# Global Architecture Notes
|
|
195
|
+
|
|
196
|
+
- **Project Analysis**: `~/.prjct-cli/projects/{id}/analysis/repo-summary.md`
|
|
197
|
+
- **Recent History**: `~/.prjct-cli/projects/{id}/memory/context.jsonl`
|
|
198
|
+
- **Config Source**: `{project}/.prjct/prjct.config.json`
|
|
199
|
+
- **Memory Logging**: Record all fix attempts and outcomes
|
|
200
|
+
- **Pattern Learning**: Build knowledge base of common fixes
|
|
201
|
+
- **Use Case**: Rapid problem resolution, reducing debugging time
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct git
|
|
3
|
+
invocable_name: p:git
|
|
4
|
+
description: Smart git operations with prjct context using global prjct architecture
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Read project config from `.prjct/prjct.config.json`
|
|
10
|
+
2. Extract `projectId` and `author` from config
|
|
11
|
+
3. Parse git subcommand and arguments
|
|
12
|
+
4. Read current task from `~/.prjct-cli/projects/{projectId}/core/now.md`
|
|
13
|
+
5. Read recent activity from `~/.prjct-cli/projects/{projectId}/memory/context.jsonl`
|
|
14
|
+
6. Execute git operation with context-aware behavior
|
|
15
|
+
7. Log git action to memory
|
|
16
|
+
8. Display result with workflow suggestions
|
|
17
|
+
|
|
18
|
+
# Supported Operations
|
|
19
|
+
|
|
20
|
+
## /p:git commit [message]
|
|
21
|
+
Smart commit with context-aware message generation
|
|
22
|
+
|
|
23
|
+
**Without message**:
|
|
24
|
+
- Analyze staged changes
|
|
25
|
+
- Read current task for context
|
|
26
|
+
- Generate meaningful commit message
|
|
27
|
+
- Preview and confirm
|
|
28
|
+
|
|
29
|
+
**With message**:
|
|
30
|
+
- Use provided message
|
|
31
|
+
- Add task context footer
|
|
32
|
+
- Execute commit
|
|
33
|
+
|
|
34
|
+
## /p:git status
|
|
35
|
+
Show git status with prjct context
|
|
36
|
+
|
|
37
|
+
**Output**:
|
|
38
|
+
- Standard git status
|
|
39
|
+
- Current prjct task
|
|
40
|
+
- Suggest next actions
|
|
41
|
+
|
|
42
|
+
## /p:git push
|
|
43
|
+
Push changes with progress tracking
|
|
44
|
+
|
|
45
|
+
**Process**:
|
|
46
|
+
- Execute git push
|
|
47
|
+
- Update shipped features if appropriate
|
|
48
|
+
- Log to memory
|
|
49
|
+
- Suggest celebration with /p:ship
|
|
50
|
+
|
|
51
|
+
## /p:git sync
|
|
52
|
+
Full sync workflow: pull, commit, push
|
|
53
|
+
|
|
54
|
+
**Process**:
|
|
55
|
+
- Pull latest changes
|
|
56
|
+
- Show conflicts if any
|
|
57
|
+
- Auto-commit with context if no conflicts
|
|
58
|
+
- Push to remote
|
|
59
|
+
- Update prjct state
|
|
60
|
+
|
|
61
|
+
# Response Formats
|
|
62
|
+
|
|
63
|
+
## commit
|
|
64
|
+
```
|
|
65
|
+
๐ Git Commit
|
|
66
|
+
|
|
67
|
+
Current Task: {task-from-now.md}
|
|
68
|
+
|
|
69
|
+
Staged Changes:
|
|
70
|
+
M {file1}
|
|
71
|
+
M {file2}
|
|
72
|
+
A {file3}
|
|
73
|
+
|
|
74
|
+
Generated Message:
|
|
75
|
+
{context-aware-commit-message}
|
|
76
|
+
|
|
77
|
+
Related to: {task-description}
|
|
78
|
+
|
|
79
|
+
โ
Committed: {commit-hash}
|
|
80
|
+
|
|
81
|
+
Next Steps:
|
|
82
|
+
- Push changes: /p:git push
|
|
83
|
+
- Ship feature: /p:ship "{feature-name}"
|
|
84
|
+
- Move to next task: /p:done
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## status
|
|
88
|
+
```
|
|
89
|
+
๐ Git Status
|
|
90
|
+
|
|
91
|
+
On branch: {branch}
|
|
92
|
+
Your branch is {ahead/behind/up-to-date}
|
|
93
|
+
|
|
94
|
+
Changes staged:
|
|
95
|
+
M {file1}
|
|
96
|
+
M {file2}
|
|
97
|
+
|
|
98
|
+
Changes not staged:
|
|
99
|
+
M {file3}
|
|
100
|
+
|
|
101
|
+
Untracked files:
|
|
102
|
+
{file4}
|
|
103
|
+
|
|
104
|
+
๐ฏ Current Task: {task-from-now.md}
|
|
105
|
+
|
|
106
|
+
๐ก Suggestions:
|
|
107
|
+
- Ready to commit? /p:git commit
|
|
108
|
+
- Review changes: git diff
|
|
109
|
+
- Stage all: git add .
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## push
|
|
113
|
+
```
|
|
114
|
+
๐ Git Push
|
|
115
|
+
|
|
116
|
+
Pushing to origin/{branch}...
|
|
117
|
+
|
|
118
|
+
โ
Pushed successfully!
|
|
119
|
+
{commit-count} commits pushed
|
|
120
|
+
|
|
121
|
+
๐ Consider:
|
|
122
|
+
{if-significant-work}
|
|
123
|
+
- Ship this feature: /p:ship "{feature-name}"
|
|
124
|
+
- Update progress: /p:progress
|
|
125
|
+
{endif}
|
|
126
|
+
|
|
127
|
+
- Mark task done: /p:done
|
|
128
|
+
- Start next task: /p:now
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## sync
|
|
132
|
+
```
|
|
133
|
+
๐ Git Sync
|
|
134
|
+
|
|
135
|
+
1. โฌ๏ธ Pulling latest changes...
|
|
136
|
+
โ
{changes} changes pulled
|
|
137
|
+
|
|
138
|
+
2. ๐ Staging local changes...
|
|
139
|
+
โ
{files} files staged
|
|
140
|
+
|
|
141
|
+
3. ๐พ Committing...
|
|
142
|
+
โ
Committed: {hash}
|
|
143
|
+
Message: {auto-generated-message}
|
|
144
|
+
|
|
145
|
+
4. โฌ๏ธ Pushing to remote...
|
|
146
|
+
โ
Pushed successfully!
|
|
147
|
+
|
|
148
|
+
๐ฏ Current Task: {task}
|
|
149
|
+
|
|
150
|
+
All synced! Keep building! ๐
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
# Context-Aware Commit Messages
|
|
154
|
+
|
|
155
|
+
Message generation considers:
|
|
156
|
+
- Current task from now.md
|
|
157
|
+
- Recent actions from memory
|
|
158
|
+
- Changed files and patterns
|
|
159
|
+
- Conventional commit types
|
|
160
|
+
|
|
161
|
+
Format:
|
|
162
|
+
```
|
|
163
|
+
{type}: {short-description}
|
|
164
|
+
|
|
165
|
+
{body-explaining-changes}
|
|
166
|
+
|
|
167
|
+
Task: {current-task-context}
|
|
168
|
+
Author: {author-from-config}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Types: feat, fix, docs, refactor, test, chore, style, perf
|
|
172
|
+
|
|
173
|
+
# Smart Suggestions
|
|
174
|
+
|
|
175
|
+
Based on changes:
|
|
176
|
+
- **Multiple features**: "Consider splitting into separate commits"
|
|
177
|
+
- **Breaking changes**: "Update version, add migration notes"
|
|
178
|
+
- **Tests added**: "Great! Test coverage improved"
|
|
179
|
+
- **Docs updated**: "Documentation up to date"
|
|
180
|
+
|
|
181
|
+
Based on prjct state:
|
|
182
|
+
- **Task complete**: "Use /p:done and /p:ship"
|
|
183
|
+
- **Long-running task**: "Make checkpoint commit?"
|
|
184
|
+
- **Many uncommitted changes**: "Commit frequently for safety"
|
|
185
|
+
|
|
186
|
+
# Global Architecture Notes
|
|
187
|
+
|
|
188
|
+
- **Current Task**: `~/.prjct-cli/projects/{id}/core/now.md` - Provides commit context
|
|
189
|
+
- **Memory Logging**: `~/.prjct-cli/projects/{id}/memory/context.jsonl` - Records git actions
|
|
190
|
+
- **Author Info**: From `{project}/.prjct/prjct.config.json`
|
|
191
|
+
- **Integration**: Seamless connection between code changes and task tracking
|
|
192
|
+
- **Use Case**: Context-aware version control, better commit messages, workflow integration
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct help
|
|
3
|
+
invocable_name: p:help
|
|
4
|
+
description: Interactive guide
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Display interactive menu with natural language options
|
|
10
|
+
2. Wait for user response
|
|
11
|
+
3. Detect intent from message
|
|
12
|
+
4. Execute corresponding command or provide guidance
|
|
13
|
+
5. Response includes menu above
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prjct idea
|
|
3
|
+
invocable_name: p:idea
|
|
4
|
+
description: Quick capture
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Steps
|
|
8
|
+
|
|
9
|
+
1. Get projectId + author from `.prjct/prjct.config.json`
|
|
10
|
+
2. Append to `~/.prjct-cli/projects/{id}/planning/ideas.md` + timestamp
|
|
11
|
+
3. If has action verbs โ add to `core/next.md`
|
|
12
|
+
4. Log to `memory/context.jsonl` with author
|
|
13
|
+
5. Response:
|
|
14
|
+
```
|
|
15
|
+
๐ก {idea}
|
|
16
|
+
โ Added to queue
|
|
17
|
+
```
|
|
18
|
+
Or:
|
|
19
|
+
```
|
|
20
|
+
๐ก {idea}
|
|
21
|
+
โ Saved to backlog
|
|
22
|
+
```
|