prjct-cli 0.18.2 → 0.20.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 +82 -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/agents/uxui.md +210 -0
- package/templates/commands/bug.md +219 -41
- package/templates/commands/done.md +57 -258
- package/templates/commands/feature.md +368 -80
- package/templates/commands/now.md +72 -277
- package/templates/commands/ship.md +167 -246
- package/templates/commands/sync.md +62 -3
- package/templates/commands/test.md +160 -20
- 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/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,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Bash, Read, Edit]
|
|
2
|
+
allowed-tools: [Bash, Read, Write, Edit]
|
|
3
3
|
description: 'Run tests with auto-fix'
|
|
4
|
+
timestamp-rule: 'GetTimestamp() for ALL timestamps'
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# /p:test
|
|
@@ -8,41 +9,180 @@ description: 'Run tests with auto-fix'
|
|
|
8
9
|
## Usage
|
|
9
10
|
|
|
10
11
|
```
|
|
11
|
-
/p:test [all|unit|e2e|failed|fix]
|
|
12
|
+
/p:test [all|unit|e2e|failed|fix]
|
|
13
|
+
[--blocking] # Exit with error if tests fail
|
|
12
14
|
```
|
|
13
15
|
|
|
14
|
-
##
|
|
16
|
+
## Context Variables
|
|
17
|
+
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
18
|
+
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
19
|
+
- `{configPath}`: `~/.prjct-cli/config.json`
|
|
20
|
+
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
15
21
|
|
|
16
|
-
1
|
|
17
|
-
2. Run: tests with appropriate command
|
|
18
|
-
3. Parse: results
|
|
19
|
-
4. Auto-fix: simple failures (snapshots, timeouts, imports)
|
|
20
|
-
5. Update: coverage in `progress/metrics.md`
|
|
22
|
+
## Step 1: Read Project Config
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
READ: `.prjct/prjct.config.json`
|
|
25
|
+
EXTRACT: `projectId`
|
|
23
26
|
|
|
27
|
+
IF file not found:
|
|
28
|
+
OUTPUT: "No prjct project. Run /p:init first."
|
|
29
|
+
STOP
|
|
30
|
+
|
|
31
|
+
## Step 2: Parse Arguments
|
|
32
|
+
|
|
33
|
+
SET defaults:
|
|
34
|
+
- {testMode} = "all"
|
|
35
|
+
- {blocking} = false
|
|
36
|
+
|
|
37
|
+
PARSE args:
|
|
38
|
+
- IF arg is "all|unit|e2e|failed|fix": {testMode} = arg
|
|
39
|
+
- IF arg contains "--blocking": {blocking} = true
|
|
40
|
+
|
|
41
|
+
## Step 3: Detect Testing Strategy
|
|
42
|
+
|
|
43
|
+
### Check for Native Test Runner
|
|
44
|
+
|
|
45
|
+
READ: `package.json`
|
|
46
|
+
IF has "scripts.test":
|
|
47
|
+
{runner} = "npm"
|
|
48
|
+
{runnerCmd} = "npm test"
|
|
49
|
+
→ Go to Step 4 (Native Testing)
|
|
50
|
+
|
|
51
|
+
IF file exists: `pytest.ini` OR `pyproject.toml` with pytest:
|
|
52
|
+
{runner} = "pytest"
|
|
53
|
+
{runnerCmd} = "pytest"
|
|
54
|
+
→ Go to Step 4
|
|
55
|
+
|
|
56
|
+
IF file exists: `Cargo.toml`:
|
|
57
|
+
{runner} = "cargo"
|
|
58
|
+
{runnerCmd} = "cargo test"
|
|
59
|
+
→ Go to Step 4
|
|
60
|
+
|
|
61
|
+
IF no runner found:
|
|
62
|
+
OUTPUT: "No test runner detected."
|
|
63
|
+
OUTPUT: ""
|
|
64
|
+
OUTPUT: "Options:"
|
|
65
|
+
OUTPUT: "• Add 'test' script to package.json"
|
|
66
|
+
OUTPUT: "• Add pytest.ini for Python projects"
|
|
67
|
+
OUTPUT: "• Add Cargo.toml for Rust projects"
|
|
68
|
+
STOP
|
|
69
|
+
|
|
70
|
+
## Step 4: Native Test Runner
|
|
71
|
+
|
|
72
|
+
OUTPUT: "🧪 Running tests with {runner}..."
|
|
73
|
+
|
|
74
|
+
BASH: `{runnerCmd} 2>&1`
|
|
75
|
+
CAPTURE output as {testOutput}
|
|
76
|
+
|
|
77
|
+
### Parse Results
|
|
78
|
+
|
|
79
|
+
IF {testOutput} contains "passed" AND NOT contains "failed":
|
|
80
|
+
{testStatus} = "passed"
|
|
81
|
+
{passed} = extract number of passed tests
|
|
82
|
+
{failed} = 0
|
|
83
|
+
ELSE IF {testOutput} contains "failed" OR contains "FAIL":
|
|
84
|
+
{testStatus} = "failed"
|
|
85
|
+
{passed} = extract passed count
|
|
86
|
+
{failed} = extract failed count
|
|
87
|
+
ELSE:
|
|
88
|
+
{testStatus} = "unknown"
|
|
89
|
+
|
|
90
|
+
### Handle Fix Mode
|
|
91
|
+
IF {testMode} == "fix" AND {testStatus} == "failed":
|
|
92
|
+
OUTPUT: "🔧 Attempting auto-fix..."
|
|
93
|
+
|
|
94
|
+
IF {runner} == "npm":
|
|
95
|
+
BASH: `npm test -- -u 2>&1` # Update snapshots
|
|
96
|
+
|
|
97
|
+
OUTPUT: "Snapshots updated. Re-running tests..."
|
|
98
|
+
BASH: `{runnerCmd} 2>&1`
|
|
99
|
+
CAPTURE and re-parse results
|
|
100
|
+
|
|
101
|
+
→ Go to Step 5 (Results)
|
|
102
|
+
|
|
103
|
+
## Step 5: Results & Response
|
|
104
|
+
|
|
105
|
+
### Log to Memory
|
|
106
|
+
|
|
107
|
+
SET: {now} = GetTimestamp()
|
|
108
|
+
|
|
109
|
+
APPEND to `{memoryPath}`:
|
|
110
|
+
```json
|
|
111
|
+
{"ts":"{now}","type":"test_run","tool":"{runner}","passed":{passed},"failed":{failed},"mode":"{testMode}"}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Check Blocking Mode
|
|
115
|
+
|
|
116
|
+
IF {blocking} AND {failed} > 0:
|
|
117
|
+
OUTPUT: "❌ {failed} tests failed. Blocking."
|
|
118
|
+
OUTPUT: ""
|
|
119
|
+
OUTPUT: "Fix failing tests or run without --blocking flag."
|
|
120
|
+
EXIT with error (non-zero)
|
|
121
|
+
|
|
122
|
+
### Success Response
|
|
123
|
+
|
|
124
|
+
IF {testStatus} == "passed":
|
|
125
|
+
OUTPUT: "✅ All tests passing!"
|
|
126
|
+
OUTPUT: ""
|
|
127
|
+
OUTPUT: "📊 Results:"
|
|
128
|
+
OUTPUT: "• Passed: {passed}"
|
|
129
|
+
IF {coverage}:
|
|
130
|
+
OUTPUT: "• Coverage: {coverage}%"
|
|
131
|
+
OUTPUT: ""
|
|
132
|
+
OUTPUT: "🎯 Next: /p:ship"
|
|
133
|
+
|
|
134
|
+
### Failure Response
|
|
135
|
+
|
|
136
|
+
IF {testStatus} == "failed":
|
|
137
|
+
OUTPUT: "❌ {failed} tests failing"
|
|
138
|
+
OUTPUT: ""
|
|
139
|
+
OUTPUT: "{testOutput}" # Show relevant failure output
|
|
140
|
+
OUTPUT: ""
|
|
141
|
+
OUTPUT: "💡 Auto-fix: /p:test fix"
|
|
142
|
+
OUTPUT: ""
|
|
143
|
+
OUTPUT: "📊 Summary: {passed}/{passed + failed} passed"
|
|
144
|
+
|
|
145
|
+
## Error Handling
|
|
146
|
+
|
|
147
|
+
| Error | Response | Action |
|
|
148
|
+
|-------|----------|--------|
|
|
149
|
+
| No project | "No prjct project" | STOP |
|
|
150
|
+
| No test runner | "No test runner detected" | Show setup options |
|
|
151
|
+
| Tests timeout | "Tests timed out" | Suggest increasing timeout |
|
|
152
|
+
|
|
153
|
+
## Examples
|
|
154
|
+
|
|
155
|
+
### Example 1: Native Tests Pass
|
|
24
156
|
```
|
|
157
|
+
🧪 Running tests with npm...
|
|
158
|
+
|
|
25
159
|
✅ All tests passing!
|
|
26
160
|
|
|
27
161
|
📊 Results:
|
|
28
|
-
•
|
|
29
|
-
•
|
|
30
|
-
• E2E: {N}/{N}
|
|
162
|
+
• Passed: 42
|
|
163
|
+
• Coverage: 87%
|
|
31
164
|
|
|
32
|
-
🎯
|
|
33
|
-
|
|
165
|
+
🎯 Next: /p:ship
|
|
166
|
+
```
|
|
34
167
|
|
|
35
|
-
|
|
168
|
+
### Example 2: Tests with Failures
|
|
36
169
|
```
|
|
170
|
+
🧪 Running tests with npm...
|
|
37
171
|
|
|
38
|
-
|
|
172
|
+
❌ 3 tests failing
|
|
39
173
|
|
|
174
|
+
[test output here]
|
|
175
|
+
|
|
176
|
+
💡 Auto-fix: /p:test fix
|
|
177
|
+
|
|
178
|
+
📊 Summary: 39/42 passed
|
|
40
179
|
```
|
|
41
|
-
❌ {N} tests failing
|
|
42
180
|
|
|
43
|
-
|
|
181
|
+
### Example 3: Blocking Mode
|
|
182
|
+
```
|
|
183
|
+
🧪 Running tests with npm...
|
|
44
184
|
|
|
45
|
-
|
|
185
|
+
❌ 2 tests failed. Blocking.
|
|
46
186
|
|
|
47
|
-
|
|
187
|
+
Fix failing tests or run without --blocking flag.
|
|
48
188
|
```
|
|
@@ -1,233 +1,68 @@
|
|
|
1
1
|
<!-- prjct:start - DO NOT REMOVE THIS MARKER -->
|
|
2
|
-
# prjct
|
|
2
|
+
# prjct-cli
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
## CRITICAL RULES (READ FIRST)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
### 1. Path Resolution (MOST IMPORTANT)
|
|
7
|
+
**ALL writes go to global storage**: `~/.prjct-cli/projects/{projectId}/`
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
- **NEVER** write to `.prjct/` (config only)
|
|
10
|
+
- **NEVER** write to `./` (current directory)
|
|
11
|
+
- **ALWAYS** use global storage path
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
| `/p:now [task]` | Set current focus | `/p:now "implement auth"` |
|
|
14
|
-
| `/p:done` | Complete current task | After finishing work |
|
|
15
|
-
| `/p:next` | Show priority queue | See what's pending |
|
|
16
|
-
| `/p:ship [feature]` | Ship & celebrate | `/p:ship "user login"` |
|
|
17
|
-
| `/p:feature [desc]` | Add feature to roadmap | `/p:feature "dark mode"` |
|
|
18
|
-
| `/p:idea [text]` | Quick idea capture | `/p:idea "add caching"` |
|
|
19
|
-
| `/p:recap` | Project overview | Status check |
|
|
20
|
-
| `/p:progress` | Show metrics | Weekly/monthly stats |
|
|
13
|
+
### 2. Project Detection
|
|
14
|
+
Read `.prjct/prjct.config.json` → extract `projectId`
|
|
15
|
+
- If missing: "No prjct project. Run /p:init first." → STOP
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
1. /p:sync → Analyze project, generate agents
|
|
26
|
-
2. /p:feature → Plan what to build
|
|
27
|
-
3. /p:now → Start working
|
|
28
|
-
4. [code...] → Do the actual work
|
|
29
|
-
5. /p:done → Mark complete
|
|
30
|
-
6. /p:ship → Celebrate & commit
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 🤖 Project Context (CRITICAL)
|
|
34
|
-
|
|
35
|
-
**BEFORE working on any prjct project, READ the project context:**
|
|
36
|
-
|
|
37
|
-
1. Read `.prjct/prjct.config.json` → get `projectId`
|
|
38
|
-
2. Read `~/.prjct-cli/projects/{projectId}/CLAUDE.md` → dynamic project context
|
|
39
|
-
|
|
40
|
-
The project CLAUDE.md contains:
|
|
41
|
-
- Tech stack (languages, frameworks, dependencies)
|
|
42
|
-
- Project structure (directories)
|
|
43
|
-
- Available agents with their expertise
|
|
44
|
-
- Current task and priority queue
|
|
45
|
-
- Recent git activity
|
|
46
|
-
- Active roadmap features
|
|
47
|
-
|
|
48
|
-
**If CLAUDE.md doesn't exist**: Suggest running `/p:sync` to generate it.
|
|
49
|
-
|
|
50
|
-
## 📋 Common Usage Patterns
|
|
51
|
-
|
|
52
|
-
### Starting Work on a Project
|
|
53
|
-
```
|
|
54
|
-
User: "p. sync"
|
|
55
|
-
→ Analyze repo, generate agents, create context
|
|
56
|
-
→ Now Claude knows: stack, structure, agents available
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Adding a New Feature
|
|
17
|
+
### 3. Timestamps
|
|
18
|
+
```bash
|
|
19
|
+
bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"
|
|
60
20
|
```
|
|
61
|
-
|
|
62
|
-
→ Creates roadmap entry with tasks
|
|
63
|
-
→ Analyzes impact and effort
|
|
64
|
-
→ Suggests starting first task
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Daily Development Flow
|
|
68
|
-
```
|
|
69
|
-
User: "p. now implement login form"
|
|
70
|
-
→ Sets current focus
|
|
71
|
-
→ [User works on code]
|
|
72
|
-
User: "p. done"
|
|
73
|
-
→ Marks complete, suggests next task
|
|
74
|
-
User: "p. ship authentication"
|
|
75
|
-
→ Commits, celebrates, updates metrics
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Quick Idea Capture
|
|
79
|
-
```
|
|
80
|
-
User: "p. idea we should add dark mode later"
|
|
81
|
-
→ Saves to ideas.md
|
|
82
|
-
→ Doesn't interrupt current work
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## ⚠️ Anti-Patterns (What NOT to Do)
|
|
86
|
-
|
|
87
|
-
| ❌ Don't | ✅ Do Instead |
|
|
88
|
-
|----------|---------------|
|
|
89
|
-
| Write to `.prjct/` folder | Write to `~/.prjct-cli/projects/{id}/` |
|
|
90
|
-
| Skip reading project context | Always read CLAUDE.md first |
|
|
91
|
-
| Execute without projectId | Check `.prjct/prjct.config.json` exists |
|
|
92
|
-
| Hardcode file paths | Use projectId to construct paths |
|
|
93
|
-
| Ignore agents | Use specialized agents for their domains |
|
|
94
|
-
|
|
95
|
-
## 🎯 Path Resolution for ALL /p:* Commands
|
|
96
|
-
|
|
97
|
-
**CRITICAL**: Every `/p:*` command operates on **global storage**, NOT local files.
|
|
98
|
-
|
|
99
|
-
### Resolution Steps:
|
|
100
|
-
|
|
101
|
-
1. **Detect prjct project**: Check if `.prjct/prjct.config.json` exists
|
|
102
|
-
2. **Read config**: Extract `projectId` from config
|
|
103
|
-
3. **Construct base path**: `~/.prjct-cli/projects/{projectId}/`
|
|
104
|
-
4. **Resolve all file operations**: Paths are relative to base path
|
|
105
|
-
|
|
106
|
-
### Examples:
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
Template says: "Write: core/now.md"
|
|
110
|
-
Actual path: ~/.prjct-cli/projects/{projectId}/core/now.md
|
|
111
|
-
|
|
112
|
-
Template says: "Read: memory/context.jsonl"
|
|
113
|
-
Actual path: ~/.prjct-cli/projects/{projectId}/memory/context.jsonl
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Validation Rules:
|
|
117
|
-
|
|
118
|
-
- ❌ **NEVER** write to `.prjct/core/now.md` (local project directory)
|
|
119
|
-
- ❌ **NEVER** write to `./core/now.md` (current working directory)
|
|
120
|
-
- ✅ **ALWAYS** write to `~/.prjct-cli/projects/{projectId}/core/now.md`
|
|
121
|
-
|
|
122
|
-
### When NOT in prjct Project:
|
|
123
|
-
|
|
124
|
-
If `.prjct/prjct.config.json` doesn't exist:
|
|
125
|
-
- Respond: "No prjct project detected. Initialize first with `/p:init`"
|
|
126
|
-
- Do NOT execute the command
|
|
127
|
-
- Do NOT create files
|
|
128
|
-
|
|
129
|
-
## 📁 File Structure
|
|
130
|
-
|
|
131
|
-
All prjct data lives in global storage:
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
~/.prjct-cli/projects/{projectId}/
|
|
135
|
-
├── CLAUDE.md # ⭐ READ THIS FIRST - Rich project context
|
|
136
|
-
├── core/ # Current focus
|
|
137
|
-
│ ├── now.md # Single current task
|
|
138
|
-
│ └── next.md # Priority queue
|
|
139
|
-
├── progress/ # Completed work
|
|
140
|
-
│ ├── shipped.md # Recent ships
|
|
141
|
-
│ └── metrics.md # Aggregated metrics
|
|
142
|
-
├── planning/ # Future planning
|
|
143
|
-
│ ├── ideas.md # Quick ideas
|
|
144
|
-
│ └── roadmap.md # Feature roadmap
|
|
145
|
-
├── analysis/ # Technical analysis
|
|
146
|
-
│ └── repo-summary.md # Full repo analysis
|
|
147
|
-
├── memory/ # Decision history
|
|
148
|
-
│ └── context.jsonl # Append-only log
|
|
149
|
-
└── agents/ # ⭐ Specialized AI agents
|
|
150
|
-
├── fe.md # Frontend specialist
|
|
151
|
-
├── be.md # Backend specialist
|
|
152
|
-
└── ... # More based on stack
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
## 🤖 Using Agents Effectively
|
|
156
|
-
|
|
157
|
-
When project has specialized agents:
|
|
158
|
-
|
|
159
|
-
1. **Read agent file** before working in that domain
|
|
160
|
-
2. **Follow agent patterns** for code style and architecture
|
|
161
|
-
3. **Agent expertise** is in CLAUDE.md summary
|
|
162
|
-
|
|
163
|
-
Example:
|
|
164
|
-
```
|
|
165
|
-
Task: "implement React component"
|
|
166
|
-
→ Check CLAUDE.md for frontend agent
|
|
167
|
-
→ Read agents/fe.md for React patterns
|
|
168
|
-
→ Follow detected conventions
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## 🤖 Git Commit Format
|
|
172
|
-
|
|
173
|
-
**ALL commits made by prjct MUST use this footer:**
|
|
21
|
+
Result: `"2025-12-20T10:30:00.000Z"` - NEVER hardcode
|
|
174
22
|
|
|
23
|
+
### 4. Git Commit Footer
|
|
175
24
|
```
|
|
176
25
|
🤖 Generated with [p/](https://www.prjct.app/)
|
|
177
26
|
Designed for [Claude](https://www.anthropic.com/claude)
|
|
178
27
|
```
|
|
179
28
|
|
|
180
|
-
|
|
181
|
-
- ❌ "Generated with Claude Code"
|
|
182
|
-
- ❌ "Co-Authored-By: Claude"
|
|
29
|
+
---
|
|
183
30
|
|
|
184
|
-
##
|
|
31
|
+
## Quick Reference
|
|
185
32
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
```
|
|
33
|
+
| Command | Purpose |
|
|
34
|
+
|---------|---------|
|
|
35
|
+
| `/p:sync` | Analyze project, generate agents |
|
|
36
|
+
| `/p:now [task]` | Start/show current task |
|
|
37
|
+
| `/p:done` | Complete current task |
|
|
38
|
+
| `/p:ship [feature]` | Ship with quality checks |
|
|
193
39
|
|
|
194
|
-
|
|
195
|
-
```javascript
|
|
196
|
-
const nowContent = await Read('~/.prjct-cli/projects/{projectId}/core/now.md')
|
|
197
|
-
if (!nowContent || nowContent.trim() === '') {
|
|
198
|
-
return "Nothing to ship yet. Build something first with /p:now."
|
|
199
|
-
}
|
|
200
|
-
```
|
|
40
|
+
**Workflow**: `/p:sync` → `/p:now` → [work] → `/p:done` → `/p:ship`
|
|
201
41
|
|
|
202
|
-
|
|
42
|
+
---
|
|
203
43
|
|
|
204
|
-
|
|
205
|
-
|-------|----------|
|
|
206
|
-
| File not found | Return empty state, don't fail |
|
|
207
|
-
| Invalid JSON config | Suggest `/p:init` again |
|
|
208
|
-
| Permission denied | Suggest `chmod -R u+w ~/.prjct-cli/` |
|
|
209
|
-
| No project detected | Suggest `/p:init` |
|
|
44
|
+
## Detailed Documentation
|
|
210
45
|
|
|
211
|
-
|
|
46
|
+
For detailed information, read these files:
|
|
212
47
|
|
|
213
|
-
|
|
48
|
+
| Topic | File |
|
|
49
|
+
|-------|------|
|
|
50
|
+
| Architecture (Write-Through, file structure) | `~/.prjct-cli/docs/architecture.md` |
|
|
51
|
+
| All commands and examples | `~/.prjct-cli/docs/commands.md` |
|
|
52
|
+
| Validation patterns | `~/.prjct-cli/docs/validation.md` |
|
|
53
|
+
| Using agents | `~/.prjct-cli/docs/agents.md` |
|
|
214
54
|
|
|
215
|
-
|
|
216
|
-
2. **Read config**: Extract projectId
|
|
217
|
-
3. **Read context**: Load `~/.prjct-cli/projects/{id}/CLAUDE.md`
|
|
218
|
-
4. **Execute**: Read/write files in global storage
|
|
219
|
-
5. **Log**: Append to `memory/context.jsonl`
|
|
220
|
-
6. **Respond**: Formatted response with next action suggestions
|
|
55
|
+
---
|
|
221
56
|
|
|
222
|
-
##
|
|
57
|
+
## Before Any Command
|
|
223
58
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
59
|
+
1. Read `.prjct/prjct.config.json` → get `projectId`
|
|
60
|
+
2. Read `~/.prjct-cli/projects/{projectId}/CLAUDE.md` → project context
|
|
61
|
+
3. Execute using global storage paths
|
|
62
|
+
4. Log to `memory/events.jsonl`
|
|
227
63
|
|
|
228
64
|
---
|
|
229
65
|
|
|
230
|
-
**
|
|
231
|
-
**Config version**: 0.10.5
|
|
66
|
+
**Auto-managed by prjct-cli** | https://prjct.app | v0.19.0
|
|
232
67
|
|
|
233
68
|
<!-- prjct:end - DO NOT REMOVE THIS MARKER -->
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Using Agents
|
|
2
|
+
|
|
3
|
+
## What Are Agents?
|
|
4
|
+
|
|
5
|
+
Agents are specialized Claude configurations for different domains:
|
|
6
|
+
|
|
7
|
+
| Agent | Domain | When to Use |
|
|
8
|
+
|-------|--------|-------------|
|
|
9
|
+
| `fe.md` | Frontend | React, CSS, UI components |
|
|
10
|
+
| `be.md` | Backend | APIs, databases, servers |
|
|
11
|
+
| `ux.md` | UX Design | Layouts, user flows |
|
|
12
|
+
| `qa.md` | Testing | Tests, QA, bug fixes |
|
|
13
|
+
| `docs.md` | Documentation | README, docs, comments |
|
|
14
|
+
|
|
15
|
+
## Agent Location
|
|
16
|
+
|
|
17
|
+
Agents live in global storage:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
~/.prjct-cli/projects/{projectId}/agents/
|
|
21
|
+
├── fe.md # Frontend specialist
|
|
22
|
+
├── be.md # Backend specialist
|
|
23
|
+
├── ux.md # UX specialist
|
|
24
|
+
├── qa.md # Testing specialist
|
|
25
|
+
└── docs.md # Documentation specialist
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## When to Read Agent Files
|
|
29
|
+
|
|
30
|
+
Read the relevant agent file before working in that domain:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Task: "implement React component"
|
|
34
|
+
→ Read agents/fe.md for React patterns
|
|
35
|
+
→ Follow detected conventions
|
|
36
|
+
|
|
37
|
+
Task: "add API endpoint"
|
|
38
|
+
→ Read agents/be.md for API patterns
|
|
39
|
+
→ Follow project architecture
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Agent File Structure
|
|
43
|
+
|
|
44
|
+
Each agent file contains:
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
---
|
|
48
|
+
name: fe
|
|
49
|
+
description: Frontend specialist for React/TypeScript
|
|
50
|
+
tools: Read, Write, Glob, Grep, Bash
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Expertise
|
|
54
|
+
- React components and hooks
|
|
55
|
+
- TypeScript patterns
|
|
56
|
+
- CSS/styling conventions
|
|
57
|
+
|
|
58
|
+
## Project Patterns
|
|
59
|
+
- Components in src/components/
|
|
60
|
+
- Use functional components
|
|
61
|
+
- CSS modules for styling
|
|
62
|
+
|
|
63
|
+
## Code Conventions
|
|
64
|
+
- Named exports
|
|
65
|
+
- Props interfaces defined inline
|
|
66
|
+
- Error boundaries for async components
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Auto-Detection
|
|
70
|
+
|
|
71
|
+
When starting a task with `/p:now`, agents are auto-detected by keywords:
|
|
72
|
+
|
|
73
|
+
| Keywords | Agent |
|
|
74
|
+
|----------|-------|
|
|
75
|
+
| UI, frontend, React, component, CSS | `fe` |
|
|
76
|
+
| API, backend, database, server | `be` |
|
|
77
|
+
| design, UX, layout, wireframe | `ux` |
|
|
78
|
+
| test, QA, bug, coverage | `qa` |
|
|
79
|
+
| docs, README, documentation | `docs` |
|
|
80
|
+
|
|
81
|
+
## Agent Generation
|
|
82
|
+
|
|
83
|
+
Agents are generated by `/p:sync` based on:
|
|
84
|
+
- Detected tech stack (package.json, etc.)
|
|
85
|
+
- Project structure
|
|
86
|
+
- Code patterns found in codebase
|
|
87
|
+
|
|
88
|
+
Re-run `/p:sync` to regenerate agents after major changes.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# prjct Architecture
|
|
2
|
+
|
|
3
|
+
## Write-Through Pattern
|
|
4
|
+
|
|
5
|
+
All data flows through three layers:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
User Action → Storage (JSON) → Context (MD) → Sync Events (JSONL)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Layer Responsibilities
|
|
12
|
+
|
|
13
|
+
| Layer | Path | Purpose | Format |
|
|
14
|
+
|-------|------|---------|--------|
|
|
15
|
+
| **Storage** | `storage/*.json` | Source of truth | JSON |
|
|
16
|
+
| **Context** | `context/*.md` | Claude-readable summaries | Markdown |
|
|
17
|
+
| **Sync** | `sync/pending.json` | Backend event queue | JSON array |
|
|
18
|
+
| **Memory** | `memory/events.jsonl` | Audit trail | JSONL (append-only) |
|
|
19
|
+
|
|
20
|
+
### Data Flow Example
|
|
21
|
+
|
|
22
|
+
When user runs `/p:now "implement auth"`:
|
|
23
|
+
|
|
24
|
+
1. **Storage**: Write to `storage/state.json`
|
|
25
|
+
```json
|
|
26
|
+
{ "currentTask": { "description": "implement auth", ... } }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. **Context**: Generate `context/now.md`
|
|
30
|
+
```markdown
|
|
31
|
+
# NOW
|
|
32
|
+
**implement auth**
|
|
33
|
+
Started: 2025-12-20T10:30:00.000Z
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. **Sync**: Append to `sync/pending.json`
|
|
37
|
+
```json
|
|
38
|
+
{ "type": "task.started", "data": {...} }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
4. **Memory**: Append to `memory/events.jsonl`
|
|
42
|
+
```json
|
|
43
|
+
{"timestamp":"...","action":"task_started","task":"implement auth"}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## File Structure
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
~/.prjct-cli/projects/{projectId}/
|
|
50
|
+
├── storage/ # SOURCE OF TRUTH
|
|
51
|
+
│ ├── state.json # Current task state
|
|
52
|
+
│ ├── shipped.json # Shipped features
|
|
53
|
+
│ ├── ideas.json # Ideas backlog
|
|
54
|
+
│ └── queue.json # Task queue
|
|
55
|
+
│
|
|
56
|
+
├── context/ # CLAUDE-READABLE (generated)
|
|
57
|
+
│ ├── now.md # Current task summary
|
|
58
|
+
│ ├── shipped.md # Recent ships
|
|
59
|
+
│ └── next.md # Priority queue
|
|
60
|
+
│
|
|
61
|
+
├── sync/ # BACKEND EVENTS
|
|
62
|
+
│ └── pending.json # Events waiting for sync
|
|
63
|
+
│
|
|
64
|
+
├── memory/ # AUDIT TRAIL
|
|
65
|
+
│ └── events.jsonl # Append-only log
|
|
66
|
+
│
|
|
67
|
+
├── agents/ # DOMAIN SPECIALISTS
|
|
68
|
+
│ ├── fe.md # Frontend agent
|
|
69
|
+
│ ├── be.md # Backend agent
|
|
70
|
+
│ └── ...
|
|
71
|
+
│
|
|
72
|
+
└── CLAUDE.md # Project context (read first)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Storage vs Context
|
|
76
|
+
|
|
77
|
+
| Aspect | Storage (JSON) | Context (MD) |
|
|
78
|
+
|--------|----------------|--------------|
|
|
79
|
+
| Format | Structured JSON | Human-readable Markdown |
|
|
80
|
+
| Purpose | Source of truth | Claude summaries |
|
|
81
|
+
| Updates | Direct writes | Generated from storage |
|
|
82
|
+
| Read by | Code, Claude | Primarily Claude |
|
|
83
|
+
|
|
84
|
+
## Timestamps
|
|
85
|
+
|
|
86
|
+
All timestamps use ISO 8601 format:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Prefer bun, fallback to node
|
|
90
|
+
bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"
|
|
91
|
+
# Output: "2025-12-20T10:30:00.000Z"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**NEVER** hardcode timestamps. Always generate dynamically.
|
|
95
|
+
|
|
96
|
+
## IDs
|
|
97
|
+
|
|
98
|
+
Use UUID v4 for all IDs:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
bun -e "console.log(crypto.randomUUID())" 2>/dev/null || node -e "console.log(require('crypto').randomUUID())"
|
|
102
|
+
# Output: "550e8400-e29b-41d4-a716-446655440000"
|
|
103
|
+
```
|