prjct-cli 0.18.2 → 0.19.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 +40 -0
- package/CLAUDE.md +74 -211
- package/core/agentic/prompt-builder.ts +3 -7
- package/core/command-registry/optional-commands.ts +0 -20
- package/core/infrastructure/command-installer/command-installer.ts +8 -1
- package/core/infrastructure/command-installer/global-config.ts +31 -1
- package/core/infrastructure/command-installer/index.ts +1 -1
- package/core/infrastructure/setup.ts +3 -0
- package/package.json +3 -17
- package/templates/commands/done.md +57 -258
- package/templates/commands/now.md +72 -277
- package/templates/commands/ship.md +55 -261
- package/templates/commands/test.md +328 -21
- package/templates/global/CLAUDE.md +40 -205
- package/templates/global/docs/agents.md +88 -0
- package/templates/global/docs/architecture.md +103 -0
- package/templates/global/docs/commands.md +98 -0
- package/templates/global/docs/validation.md +95 -0
- package/templates/mcp-config.json +36 -0
- package/bin/dev.js +0 -216
- package/bin/serve.js +0 -361
- package/packages/web/README.md +0 -36
- package/packages/web/app/api/claude/sessions/route.ts +0 -44
- package/packages/web/app/api/claude/status/route.ts +0 -34
- package/packages/web/app/api/projects/[id]/icon/route.ts +0 -33
- package/packages/web/app/api/projects/[id]/momentum/route.ts +0 -257
- package/packages/web/app/api/projects/[id]/route.ts +0 -29
- package/packages/web/app/api/projects/[id]/stats/route.ts +0 -41
- package/packages/web/app/api/projects/[id]/status/route.ts +0 -21
- package/packages/web/app/api/projects/route.ts +0 -16
- package/packages/web/app/api/sessions/current/route.ts +0 -132
- package/packages/web/app/api/sessions/history/route.ts +0 -204
- package/packages/web/app/error.tsx +0 -34
- package/packages/web/app/favicon.ico +0 -0
- package/packages/web/app/globals.css +0 -198
- package/packages/web/app/layout.tsx +0 -53
- package/packages/web/app/loading.tsx +0 -7
- package/packages/web/app/not-found.tsx +0 -25
- package/packages/web/app/page.tsx +0 -12
- package/packages/web/app/project/[id]/code/layout.tsx +0 -18
- package/packages/web/app/project/[id]/code/page.tsx +0 -408
- package/packages/web/app/project/[id]/error.tsx +0 -41
- package/packages/web/app/project/[id]/loading.tsx +0 -9
- package/packages/web/app/project/[id]/not-found.tsx +0 -27
- package/packages/web/app/project/[id]/page.tsx +0 -384
- package/packages/web/app/project/[id]/reports/page.tsx +0 -59
- package/packages/web/app/project/[id]/reports/print/page.tsx +0 -58
- package/packages/web/app/sessions/page.tsx +0 -165
- package/packages/web/app/settings/page.tsx +0 -151
- package/packages/web/components/ActivityTimeline/ActivityTimeline.constants.ts +0 -2
- package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +0 -49
- package/packages/web/components/ActivityTimeline/ActivityTimeline.types.ts +0 -8
- package/packages/web/components/ActivityTimeline/hooks/index.ts +0 -2
- package/packages/web/components/ActivityTimeline/hooks/useExpandable.ts +0 -9
- package/packages/web/components/ActivityTimeline/hooks/useGroupedEvents.ts +0 -23
- package/packages/web/components/ActivityTimeline/index.ts +0 -2
- package/packages/web/components/AgentsCard/AgentsCard.tsx +0 -93
- package/packages/web/components/AgentsCard/AgentsCard.types.ts +0 -14
- package/packages/web/components/AgentsCard/index.ts +0 -2
- package/packages/web/components/AppSidebar/AppSidebar.tsx +0 -316
- package/packages/web/components/AppSidebar/index.ts +0 -1
- package/packages/web/components/BackLink/BackLink.tsx +0 -18
- package/packages/web/components/BackLink/BackLink.types.ts +0 -5
- package/packages/web/components/BackLink/index.ts +0 -2
- package/packages/web/components/BentoCard/BentoCard.constants.ts +0 -16
- package/packages/web/components/BentoCard/BentoCard.tsx +0 -48
- package/packages/web/components/BentoCard/BentoCard.types.ts +0 -15
- package/packages/web/components/BentoCard/index.ts +0 -2
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.constants.ts +0 -9
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.tsx +0 -18
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.types.ts +0 -5
- package/packages/web/components/BentoCardSkeleton/index.ts +0 -2
- package/packages/web/components/BentoGrid/BentoGrid.tsx +0 -18
- package/packages/web/components/BentoGrid/BentoGrid.types.ts +0 -4
- package/packages/web/components/BentoGrid/index.ts +0 -2
- package/packages/web/components/BlockersCard/BlockersCard.tsx +0 -75
- package/packages/web/components/BlockersCard/BlockersCard.types.ts +0 -12
- package/packages/web/components/BlockersCard/index.ts +0 -2
- package/packages/web/components/CommandBar/CommandBar.tsx +0 -67
- package/packages/web/components/CommandBar/index.ts +0 -1
- package/packages/web/components/CommandButton/CommandButton.tsx +0 -46
- package/packages/web/components/CommandButton/index.ts +0 -1
- package/packages/web/components/ConnectionStatus/ConnectionStatus.tsx +0 -29
- package/packages/web/components/ConnectionStatus/index.ts +0 -1
- package/packages/web/components/DashboardContent/DashboardContent.tsx +0 -284
- package/packages/web/components/DashboardContent/index.ts +0 -1
- package/packages/web/components/DateGroup/DateGroup.tsx +0 -18
- package/packages/web/components/DateGroup/DateGroup.types.ts +0 -6
- package/packages/web/components/DateGroup/DateGroup.utils.ts +0 -11
- package/packages/web/components/DateGroup/index.ts +0 -2
- package/packages/web/components/EmptyState/EmptyState.tsx +0 -76
- package/packages/web/components/EmptyState/EmptyState.types.ts +0 -11
- package/packages/web/components/EmptyState/index.ts +0 -2
- package/packages/web/components/EventRow/EventRow.constants.ts +0 -10
- package/packages/web/components/EventRow/EventRow.tsx +0 -49
- package/packages/web/components/EventRow/EventRow.types.ts +0 -7
- package/packages/web/components/EventRow/EventRow.utils.ts +0 -49
- package/packages/web/components/EventRow/index.ts +0 -2
- package/packages/web/components/ExpandButton/ExpandButton.tsx +0 -18
- package/packages/web/components/ExpandButton/ExpandButton.types.ts +0 -6
- package/packages/web/components/ExpandButton/index.ts +0 -2
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.tsx +0 -14
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.types.ts +0 -5
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.utils.ts +0 -13
- package/packages/web/components/HealthGradientBackground/index.ts +0 -2
- package/packages/web/components/HeroSection/HeroSection.tsx +0 -92
- package/packages/web/components/HeroSection/HeroSection.types.ts +0 -14
- package/packages/web/components/HeroSection/HeroSection.utils.ts +0 -11
- package/packages/web/components/HeroSection/hooks/index.ts +0 -2
- package/packages/web/components/HeroSection/hooks/useCountUp.ts +0 -45
- package/packages/web/components/HeroSection/hooks/useWeeklyActivity.ts +0 -18
- package/packages/web/components/HeroSection/index.ts +0 -2
- package/packages/web/components/IdeasCard/IdeasCard.tsx +0 -115
- package/packages/web/components/IdeasCard/IdeasCard.types.ts +0 -10
- package/packages/web/components/IdeasCard/index.ts +0 -2
- package/packages/web/components/InsightMessage/InsightMessage.tsx +0 -9
- package/packages/web/components/InsightMessage/InsightMessage.types.ts +0 -3
- package/packages/web/components/InsightMessage/index.ts +0 -2
- package/packages/web/components/Logo/Logo.tsx +0 -65
- package/packages/web/components/Logo/index.ts +0 -1
- package/packages/web/components/MarkdownContent/MarkdownContent.tsx +0 -123
- package/packages/web/components/MarkdownContent/index.ts +0 -1
- package/packages/web/components/MasonryGrid/MasonryGrid.tsx +0 -18
- package/packages/web/components/MasonryGrid/index.ts +0 -1
- package/packages/web/components/MomentumWidget/MomentumWidget.tsx +0 -119
- package/packages/web/components/MomentumWidget/MomentumWidget.types.ts +0 -16
- package/packages/web/components/MomentumWidget/index.ts +0 -2
- package/packages/web/components/NowCard/NowCard.tsx +0 -118
- package/packages/web/components/NowCard/NowCard.types.ts +0 -16
- package/packages/web/components/NowCard/index.ts +0 -2
- package/packages/web/components/PageHeader/PageHeader.tsx +0 -24
- package/packages/web/components/PageHeader/index.ts +0 -1
- package/packages/web/components/ProgressRing/ProgressRing.constants.ts +0 -20
- package/packages/web/components/ProgressRing/ProgressRing.tsx +0 -51
- package/packages/web/components/ProgressRing/ProgressRing.types.ts +0 -11
- package/packages/web/components/ProgressRing/index.ts +0 -2
- package/packages/web/components/ProjectAvatar/ProjectAvatar.tsx +0 -54
- package/packages/web/components/ProjectAvatar/index.ts +0 -1
- package/packages/web/components/ProjectColorDot/ProjectColorDot.tsx +0 -37
- package/packages/web/components/ProjectColorDot/index.ts +0 -1
- package/packages/web/components/ProjectSelectorModal/ProjectSelectorModal.tsx +0 -104
- package/packages/web/components/ProjectSelectorModal/index.ts +0 -1
- package/packages/web/components/Providers/Providers.tsx +0 -48
- package/packages/web/components/Providers/index.ts +0 -1
- package/packages/web/components/QueueCard/QueueCard.tsx +0 -125
- package/packages/web/components/QueueCard/QueueCard.types.ts +0 -12
- package/packages/web/components/QueueCard/QueueCard.utils.ts +0 -12
- package/packages/web/components/QueueCard/index.ts +0 -2
- package/packages/web/components/RecoverCard/RecoverCard.tsx +0 -72
- package/packages/web/components/RecoverCard/RecoverCard.types.ts +0 -16
- package/packages/web/components/RecoverCard/index.ts +0 -2
- package/packages/web/components/RoadmapCard/RoadmapCard.tsx +0 -145
- package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +0 -16
- package/packages/web/components/RoadmapCard/index.ts +0 -2
- package/packages/web/components/ShipsCard/ShipsCard.tsx +0 -95
- package/packages/web/components/ShipsCard/ShipsCard.types.ts +0 -14
- package/packages/web/components/ShipsCard/ShipsCard.utils.ts +0 -4
- package/packages/web/components/ShipsCard/index.ts +0 -2
- package/packages/web/components/SparklineChart/SparklineChart.tsx +0 -40
- package/packages/web/components/SparklineChart/SparklineChart.types.ts +0 -6
- package/packages/web/components/SparklineChart/index.ts +0 -2
- package/packages/web/components/StatsMasonry/StatsMasonry.tsx +0 -95
- package/packages/web/components/StatsMasonry/index.ts +0 -1
- package/packages/web/components/StreakCard/StreakCard.constants.ts +0 -2
- package/packages/web/components/StreakCard/StreakCard.tsx +0 -55
- package/packages/web/components/StreakCard/StreakCard.types.ts +0 -4
- package/packages/web/components/StreakCard/index.ts +0 -2
- package/packages/web/components/TasksCounter/TasksCounter.tsx +0 -14
- package/packages/web/components/TasksCounter/TasksCounter.types.ts +0 -3
- package/packages/web/components/TasksCounter/index.ts +0 -2
- package/packages/web/components/TechStackBadges/TechStackBadges.tsx +0 -28
- package/packages/web/components/TechStackBadges/index.ts +0 -1
- package/packages/web/components/TerminalDock/DockToggleTab.tsx +0 -29
- package/packages/web/components/TerminalDock/TerminalDock.tsx +0 -386
- package/packages/web/components/TerminalDock/TerminalDockTab.tsx +0 -130
- package/packages/web/components/TerminalDock/TerminalTabBar.tsx +0 -142
- package/packages/web/components/TerminalDock/index.ts +0 -2
- package/packages/web/components/TerminalTabs/TerminalTab.tsx +0 -95
- package/packages/web/components/TerminalTabs/TerminalTabs.tsx +0 -211
- package/packages/web/components/TerminalTabs/index.ts +0 -1
- package/packages/web/components/VelocityBadge/VelocityBadge.tsx +0 -32
- package/packages/web/components/VelocityBadge/VelocityBadge.types.ts +0 -3
- package/packages/web/components/VelocityBadge/index.ts +0 -2
- package/packages/web/components/VelocityCard/VelocityCard.tsx +0 -73
- package/packages/web/components/VelocityCard/VelocityCard.types.ts +0 -7
- package/packages/web/components/VelocityCard/index.ts +0 -2
- package/packages/web/components/WeeklyReports/PrintableReport.tsx +0 -259
- package/packages/web/components/WeeklyReports/ReportPreviewCard.tsx +0 -187
- package/packages/web/components/WeeklyReports/WeekCalendar.tsx +0 -288
- package/packages/web/components/WeeklyReports/WeeklyReports.tsx +0 -149
- package/packages/web/components/WeeklyReports/index.ts +0 -4
- package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +0 -25
- package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +0 -4
- package/packages/web/components/WeeklySparkline/index.ts +0 -2
- package/packages/web/components/charts/SessionsChart.tsx +0 -175
- package/packages/web/components/ui/alert-dialog.tsx +0 -157
- package/packages/web/components/ui/badge.tsx +0 -46
- package/packages/web/components/ui/button.tsx +0 -60
- package/packages/web/components/ui/card.tsx +0 -92
- package/packages/web/components/ui/chart.tsx +0 -385
- package/packages/web/components/ui/dialog.tsx +0 -143
- package/packages/web/components/ui/drawer.tsx +0 -135
- package/packages/web/components/ui/dropdown-menu.tsx +0 -257
- package/packages/web/components/ui/input.tsx +0 -21
- package/packages/web/components/ui/scroll-area.tsx +0 -58
- package/packages/web/components/ui/select.tsx +0 -187
- package/packages/web/components/ui/sheet.tsx +0 -139
- package/packages/web/components/ui/tabs.tsx +0 -66
- package/packages/web/components/ui/tooltip.tsx +0 -61
- package/packages/web/components.json +0 -22
- package/packages/web/context/GlobalTerminalContext.tsx +0 -538
- package/packages/web/context/TerminalContext.tsx +0 -45
- package/packages/web/context/TerminalTabsContext.tsx +0 -181
- package/packages/web/eslint.config.mjs +0 -18
- package/packages/web/hooks/useClaudeTerminal.ts +0 -425
- package/packages/web/hooks/useProjectStats.ts +0 -93
- package/packages/web/hooks/useProjects.ts +0 -73
- package/packages/web/lib/actions/projects.ts +0 -15
- package/packages/web/lib/commands.ts +0 -81
- package/packages/web/lib/format.ts +0 -23
- package/packages/web/lib/generate-week-report.ts +0 -285
- package/packages/web/lib/parse-prjct-files.ts +0 -1123
- package/packages/web/lib/project-colors.ts +0 -58
- package/packages/web/lib/projects.ts +0 -506
- package/packages/web/lib/pty.ts +0 -101
- package/packages/web/lib/query-config.ts +0 -44
- package/packages/web/lib/services/index.ts +0 -9
- package/packages/web/lib/services/projects.server.ts +0 -66
- package/packages/web/lib/services/stats.server.ts +0 -562
- package/packages/web/lib/unified-loader.ts +0 -396
- package/packages/web/lib/utils.ts +0 -6
- package/packages/web/next-env.d.ts +0 -6
- package/packages/web/next.config.ts +0 -7
- package/packages/web/package.json +0 -57
- package/packages/web/postcss.config.mjs +0 -7
- package/packages/web/public/file.svg +0 -1
- package/packages/web/public/globe.svg +0 -1
- package/packages/web/public/next.svg +0 -1
- package/packages/web/public/vercel.svg +0 -1
- package/packages/web/public/window.svg +0 -1
- package/packages/web/server.ts +0 -312
- package/packages/web/tsconfig.json +0 -34
- package/templates/commands/serve.md +0 -121
|
@@ -1,136 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Write, Bash]
|
|
3
3
|
description: 'Complete current task with session metrics'
|
|
4
|
-
timestamp-rule: 'GetTimestamp() for all timestamps'
|
|
5
|
-
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
-
storage-layer: true
|
|
7
|
-
source-of-truth: 'storage/state.json'
|
|
8
|
-
claude-context: 'context/now.md'
|
|
9
|
-
backend-sync: 'sync/pending.json'
|
|
10
4
|
---
|
|
11
5
|
|
|
12
|
-
# /p:done - Complete
|
|
6
|
+
# /p:done - Complete Task
|
|
13
7
|
|
|
14
|
-
|
|
8
|
+
Mark current task as complete with metrics.
|
|
15
9
|
|
|
10
|
+
## Usage
|
|
16
11
|
```
|
|
17
|
-
|
|
12
|
+
/p:done
|
|
18
13
|
```
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
**Claude Context**: `context/now.md` (generated)
|
|
22
|
-
**Backend Sync**: `sync/pending.json` (events)
|
|
15
|
+
## Flow
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `{statePath}`: `{globalPath}/storage/state.json`
|
|
28
|
-
- `{nowContextPath}`: `{globalPath}/context/now.md`
|
|
29
|
-
- `{syncPath}`: `{globalPath}/sync/pending.json`
|
|
30
|
-
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
31
|
-
- `{sessionsPath}`: `{globalPath}/progress/sessions`
|
|
17
|
+
### Step 1: Validate
|
|
18
|
+
READ: `.prjct/prjct.config.json` → extract `projectId`
|
|
19
|
+
IF missing: "No prjct project. Run /p:init first." → STOP
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
SET: `{globalPath}` = `~/.prjct-cli/projects/{projectId}`
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- If actual < estimate: bonus (under-budget)
|
|
39
|
-
- If actual > estimate: penalty (over-budget)
|
|
40
|
-
|
|
41
|
-
**Example:**
|
|
42
|
-
- Estimate: 2h (7200s), Actual: 2h 15m (8100s)
|
|
43
|
-
- Accuracy = 100 - |((8100-7200)/7200)*100| = 100 - 12.5 = 87.5%
|
|
44
|
-
|
|
45
|
-
## Step 1: Read Config
|
|
46
|
-
|
|
47
|
-
READ: `.prjct/prjct.config.json`
|
|
48
|
-
EXTRACT: `projectId`
|
|
49
|
-
|
|
50
|
-
IF file not found:
|
|
51
|
-
OUTPUT: "No prjct project. Run /p:init first."
|
|
23
|
+
READ: `{globalPath}/storage/state.json`
|
|
24
|
+
IF no `currentTask` OR status != "active":
|
|
25
|
+
OUTPUT: "No active task. Use /p:now to start one."
|
|
52
26
|
STOP
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
EXTRACT: `{task}` = currentTask.description
|
|
29
|
+
EXTRACT: `{startedAt}` = currentTask.startedAt
|
|
30
|
+
EXTRACT: `{sessionId}` = currentTask.sessionId
|
|
31
|
+
EXTRACT: `{estimate}` = currentTask.estimate (optional)
|
|
55
32
|
|
|
56
|
-
###
|
|
57
|
-
|
|
33
|
+
### Step 2: Calculate Metrics
|
|
34
|
+
GET timestamp: `bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"`
|
|
35
|
+
SET: `{now}` = result
|
|
58
36
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
STOP
|
|
62
|
-
|
|
63
|
-
PARSE JSON
|
|
64
|
-
EXTRACT: {currentTask}
|
|
37
|
+
CALCULATE: `{duration}` = time between startedAt and now
|
|
38
|
+
FORMAT: as "Xh Ym" or "Xm"
|
|
65
39
|
|
|
66
|
-
IF
|
|
67
|
-
|
|
68
|
-
|
|
40
|
+
IF estimate exists:
|
|
41
|
+
CALCULATE: `{accuracy}` = 100 - |((actual - estimate) / estimate) * 100|
|
|
42
|
+
CAP at 0-100%
|
|
69
43
|
|
|
70
|
-
## Step 3: Calculate Metrics
|
|
71
|
-
|
|
72
|
-
SET: {now} = GetTimestamp()
|
|
73
|
-
SET: {startedAt} = {currentTask.startedAt}
|
|
74
|
-
|
|
75
|
-
### Calculate Duration
|
|
76
|
-
SET: {durationSeconds} = seconds between {startedAt} and {now}
|
|
77
|
-
SET: {durationFormatted} = format as "Xh Ym" or "Xm"
|
|
78
|
-
|
|
79
|
-
### Calculate Git Metrics
|
|
80
44
|
BASH: `git rev-list --count --since="{startedAt}" HEAD 2>/dev/null || echo "0"`
|
|
81
|
-
|
|
45
|
+
SET: `{commits}` = result
|
|
82
46
|
|
|
83
47
|
BASH: `git diff --stat HEAD~{commits} 2>/dev/null || git diff --stat`
|
|
84
|
-
|
|
85
|
-
- {filesChanged}: number of files
|
|
86
|
-
- {linesAdded}: insertions
|
|
87
|
-
- {linesRemoved}: deletions
|
|
48
|
+
EXTRACT: `{filesChanged}`, `{linesAdded}`, `{linesRemoved}`
|
|
88
49
|
|
|
89
|
-
###
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{accuracy} = null
|
|
96
|
-
{accuracyLabel} = null
|
|
50
|
+
### Step 3: Update Storage
|
|
51
|
+
Update `{globalPath}/storage/state.json`:
|
|
52
|
+
- Move currentTask to previousTask with status: "completed"
|
|
53
|
+
- Set currentTask = null
|
|
54
|
+
- Set lastUpdated = {now}
|
|
55
|
+
- Add completedAt, duration, accuracy, metrics
|
|
97
56
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Prepare completed task
|
|
101
|
-
```json
|
|
102
|
-
{
|
|
103
|
-
"id": "{currentTask.id}",
|
|
104
|
-
"description": "{currentTask.description}",
|
|
105
|
-
"status": "completed",
|
|
106
|
-
"startedAt": "{currentTask.startedAt}",
|
|
107
|
-
"completedAt": "{now}",
|
|
108
|
-
"sessionId": "{currentTask.sessionId}",
|
|
109
|
-
"duration": {durationSeconds},
|
|
110
|
-
"estimate": "{currentTask.estimate}",
|
|
111
|
-
"estimateSeconds": {currentTask.estimateSeconds},
|
|
112
|
-
"accuracy": {accuracy},
|
|
113
|
-
"metrics": {
|
|
114
|
-
"filesChanged": {filesChanged},
|
|
115
|
-
"linesAdded": {linesAdded},
|
|
116
|
-
"linesRemoved": {linesRemoved},
|
|
117
|
-
"commits": {commits}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Update state.json
|
|
123
|
-
READ: `{statePath}`
|
|
124
|
-
SET: state.previousTask = completed task object
|
|
125
|
-
SET: state.currentTask = null
|
|
126
|
-
SET: state.lastUpdated = {now}
|
|
127
|
-
WRITE: `{statePath}`
|
|
128
|
-
|
|
129
|
-
## Step 5: Generate Context (FOR CLAUDE)
|
|
130
|
-
|
|
131
|
-
### Clear now.md
|
|
132
|
-
WRITE: `{nowContextPath}`
|
|
57
|
+
WRITE: `{globalPath}/storage/state.json`
|
|
133
58
|
|
|
59
|
+
### Step 4: Generate Context
|
|
60
|
+
WRITE: `{globalPath}/context/now.md`:
|
|
134
61
|
```markdown
|
|
135
62
|
# NOW
|
|
136
63
|
|
|
@@ -139,179 +66,51 @@ _No active task_
|
|
|
139
66
|
Use `/p:now <task>` to start working.
|
|
140
67
|
```
|
|
141
68
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
READ: `{syncPath}` or create empty array
|
|
145
|
-
APPEND event:
|
|
146
|
-
```json
|
|
147
|
-
{
|
|
148
|
-
"type": "task.completed",
|
|
149
|
-
"path": ["state"],
|
|
150
|
-
"data": {
|
|
151
|
-
"taskId": "{currentTask.id}",
|
|
152
|
-
"description": "{currentTask.description}",
|
|
153
|
-
"startedAt": "{currentTask.startedAt}",
|
|
154
|
-
"completedAt": "{now}",
|
|
155
|
-
"duration": {durationSeconds},
|
|
156
|
-
"accuracy": {accuracy},
|
|
157
|
-
"metrics": {
|
|
158
|
-
"filesChanged": {filesChanged},
|
|
159
|
-
"linesAdded": {linesAdded},
|
|
160
|
-
"linesRemoved": {linesRemoved},
|
|
161
|
-
"commits": {commits}
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"timestamp": "{now}",
|
|
165
|
-
"projectId": "{projectId}"
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
WRITE: `{syncPath}`
|
|
169
|
-
|
|
170
|
-
## Step 7: Log to Daily Session (for Dashboard Charts)
|
|
171
|
-
|
|
172
|
-
GET: {date} = YYYY-MM-DD from {now}
|
|
173
|
-
GET: {yearMonth} = YYYY-MM from {now}
|
|
174
|
-
SET: {dailySessionPath} = `{sessionsPath}/{yearMonth}/{date}.jsonl`
|
|
175
|
-
|
|
176
|
-
BASH: `mkdir -p {sessionsPath}/{yearMonth}`
|
|
177
|
-
|
|
178
|
-
APPEND to: `{dailySessionPath}`
|
|
179
|
-
|
|
180
|
-
Single line (JSONL format):
|
|
69
|
+
### Step 5: Log Events
|
|
70
|
+
APPEND to `{globalPath}/sync/pending.json`:
|
|
181
71
|
```json
|
|
182
|
-
{"
|
|
72
|
+
{"type":"task.completed","data":{...},"timestamp":"{now}"}
|
|
183
73
|
```
|
|
184
74
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
APPEND to: `{memoryPath}`
|
|
188
|
-
|
|
189
|
-
Single line (JSONL format):
|
|
190
|
-
|
|
191
|
-
IF {accuracy} exists:
|
|
75
|
+
APPEND to `{globalPath}/memory/events.jsonl`:
|
|
192
76
|
```json
|
|
193
|
-
{"timestamp":"{now}","action":"task_completed","
|
|
77
|
+
{"timestamp":"{now}","action":"task_completed","task":"{task}","duration":{seconds}}
|
|
194
78
|
```
|
|
195
79
|
|
|
196
|
-
|
|
80
|
+
APPEND to `{globalPath}/progress/sessions/{YYYY-MM}/{date}.jsonl`:
|
|
197
81
|
```json
|
|
198
|
-
{"
|
|
82
|
+
{"ts":"{now}","type":"task_complete","task":"{task}","duration":"{duration}"}
|
|
199
83
|
```
|
|
200
84
|
|
|
201
|
-
|
|
85
|
+
### Step 6: Output
|
|
202
86
|
|
|
203
|
-
|
|
87
|
+
WITH estimate:
|
|
204
88
|
```
|
|
205
|
-
✅ {
|
|
89
|
+
✅ {task} ({duration})
|
|
206
90
|
|
|
207
|
-
Estimate: {estimate} | Actual: {
|
|
91
|
+
Estimate: {estimate} | Actual: {duration} | Accuracy: {accuracy}%
|
|
92
|
+
Files: {filesChanged} | +{linesAdded}/-{linesRemoved} | Commits: {commits}
|
|
208
93
|
|
|
209
|
-
|
|
210
|
-
Files: {filesChanged} | +{linesAdded}/-{linesRemoved}
|
|
211
|
-
Commits: {commits}
|
|
212
|
-
|
|
213
|
-
Next:
|
|
214
|
-
• /p:now - Start next task
|
|
215
|
-
• /p:ship - Ship completed work
|
|
216
|
-
• /p:progress - View metrics
|
|
94
|
+
Next: /p:now | /p:ship | /p:progress
|
|
217
95
|
```
|
|
218
96
|
|
|
219
|
-
|
|
97
|
+
WITHOUT estimate:
|
|
220
98
|
```
|
|
221
|
-
✅ {
|
|
99
|
+
✅ {task} ({duration})
|
|
222
100
|
|
|
223
|
-
|
|
224
|
-
Files: {filesChanged} | +{linesAdded}/-{linesRemoved}
|
|
225
|
-
Commits: {commits}
|
|
101
|
+
Files: {filesChanged} | +{linesAdded}/-{linesRemoved} | Commits: {commits}
|
|
226
102
|
|
|
227
|
-
Next:
|
|
228
|
-
• /p:now - Start next task
|
|
229
|
-
• /p:ship - Ship completed work
|
|
230
|
-
• /p:progress - View metrics
|
|
103
|
+
Next: /p:now | /p:ship | /p:progress
|
|
231
104
|
```
|
|
232
105
|
|
|
233
106
|
## Error Handling
|
|
234
107
|
|
|
235
108
|
| Error | Response | Action |
|
|
236
109
|
|-------|----------|--------|
|
|
237
|
-
|
|
|
238
|
-
| No
|
|
110
|
+
| No project | "No prjct project" | STOP |
|
|
111
|
+
| No active task | "No active task" | STOP |
|
|
239
112
|
| Git fails | Use zeros for metrics | CONTINUE |
|
|
240
|
-
| Write fails | Log warning | CONTINUE |
|
|
241
|
-
|
|
242
|
-
## File Structure Reference
|
|
243
|
-
|
|
244
|
-
```
|
|
245
|
-
~/.prjct-cli/projects/{projectId}/
|
|
246
|
-
├── storage/
|
|
247
|
-
│ └── state.json # Source of truth
|
|
248
|
-
├── context/
|
|
249
|
-
│ └── now.md # Generated (cleared on done)
|
|
250
|
-
├── sync/
|
|
251
|
-
│ └── pending.json # Events for backend
|
|
252
|
-
├── progress/
|
|
253
|
-
│ └── sessions/{YYYY-MM}/ # Daily session logs
|
|
254
|
-
└── memory/
|
|
255
|
-
└── events.jsonl # Audit trail
|
|
256
|
-
```
|
|
257
113
|
|
|
258
|
-
##
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
**State:**
|
|
262
|
-
```json
|
|
263
|
-
{
|
|
264
|
-
"currentTask": {
|
|
265
|
-
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
266
|
-
"description": "implement authentication",
|
|
267
|
-
"status": "active",
|
|
268
|
-
"startedAt": "2025-12-07T10:00:00.000Z",
|
|
269
|
-
"estimate": "2h",
|
|
270
|
-
"estimateSeconds": 7200
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
**Git activity:**
|
|
276
|
-
- 3 commits
|
|
277
|
-
- 5 files changed
|
|
278
|
-
- +120/-30 lines
|
|
279
|
-
- Actual duration: 2h 15m (8100s)
|
|
280
|
-
- Accuracy: 100 - |((8100-7200)/7200)*100| = 87.5%
|
|
281
|
-
|
|
282
|
-
**Output:**
|
|
283
|
-
```
|
|
284
|
-
✅ implement authentication (2h 15m)
|
|
285
|
-
|
|
286
|
-
Estimate: 2h | Actual: 2h 15m | ✅ Accuracy: 88%
|
|
287
|
-
|
|
288
|
-
Session: 550e8400-e29b-41d4-a716-446655440000
|
|
289
|
-
Files: 5 | +120/-30
|
|
290
|
-
Commits: 3
|
|
291
|
-
|
|
292
|
-
Next:
|
|
293
|
-
• /p:now - Start next task
|
|
294
|
-
• /p:ship - Ship completed work
|
|
295
|
-
• /p:progress - View metrics
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Example 2: Session Completion (without estimate)
|
|
299
|
-
**Output:**
|
|
300
|
-
```
|
|
301
|
-
✅ implement authentication (2h 15m)
|
|
302
|
-
|
|
303
|
-
Session: 550e8400-e29b-41d4-a716-446655440000
|
|
304
|
-
Files: 5 | +120/-30
|
|
305
|
-
Commits: 3
|
|
306
|
-
|
|
307
|
-
Next:
|
|
308
|
-
• /p:now - Start next task
|
|
309
|
-
• /p:ship - Ship completed work
|
|
310
|
-
• /p:progress - View metrics
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### Example 3: No Active Task
|
|
314
|
-
**Output:**
|
|
315
|
-
```
|
|
316
|
-
⚠️ No active task to complete. Use /p:now to start one.
|
|
317
|
-
```
|
|
114
|
+
## References
|
|
115
|
+
- Architecture: `~/.prjct-cli/docs/architecture.md`
|
|
116
|
+
- Validation: `~/.prjct-cli/docs/validation.md`
|