prjct-cli 0.18.1 → 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 +53 -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/agentic/subagent-generation.md +8 -6
- package/templates/commands/done.md +57 -258
- package/templates/commands/now.md +72 -277
- package/templates/commands/ship.md +55 -261
- package/templates/commands/sync.md +7 -7
- 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,267 +1,126 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Write, Bash]
|
|
3
3
|
description: 'Set or show current task with session tracking'
|
|
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:now - Current Task
|
|
6
|
+
# /p:now - Current Task
|
|
13
7
|
|
|
14
|
-
|
|
8
|
+
Start a new task or show current task status.
|
|
15
9
|
|
|
10
|
+
## Usage
|
|
16
11
|
```
|
|
17
|
-
|
|
12
|
+
/p:now [task] [estimate]
|
|
18
13
|
```
|
|
14
|
+
- `task`: Description of what you're working on
|
|
15
|
+
- `estimate`: Time estimate (e.g., "2h", "30m", "1d")
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
**Claude Context**: `context/now.md` (generated)
|
|
22
|
-
**Backend Sync**: `sync/pending.json` (events)
|
|
23
|
-
|
|
24
|
-
## Context Variables
|
|
25
|
-
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
26
|
-
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
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
|
-
- `{task}`: User-provided task (optional)
|
|
32
|
-
- `{estimate}`: User-provided time estimate (optional, e.g., "2h", "30m", "1d")
|
|
33
|
-
|
|
34
|
-
## Estimate Format
|
|
35
|
-
|
|
36
|
-
Estimates use simple duration format:
|
|
37
|
-
- `30m` - 30 minutes
|
|
38
|
-
- `2h` - 2 hours
|
|
39
|
-
- `1d` - 1 day (8 hours)
|
|
40
|
-
- `2h30m` - 2 hours 30 minutes
|
|
41
|
-
|
|
42
|
-
If no estimate provided, gently remind:
|
|
43
|
-
```
|
|
44
|
-
💡 Tip: Add estimate next time with /p:now "task" 2h
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Agent Detection (Optional)
|
|
48
|
-
|
|
49
|
-
When starting a task, auto-detect the best agent based on keywords:
|
|
50
|
-
|
|
51
|
-
| Keywords | Agent | Domain |
|
|
52
|
-
|----------|-------|--------|
|
|
53
|
-
| UI, frontend, React, component, CSS, style | `fe` | Frontend |
|
|
54
|
-
| API, backend, database, server, endpoint | `be` | Backend |
|
|
55
|
-
| design, UX, layout, wireframe | `ux` | UX Design |
|
|
56
|
-
| test, QA, bug, coverage, spec | `qa` | Testing |
|
|
57
|
-
| docs, README, documentation | `docs` | Documentation |
|
|
58
|
-
| (default) | `general` | General |
|
|
17
|
+
## Flow
|
|
59
18
|
|
|
60
|
-
|
|
19
|
+
### Step 1: Validate
|
|
20
|
+
READ: `.prjct/prjct.config.json` → extract `projectId`
|
|
21
|
+
IF missing: "No prjct project. Run /p:init first." → STOP
|
|
61
22
|
|
|
62
|
-
|
|
23
|
+
SET: `{globalPath}` = `~/.prjct-cli/projects/{projectId}`
|
|
63
24
|
|
|
64
|
-
READ: `{
|
|
25
|
+
READ: `{globalPath}/storage/state.json`
|
|
65
26
|
|
|
66
|
-
|
|
67
|
-
SET: {existingTask} = currentTask object
|
|
68
|
-
SET: {lastActivity} = existingTask.startedAt or last timeline entry
|
|
69
|
-
SET: {hoursAgo} = hours between {lastActivity} and now
|
|
27
|
+
### Step 2: Handle Cases
|
|
70
28
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Task: {existingTask.description}
|
|
77
|
-
Session: {existingTask.sessionId}
|
|
78
|
-
Started: {existingTask.startedAt}
|
|
79
|
-
|
|
80
|
-
Options:
|
|
81
|
-
1. Resume previous task → /p:resume
|
|
82
|
-
2. Close previous as partial → /p:recover close
|
|
83
|
-
3. View full context → /p:recover
|
|
84
|
-
|
|
85
|
-
Choose an option before starting a new task.
|
|
86
|
-
```
|
|
87
|
-
STOP
|
|
88
|
-
|
|
89
|
-
## Step 1: Read Config
|
|
90
|
-
|
|
91
|
-
READ: `.prjct/prjct.config.json`
|
|
92
|
-
EXTRACT: `projectId`
|
|
93
|
-
|
|
94
|
-
IF file not found:
|
|
95
|
-
OUTPUT: "No prjct project. Run /p:init first."
|
|
96
|
-
STOP
|
|
97
|
-
|
|
98
|
-
## Step 2: Check Current State
|
|
99
|
-
|
|
100
|
-
### Read state.json (source of truth)
|
|
101
|
-
READ: `{statePath}`
|
|
102
|
-
|
|
103
|
-
IF file exists:
|
|
104
|
-
PARSE JSON
|
|
105
|
-
EXTRACT: {currentTask}, {pausedTask} if present
|
|
106
|
-
|
|
107
|
-
## Step 3: Handle Cases
|
|
108
|
-
|
|
109
|
-
### Case A: No task provided - Show current
|
|
110
|
-
IF {task} is empty OR not provided:
|
|
111
|
-
IF {currentTask} exists AND {currentTask.status} == "active":
|
|
112
|
-
CALCULATE: {elapsed} = time since {currentTask.startedAt}
|
|
29
|
+
**Case A: No task provided - Show current**
|
|
30
|
+
IF task not provided:
|
|
31
|
+
IF currentTask exists AND status == "active":
|
|
32
|
+
CALCULATE elapsed time
|
|
113
33
|
OUTPUT:
|
|
114
34
|
```
|
|
115
35
|
🎯 {currentTask.description}
|
|
116
36
|
|
|
117
|
-
Session: {
|
|
118
|
-
Started: {
|
|
119
|
-
Status: active
|
|
37
|
+
Session: {sessionId}
|
|
38
|
+
Started: {elapsed} ago
|
|
120
39
|
|
|
121
40
|
/p:done to complete | /p:pause to pause
|
|
122
41
|
```
|
|
123
42
|
STOP
|
|
124
|
-
ELSE IF {pausedTask} exists:
|
|
125
|
-
OUTPUT:
|
|
126
|
-
```
|
|
127
|
-
⏸️ Paused: {pausedTask.description}
|
|
128
|
-
|
|
129
|
-
Duration so far: {pausedTask.duration}
|
|
130
|
-
|
|
131
|
-
/p:resume to continue | /p:done to complete
|
|
132
|
-
```
|
|
133
|
-
STOP
|
|
134
43
|
ELSE:
|
|
135
44
|
OUTPUT: "No current task. Use /p:now <task> to start one."
|
|
136
45
|
STOP
|
|
137
46
|
|
|
138
|
-
|
|
139
|
-
IF
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
STOP
|
|
47
|
+
**Case B: Task provided - Check conflicts**
|
|
48
|
+
IF currentTask exists AND status == "active" AND description != task:
|
|
49
|
+
OUTPUT:
|
|
50
|
+
```
|
|
51
|
+
⚠️ Already working on: {currentTask.description}
|
|
52
|
+
|
|
53
|
+
Options:
|
|
54
|
+
• /p:done - Complete current task first
|
|
55
|
+
• /p:pause - Pause and switch
|
|
56
|
+
```
|
|
57
|
+
STOP
|
|
58
|
+
|
|
59
|
+
**Case C: Same task - Continue**
|
|
60
|
+
IF currentTask.description == task:
|
|
61
|
+
OUTPUT: "🎯 Continuing: {task}"
|
|
62
|
+
STOP
|
|
63
|
+
|
|
64
|
+
### Step 3: Create New Task
|
|
65
|
+
GET timestamp: `bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"`
|
|
66
|
+
GET uuid: `bun -e "console.log(crypto.randomUUID())" 2>/dev/null || node -e "console.log(require('crypto').randomUUID())"`
|
|
159
67
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
SET: {startedAt} = GetTimestamp()
|
|
68
|
+
SET: `{taskId}` = uuid
|
|
69
|
+
SET: `{sessionId}` = uuid (different call)
|
|
70
|
+
SET: `{startedAt}` = timestamp
|
|
164
71
|
|
|
165
|
-
|
|
72
|
+
IF estimate provided:
|
|
73
|
+
PARSE to seconds (30m=1800, 2h=7200, 1d=28800)
|
|
166
74
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
75
|
+
### Step 4: Update Storage
|
|
76
|
+
WRITE to `{globalPath}/storage/state.json`:
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"currentTask": {
|
|
170
80
|
"id": "{taskId}",
|
|
171
81
|
"description": "{task}",
|
|
172
82
|
"status": "active",
|
|
173
83
|
"startedAt": "{startedAt}",
|
|
174
84
|
"sessionId": "{sessionId}",
|
|
175
|
-
"estimate": "{estimate
|
|
176
|
-
"estimateSeconds": {
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
READ existing `{statePath}` or create empty object
|
|
182
|
-
SET: state.currentTask = new task object
|
|
183
|
-
SET: state.lastUpdated = {startedAt}
|
|
184
|
-
WRITE: `{statePath}`
|
|
185
|
-
|
|
186
|
-
## Step 5: Generate Context (FOR CLAUDE)
|
|
187
|
-
|
|
188
|
-
WRITE: `{nowContextPath}`
|
|
189
|
-
|
|
190
|
-
IF {estimate} provided:
|
|
191
|
-
```markdown
|
|
192
|
-
# NOW
|
|
193
|
-
|
|
194
|
-
**{task}**
|
|
195
|
-
|
|
196
|
-
Started: {startedAt}
|
|
197
|
-
Session: {sessionId}
|
|
198
|
-
Estimate: {estimate}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
ELSE (no estimate):
|
|
202
|
-
```markdown
|
|
203
|
-
# NOW
|
|
204
|
-
|
|
205
|
-
**{task}**
|
|
206
|
-
|
|
207
|
-
Started: {startedAt}
|
|
208
|
-
Session: {sessionId}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
## Step 6: Queue Sync Event (FOR BACKEND)
|
|
212
|
-
|
|
213
|
-
READ: `{syncPath}` or create empty array
|
|
214
|
-
APPEND event:
|
|
215
|
-
```json
|
|
216
|
-
{
|
|
217
|
-
"type": "task.started",
|
|
218
|
-
"path": ["state"],
|
|
219
|
-
"data": {
|
|
220
|
-
"taskId": "{taskId}",
|
|
221
|
-
"description": "{task}",
|
|
222
|
-
"startedAt": "{startedAt}",
|
|
223
|
-
"sessionId": "{sessionId}"
|
|
224
|
-
},
|
|
225
|
-
"timestamp": "{startedAt}",
|
|
226
|
-
"projectId": "{projectId}"
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
WRITE: `{syncPath}`
|
|
85
|
+
"estimate": "{estimate}",
|
|
86
|
+
"estimateSeconds": {estimateSeconds}
|
|
87
|
+
},
|
|
88
|
+
"lastUpdated": "{startedAt}"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
230
91
|
|
|
231
|
-
|
|
92
|
+
### Step 5: Generate Context
|
|
93
|
+
WRITE: `{globalPath}/context/now.md`:
|
|
94
|
+
```markdown
|
|
95
|
+
# NOW
|
|
232
96
|
|
|
233
|
-
|
|
234
|
-
Single line (JSONL):
|
|
97
|
+
**{task}**
|
|
235
98
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
```
|
|
99
|
+
Started: {startedAt}
|
|
100
|
+
Session: {sessionId}
|
|
101
|
+
```
|
|
240
102
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
```
|
|
103
|
+
### Step 6: Log Events
|
|
104
|
+
APPEND to `{globalPath}/sync/pending.json`
|
|
105
|
+
APPEND to `{globalPath}/memory/events.jsonl`
|
|
245
106
|
|
|
246
|
-
|
|
107
|
+
### Step 7: Output
|
|
247
108
|
|
|
248
|
-
|
|
109
|
+
WITH estimate:
|
|
249
110
|
```
|
|
250
111
|
🎯 {task}
|
|
251
112
|
|
|
252
113
|
Session: {sessionId}
|
|
253
|
-
Started: now
|
|
254
114
|
Estimate: {estimate}
|
|
255
115
|
|
|
256
116
|
/p:done when finished | /p:pause to take a break
|
|
257
117
|
```
|
|
258
118
|
|
|
259
|
-
|
|
119
|
+
WITHOUT estimate:
|
|
260
120
|
```
|
|
261
121
|
🎯 {task}
|
|
262
122
|
|
|
263
123
|
Session: {sessionId}
|
|
264
|
-
Started: now
|
|
265
124
|
|
|
266
125
|
💡 Tip: Add estimate next time with /p:now "task" 2h
|
|
267
126
|
|
|
@@ -276,70 +135,6 @@ Started: now
|
|
|
276
135
|
| Active task exists | Show options | STOP |
|
|
277
136
|
| Write fails | "Failed to create session" | STOP |
|
|
278
137
|
|
|
279
|
-
##
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
~/.prjct-cli/projects/{projectId}/
|
|
283
|
-
├── storage/
|
|
284
|
-
│ └── state.json # Source of truth (current + paused tasks)
|
|
285
|
-
├── context/
|
|
286
|
-
│ └── now.md # Generated for Claude
|
|
287
|
-
├── sync/
|
|
288
|
-
│ └── pending.json # Events for backend
|
|
289
|
-
└── memory/
|
|
290
|
-
└── events.jsonl # Audit trail
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## Examples
|
|
294
|
-
|
|
295
|
-
### Example 1: Show Current Task
|
|
296
|
-
```
|
|
297
|
-
User: /p:now
|
|
298
|
-
Output:
|
|
299
|
-
🎯 Implement user authentication
|
|
300
|
-
|
|
301
|
-
Session: 550e8400-e29b-41d4-a716-446655440000
|
|
302
|
-
Started: 2 hours ago
|
|
303
|
-
Status: active
|
|
304
|
-
|
|
305
|
-
/p:done to complete | /p:pause to pause
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### Example 2: Start New Task (without estimate)
|
|
309
|
-
```
|
|
310
|
-
User: /p:now "Add login form"
|
|
311
|
-
Output:
|
|
312
|
-
🎯 Add login form
|
|
313
|
-
|
|
314
|
-
Session: 7c9e6679-7425-40de-944b-e07fc1f90ae7
|
|
315
|
-
Started: now
|
|
316
|
-
|
|
317
|
-
💡 Tip: Add estimate next time with /p:now "task" 2h
|
|
318
|
-
|
|
319
|
-
/p:done when finished | /p:pause to take a break
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
### Example 3: Start New Task (with estimate)
|
|
323
|
-
```
|
|
324
|
-
User: /p:now "Add login form" 2h
|
|
325
|
-
Output:
|
|
326
|
-
🎯 Add login form
|
|
327
|
-
|
|
328
|
-
Session: 7c9e6679-7425-40de-944b-e07fc1f90ae7
|
|
329
|
-
Started: now
|
|
330
|
-
Estimate: 2h
|
|
331
|
-
|
|
332
|
-
/p:done when finished | /p:pause to take a break
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Example 4: Task Conflict
|
|
336
|
-
```
|
|
337
|
-
User: /p:now "Something else"
|
|
338
|
-
Output:
|
|
339
|
-
⚠️ Already working on: Add login form
|
|
340
|
-
|
|
341
|
-
Options:
|
|
342
|
-
• /p:done - Complete current task first
|
|
343
|
-
• /p:pause - Pause and switch
|
|
344
|
-
• /p:now (same task) - Continue current
|
|
345
|
-
```
|
|
138
|
+
## References
|
|
139
|
+
- Architecture: `~/.prjct-cli/docs/architecture.md`
|
|
140
|
+
- Commands: `~/.prjct-cli/docs/commands.md`
|