prjct-cli 0.13.3 → 0.15.1
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 +122 -0
- package/bin/prjct +10 -13
- package/core/agentic/memory-system/semantic-memories.ts +2 -1
- package/core/agentic/plan-mode/plan-mode.ts +2 -1
- package/core/agentic/prompt-builder.ts +22 -43
- package/core/agentic/services.ts +5 -5
- package/core/agentic/smart-context.ts +7 -2
- package/core/command-registry/core-commands.ts +54 -29
- package/core/command-registry/optional-commands.ts +64 -0
- package/core/command-registry/setup-commands.ts +18 -3
- package/core/commands/analysis.ts +21 -68
- package/core/commands/analytics.ts +247 -213
- package/core/commands/base.ts +1 -1
- package/core/commands/index.ts +41 -36
- package/core/commands/maintenance.ts +300 -31
- package/core/commands/planning.ts +233 -22
- package/core/commands/setup.ts +3 -8
- package/core/commands/shipping.ts +14 -18
- package/core/commands/types.ts +8 -6
- package/core/commands/workflow.ts +105 -100
- package/core/context/generator.ts +317 -0
- package/core/context-sync.ts +7 -350
- package/core/data/index.ts +13 -32
- package/core/data/md-ideas-manager.ts +155 -0
- package/core/data/md-queue-manager.ts +4 -3
- package/core/data/md-shipped-manager.ts +90 -0
- package/core/data/md-state-manager.ts +11 -7
- package/core/domain/agent-generator.ts +23 -63
- package/core/events/index.ts +143 -0
- package/core/index.ts +17 -14
- package/core/infrastructure/capability-installer.ts +13 -149
- package/core/infrastructure/migrator/project-scanner.ts +2 -1
- package/core/infrastructure/path-manager.ts +4 -6
- package/core/infrastructure/setup.ts +3 -0
- package/core/infrastructure/uuid-migration.ts +750 -0
- package/core/outcomes/recorder.ts +2 -1
- package/core/plugin/loader.ts +4 -7
- package/core/plugin/registry.ts +3 -3
- package/core/schemas/index.ts +23 -25
- package/core/schemas/state.ts +1 -0
- package/core/serializers/ideas-serializer.ts +187 -0
- package/core/serializers/index.ts +16 -0
- package/core/serializers/shipped-serializer.ts +108 -0
- package/core/session/utils.ts +3 -9
- package/core/storage/ideas-storage.ts +273 -0
- package/core/storage/index.ts +204 -0
- package/core/storage/queue-storage.ts +297 -0
- package/core/storage/shipped-storage.ts +223 -0
- package/core/storage/state-storage.ts +235 -0
- package/core/storage/storage-manager.ts +175 -0
- package/package.json +1 -1
- package/packages/web/app/api/projects/[id]/momentum/route.ts +257 -0
- package/packages/web/app/api/sessions/current/route.ts +132 -0
- package/packages/web/app/api/sessions/history/route.ts +96 -14
- package/packages/web/app/globals.css +5 -0
- package/packages/web/app/layout.tsx +2 -0
- package/packages/web/app/project/[id]/code/layout.tsx +18 -0
- package/packages/web/app/project/[id]/code/page.tsx +408 -0
- package/packages/web/app/project/[id]/page.tsx +359 -389
- package/packages/web/app/project/[id]/reports/page.tsx +59 -0
- package/packages/web/app/project/[id]/reports/print/page.tsx +58 -0
- package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +0 -1
- package/packages/web/components/AgentsCard/AgentsCard.tsx +64 -34
- package/packages/web/components/AgentsCard/AgentsCard.types.ts +1 -0
- package/packages/web/components/AppSidebar/AppSidebar.tsx +135 -11
- package/packages/web/components/BentoCard/BentoCard.constants.ts +3 -3
- package/packages/web/components/BentoCard/BentoCard.tsx +2 -1
- package/packages/web/components/BentoGrid/BentoGrid.tsx +2 -2
- package/packages/web/components/BlockersCard/BlockersCard.tsx +65 -57
- package/packages/web/components/BlockersCard/BlockersCard.types.ts +1 -0
- package/packages/web/components/CommandBar/CommandBar.tsx +67 -0
- package/packages/web/components/CommandBar/index.ts +1 -0
- package/packages/web/components/DashboardContent/DashboardContent.tsx +35 -5
- package/packages/web/components/DateGroup/DateGroup.tsx +1 -1
- package/packages/web/components/EmptyState/EmptyState.tsx +39 -21
- package/packages/web/components/EmptyState/EmptyState.types.ts +1 -0
- package/packages/web/components/EventRow/EventRow.tsx +4 -4
- package/packages/web/components/EventRow/EventRow.utils.ts +3 -3
- package/packages/web/components/HeroSection/HeroSection.tsx +52 -15
- package/packages/web/components/HeroSection/HeroSection.types.ts +4 -4
- package/packages/web/components/HeroSection/HeroSection.utils.ts +7 -3
- package/packages/web/components/IdeasCard/IdeasCard.tsx +94 -27
- package/packages/web/components/IdeasCard/IdeasCard.types.ts +1 -0
- package/packages/web/components/MasonryGrid/MasonryGrid.tsx +18 -0
- package/packages/web/components/MasonryGrid/index.ts +1 -0
- package/packages/web/components/MomentumWidget/MomentumWidget.tsx +119 -0
- package/packages/web/components/MomentumWidget/MomentumWidget.types.ts +16 -0
- package/packages/web/components/MomentumWidget/index.ts +2 -0
- package/packages/web/components/NowCard/NowCard.tsx +81 -56
- package/packages/web/components/NowCard/NowCard.types.ts +1 -0
- package/packages/web/components/PageHeader/PageHeader.tsx +24 -0
- package/packages/web/components/PageHeader/index.ts +1 -0
- package/packages/web/components/ProgressRing/ProgressRing.constants.ts +2 -2
- package/packages/web/components/ProjectAvatar/ProjectAvatar.tsx +2 -2
- package/packages/web/components/ProjectColorDot/ProjectColorDot.tsx +37 -0
- package/packages/web/components/ProjectColorDot/index.ts +1 -0
- package/packages/web/components/ProjectSelectorModal/ProjectSelectorModal.tsx +104 -0
- package/packages/web/components/ProjectSelectorModal/index.ts +1 -0
- package/packages/web/components/Providers/Providers.tsx +4 -1
- package/packages/web/components/QueueCard/QueueCard.tsx +78 -25
- package/packages/web/components/QueueCard/QueueCard.types.ts +1 -0
- package/packages/web/components/QueueCard/QueueCard.utils.ts +3 -3
- package/packages/web/components/RecoverCard/RecoverCard.tsx +72 -0
- package/packages/web/components/RecoverCard/RecoverCard.types.ts +16 -0
- package/packages/web/components/RecoverCard/index.ts +2 -0
- package/packages/web/components/RoadmapCard/RoadmapCard.tsx +101 -33
- package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +1 -0
- package/packages/web/components/ShipsCard/ShipsCard.tsx +71 -28
- package/packages/web/components/ShipsCard/ShipsCard.types.ts +2 -0
- package/packages/web/components/SparklineChart/SparklineChart.tsx +20 -18
- package/packages/web/components/StatsMasonry/StatsMasonry.tsx +95 -0
- package/packages/web/components/StatsMasonry/index.ts +1 -0
- package/packages/web/components/StreakCard/StreakCard.tsx +37 -35
- package/packages/web/components/TasksCounter/TasksCounter.tsx +1 -1
- package/packages/web/components/TechStackBadges/TechStackBadges.tsx +12 -4
- package/packages/web/components/TerminalDock/DockToggleTab.tsx +29 -0
- package/packages/web/components/TerminalDock/TerminalDock.tsx +386 -0
- package/packages/web/components/TerminalDock/TerminalDockTab.tsx +130 -0
- package/packages/web/components/TerminalDock/TerminalTabBar.tsx +142 -0
- package/packages/web/components/TerminalDock/index.ts +2 -0
- package/packages/web/components/VelocityBadge/VelocityBadge.tsx +8 -3
- package/packages/web/components/VelocityCard/VelocityCard.tsx +49 -47
- package/packages/web/components/WeeklyReports/PrintableReport.tsx +259 -0
- package/packages/web/components/WeeklyReports/ReportPreviewCard.tsx +187 -0
- package/packages/web/components/WeeklyReports/WeekCalendar.tsx +288 -0
- package/packages/web/components/WeeklyReports/WeeklyReports.tsx +149 -0
- package/packages/web/components/WeeklyReports/index.ts +4 -0
- package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +16 -4
- package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +1 -0
- package/packages/web/components/charts/SessionsChart.tsx +6 -3
- package/packages/web/components/ui/dialog.tsx +143 -0
- package/packages/web/components/ui/drawer.tsx +135 -0
- package/packages/web/components/ui/select.tsx +187 -0
- package/packages/web/context/GlobalTerminalContext.tsx +538 -0
- package/packages/web/lib/commands.ts +81 -0
- package/packages/web/lib/generate-week-report.ts +285 -0
- package/packages/web/lib/parse-prjct-files.ts +56 -55
- package/packages/web/lib/project-colors.ts +58 -0
- package/packages/web/lib/projects.ts +58 -5
- package/packages/web/lib/services/projects.server.ts +11 -1
- package/packages/web/next-env.d.ts +1 -1
- package/packages/web/package.json +5 -1
- package/templates/commands/analyze.md +39 -3
- package/templates/commands/ask.md +58 -3
- package/templates/commands/bug.md +117 -26
- package/templates/commands/dash.md +95 -158
- package/templates/commands/done.md +130 -148
- package/templates/commands/feature.md +125 -103
- package/templates/commands/git.md +18 -3
- package/templates/commands/idea.md +121 -38
- package/templates/commands/init.md +124 -20
- package/templates/commands/migrate-all.md +63 -28
- package/templates/commands/migrate.md +140 -0
- package/templates/commands/next.md +115 -5
- package/templates/commands/now.md +146 -82
- package/templates/commands/pause.md +89 -74
- package/templates/commands/redo.md +6 -4
- package/templates/commands/resume.md +141 -59
- package/templates/commands/setup.md +18 -3
- package/templates/commands/ship.md +103 -231
- package/templates/commands/spec.md +98 -8
- package/templates/commands/suggest.md +22 -2
- package/templates/commands/sync.md +192 -203
- package/templates/commands/undo.md +6 -4
- package/templates/mcp-config.json +20 -1
- package/core/data/agents-manager.ts +0 -76
- package/core/data/analysis-manager.ts +0 -83
- package/core/data/base-manager.ts +0 -156
- package/core/data/ideas-manager.ts +0 -81
- package/core/data/outcomes-manager.ts +0 -96
- package/core/data/project-manager.ts +0 -75
- package/core/data/roadmap-manager.ts +0 -118
- package/core/data/shipped-manager.ts +0 -65
- package/core/data/state-manager.ts +0 -214
- package/core/state/index.ts +0 -25
- package/core/state/manager.ts +0 -376
- package/core/state/types.ts +0 -185
- package/core/utils/project-capabilities.ts +0 -156
- package/core/view-generator.ts +0 -536
- package/packages/web/app/project/[id]/stats/loading.tsx +0 -43
- package/packages/web/app/project/[id]/stats/page.tsx +0 -253
- package/templates/agent-assignment.md +0 -72
- package/templates/analysis/project-analysis.md +0 -78
- package/templates/checklists/accessibility.md +0 -33
- package/templates/commands/build.md +0 -17
- package/templates/commands/decision.md +0 -226
- package/templates/commands/fix.md +0 -79
- package/templates/commands/help.md +0 -61
- package/templates/commands/progress.md +0 -14
- package/templates/commands/recap.md +0 -14
- package/templates/commands/roadmap.md +0 -52
- package/templates/commands/status.md +0 -17
- package/templates/commands/task.md +0 -63
- package/templates/commands/work.md +0 -44
- package/templates/commands/workflow.md +0 -12
|
@@ -2,35 +2,116 @@
|
|
|
2
2
|
allowed-tools: [Read, Write, Bash]
|
|
3
3
|
description: 'Initialize prjct'
|
|
4
4
|
timestamp-rule: 'GetTimestamp() for all timestamps'
|
|
5
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
+
storage-layer: true
|
|
5
7
|
---
|
|
6
8
|
|
|
7
|
-
# /p:init
|
|
9
|
+
# /p:init - Initialize Project
|
|
10
|
+
|
|
11
|
+
## Architecture: Write-Through Pattern
|
|
12
|
+
|
|
13
|
+
Creates the full storage structure for a new project.
|
|
8
14
|
|
|
9
15
|
## Context Variables
|
|
10
|
-
- `{projectId}`: Generated
|
|
16
|
+
- `{projectId}`: Generated UUID (standard format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
|
|
11
17
|
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
12
18
|
- `{cwd}`: Current working directory (repository path)
|
|
13
19
|
|
|
20
|
+
## Project ID Format
|
|
21
|
+
|
|
22
|
+
**CRITICAL**: Project IDs MUST be standard UUIDs for PostgreSQL consistency.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
26
|
+
Example: 550e8400-e29b-41d4-a716-446655440000
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Generate using: `crypto.randomUUID()`
|
|
30
|
+
|
|
14
31
|
## Flow
|
|
15
32
|
|
|
16
|
-
**
|
|
17
|
-
**
|
|
33
|
+
1. **Check existing**: Read `.prjct/prjct.config.json`
|
|
34
|
+
2. **Generate UUID**: Use `crypto.randomUUID()`
|
|
35
|
+
3. **Create directories**: storage/, context/, sync/, agents/, memory/
|
|
36
|
+
4. **Create config files**: local + global
|
|
37
|
+
5. **Analyze project**: Detect stack, dependencies
|
|
38
|
+
6. **Generate agents**: Based on detected stack
|
|
39
|
+
|
|
40
|
+
## Directory Structure
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
~/.prjct-cli/projects/{projectId}/
|
|
44
|
+
├── storage/ # Source of Truth (JSON)
|
|
45
|
+
│ ├── state.json # Current + paused task
|
|
46
|
+
│ ├── queue.json # Task queue
|
|
47
|
+
│ ├── ideas.json # Ideas list
|
|
48
|
+
│ └── shipped.json # Shipped features
|
|
49
|
+
├── context/ # For Claude (MD)
|
|
50
|
+
│ ├── CLAUDE.md # Full context
|
|
51
|
+
│ ├── now.md # Current task
|
|
52
|
+
│ ├── next.md # Queue
|
|
53
|
+
│ ├── ideas.md # Ideas
|
|
54
|
+
│ └── shipped.md # Shipped
|
|
55
|
+
├── sync/ # Backend Sync
|
|
56
|
+
│ └── pending.json # Events queue
|
|
57
|
+
├── agents/ # Specialists
|
|
58
|
+
├── memory/ # Audit Trail
|
|
59
|
+
│ └── events.jsonl
|
|
60
|
+
├── progress/ # Historical Data
|
|
61
|
+
│ └── sessions/{YYYY-MM}/
|
|
62
|
+
└── project.json # Metadata
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Step: Create Storage Files
|
|
66
|
+
|
|
67
|
+
### storage/state.json
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"currentTask": null,
|
|
71
|
+
"pausedTask": null,
|
|
72
|
+
"previousTask": null,
|
|
73
|
+
"lastUpdated": null
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### storage/queue.json
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"tasks": [],
|
|
81
|
+
"lastUpdated": null
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### storage/ideas.json
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"ideas": [],
|
|
89
|
+
"lastUpdated": null
|
|
90
|
+
}
|
|
91
|
+
```
|
|
18
92
|
|
|
19
|
-
|
|
20
|
-
|
|
93
|
+
### storage/shipped.json
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"shipped": [],
|
|
97
|
+
"lastUpdated": null
|
|
98
|
+
}
|
|
99
|
+
```
|
|
21
100
|
|
|
22
|
-
|
|
23
|
-
|
|
101
|
+
### sync/pending.json
|
|
102
|
+
```json
|
|
103
|
+
[]
|
|
104
|
+
```
|
|
24
105
|
|
|
25
106
|
## Step: Create project.json (REQUIRED)
|
|
26
107
|
|
|
27
|
-
This file is the source of truth for the web dashboard.
|
|
108
|
+
This file is the source of truth for the web dashboard.
|
|
28
109
|
|
|
29
110
|
### Determine Project Name
|
|
30
111
|
- Try package.json → `name` field
|
|
31
112
|
- Try Cargo.toml → `[package] name`
|
|
32
113
|
- Try pyproject.toml → `[project] name`
|
|
33
|
-
- Fallback to directory name
|
|
114
|
+
- Fallback to directory name
|
|
34
115
|
|
|
35
116
|
WRITE: `{globalPath}/project.json`
|
|
36
117
|
|
|
@@ -44,18 +125,41 @@ WRITE: `{globalPath}/project.json`
|
|
|
44
125
|
}
|
|
45
126
|
```
|
|
46
127
|
|
|
128
|
+
## Step: Create Local Config
|
|
129
|
+
|
|
130
|
+
WRITE: `.prjct/prjct.config.json`
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"projectId": "{projectId}",
|
|
135
|
+
"dataPath": "~/.prjct-cli/projects/{projectId}"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
47
139
|
## Response
|
|
48
|
-
`✅ Init | {stack} | {N} agents | Next: /p:feature or /p:help`
|
|
49
140
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
141
|
+
```
|
|
142
|
+
✅ Initialized prjct
|
|
143
|
+
|
|
144
|
+
Project ID: {projectId}
|
|
145
|
+
Data Path: ~/.prjct-cli/projects/{projectId}/
|
|
53
146
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
147
|
+
Structure:
|
|
148
|
+
├── storage/ # JSON (source of truth)
|
|
149
|
+
├── context/ # MD (for Claude)
|
|
150
|
+
├── sync/ # Backend events
|
|
151
|
+
└── agents/ # Specialists
|
|
152
|
+
|
|
153
|
+
Next:
|
|
154
|
+
• /p:sync - Analyze project and generate agents
|
|
155
|
+
• /p:feature "{first_feature}" - Start first feature
|
|
156
|
+
• /p:help - See all commands
|
|
157
|
+
```
|
|
58
158
|
|
|
59
|
-
|
|
159
|
+
## Error Handling
|
|
60
160
|
|
|
61
|
-
|
|
161
|
+
| Error | Response |
|
|
162
|
+
|-------|----------|
|
|
163
|
+
| Already initialized | Show existing projectId |
|
|
164
|
+
| Permission denied | Suggest chmod |
|
|
165
|
+
| Write fails | Show error |
|
|
@@ -1,61 +1,96 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Write, Bash]
|
|
3
|
-
description: 'Migrate all
|
|
3
|
+
description: 'Migrate all projects to UUID format'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /p:migrate-all
|
|
7
7
|
|
|
8
|
+
Migrate all projects to UUID format.
|
|
9
|
+
|
|
8
10
|
## Usage
|
|
9
11
|
|
|
10
12
|
```
|
|
11
|
-
/p:migrate-all [--deep-scan] [--
|
|
13
|
+
/p:migrate-all [--deep-scan] [--dry-run]
|
|
12
14
|
```
|
|
13
15
|
|
|
14
16
|
## What It Does
|
|
15
17
|
|
|
16
|
-
1. **Scans global storage** →
|
|
17
|
-
2. **
|
|
18
|
-
3. **Migrates each project** →
|
|
19
|
-
4. **
|
|
20
|
-
5. **Reports summary** → Shows migrated, skipped, failed counts
|
|
18
|
+
1. **Scans global storage** → Lists all projects in `~/.prjct-cli/projects/`
|
|
19
|
+
2. **Checks UUID format** → Identifies projects with non-UUID IDs
|
|
20
|
+
3. **Migrates each project** → Renames folders and updates configs to UUID
|
|
21
|
+
4. **Reports summary** → Shows migrated, skipped, failed counts
|
|
21
22
|
|
|
22
23
|
## Options
|
|
23
24
|
|
|
24
|
-
- `--deep-scan`:
|
|
25
|
-
- `--remove-legacy`: Delete old `.prjct/` after successful migration
|
|
25
|
+
- `--deep-scan`: Also scan for projects in common locations
|
|
26
26
|
- `--dry-run`: Show what would be migrated without making changes
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Migration Flow
|
|
29
|
+
|
|
30
|
+
For each project:
|
|
31
|
+
|
|
32
|
+
1. Read `project.json` to get current ID
|
|
33
|
+
2. Check if ID is already UUID format
|
|
34
|
+
3. If not UUID:
|
|
35
|
+
- Generate new UUID
|
|
36
|
+
- Rename folder to new UUID
|
|
37
|
+
- Update `project.json`
|
|
38
|
+
- Find and update linked `.prjct/prjct.config.json`
|
|
39
|
+
|
|
40
|
+
## UUID Format
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
- Troubleshooting projects not working after update
|
|
42
|
+
Standard UUID: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` (36 chars)
|
|
43
|
+
Example: `550e8400-e29b-41d4-a716-446655440000`
|
|
33
44
|
|
|
34
|
-
##
|
|
45
|
+
## Before → After
|
|
35
46
|
|
|
36
|
-
**Before
|
|
47
|
+
**Before**:
|
|
37
48
|
```
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
~/.prjct-cli/projects/
|
|
50
|
+
3a5667a5dedb/ # Hash-based ID
|
|
51
|
+
abc12345/ # Short ID
|
|
40
52
|
```
|
|
41
53
|
|
|
42
|
-
**After
|
|
54
|
+
**After**:
|
|
43
55
|
```
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
~/.prjct-cli/projects/{id}/
|
|
48
|
-
core/, planning/, progress/, memory/, analysis/, agents/
|
|
56
|
+
~/.prjct-cli/projects/
|
|
57
|
+
550e8400-e29b-41d4-a716-446655440000/ # UUID
|
|
58
|
+
7c9e6679-7425-40de-944b-e07fc1f90ae7/ # UUID
|
|
49
59
|
```
|
|
50
60
|
|
|
51
61
|
## Safety
|
|
52
62
|
|
|
53
|
-
- **Idempotent**: Safe to run multiple times
|
|
54
|
-
- **Non-destructive**:
|
|
63
|
+
- **Idempotent**: Safe to run multiple times (skips UUIDs)
|
|
64
|
+
- **Non-destructive**: Renames, doesn't delete
|
|
55
65
|
- **Dry run**: Test with `--dry-run` first
|
|
56
|
-
- **Automatic backup**: Legacy data preserved until explicitly removed
|
|
57
66
|
|
|
58
67
|
## Requirements
|
|
59
68
|
|
|
60
|
-
- Write permissions to `~/.prjct-cli/`
|
|
61
|
-
- Projects must have valid
|
|
69
|
+
- Write permissions to `~/.prjct-cli/`
|
|
70
|
+
- Projects must have valid `project.json`
|
|
71
|
+
|
|
72
|
+
## Output
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
📦 UUID Migration
|
|
76
|
+
|
|
77
|
+
Scanning ~/.prjct-cli/projects/...
|
|
78
|
+
|
|
79
|
+
Found 5 projects:
|
|
80
|
+
- 3a5667a5dedb: Needs migration
|
|
81
|
+
- abc12345: Needs migration
|
|
82
|
+
- 550e8400-e29b-...: Already UUID ✓
|
|
83
|
+
- def67890: Needs migration
|
|
84
|
+
- 7c9e6679-7425-...: Already UUID ✓
|
|
85
|
+
|
|
86
|
+
Migrating 3 projects...
|
|
87
|
+
|
|
88
|
+
✅ 3a5667a5dedb → 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
|
|
89
|
+
✅ abc12345 → 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
|
|
90
|
+
✅ def67890 → 2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e
|
|
91
|
+
|
|
92
|
+
Summary:
|
|
93
|
+
- Migrated: 3
|
|
94
|
+
- Skipped (already UUID): 2
|
|
95
|
+
- Failed: 0
|
|
96
|
+
```
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: [Read, Write, Bash, Glob]
|
|
3
|
+
description: 'Migrate project to UUID format + sync'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /p:migrate - UUID Migration
|
|
7
|
+
|
|
8
|
+
Migrate project ID to UUID format and run full sync.
|
|
9
|
+
|
|
10
|
+
## Context Variables
|
|
11
|
+
|
|
12
|
+
- `{projectId}`: Current ID from `.prjct/prjct.config.json`
|
|
13
|
+
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
14
|
+
|
|
15
|
+
## Step 1: Read Configuration
|
|
16
|
+
|
|
17
|
+
READ: `.prjct/prjct.config.json`
|
|
18
|
+
EXTRACT: `projectId`
|
|
19
|
+
|
|
20
|
+
IF file not found:
|
|
21
|
+
OUTPUT: "No prjct project. Run /p:init first."
|
|
22
|
+
STOP
|
|
23
|
+
|
|
24
|
+
## Step 2: Check UUID Format
|
|
25
|
+
|
|
26
|
+
UUID format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` (36 chars with dashes)
|
|
27
|
+
|
|
28
|
+
IF projectId matches UUID regex `/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i`:
|
|
29
|
+
OUTPUT: "✅ Already UUID: {projectId}"
|
|
30
|
+
GOTO: Step 7 (Run Sync)
|
|
31
|
+
|
|
32
|
+
IF projectId does NOT match UUID format:
|
|
33
|
+
CONTINUE to Step 3
|
|
34
|
+
|
|
35
|
+
## Step 3: Generate New UUID
|
|
36
|
+
|
|
37
|
+
Generate new UUID using Node.js `crypto.randomUUID()`.
|
|
38
|
+
|
|
39
|
+
Store:
|
|
40
|
+
- `{oldId}` = current projectId
|
|
41
|
+
- `{newId}` = generated UUID
|
|
42
|
+
|
|
43
|
+
## Step 4: Show Migration Plan
|
|
44
|
+
|
|
45
|
+
OUTPUT:
|
|
46
|
+
```
|
|
47
|
+
📦 UUID Migration Plan
|
|
48
|
+
|
|
49
|
+
Current ID: {oldId} (non-UUID format)
|
|
50
|
+
New UUID: {newId}
|
|
51
|
+
|
|
52
|
+
Actions:
|
|
53
|
+
1. Rename folder: ~/.prjct-cli/projects/{oldId}/ → ~/.prjct-cli/projects/{newId}/
|
|
54
|
+
2. Update .prjct/prjct.config.json
|
|
55
|
+
3. Update project.json
|
|
56
|
+
4. Run /p:sync
|
|
57
|
+
|
|
58
|
+
Continue? (yes/no)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
WAIT for user confirmation.
|
|
62
|
+
|
|
63
|
+
## Step 5: Rename Global Folder
|
|
64
|
+
|
|
65
|
+
BASH:
|
|
66
|
+
```bash
|
|
67
|
+
mv ~/.prjct-cli/projects/{oldId} ~/.prjct-cli/projects/{newId}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
IF error:
|
|
71
|
+
OUTPUT: "❌ Failed to rename folder: {error}"
|
|
72
|
+
STOP
|
|
73
|
+
|
|
74
|
+
## Step 6: Update Configuration Files
|
|
75
|
+
|
|
76
|
+
### Local Config (.prjct/prjct.config.json)
|
|
77
|
+
|
|
78
|
+
READ current config, UPDATE:
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"projectId": "{newId}",
|
|
82
|
+
"dataPath": "~/.prjct-cli/projects/{newId}"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
WRITE back to `.prjct/prjct.config.json`
|
|
87
|
+
|
|
88
|
+
### Global Config (project.json)
|
|
89
|
+
|
|
90
|
+
READ: `~/.prjct-cli/projects/{newId}/project.json`
|
|
91
|
+
REPLACE all occurrences of `{oldId}` with `{newId}`
|
|
92
|
+
WRITE back
|
|
93
|
+
|
|
94
|
+
## Step 7: Run Sync
|
|
95
|
+
|
|
96
|
+
Execute `/p:sync` to:
|
|
97
|
+
- Analyze project
|
|
98
|
+
- Regenerate CLAUDE.md
|
|
99
|
+
- Update agents
|
|
100
|
+
|
|
101
|
+
## Output
|
|
102
|
+
|
|
103
|
+
**If migrated:**
|
|
104
|
+
```
|
|
105
|
+
✅ Migrated to UUID
|
|
106
|
+
|
|
107
|
+
Old ID: {oldId}
|
|
108
|
+
New ID: {newId}
|
|
109
|
+
|
|
110
|
+
Updated:
|
|
111
|
+
- Folder renamed
|
|
112
|
+
- Config updated
|
|
113
|
+
- Sync completed
|
|
114
|
+
|
|
115
|
+
Next: Continue working with /p:now
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**If skipped (already UUID):**
|
|
119
|
+
```
|
|
120
|
+
✅ Already UUID: {projectId}
|
|
121
|
+
|
|
122
|
+
Sync completed.
|
|
123
|
+
|
|
124
|
+
Next: Continue working with /p:now
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Error Handling
|
|
128
|
+
|
|
129
|
+
| Error | Action |
|
|
130
|
+
|-------|--------|
|
|
131
|
+
| No config | "Run /p:init first" |
|
|
132
|
+
| Folder not found | "Global data missing - reinitialize" |
|
|
133
|
+
| Rename failed | Show error, abort |
|
|
134
|
+
| User cancels | STOP without changes |
|
|
135
|
+
|
|
136
|
+
## Notes
|
|
137
|
+
|
|
138
|
+
- Migration is idempotent: if already UUID, skips to sync
|
|
139
|
+
- UUIDs are standard format for PostgreSQL consistency
|
|
140
|
+
- Always runs sync after migration
|
|
@@ -1,14 +1,124 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read]
|
|
3
3
|
description: 'Show priority queue'
|
|
4
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
5
|
+
storage-layer: true
|
|
6
|
+
source-of-truth: 'storage/queue.json'
|
|
7
|
+
claude-context: 'context/next.md'
|
|
4
8
|
---
|
|
5
9
|
|
|
6
|
-
# /p:next
|
|
10
|
+
# /p:next - Show Priority Queue
|
|
11
|
+
|
|
12
|
+
## Architecture: Write-Through Pattern
|
|
13
|
+
|
|
14
|
+
Reads from **Storage (JSON)** as source of truth.
|
|
15
|
+
|
|
16
|
+
**Source of Truth**: `storage/queue.json`
|
|
17
|
+
**Also reads**: `storage/state.json` for current task status
|
|
18
|
+
|
|
19
|
+
## Context Variables
|
|
20
|
+
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
21
|
+
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
22
|
+
- `{queuePath}`: `{globalPath}/storage/queue.json`
|
|
23
|
+
- `{statePath}`: `{globalPath}/storage/state.json`
|
|
7
24
|
|
|
8
25
|
## Flow
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
|
|
27
|
+
1. Read `storage/state.json` → Check if active task
|
|
28
|
+
2. Read `storage/queue.json` → Get queue tasks
|
|
29
|
+
3. Display top 5 non-blocked tasks
|
|
11
30
|
|
|
12
31
|
## Response
|
|
13
|
-
|
|
14
|
-
**
|
|
32
|
+
|
|
33
|
+
**If active task**:
|
|
34
|
+
```
|
|
35
|
+
⚠️ Active: {currentTask.description}
|
|
36
|
+
|
|
37
|
+
Complete with /p:done first, or:
|
|
38
|
+
|
|
39
|
+
📋 Queue ({count})
|
|
40
|
+
1. {task_1}
|
|
41
|
+
2. {task_2}
|
|
42
|
+
3. {task_3}
|
|
43
|
+
...
|
|
44
|
+
|
|
45
|
+
Start: /p:work {N}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**If no active task**:
|
|
49
|
+
```
|
|
50
|
+
📋 Queue ({count})
|
|
51
|
+
|
|
52
|
+
1. {task_1} {priority}
|
|
53
|
+
2. {task_2} {priority}
|
|
54
|
+
3. {task_3} {priority}
|
|
55
|
+
4. {task_4}
|
|
56
|
+
5. {task_5}
|
|
57
|
+
|
|
58
|
+
{IF count > 5: ... and {count - 5} more}
|
|
59
|
+
|
|
60
|
+
Start: /p:work 1 or /p:now "{task}"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**If empty queue**:
|
|
64
|
+
```
|
|
65
|
+
📋 Queue is empty
|
|
66
|
+
|
|
67
|
+
Add tasks:
|
|
68
|
+
• /p:feature "description"
|
|
69
|
+
• /p:bug "description"
|
|
70
|
+
• /p:idea "quick note"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Data Source
|
|
74
|
+
|
|
75
|
+
| Data | Storage File | Field |
|
|
76
|
+
|------|--------------|-------|
|
|
77
|
+
| Current Task | `storage/state.json` | `currentTask` |
|
|
78
|
+
| Queue Tasks | `storage/queue.json` | `tasks[]` |
|
|
79
|
+
| Shipped | `storage/shipped.json` | `shipped[]` |
|
|
80
|
+
|
|
81
|
+
## Usage Variants
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
/p:next # Priority queue (default)
|
|
85
|
+
/p:next roadmap # Feature-grouped view
|
|
86
|
+
/p:next --roadmap # Same as above
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Roadmap View
|
|
90
|
+
|
|
91
|
+
When called with `roadmap` parameter, show feature-grouped view:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
📍 PRODUCT ROADMAP
|
|
95
|
+
|
|
96
|
+
🚀 Current Sprint
|
|
97
|
+
├── ✅ {completed_feature} - shipped {date}
|
|
98
|
+
├── 🔄 {active_feature} ({X}% complete)
|
|
99
|
+
│ └── 🎯 {current_task}
|
|
100
|
+
└── ⏳ {pending_feature} ({N} tasks)
|
|
101
|
+
|
|
102
|
+
📅 Next Up ({N} features)
|
|
103
|
+
├── {feature_1} - {effort}
|
|
104
|
+
└── {feature_2} - {effort}
|
|
105
|
+
|
|
106
|
+
📊 Velocity: {X.X} features/week
|
|
107
|
+
|
|
108
|
+
/p:now "{next}" | /p:done
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Roadmap Data Aggregation
|
|
112
|
+
|
|
113
|
+
1. Group queue tasks by `featureId`
|
|
114
|
+
2. Calculate completion % per feature
|
|
115
|
+
3. Sort by priority/dependency
|
|
116
|
+
4. Show current task within active feature
|
|
117
|
+
|
|
118
|
+
## Natural Language Support
|
|
119
|
+
|
|
120
|
+
- "p. next" → Priority queue
|
|
121
|
+
- "p. queue" → Priority queue
|
|
122
|
+
- "p. what's next" → Priority queue
|
|
123
|
+
- "p. roadmap" → Roadmap view
|
|
124
|
+
- "p. features" → Roadmap view
|