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,16 +2,24 @@
|
|
|
2
2
|
allowed-tools: [Read, Write, Bash, Task, Glob]
|
|
3
3
|
description: 'Value analysis + roadmap + task breakdown + auto-start'
|
|
4
4
|
timestamp-rule: 'GetTimestamp() and GetDate() for ALL timestamps'
|
|
5
|
-
architecture: '
|
|
5
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
+
storage-layer: true
|
|
7
|
+
source-of-truth: 'storage/queue.json'
|
|
8
|
+
claude-context: 'context/next.md'
|
|
9
|
+
backend-sync: 'sync/pending.json'
|
|
6
10
|
---
|
|
7
11
|
|
|
8
12
|
# /p:feature - Add Feature to Roadmap
|
|
9
13
|
|
|
10
|
-
## Architecture:
|
|
14
|
+
## Architecture: Write-Through Pattern
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
```
|
|
17
|
+
User Action → Storage (JSON) → Context (MD) → Sync Events
|
|
18
|
+
```
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
**Source of Truth**: `storage/queue.json` (tasks), `storage/roadmap.json` (features)
|
|
21
|
+
**Claude Context**: `context/next.md`, `context/roadmap.md` (generated)
|
|
22
|
+
**Backend Sync**: `sync/pending.json` (events)
|
|
15
23
|
|
|
16
24
|
## Agent Delegation (REQUIRED)
|
|
17
25
|
|
|
@@ -53,10 +61,11 @@ Task(
|
|
|
53
61
|
## Context Variables
|
|
54
62
|
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
55
63
|
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
56
|
-
- `{
|
|
57
|
-
- `{
|
|
58
|
-
- `{
|
|
59
|
-
- `{
|
|
64
|
+
- `{queuePath}`: `{globalPath}/storage/queue.json`
|
|
65
|
+
- `{statePath}`: `{globalPath}/storage/state.json`
|
|
66
|
+
- `{nextContextPath}`: `{globalPath}/context/next.md`
|
|
67
|
+
- `{syncPath}`: `{globalPath}/sync/pending.json`
|
|
68
|
+
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
60
69
|
- `{feature}`: User-provided feature description
|
|
61
70
|
|
|
62
71
|
## Step 1: Read Config
|
|
@@ -148,96 +157,54 @@ For feature "add user authentication":
|
|
|
148
157
|
```
|
|
149
158
|
|
|
150
159
|
GENERATE: {tasks} = list of task descriptions
|
|
151
|
-
|
|
152
|
-
## Step 5: Update Roadmap (MD)
|
|
153
|
-
|
|
154
|
-
READ: `{roadmapPath}` (or create default if not exists)
|
|
155
|
-
|
|
156
|
-
Default structure:
|
|
157
|
-
```markdown
|
|
158
|
-
# Roadmap
|
|
159
|
-
|
|
160
|
-
## Active
|
|
161
|
-
|
|
162
|
-
_No active features_
|
|
163
|
-
|
|
164
|
-
## Planned
|
|
165
|
-
|
|
166
|
-
_No planned features_
|
|
167
|
-
|
|
168
|
-
## Shipped
|
|
169
|
-
|
|
170
|
-
_Nothing shipped yet_
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Generate Feature ID
|
|
174
|
-
GENERATE: {featureId} = "feat_" + 8 random alphanumeric chars
|
|
160
|
+
GENERATE: {featureId} = UUID v4
|
|
175
161
|
SET: {now} = GetTimestamp()
|
|
176
162
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Parse existing content and add new feature under "## Active" section:
|
|
180
|
-
|
|
181
|
-
```markdown
|
|
182
|
-
# Roadmap
|
|
183
|
-
|
|
184
|
-
## Active
|
|
163
|
+
## Step 5: Update Storage (SOURCE OF TRUTH)
|
|
185
164
|
|
|
186
|
-
###
|
|
187
|
-
- **ID**: {featureId}
|
|
188
|
-
- **Impact**: {impact}
|
|
189
|
-
- **Effort**: {effort}
|
|
190
|
-
- **Started**: {now}
|
|
191
|
-
- **Tasks**:
|
|
192
|
-
- [ ] {task1}
|
|
193
|
-
- [ ] {task2}
|
|
194
|
-
- [ ] {task3}
|
|
195
|
-
...
|
|
196
|
-
|
|
197
|
-
{...existing active features}
|
|
198
|
-
|
|
199
|
-
## Planned
|
|
200
|
-
|
|
201
|
-
{...existing planned features}
|
|
202
|
-
|
|
203
|
-
## Shipped
|
|
204
|
-
|
|
205
|
-
{...existing shipped features}
|
|
206
|
-
```
|
|
165
|
+
### Update queue.json
|
|
207
166
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
## Step 6: Update Priority Queue (MD)
|
|
211
|
-
|
|
212
|
-
READ: `{nextPath}` (or create default if not exists)
|
|
167
|
+
READ: `{queuePath}` (or create default if not exists)
|
|
213
168
|
|
|
214
169
|
Default structure:
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
## Normal Priority
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"tasks": [],
|
|
173
|
+
"lastUpdated": null
|
|
174
|
+
}
|
|
175
|
+
```
|
|
223
176
|
|
|
224
|
-
|
|
177
|
+
For each task in {tasks}, create task object:
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"id": "{taskId}",
|
|
181
|
+
"description": "{taskDescription}",
|
|
182
|
+
"type": "feature",
|
|
183
|
+
"priority": "normal",
|
|
184
|
+
"section": "active",
|
|
185
|
+
"featureId": "{featureId}",
|
|
186
|
+
"featureName": "{feature}",
|
|
187
|
+
"createdAt": "{now}"
|
|
188
|
+
}
|
|
189
|
+
```
|
|
225
190
|
|
|
226
|
-
|
|
191
|
+
APPEND all tasks to `tasks` array
|
|
192
|
+
SET: `lastUpdated` = {now}
|
|
193
|
+
WRITE: `{queuePath}`
|
|
227
194
|
|
|
228
|
-
|
|
229
|
-
```
|
|
195
|
+
## Step 6: Generate Context (FOR CLAUDE)
|
|
230
196
|
|
|
231
|
-
###
|
|
197
|
+
### Generate context/next.md
|
|
232
198
|
|
|
233
|
-
|
|
199
|
+
READ: `{queuePath}`
|
|
200
|
+
TRANSFORM to markdown:
|
|
234
201
|
|
|
235
202
|
```markdown
|
|
236
203
|
# Next
|
|
237
204
|
|
|
238
205
|
## High Priority
|
|
239
206
|
|
|
240
|
-
{
|
|
207
|
+
{high priority tasks from queue}
|
|
241
208
|
|
|
242
209
|
## Normal Priority
|
|
243
210
|
|
|
@@ -245,58 +212,113 @@ For each task in {tasks}, add to appropriate priority section:
|
|
|
245
212
|
- [ ] {task2} @{featureId}
|
|
246
213
|
...
|
|
247
214
|
|
|
248
|
-
{...existing tasks}
|
|
249
|
-
|
|
250
215
|
## Low Priority
|
|
251
216
|
|
|
252
|
-
{
|
|
217
|
+
{low priority tasks}
|
|
253
218
|
```
|
|
254
219
|
|
|
255
|
-
WRITE: `{
|
|
220
|
+
WRITE: `{nextContextPath}`
|
|
256
221
|
|
|
257
|
-
## Step 7: Auto-Start First Task
|
|
222
|
+
## Step 7: Auto-Start First Task
|
|
258
223
|
|
|
259
|
-
READ: `{
|
|
224
|
+
READ: `{statePath}`
|
|
260
225
|
|
|
261
|
-
IF
|
|
226
|
+
IF no currentTask:
|
|
262
227
|
### Start First Task
|
|
263
228
|
{firstTask} = first item from {tasks}
|
|
264
|
-
GENERATE: {sessionId} =
|
|
229
|
+
GENERATE: {sessionId} = UUID v4
|
|
230
|
+
|
|
231
|
+
### Update state.json
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"currentTask": {
|
|
235
|
+
"id": "{firstTask.id}",
|
|
236
|
+
"description": "{firstTask.description}",
|
|
237
|
+
"sessionId": "{sessionId}",
|
|
238
|
+
"featureId": "{featureId}",
|
|
239
|
+
"startedAt": "{now}",
|
|
240
|
+
"status": "active"
|
|
241
|
+
},
|
|
242
|
+
"pausedTask": null,
|
|
243
|
+
"lastUpdated": "{now}"
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
WRITE: `{statePath}`
|
|
265
247
|
|
|
266
|
-
###
|
|
248
|
+
### Generate context/now.md
|
|
267
249
|
```markdown
|
|
268
250
|
# NOW
|
|
269
251
|
|
|
270
|
-
**{firstTask}**
|
|
252
|
+
**{firstTask.description}**
|
|
271
253
|
|
|
272
254
|
Started: {now}
|
|
273
255
|
Session: {sessionId}
|
|
274
256
|
Feature: {featureId}
|
|
275
257
|
```
|
|
258
|
+
WRITE: `{globalPath}/context/now.md`
|
|
276
259
|
|
|
277
|
-
WRITE: `{nowPath}`
|
|
278
260
|
{autoStarted} = true
|
|
279
261
|
ELSE:
|
|
280
262
|
{autoStarted} = false
|
|
281
263
|
|
|
282
|
-
## Step 8:
|
|
264
|
+
## Step 8: Queue Sync Events
|
|
283
265
|
|
|
284
|
-
|
|
285
|
-
EXTRACT: {yearMonth} = YYYY-MM from {date}
|
|
266
|
+
READ: `{syncPath}` or create empty array
|
|
286
267
|
|
|
287
|
-
|
|
288
|
-
|
|
268
|
+
### Feature created event
|
|
269
|
+
APPEND:
|
|
270
|
+
```json
|
|
271
|
+
{
|
|
272
|
+
"type": "feature.created",
|
|
273
|
+
"path": ["queue"],
|
|
274
|
+
"data": {
|
|
275
|
+
"featureId": "{featureId}",
|
|
276
|
+
"name": "{feature}",
|
|
277
|
+
"impact": "{impact}",
|
|
278
|
+
"effort": "{effort}",
|
|
279
|
+
"taskCount": {taskCount}
|
|
280
|
+
},
|
|
281
|
+
"timestamp": "{now}",
|
|
282
|
+
"projectId": "{projectId}"
|
|
283
|
+
}
|
|
284
|
+
```
|
|
289
285
|
|
|
290
|
-
|
|
286
|
+
### Tasks added events (one per task)
|
|
287
|
+
For each task:
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"type": "queue.task_added",
|
|
291
|
+
"path": ["queue"],
|
|
292
|
+
"data": {
|
|
293
|
+
"taskId": "{taskId}",
|
|
294
|
+
"description": "{taskDescription}",
|
|
295
|
+
"featureId": "{featureId}"
|
|
296
|
+
},
|
|
297
|
+
"timestamp": "{now}",
|
|
298
|
+
"projectId": "{projectId}"
|
|
299
|
+
}
|
|
300
|
+
```
|
|
291
301
|
|
|
292
|
-
|
|
302
|
+
IF {autoStarted}:
|
|
293
303
|
```json
|
|
294
|
-
{
|
|
304
|
+
{
|
|
305
|
+
"type": "task.started",
|
|
306
|
+
"path": ["state"],
|
|
307
|
+
"data": {
|
|
308
|
+
"taskId": "{firstTask.id}",
|
|
309
|
+
"sessionId": "{sessionId}",
|
|
310
|
+
"featureId": "{featureId}"
|
|
311
|
+
},
|
|
312
|
+
"timestamp": "{now}",
|
|
313
|
+
"projectId": "{projectId}"
|
|
314
|
+
}
|
|
295
315
|
```
|
|
296
316
|
|
|
297
|
-
|
|
317
|
+
WRITE: `{syncPath}`
|
|
318
|
+
|
|
319
|
+
## Step 9: Log to Memory
|
|
298
320
|
|
|
299
|
-
|
|
321
|
+
APPEND to: `{memoryPath}`
|
|
300
322
|
```json
|
|
301
323
|
{"timestamp":"{now}","action":"feature_added","featureId":"{featureId}","feature":"{feature}","tasks":{taskCount}}
|
|
302
324
|
```
|
|
@@ -310,7 +332,7 @@ SUCCESS (with auto-start):
|
|
|
310
332
|
Impact: {impact} | Effort: {effort}
|
|
311
333
|
Tasks: {taskCount}
|
|
312
334
|
|
|
313
|
-
🎯 Started: {firstTask}
|
|
335
|
+
🎯 Started: {firstTask.description}
|
|
314
336
|
|
|
315
337
|
Next:
|
|
316
338
|
• Work on the task
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Bash, Read, Write]
|
|
3
3
|
description: 'Smart git operations with context'
|
|
4
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
5
|
+
storage-layer: true
|
|
6
|
+
source-of-truth: 'storage/state.json'
|
|
4
7
|
---
|
|
5
8
|
|
|
6
|
-
# /p:git
|
|
9
|
+
# /p:git - Smart Git Operations
|
|
10
|
+
|
|
11
|
+
## Architecture: Write-Through Pattern
|
|
12
|
+
|
|
13
|
+
Reads from **Storage (JSON)** as source of truth.
|
|
14
|
+
|
|
15
|
+
**Source of Truth**: `storage/state.json`
|
|
7
16
|
|
|
8
17
|
## Usage
|
|
9
18
|
|
|
@@ -14,13 +23,19 @@ description: 'Smart git operations with context'
|
|
|
14
23
|
/p:git undo # Undo last commit
|
|
15
24
|
```
|
|
16
25
|
|
|
26
|
+
## Context Variables
|
|
27
|
+
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
28
|
+
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
29
|
+
- `{statePath}`: `{globalPath}/storage/state.json`
|
|
30
|
+
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
31
|
+
|
|
17
32
|
## Flow: commit
|
|
18
33
|
|
|
19
|
-
1. Read: `
|
|
34
|
+
1. Read: `storage/state.json` → get task context
|
|
20
35
|
2. Git: `add .` → stage changes
|
|
21
36
|
3. Create: commit message with prjct metadata
|
|
22
37
|
4. Commit: with message
|
|
23
|
-
5. Log: `memory/
|
|
38
|
+
5. Log: `memory/events.jsonl`
|
|
24
39
|
|
|
25
40
|
## Flow: push
|
|
26
41
|
|
|
@@ -2,22 +2,32 @@
|
|
|
2
2
|
allowed-tools: [Read, Write, Bash, GetTimestamp, GetDate]
|
|
3
3
|
description: 'Quick idea capture'
|
|
4
4
|
timestamp-rule: 'GetTimestamp() and GetDate() for timestamps'
|
|
5
|
-
architecture: '
|
|
5
|
+
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
+
storage-layer: true
|
|
7
|
+
source-of-truth: 'storage/ideas.json'
|
|
8
|
+
claude-context: 'context/ideas.md'
|
|
9
|
+
backend-sync: 'sync/pending.json'
|
|
6
10
|
---
|
|
7
11
|
|
|
8
12
|
# /p:idea - Quick Idea Capture
|
|
9
13
|
|
|
10
|
-
## Architecture:
|
|
14
|
+
## Architecture: Write-Through Pattern
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
```
|
|
17
|
+
User Action → Storage (JSON) → Context (MD) → Sync Events
|
|
18
|
+
```
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
**Source of Truth**: `storage/ideas.json`
|
|
21
|
+
**Claude Context**: `context/ideas.md` (generated)
|
|
22
|
+
**Backend Sync**: `sync/pending.json` (events)
|
|
15
23
|
|
|
16
24
|
## Context Variables
|
|
17
25
|
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
18
26
|
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
19
|
-
- `{
|
|
20
|
-
- `{
|
|
27
|
+
- `{ideasStoragePath}`: `{globalPath}/storage/ideas.json`
|
|
28
|
+
- `{ideasContextPath}`: `{globalPath}/context/ideas.md`
|
|
29
|
+
- `{syncPath}`: `{globalPath}/sync/pending.json`
|
|
30
|
+
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
21
31
|
- `{text}`: User-provided idea text
|
|
22
32
|
|
|
23
33
|
## Step 1: Read Config
|
|
@@ -29,64 +39,137 @@ IF file not found:
|
|
|
29
39
|
OUTPUT: "No prjct project. Run /p:init first."
|
|
30
40
|
STOP
|
|
31
41
|
|
|
32
|
-
## Step 2:
|
|
42
|
+
## Step 2: Analyze Idea
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
Based on {text}, detect:
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
### Priority Detection
|
|
47
|
+
- If mentions "urgent", "critical", "asap" → priority = "high"
|
|
48
|
+
- If mentions "later", "maybe", "nice to have" → priority = "low"
|
|
49
|
+
- Default → priority = "medium"
|
|
39
50
|
|
|
40
|
-
|
|
51
|
+
### Tag Detection
|
|
52
|
+
- If mentions UI/design → add `#ui` tag
|
|
53
|
+
- If mentions performance → add `#perf` tag
|
|
54
|
+
- If mentions bug/fix → add `#bug` tag
|
|
55
|
+
- If mentions API/backend → add `#api` tag
|
|
56
|
+
- If mentions security → add `#security` tag
|
|
57
|
+
- If mentions docs → add `#docs` tag
|
|
41
58
|
|
|
42
|
-
|
|
59
|
+
## Step 3: Update Storage (SOURCE OF TRUTH)
|
|
43
60
|
|
|
44
|
-
|
|
61
|
+
GENERATE: {ideaId} = UUID v4
|
|
62
|
+
SET: {now} = GetTimestamp()
|
|
45
63
|
|
|
46
|
-
|
|
64
|
+
### Read existing ideas
|
|
65
|
+
READ: `{ideasStoragePath}` or create default:
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"ideas": [],
|
|
69
|
+
"lastUpdated": null
|
|
70
|
+
}
|
|
47
71
|
```
|
|
48
72
|
|
|
49
|
-
|
|
73
|
+
### Create idea object
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"id": "{ideaId}",
|
|
77
|
+
"text": "{text}",
|
|
78
|
+
"priority": "{priority}",
|
|
79
|
+
"tags": ["{detected_tags}"],
|
|
80
|
+
"status": "pending",
|
|
81
|
+
"createdAt": "{now}"
|
|
82
|
+
}
|
|
83
|
+
```
|
|
50
84
|
|
|
51
|
-
|
|
52
|
-
|
|
85
|
+
### Update ideas.json
|
|
86
|
+
PREPEND new idea to ideas array
|
|
87
|
+
SET: lastUpdated = {now}
|
|
88
|
+
WRITE: `{ideasStoragePath}`
|
|
53
89
|
|
|
54
|
-
|
|
55
|
-
Based on {text}, detect tags:
|
|
56
|
-
- If mentions UI/design → add `#ui` tag
|
|
57
|
-
- If mentions performance → add `#perf` tag
|
|
58
|
-
- If mentions bug/fix → add `#bug` tag
|
|
59
|
-
- If mentions API/backend → add `#api` tag
|
|
90
|
+
## Step 4: Generate Context (FOR CLAUDE)
|
|
60
91
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Parse existing content and add new idea under "## Pending" section:
|
|
92
|
+
WRITE: `{ideasContextPath}`
|
|
64
93
|
|
|
65
94
|
```markdown
|
|
66
|
-
#
|
|
95
|
+
# IDEAS
|
|
67
96
|
|
|
68
97
|
## Pending
|
|
69
98
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
{
|
|
99
|
+
{FOR EACH idea in ideas WHERE status == "pending":}
|
|
100
|
+
- **{idea.text}** {idea.tags.join(' ')}
|
|
101
|
+
- Priority: {idea.priority}
|
|
102
|
+
- Added: {idea.createdAt}
|
|
103
|
+
{END FOR}
|
|
75
104
|
|
|
76
|
-
##
|
|
105
|
+
## Converted
|
|
77
106
|
|
|
78
|
-
{
|
|
107
|
+
{FOR EACH idea in ideas WHERE status == "converted":}
|
|
108
|
+
- ~~{idea.text}~~ → Feature: {idea.convertedTo}
|
|
109
|
+
{END FOR}
|
|
79
110
|
```
|
|
80
111
|
|
|
81
|
-
|
|
112
|
+
## Step 5: Queue Sync Event (FOR BACKEND)
|
|
82
113
|
|
|
83
|
-
|
|
114
|
+
READ: `{syncPath}` or create empty array
|
|
115
|
+
APPEND event:
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"type": "idea.created",
|
|
119
|
+
"path": ["ideas"],
|
|
120
|
+
"data": {
|
|
121
|
+
"ideaId": "{ideaId}",
|
|
122
|
+
"text": "{text}",
|
|
123
|
+
"priority": "{priority}",
|
|
124
|
+
"tags": ["{detected_tags}"]
|
|
125
|
+
},
|
|
126
|
+
"timestamp": "{now}",
|
|
127
|
+
"projectId": "{projectId}"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
WRITE: `{syncPath}`
|
|
131
|
+
|
|
132
|
+
## Step 6: Log to Memory (AUDIT TRAIL)
|
|
84
133
|
|
|
85
134
|
APPEND to: `{memoryPath}`
|
|
86
135
|
```json
|
|
87
|
-
{"timestamp":"{now}","action":"idea_added","ideaId":"{ideaId}","text":"{text}"}
|
|
136
|
+
{"timestamp":"{now}","action":"idea_added","ideaId":"{ideaId}","text":"{text}","priority":"{priority}"}
|
|
88
137
|
```
|
|
89
138
|
|
|
90
139
|
## Response
|
|
91
140
|
|
|
92
141
|
`💡 {text} | Saved | Start: /p:feature "{text}"`
|
|
142
|
+
|
|
143
|
+
## Error Handling
|
|
144
|
+
|
|
145
|
+
| Error | Response | Action |
|
|
146
|
+
|-------|----------|--------|
|
|
147
|
+
| No project | "No prjct project" | STOP |
|
|
148
|
+
| No text | "What's your idea?" | ASK |
|
|
149
|
+
| Write fails | Log warning | CONTINUE |
|
|
150
|
+
|
|
151
|
+
## Examples
|
|
152
|
+
|
|
153
|
+
### Example 1: Simple Idea
|
|
154
|
+
**Input:** `/p:idea add dark mode support`
|
|
155
|
+
|
|
156
|
+
**Output:**
|
|
157
|
+
```
|
|
158
|
+
💡 add dark mode support | Saved | Start: /p:feature "add dark mode support"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Example 2: Idea with Priority
|
|
162
|
+
**Input:** `/p:idea urgent fix login bug`
|
|
163
|
+
|
|
164
|
+
**Output:**
|
|
165
|
+
```
|
|
166
|
+
💡 urgent fix login bug [high] | Saved | Start: /p:feature "fix login bug"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Example 3: Idea with Tags
|
|
170
|
+
**Input:** `/p:idea improve API performance`
|
|
171
|
+
|
|
172
|
+
**Output:**
|
|
173
|
+
```
|
|
174
|
+
💡 improve API performance #api #perf | Saved
|
|
175
|
+
```
|