prjct-cli 0.8.4 → 0.8.8
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 +115 -0
- package/CLAUDE.md +34 -0
- package/bin/prjct +19 -166
- package/core/agentic/context-builder.js +4 -3
- package/core/agentic/tool-registry.js +35 -0
- package/core/commands.js +84 -0
- package/core/index.js +178 -0
- package/core/infrastructure/command-installer.js +9 -26
- package/core/infrastructure/legacy-installer-detector.js +546 -0
- package/core/infrastructure/session-manager.js +14 -2
- package/core/infrastructure/setup.js +185 -0
- package/core/utils/jsonl-helper.js +137 -0
- package/package.json +1 -1
- package/scripts/install.sh +45 -8
- package/scripts/postinstall.js +12 -203
- package/templates/agents/AGENTS.md +3 -3
- package/templates/commands/ask.md +25 -338
- package/templates/commands/build.md +7 -4
- package/templates/commands/feature.md +19 -160
- package/templates/commands/help.md +41 -299
- package/templates/commands/idea.md +7 -4
- package/templates/commands/init.md +15 -112
- package/templates/commands/migrate-all.md +25 -84
- package/templates/commands/now.md +4 -3
- package/templates/commands/ship.md +20 -86
- package/templates/commands/suggest.md +36 -495
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read, Write, Bash]
|
|
3
|
+
description: 'Migrate all legacy projects to global storage architecture'
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# /p:migrate-all
|
|
4
7
|
|
|
5
8
|
## Usage
|
|
6
9
|
|
|
@@ -8,113 +11,51 @@ Migrates all legacy prjct projects to the new global storage architecture.
|
|
|
8
11
|
/p:migrate-all [--deep-scan] [--remove-legacy] [--dry-run]
|
|
9
12
|
```
|
|
10
13
|
|
|
11
|
-
## What
|
|
14
|
+
## What It Does
|
|
12
15
|
|
|
13
|
-
1. **Scans
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Checks each project for old `.prjct/` directory structure
|
|
19
|
-
- Identifies projects that need migration
|
|
20
|
-
|
|
21
|
-
3. **Migrates Each Project**
|
|
22
|
-
- Moves data from local `.prjct/` to global `~/.prjct-cli/projects/{id}/`
|
|
23
|
-
- Creates new minimal local config (`.prjct/prjct.config.json`)
|
|
24
|
-
- Preserves all project data and history
|
|
25
|
-
|
|
26
|
-
4. **Cleanup (Optional)**
|
|
27
|
-
- Removes legacy `.prjct/` directories (with `--remove-legacy`)
|
|
28
|
-
- Keeps only the new minimal config file
|
|
29
|
-
|
|
30
|
-
5. **Reports Summary**
|
|
31
|
-
- Shows migrated, skipped, and failed projects
|
|
32
|
-
- Lists detailed errors for any failures
|
|
16
|
+
1. **Scans global storage** → Reads all project IDs from `~/.prjct-cli/projects/`
|
|
17
|
+
2. **Detects legacy structure** → Checks each project for old `.prjct/` directory
|
|
18
|
+
3. **Migrates each project** → Moves data from local `.prjct/` to global storage
|
|
19
|
+
4. **Cleanup (optional)** → Removes legacy `.prjct/` directories (with `--remove-legacy`)
|
|
20
|
+
5. **Reports summary** → Shows migrated, skipped, failed counts
|
|
33
21
|
|
|
34
22
|
## Options
|
|
35
23
|
|
|
36
24
|
- `--deep-scan`: Scan entire file system (slow but thorough)
|
|
37
|
-
- `--remove-legacy`: Delete old `.prjct/`
|
|
25
|
+
- `--remove-legacy`: Delete old `.prjct/` after successful migration
|
|
38
26
|
- `--dry-run`: Show what would be migrated without making changes
|
|
39
27
|
|
|
40
28
|
## When to Use
|
|
41
29
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
- **Troubleshooting**: If projects aren't working after update
|
|
30
|
+
- After major version updates (architecture changes)
|
|
31
|
+
- Upgrading from v0.7.x to v0.8.x (new global storage)
|
|
32
|
+
- Troubleshooting projects not working after update
|
|
46
33
|
|
|
47
|
-
## Migration
|
|
34
|
+
## Migration: Before → After
|
|
48
35
|
|
|
49
|
-
|
|
36
|
+
**Before (Legacy)**:
|
|
50
37
|
```
|
|
51
|
-
your-project/
|
|
52
|
-
|
|
53
|
-
core/
|
|
54
|
-
planning/
|
|
55
|
-
progress/
|
|
56
|
-
memory/
|
|
57
|
-
analysis/
|
|
58
|
-
prjct.config.json # Full config
|
|
38
|
+
your-project/.prjct/ # All data locally
|
|
39
|
+
core/, planning/, progress/, memory/, analysis/
|
|
59
40
|
```
|
|
60
41
|
|
|
61
|
-
|
|
42
|
+
**After (Global)**:
|
|
62
43
|
```
|
|
63
|
-
your-project/
|
|
64
|
-
.
|
|
65
|
-
prjct.config.json # Minimal (projectId + dataPath only)
|
|
66
|
-
|
|
67
|
-
~/.prjct-cli/projects/3a5667a5dedb/
|
|
68
|
-
core/
|
|
69
|
-
planning/
|
|
70
|
-
progress/
|
|
71
|
-
memory/
|
|
72
|
-
analysis/
|
|
73
|
-
agents/
|
|
74
|
-
project.json # System config (authors, version, etc.)
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Output Example
|
|
44
|
+
your-project/.prjct/
|
|
45
|
+
prjct.config.json # Minimal (projectId + dataPath only)
|
|
78
46
|
|
|
47
|
+
~/.prjct-cli/projects/{id}/
|
|
48
|
+
core/, planning/, progress/, memory/, analysis/, agents/
|
|
79
49
|
```
|
|
80
|
-
🔄 Scanning for legacy prjct projects...
|
|
81
|
-
|
|
82
|
-
📁 Found 3 projects in global storage
|
|
83
|
-
|
|
84
|
-
🔄 Migrating: /Users/jj/Apps/my-app
|
|
85
|
-
✅ Migrated successfully
|
|
86
|
-
|
|
87
|
-
🔄 Migrating: /Users/jj/Apps/other-project
|
|
88
|
-
⏭️ Already migrated
|
|
89
|
-
|
|
90
|
-
📊 Migration Summary:
|
|
91
|
-
✅ Migrated: 1
|
|
92
|
-
⏭️ Skipped: 1
|
|
93
|
-
❌ Failed: 0
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Error Handling
|
|
97
|
-
|
|
98
|
-
- **No global storage**: Creates directory structure
|
|
99
|
-
- **Missing project paths**: Skips projects with invalid paths
|
|
100
|
-
- **Permission errors**: Reports which projects couldn't be migrated
|
|
101
|
-
- **Already migrated**: Safely skips without changes
|
|
102
50
|
|
|
103
51
|
## Safety
|
|
104
52
|
|
|
105
53
|
- **Idempotent**: Safe to run multiple times
|
|
106
54
|
- **Non-destructive**: Original files only removed with `--remove-legacy`
|
|
107
|
-
- **Dry run
|
|
55
|
+
- **Dry run**: Test with `--dry-run` first
|
|
108
56
|
- **Automatic backup**: Legacy data preserved until explicitly removed
|
|
109
57
|
|
|
110
58
|
## Requirements
|
|
111
59
|
|
|
112
60
|
- Write permissions to `~/.prjct-cli/` and project directories
|
|
113
61
|
- Projects must have valid global config in `project.json`
|
|
114
|
-
|
|
115
|
-
## Notes
|
|
116
|
-
|
|
117
|
-
- This command does NOT require an initialized prjct project
|
|
118
|
-
- Migration is automatic on install (but manual execution is safer)
|
|
119
|
-
- Always test with `--dry-run` first for large migrations
|
|
120
|
-
- Can be safely interrupted and resumed
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write]
|
|
2
|
+
allowed-tools: [Read, Write, GetTimestamp, GetDate]
|
|
3
3
|
description: 'Manage current focus task'
|
|
4
|
+
timestamp-rule: 'CRITICAL - ALWAYS use GetTimestamp() tool for ALL timestamps. NEVER generate timestamps manually. LLM does not know current date/time.'
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# /p:now
|
|
@@ -18,9 +19,9 @@ description: 'Manage current focus task'
|
|
|
18
19
|
|
|
19
20
|
**Set**:
|
|
20
21
|
|
|
21
|
-
1. Write: `core/now.md` with task + timestamp
|
|
22
|
+
1. Write: `core/now.md` with task + timestamp (use GetTimestamp() tool)
|
|
22
23
|
2. Update: `core/context.md`, `progress/metrics.md`
|
|
23
|
-
3. Log: `memory/context.jsonl`
|
|
24
|
+
3. Log: `memory/context.jsonl` (use GetTimestamp() tool)
|
|
24
25
|
|
|
25
26
|
## Response
|
|
26
27
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Write, Bash]
|
|
2
|
+
allowed-tools: [Read, Write, Bash, GetTimestamp, GetDate]
|
|
3
3
|
description: 'Ship feature with complete automated workflow'
|
|
4
|
+
timestamp-rule: 'CRITICAL - ALWAYS use GetTimestamp() and GetDate() tools for ALL timestamps and dates. NEVER generate dates manually. LLM does not know current date.'
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# /p:ship
|
|
@@ -14,94 +15,28 @@ description: 'Ship feature with complete automated workflow'
|
|
|
14
15
|
|
|
15
16
|
## Complete Workflow (Automated)
|
|
16
17
|
|
|
17
|
-
1. ✅ **Lint checks** → Run
|
|
18
|
-
2. ✅ **Run tests** → Execute test suite (
|
|
19
|
-
3. ✅ **Update docs** →
|
|
18
|
+
1. ✅ **Lint checks** → Run linters (non-blocking if fail)
|
|
19
|
+
2. ✅ **Run tests** → Execute test suite (non-blocking if fail)
|
|
20
|
+
3. ✅ **Update docs** → README, API docs, component docs if needed
|
|
20
21
|
4. ✅ **Update version** → Bump version (patch/minor based on changes)
|
|
21
|
-
5. ✅ **Update CHANGELOG** → Add entry with
|
|
22
|
-
6. ✅ **Git commit** →
|
|
22
|
+
5. ✅ **Update CHANGELOG** → Add entry with metadata
|
|
23
|
+
6. ✅ **Git commit** → With prjct footer format
|
|
23
24
|
7. ✅ **Git push** → Push to remote
|
|
24
|
-
8. ✅ **
|
|
25
|
+
8. ✅ **Log to session** → Append to `progress/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`
|
|
26
|
+
9. ✅ **Update index** → Prepend to `progress/shipped.md` (last 30 days only)
|
|
27
|
+
10. ✅ **Update roadmap** → Mark as complete in `planning/roadmap.md`
|
|
28
|
+
11. ✅ **Recommend compact** → Suggest conversation compacting
|
|
25
29
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
### Step 1: Lint Checks
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm run lint || yarn lint || pnpm lint
|
|
32
|
-
# If fails: Show errors but continue
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 2: Run Tests
|
|
36
|
-
|
|
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
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Step 3: Update Docs
|
|
44
|
-
|
|
45
|
-
- Update README if needed
|
|
46
|
-
- Update API docs if endpoints changed
|
|
47
|
-
- Update component docs if UI changed
|
|
48
|
-
|
|
49
|
-
### Step 4: Update Version
|
|
50
|
-
|
|
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
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Step 5: Update CHANGELOG
|
|
58
|
-
|
|
59
|
-
```markdown
|
|
60
|
-
## [X.Y.Z] - YYYY-MM-DD
|
|
61
|
-
|
|
62
|
-
### Added / Changed / Fixed
|
|
63
|
-
|
|
64
|
-
- {feature_description}
|
|
65
|
-
- Agent: {agent}
|
|
66
|
-
- Time: {actual_time}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Step 6-7: Git Commit + Push
|
|
70
|
-
|
|
71
|
-
Auto-commit with metadata and push
|
|
72
|
-
|
|
73
|
-
### Step 8: Log to Session
|
|
30
|
+
## Session Log Format
|
|
74
31
|
|
|
75
32
|
Append to `progress/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`:
|
|
76
33
|
|
|
77
|
-
|
|
78
|
-
{"ts":"2025-10-04T18:00:00Z","type":"feature_ship","name":"{feature}","tasks_done":{N},"duration":"{Xh}","agent":"{agent}","version":"{X.Y.Z}"}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Step 9: Update Index
|
|
34
|
+
**Use GetTimestamp() tool for real system time:**
|
|
82
35
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```markdown
|
|
86
|
-
## 2025-10-04
|
|
87
|
-
- ✅ {feature_name} ({Xh}, {N} tasks, v{X.Y.Z})
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
If shipped.md has entries > 30 days old, archive to `progress/archive/shipped-{YYYY-MM}.md`
|
|
91
|
-
|
|
92
|
-
### Step 10: Update Roadmap
|
|
93
|
-
|
|
94
|
-
Mark feature as complete in `planning/roadmap.md`:
|
|
95
|
-
|
|
96
|
-
```markdown
|
|
97
|
-
## Completed
|
|
98
|
-
- [x] {feature_name} - Shipped 2025-10-04
|
|
36
|
+
```jsonl
|
|
37
|
+
{"ts":"{GetTimestamp()}","type":"feature_ship","name":"{feature}","tasks_done":{N},"duration":"{Xh}","agent":"{agent}","version":"{X.Y.Z}"}
|
|
99
38
|
```
|
|
100
39
|
|
|
101
|
-
### Step 11: Recommend Compact
|
|
102
|
-
|
|
103
|
-
Suggest compacting conversation after ship
|
|
104
|
-
|
|
105
40
|
## Commit Message Format
|
|
106
41
|
|
|
107
42
|
```
|
|
@@ -116,7 +51,7 @@ Time: {actual_time}
|
|
|
116
51
|
Designed for [Claude](https://www.anthropic.com/claude)
|
|
117
52
|
```
|
|
118
53
|
|
|
119
|
-
**
|
|
54
|
+
**CRITICAL**: This footer format MUST be used in ALL commits made by prjct.
|
|
120
55
|
|
|
121
56
|
## Response
|
|
122
57
|
|
|
@@ -141,8 +76,7 @@ Workflow completed:
|
|
|
141
76
|
|
|
142
77
|
## Important Notes
|
|
143
78
|
|
|
144
|
-
- **Tests/Lint failures DO NOT block shipping**
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
- ALWAYS commits and pushes if workflow completes
|
|
79
|
+
- **Tests/Lint failures DO NOT block shipping** → User sees results and decides
|
|
80
|
+
- **ALWAYS** updates version and CHANGELOG
|
|
81
|
+
- **ALWAYS** commits and pushes if workflow completes
|
|
82
|
+
- Archive `shipped.md` entries > 30 days to `progress/archive/shipped-{YYYY-MM}.md`
|