prjct-cli 0.13.3 → 0.15.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 +106 -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/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/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,13 +2,27 @@
|
|
|
2
2
|
allowed-tools: [Read, Write, Bash, Glob, Grep]
|
|
3
3
|
description: 'Deep sync - analyze git, update ALL project data'
|
|
4
4
|
timestamp-rule: 'GetTimestamp() for all timestamps'
|
|
5
|
-
architecture: '
|
|
5
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
+
storage-layer: true
|
|
7
|
+
source-of-truth: 'storage/*.json'
|
|
8
|
+
claude-context: 'context/*.md'
|
|
9
|
+
backend-sync: 'sync/pending.json'
|
|
6
10
|
---
|
|
7
11
|
|
|
8
12
|
# /p:sync - Deep Project Sync
|
|
9
13
|
|
|
10
14
|
**CRITICAL**: This is a DEEP analysis. Sync EVERYTHING with the real state of the repository.
|
|
11
15
|
|
|
16
|
+
## Architecture: Write-Through Pattern
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Git Analysis → Storage (JSON) → Context (MD) → Project Metadata
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Source of Truth**: `storage/*.json` (state, queue, ideas, shipped)
|
|
23
|
+
**Claude Context**: `context/*.md` (now, next, ideas, shipped, CLAUDE.md)
|
|
24
|
+
**Project Metadata**: `project.json`
|
|
25
|
+
|
|
12
26
|
## What Gets Analyzed & Updated
|
|
13
27
|
|
|
14
28
|
### Git Analysis (Deep)
|
|
@@ -17,18 +31,21 @@ architecture: 'MD-first - MD files are source of truth'
|
|
|
17
31
|
- `git diff` - What's changed since last commit
|
|
18
32
|
- `git branch` - Current branch, feature branches
|
|
19
33
|
|
|
20
|
-
###
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
|
|
34
|
+
### Storage Files (Source of Truth)
|
|
35
|
+
- `storage/state.json` - Current task state
|
|
36
|
+
- `storage/queue.json` - Task queue
|
|
37
|
+
- `storage/ideas.json` - Ideas list
|
|
38
|
+
- `storage/shipped.json` - Shipped features
|
|
39
|
+
|
|
40
|
+
### Context Files (Generated for Claude)
|
|
41
|
+
- `context/now.md` - Current task (from state.json)
|
|
42
|
+
- `context/next.md` - Task queue (from queue.json)
|
|
43
|
+
- `context/ideas.md` - Ideas (from ideas.json)
|
|
44
|
+
- `context/shipped.md` - Shipped (from shipped.json)
|
|
45
|
+
- `context/CLAUDE.md` - Full project context
|
|
26
46
|
|
|
27
47
|
### Project Metadata
|
|
28
48
|
- `project.json` - ALL fields with real data
|
|
29
|
-
- `CLAUDE.md` - Quick Reference with real stats
|
|
30
|
-
- `analysis/repo-summary.md` - Full analysis
|
|
31
|
-
- `agents/*.md` - Specialized agents
|
|
32
49
|
|
|
33
50
|
## Context Variables
|
|
34
51
|
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
@@ -56,9 +73,9 @@ git status --porcelain
|
|
|
56
73
|
```
|
|
57
74
|
|
|
58
75
|
EXTRACT:
|
|
59
|
-
- `{stagedFiles}`: Files staged for commit
|
|
60
|
-
- `{modifiedFiles}`: Modified but not staged
|
|
61
|
-
- `{untrackedFiles}`: New files
|
|
76
|
+
- `{stagedFiles}`: Files staged for commit
|
|
77
|
+
- `{modifiedFiles}`: Modified but not staged
|
|
78
|
+
- `{untrackedFiles}`: New files
|
|
62
79
|
- `{hasUncommittedChanges}`: true/false
|
|
63
80
|
|
|
64
81
|
### 2.2 Recent Commits (Last 20)
|
|
@@ -66,17 +83,14 @@ EXTRACT:
|
|
|
66
83
|
git log --oneline -20 --pretty=format:"%h|%s|%ad" --date=short
|
|
67
84
|
```
|
|
68
85
|
|
|
69
|
-
ANALYZE each commit
|
|
70
|
-
- Keywords: "feat:", "fix:", "complete", "done", "implement", "add", "finish"
|
|
71
|
-
- Task patterns: "Task: X", "#123", issue references
|
|
72
|
-
- Feature completions: "feat(auth):", "feat: user login"
|
|
86
|
+
ANALYZE each commit for completed tasks.
|
|
73
87
|
|
|
74
88
|
EXTRACT: `{completedTasks}` - List of tasks found in commits
|
|
75
89
|
|
|
76
90
|
### 2.3 Current Branch Analysis
|
|
77
91
|
```bash
|
|
78
92
|
git branch --show-current
|
|
79
|
-
git log main..HEAD --oneline 2>/dev/null
|
|
93
|
+
git log main..HEAD --oneline 2>/dev/null
|
|
80
94
|
```
|
|
81
95
|
|
|
82
96
|
EXTRACT:
|
|
@@ -84,21 +98,13 @@ EXTRACT:
|
|
|
84
98
|
- `{branchCommits}`: Commits ahead of main
|
|
85
99
|
- `{isFeatureBranch}`: true if not main/master
|
|
86
100
|
|
|
87
|
-
### 2.4 Uncommitted Changes Summary
|
|
88
|
-
```bash
|
|
89
|
-
git diff --stat
|
|
90
|
-
git diff --cached --stat
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
EXTRACT: `{changesDescription}` - What files are being worked on
|
|
94
|
-
|
|
95
101
|
---
|
|
96
102
|
|
|
97
103
|
## Step 3: Gather Project Stats
|
|
98
104
|
|
|
99
105
|
### Count Files
|
|
100
106
|
```bash
|
|
101
|
-
find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.
|
|
107
|
+
find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.tsx" -o -name "*.py" \) -not -path "./node_modules/*" -not -path "./.git/*" | wc -l
|
|
102
108
|
```
|
|
103
109
|
EXTRACT: `{fileCount}`
|
|
104
110
|
|
|
@@ -127,86 +133,120 @@ EXTRACT: `{languages}`, `{frameworks}`, `{techStack}`
|
|
|
127
133
|
|
|
128
134
|
---
|
|
129
135
|
|
|
130
|
-
## Step 4:
|
|
136
|
+
## Step 4: Regenerate ALL Context Files
|
|
131
137
|
|
|
132
|
-
### 4.1
|
|
138
|
+
### 4.1 Read Storage (Source of Truth)
|
|
133
139
|
|
|
134
|
-
READ: `{globalPath}/
|
|
140
|
+
READ: `{globalPath}/storage/state.json`
|
|
141
|
+
READ: `{globalPath}/storage/queue.json`
|
|
142
|
+
READ: `{globalPath}/storage/ideas.json`
|
|
143
|
+
READ: `{globalPath}/storage/shipped.json`
|
|
135
144
|
|
|
136
|
-
|
|
137
|
-
- IF `{hasUncommittedChanges}` AND now.md is empty:
|
|
138
|
-
- INFER task from modified files (e.g., "Working on: auth module")
|
|
139
|
-
- UPDATE now.md with inferred task
|
|
145
|
+
### 4.2 Generate context/now.md
|
|
140
146
|
|
|
141
|
-
|
|
142
|
-
- Task is DONE → Clear now.md, add to shipped.md
|
|
147
|
+
WRITE: `{globalPath}/context/now.md`
|
|
143
148
|
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
IF state.currentTask exists:
|
|
150
|
+
```markdown
|
|
151
|
+
# NOW
|
|
146
152
|
|
|
147
|
-
|
|
153
|
+
**{state.currentTask.description}**
|
|
148
154
|
|
|
149
|
-
|
|
155
|
+
Started: {state.currentTask.startedAt}
|
|
156
|
+
Session: {state.currentTask.sessionId}
|
|
157
|
+
{IF estimate: Estimate: {state.currentTask.estimate}}
|
|
158
|
+
```
|
|
150
159
|
|
|
151
|
-
|
|
160
|
+
ELSE IF state.pausedTask exists:
|
|
161
|
+
```markdown
|
|
162
|
+
# NOW
|
|
152
163
|
|
|
153
|
-
**
|
|
154
|
-
- Parse existing tasks (lines starting with `- `)
|
|
155
|
-
- For each task, check if it appears in `{completedTasks}` from commits
|
|
156
|
-
- REMOVE completed tasks from queue
|
|
157
|
-
- Keep remaining tasks
|
|
164
|
+
⏸️ **{state.pausedTask.description}** (paused)
|
|
158
165
|
|
|
159
|
-
|
|
166
|
+
Paused: {state.pausedTask.pausedAt}
|
|
167
|
+
Reason: {state.pausedTask.pauseReason}
|
|
168
|
+
```
|
|
160
169
|
|
|
161
|
-
|
|
170
|
+
ELSE:
|
|
171
|
+
```markdown
|
|
172
|
+
# NOW
|
|
162
173
|
|
|
163
|
-
|
|
174
|
+
_No active task_
|
|
164
175
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
176
|
+
Use `/p:now <task>` to start working.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 4.3 Generate context/next.md
|
|
180
|
+
|
|
181
|
+
WRITE: `{globalPath}/context/next.md`
|
|
169
182
|
|
|
170
|
-
FORMAT for new entries:
|
|
171
183
|
```markdown
|
|
172
|
-
|
|
173
|
-
|
|
184
|
+
# NEXT
|
|
185
|
+
|
|
186
|
+
## Active
|
|
187
|
+
|
|
188
|
+
{FOR EACH task in queue.tasks WHERE section == "active":}
|
|
189
|
+
- [ ] {task.description} {task.priority ? `[${task.priority}]` : ''}
|
|
190
|
+
{END FOR}
|
|
191
|
+
|
|
192
|
+
## Backlog
|
|
193
|
+
|
|
194
|
+
{FOR EACH task in queue.tasks WHERE section == "backlog":}
|
|
195
|
+
- [ ] {task.description}
|
|
196
|
+
{END FOR}
|
|
174
197
|
```
|
|
175
198
|
|
|
176
|
-
|
|
199
|
+
### 4.4 Generate context/ideas.md
|
|
200
|
+
|
|
201
|
+
WRITE: `{globalPath}/context/ideas.md`
|
|
202
|
+
|
|
203
|
+
```markdown
|
|
204
|
+
# IDEAS
|
|
177
205
|
|
|
178
|
-
|
|
206
|
+
## Pending
|
|
179
207
|
|
|
180
|
-
|
|
208
|
+
{FOR EACH idea in ideas.ideas WHERE status == "pending":}
|
|
209
|
+
- **{idea.text}** {idea.tags.join(' ')}
|
|
210
|
+
- Priority: {idea.priority}
|
|
211
|
+
- Added: {idea.createdAt}
|
|
212
|
+
{END FOR}
|
|
181
213
|
|
|
182
|
-
|
|
183
|
-
- Parse existing ideas
|
|
184
|
-
- Check if any idea was implemented (appears in commits)
|
|
185
|
-
- REMOVE implemented ideas OR mark as done
|
|
214
|
+
## Converted
|
|
186
215
|
|
|
187
|
-
|
|
216
|
+
{FOR EACH idea in ideas.ideas WHERE status == "converted":}
|
|
217
|
+
- ~~{idea.text}~~ → Feature
|
|
218
|
+
{END FOR}
|
|
219
|
+
```
|
|
188
220
|
|
|
189
|
-
### 4.5
|
|
221
|
+
### 4.5 Generate context/shipped.md
|
|
190
222
|
|
|
191
|
-
|
|
223
|
+
WRITE: `{globalPath}/context/shipped.md`
|
|
192
224
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
- For each feature, check commits for implementation
|
|
196
|
-
- UPDATE status: planning → in-progress → completed
|
|
197
|
-
- Add completion dates where applicable
|
|
225
|
+
```markdown
|
|
226
|
+
# SHIPPED 🚀
|
|
198
227
|
|
|
199
|
-
|
|
228
|
+
## {Current Month Year}
|
|
229
|
+
|
|
230
|
+
{FOR EACH ship in shipped.shipped WHERE month matches:}
|
|
231
|
+
- **{ship.name}** v{ship.version} - {formatDate(ship.shippedAt)}
|
|
232
|
+
{END FOR}
|
|
200
233
|
|
|
201
234
|
---
|
|
202
235
|
|
|
203
|
-
|
|
236
|
+
**Total shipped:** {shipped.shipped.length}
|
|
237
|
+
```
|
|
204
238
|
|
|
205
|
-
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Step 5: Update context/CLAUDE.md
|
|
206
242
|
|
|
207
|
-
|
|
243
|
+
WRITE: `{globalPath}/context/CLAUDE.md`
|
|
208
244
|
|
|
209
245
|
```markdown
|
|
246
|
+
# {projectName} - Project Context
|
|
247
|
+
<!-- projectId: {projectId} -->
|
|
248
|
+
<!-- Generated: {GetTimestamp()} -->
|
|
249
|
+
|
|
210
250
|
## Quick Reference
|
|
211
251
|
|
|
212
252
|
| Field | Value |
|
|
@@ -219,11 +259,7 @@ READ: `{globalPath}/CLAUDE.md`
|
|
|
219
259
|
| **Branch** | {currentBranch} |
|
|
220
260
|
| **Path** | {cwd} |
|
|
221
261
|
| **Last Sync** | {GetTimestamp()} |
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Git Status Section
|
|
225
262
|
|
|
226
|
-
```markdown
|
|
227
263
|
## Current Git Status
|
|
228
264
|
|
|
229
265
|
**Branch**: `{currentBranch}`
|
|
@@ -232,13 +268,46 @@ READ: `{globalPath}/CLAUDE.md`
|
|
|
232
268
|
{IF hasUncommittedChanges}
|
|
233
269
|
### Modified Files
|
|
234
270
|
{list of modified files}
|
|
235
|
-
|
|
236
|
-
### What's Being Worked On
|
|
237
|
-
{changesDescription}
|
|
238
271
|
{ENDIF}
|
|
239
|
-
```
|
|
240
272
|
|
|
241
|
-
|
|
273
|
+
## PROJECT DATA
|
|
274
|
+
|
|
275
|
+
### Dependencies
|
|
276
|
+
{list dependencies from package.json}
|
|
277
|
+
|
|
278
|
+
### Scripts
|
|
279
|
+
{list scripts from package.json}
|
|
280
|
+
|
|
281
|
+
## CURRENT STATE
|
|
282
|
+
|
|
283
|
+
**Now:** {currentTask or "_No active task_"}
|
|
284
|
+
|
|
285
|
+
**Queue ({queue.tasks.length}):**
|
|
286
|
+
{list first 5 tasks}
|
|
287
|
+
|
|
288
|
+
**Ideas ({ideas.ideas.length}):**
|
|
289
|
+
{list first 3 ideas}
|
|
290
|
+
|
|
291
|
+
## DATA LOCATION
|
|
292
|
+
|
|
293
|
+
\`\`\`
|
|
294
|
+
~/.prjct-cli/projects/{projectId}/
|
|
295
|
+
├── storage/ # JSON (source of truth)
|
|
296
|
+
│ ├── state.json
|
|
297
|
+
│ ├── queue.json
|
|
298
|
+
│ ├── ideas.json
|
|
299
|
+
│ └── shipped.json
|
|
300
|
+
├── context/ # MD (for Claude)
|
|
301
|
+
│ ├── CLAUDE.md
|
|
302
|
+
│ ├── now.md
|
|
303
|
+
│ ├── next.md
|
|
304
|
+
│ ├── ideas.md
|
|
305
|
+
│ └── shipped.md
|
|
306
|
+
├── sync/ # Backend sync
|
|
307
|
+
│ └── pending.json
|
|
308
|
+
└── agents/ # Specialists
|
|
309
|
+
\`\`\`
|
|
310
|
+
```
|
|
242
311
|
|
|
243
312
|
---
|
|
244
313
|
|
|
@@ -267,64 +336,28 @@ WRITE: `{globalPath}/project.json`
|
|
|
267
336
|
|
|
268
337
|
---
|
|
269
338
|
|
|
270
|
-
## Step 7: Generate
|
|
339
|
+
## Step 7: Generate Agents (AGENTIC)
|
|
271
340
|
|
|
272
|
-
|
|
273
|
-
WRITE: `{globalPath}/analysis/repo-summary.md`
|
|
341
|
+
Based on detected stack, generate specialized agents.
|
|
274
342
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
- **Path**: {cwd}
|
|
284
|
-
|
|
285
|
-
## Stack
|
|
286
|
-
- **Languages**: {languages}
|
|
287
|
-
- **Frameworks**: {frameworks}
|
|
288
|
-
- **Package Manager**: {packageManager}
|
|
289
|
-
|
|
290
|
-
## Stats
|
|
291
|
-
- **Files**: {fileCount}
|
|
292
|
-
- **Commits**: {commitCount}
|
|
293
|
-
- **Contributors**: {contributorCount}
|
|
294
|
-
|
|
295
|
-
## Structure
|
|
296
|
-
- **Source**: {sourceDir}
|
|
297
|
-
- **Tests**: {testDir}
|
|
298
|
-
- **Config**: {configFiles}
|
|
299
|
-
|
|
300
|
-
## Git Status
|
|
301
|
-
- **Branch**: {currentBranch}
|
|
302
|
-
- **Uncommitted**: {hasUncommittedChanges}
|
|
303
|
-
- **Recent Activity**: {recentCommitCount} commits this week
|
|
343
|
+
For EACH specialist needed:
|
|
344
|
+
```typescript
|
|
345
|
+
const generator = new AgentGenerator('{projectId}')
|
|
346
|
+
await generator.generateDynamicAgent('agent-name', {
|
|
347
|
+
role: 'specific role',
|
|
348
|
+
domain: 'domain',
|
|
349
|
+
expertise: 'technologies'
|
|
350
|
+
})
|
|
304
351
|
```
|
|
305
352
|
|
|
306
|
-
### patterns.md (Code patterns detected)
|
|
307
|
-
Analyze code and WRITE: `{globalPath}/analysis/patterns.md`
|
|
308
|
-
|
|
309
353
|
---
|
|
310
354
|
|
|
311
|
-
## Step 8:
|
|
355
|
+
## Step 8: Log to Memory
|
|
312
356
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
- `coordinator.md` - Always generated
|
|
316
|
-
- `fe.md` - If React/Vue/Angular detected
|
|
317
|
-
- `be.md` - If Express/Fastify/Django detected
|
|
318
|
-
- `qa.md` - If tests detected
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## Step 9: Log to Memory
|
|
323
|
-
|
|
324
|
-
APPEND to: `{globalPath}/memory/context.jsonl`
|
|
357
|
+
APPEND to: `{globalPath}/memory/events.jsonl`
|
|
325
358
|
|
|
326
359
|
```json
|
|
327
|
-
{"ts":"{GetTimestamp()}","action":"sync","branch":"{currentBranch}","uncommitted":{hasUncommittedChanges},"
|
|
360
|
+
{"ts":"{GetTimestamp()}","action":"sync","branch":"{currentBranch}","uncommitted":{hasUncommittedChanges},"fileCount":{fileCount},"commitCount":{commitCount}}
|
|
328
361
|
```
|
|
329
362
|
|
|
330
363
|
---
|
|
@@ -345,24 +378,15 @@ APPEND to: `{globalPath}/memory/context.jsonl`
|
|
|
345
378
|
├── Uncommitted: {hasUncommittedChanges ? "Yes - " + modifiedCount + " files" : "Clean"}
|
|
346
379
|
└── Recent: {recentCommitCount} commits this week
|
|
347
380
|
|
|
348
|
-
|
|
349
|
-
├──
|
|
350
|
-
├──
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
├── core/now.md
|
|
355
|
-
├── core/next.md
|
|
356
|
-
├── progress/shipped.md
|
|
357
|
-
├── planning/ideas.md
|
|
358
|
-
├── planning/roadmap.md
|
|
359
|
-
├── project.json
|
|
360
|
-
├── CLAUDE.md
|
|
361
|
-
└── analysis/*.md
|
|
381
|
+
📁 Context Updated
|
|
382
|
+
├── context/now.md
|
|
383
|
+
├── context/next.md
|
|
384
|
+
├── context/ideas.md
|
|
385
|
+
├── context/shipped.md
|
|
386
|
+
└── context/CLAUDE.md
|
|
362
387
|
|
|
363
388
|
{IF hasUncommittedChanges}
|
|
364
|
-
⚠️ You have uncommitted changes
|
|
365
|
-
{changesDescription}
|
|
389
|
+
⚠️ You have uncommitted changes
|
|
366
390
|
|
|
367
391
|
Next: Commit your work or continue coding
|
|
368
392
|
{ELSE}
|
|
@@ -385,60 +409,25 @@ Next: /p:now to start a new task
|
|
|
385
409
|
|
|
386
410
|
---
|
|
387
411
|
|
|
388
|
-
##
|
|
389
|
-
|
|
390
|
-
### Example: Clean repo, tasks completed
|
|
391
|
-
```
|
|
392
|
-
🔄 Deep Sync Complete
|
|
393
|
-
|
|
394
|
-
📊 Project Stats
|
|
395
|
-
├── Files: 156
|
|
396
|
-
├── Commits: 234
|
|
397
|
-
├── Version: 1.2.0
|
|
398
|
-
└── Stack: TypeScript + React + Node.js
|
|
399
|
-
|
|
400
|
-
🌿 Git Status
|
|
401
|
-
├── Branch: main
|
|
402
|
-
├── Uncommitted: Clean
|
|
403
|
-
└── Recent: 8 commits this week
|
|
404
|
-
|
|
405
|
-
✅ Tasks Synced
|
|
406
|
-
├── Completed (from commits): 3
|
|
407
|
-
├── Removed from queue: 2
|
|
408
|
-
└── Added to shipped: 3
|
|
409
|
-
|
|
410
|
-
📁 Files Updated
|
|
411
|
-
├── core/now.md (cleared - task completed)
|
|
412
|
-
├── core/next.md (2 tasks removed)
|
|
413
|
-
├── progress/shipped.md (+3 entries)
|
|
414
|
-
└── All metadata updated
|
|
415
|
-
|
|
416
|
-
✨ Repository is clean!
|
|
417
|
-
|
|
418
|
-
Next: /p:now to start a new task
|
|
419
|
-
```
|
|
412
|
+
## File Structure Reference
|
|
420
413
|
|
|
421
|
-
### Example: Work in progress
|
|
422
414
|
```
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
├──
|
|
427
|
-
├──
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
├──
|
|
433
|
-
├──
|
|
434
|
-
└──
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
Working on: Authentication module
|
|
442
|
-
|
|
443
|
-
Next: Commit your work or continue coding
|
|
415
|
+
~/.prjct-cli/projects/{projectId}/
|
|
416
|
+
├── storage/ # Source of Truth (JSON)
|
|
417
|
+
│ ├── state.json # Current + paused task
|
|
418
|
+
│ ├── queue.json # Task queue
|
|
419
|
+
│ ├── ideas.json # Ideas list
|
|
420
|
+
│ └── shipped.json # Shipped features
|
|
421
|
+
├── context/ # For Claude (MD)
|
|
422
|
+
│ ├── CLAUDE.md # Full context
|
|
423
|
+
│ ├── now.md # Current task
|
|
424
|
+
│ ├── next.md # Queue
|
|
425
|
+
│ ├── ideas.md # Ideas
|
|
426
|
+
│ └── shipped.md # Shipped
|
|
427
|
+
├── sync/ # Backend Sync
|
|
428
|
+
│ └── pending.json # Events queue
|
|
429
|
+
├── agents/ # Specialists
|
|
430
|
+
├── memory/ # Audit Trail
|
|
431
|
+
│ └── events.jsonl
|
|
432
|
+
└── project.json # Metadata
|
|
444
433
|
```
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
allowed-tools: [Read, Write, Bash]
|
|
3
3
|
description: 'Undo last changes by restoring previous snapshot'
|
|
4
4
|
timestamp-rule: 'GetTimestamp() for ALL timestamps'
|
|
5
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
+
storage-layer: true
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# /p:undo - Revert to Previous Snapshot
|
|
@@ -13,7 +15,7 @@ Reverts the project to the previous snapshot state. Uses Git-based snapshots sto
|
|
|
13
15
|
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
14
16
|
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
15
17
|
- `{snapshotDir}`: `{globalPath}/snapshots`
|
|
16
|
-
- `{memoryPath}`: `{globalPath}/memory/
|
|
18
|
+
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
17
19
|
|
|
18
20
|
## Step 1: Read Config
|
|
19
21
|
|
|
@@ -29,7 +31,7 @@ IF file not found:
|
|
|
29
31
|
BASH: `cd ~/.prjct-cli/projects/{projectId}/snapshots && git log --oneline -5 2>/dev/null || echo "NO_SNAPSHOTS"`
|
|
30
32
|
|
|
31
33
|
IF output contains "NO_SNAPSHOTS" OR empty:
|
|
32
|
-
OUTPUT: "
|
|
34
|
+
OUTPUT: "No snapshots available. Create one with /p:ship first."
|
|
33
35
|
STOP
|
|
34
36
|
|
|
35
37
|
CAPTURE last two lines as:
|
|
@@ -37,7 +39,7 @@ CAPTURE last two lines as:
|
|
|
37
39
|
- {previousHash}: Second line (snapshot to restore)
|
|
38
40
|
|
|
39
41
|
IF only one snapshot exists:
|
|
40
|
-
OUTPUT: "
|
|
42
|
+
OUTPUT: "Only one snapshot exists. Nothing to undo."
|
|
41
43
|
STOP
|
|
42
44
|
|
|
43
45
|
## Step 3: Get Current State Info
|
|
@@ -139,7 +141,7 @@ Files affected: 5
|
|
|
139
141
|
|
|
140
142
|
### Example 2: Nothing to Undo
|
|
141
143
|
```
|
|
142
|
-
|
|
144
|
+
Only one snapshot exists. Nothing to undo.
|
|
143
145
|
|
|
144
146
|
Create more snapshots with /p:ship
|
|
145
147
|
```
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agents Manager
|
|
3
|
-
*
|
|
4
|
-
* Manages agents.json - specialized AI agents.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { ArrayManager } from './base-manager'
|
|
8
|
-
import type { AgentSchema, AgentsSchema } from '../schemas'
|
|
9
|
-
import { DEFAULT_AGENT } from '../schemas'
|
|
10
|
-
|
|
11
|
-
class AgentsManager extends ArrayManager<AgentSchema> {
|
|
12
|
-
constructor() {
|
|
13
|
-
super('agents.json')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async getAgents(projectId: string): Promise<AgentsSchema> {
|
|
17
|
-
return this.read(projectId)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async getAgent(projectId: string, name: string): Promise<AgentSchema | undefined> {
|
|
21
|
-
return this.find(projectId, (agent) => agent.name === name)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async addAgent(
|
|
25
|
-
projectId: string,
|
|
26
|
-
agent: Pick<AgentSchema, 'name' | 'description'> & Partial<AgentSchema>
|
|
27
|
-
): Promise<AgentsSchema> {
|
|
28
|
-
const fullAgent: AgentSchema = {
|
|
29
|
-
...DEFAULT_AGENT,
|
|
30
|
-
...agent
|
|
31
|
-
}
|
|
32
|
-
return this.add(projectId, fullAgent)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async updateAgent(
|
|
36
|
-
projectId: string,
|
|
37
|
-
name: string,
|
|
38
|
-
updates: Partial<AgentSchema>
|
|
39
|
-
): Promise<AgentsSchema> {
|
|
40
|
-
return this.updateItem(
|
|
41
|
-
projectId,
|
|
42
|
-
(agent) => agent.name === name,
|
|
43
|
-
(agent) => ({ ...agent, ...updates })
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async removeAgent(projectId: string, name: string): Promise<AgentsSchema> {
|
|
48
|
-
return this.remove(projectId, (agent) => agent.name === name)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async setAgents(projectId: string, agents: AgentsSchema): Promise<void> {
|
|
52
|
-
await this.write(projectId, agents)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async incrementTasksCompleted(projectId: string, name: string): Promise<AgentsSchema> {
|
|
56
|
-
return this.updateItem(
|
|
57
|
-
projectId,
|
|
58
|
-
(agent) => agent.name === name,
|
|
59
|
-
(agent) => ({
|
|
60
|
-
...agent,
|
|
61
|
-
tasksCompleted: (agent.tasksCompleted || 0) + 1
|
|
62
|
-
})
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async updateSuccessRate(
|
|
67
|
-
projectId: string,
|
|
68
|
-
name: string,
|
|
69
|
-
successRate: number
|
|
70
|
-
): Promise<AgentsSchema> {
|
|
71
|
-
return this.updateAgent(projectId, name, { successRate })
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export const agentsManager = new AgentsManager()
|
|
76
|
-
export default agentsManager
|