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.
Files changed (245) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/CLAUDE.md +74 -211
  3. package/core/agentic/prompt-builder.ts +3 -7
  4. package/core/command-registry/optional-commands.ts +0 -20
  5. package/core/infrastructure/command-installer/command-installer.ts +8 -1
  6. package/core/infrastructure/command-installer/global-config.ts +31 -1
  7. package/core/infrastructure/command-installer/index.ts +1 -1
  8. package/core/infrastructure/setup.ts +3 -0
  9. package/package.json +3 -17
  10. package/templates/agentic/subagent-generation.md +8 -6
  11. package/templates/commands/done.md +57 -258
  12. package/templates/commands/now.md +72 -277
  13. package/templates/commands/ship.md +55 -261
  14. package/templates/commands/sync.md +7 -7
  15. package/templates/commands/test.md +328 -21
  16. package/templates/global/CLAUDE.md +40 -205
  17. package/templates/global/docs/agents.md +88 -0
  18. package/templates/global/docs/architecture.md +103 -0
  19. package/templates/global/docs/commands.md +98 -0
  20. package/templates/global/docs/validation.md +95 -0
  21. package/templates/mcp-config.json +36 -0
  22. package/bin/dev.js +0 -216
  23. package/bin/serve.js +0 -361
  24. package/packages/web/README.md +0 -36
  25. package/packages/web/app/api/claude/sessions/route.ts +0 -44
  26. package/packages/web/app/api/claude/status/route.ts +0 -34
  27. package/packages/web/app/api/projects/[id]/icon/route.ts +0 -33
  28. package/packages/web/app/api/projects/[id]/momentum/route.ts +0 -257
  29. package/packages/web/app/api/projects/[id]/route.ts +0 -29
  30. package/packages/web/app/api/projects/[id]/stats/route.ts +0 -41
  31. package/packages/web/app/api/projects/[id]/status/route.ts +0 -21
  32. package/packages/web/app/api/projects/route.ts +0 -16
  33. package/packages/web/app/api/sessions/current/route.ts +0 -132
  34. package/packages/web/app/api/sessions/history/route.ts +0 -204
  35. package/packages/web/app/error.tsx +0 -34
  36. package/packages/web/app/favicon.ico +0 -0
  37. package/packages/web/app/globals.css +0 -198
  38. package/packages/web/app/layout.tsx +0 -53
  39. package/packages/web/app/loading.tsx +0 -7
  40. package/packages/web/app/not-found.tsx +0 -25
  41. package/packages/web/app/page.tsx +0 -12
  42. package/packages/web/app/project/[id]/code/layout.tsx +0 -18
  43. package/packages/web/app/project/[id]/code/page.tsx +0 -408
  44. package/packages/web/app/project/[id]/error.tsx +0 -41
  45. package/packages/web/app/project/[id]/loading.tsx +0 -9
  46. package/packages/web/app/project/[id]/not-found.tsx +0 -27
  47. package/packages/web/app/project/[id]/page.tsx +0 -384
  48. package/packages/web/app/project/[id]/reports/page.tsx +0 -59
  49. package/packages/web/app/project/[id]/reports/print/page.tsx +0 -58
  50. package/packages/web/app/sessions/page.tsx +0 -165
  51. package/packages/web/app/settings/page.tsx +0 -151
  52. package/packages/web/components/ActivityTimeline/ActivityTimeline.constants.ts +0 -2
  53. package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +0 -49
  54. package/packages/web/components/ActivityTimeline/ActivityTimeline.types.ts +0 -8
  55. package/packages/web/components/ActivityTimeline/hooks/index.ts +0 -2
  56. package/packages/web/components/ActivityTimeline/hooks/useExpandable.ts +0 -9
  57. package/packages/web/components/ActivityTimeline/hooks/useGroupedEvents.ts +0 -23
  58. package/packages/web/components/ActivityTimeline/index.ts +0 -2
  59. package/packages/web/components/AgentsCard/AgentsCard.tsx +0 -93
  60. package/packages/web/components/AgentsCard/AgentsCard.types.ts +0 -14
  61. package/packages/web/components/AgentsCard/index.ts +0 -2
  62. package/packages/web/components/AppSidebar/AppSidebar.tsx +0 -316
  63. package/packages/web/components/AppSidebar/index.ts +0 -1
  64. package/packages/web/components/BackLink/BackLink.tsx +0 -18
  65. package/packages/web/components/BackLink/BackLink.types.ts +0 -5
  66. package/packages/web/components/BackLink/index.ts +0 -2
  67. package/packages/web/components/BentoCard/BentoCard.constants.ts +0 -16
  68. package/packages/web/components/BentoCard/BentoCard.tsx +0 -48
  69. package/packages/web/components/BentoCard/BentoCard.types.ts +0 -15
  70. package/packages/web/components/BentoCard/index.ts +0 -2
  71. package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.constants.ts +0 -9
  72. package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.tsx +0 -18
  73. package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.types.ts +0 -5
  74. package/packages/web/components/BentoCardSkeleton/index.ts +0 -2
  75. package/packages/web/components/BentoGrid/BentoGrid.tsx +0 -18
  76. package/packages/web/components/BentoGrid/BentoGrid.types.ts +0 -4
  77. package/packages/web/components/BentoGrid/index.ts +0 -2
  78. package/packages/web/components/BlockersCard/BlockersCard.tsx +0 -75
  79. package/packages/web/components/BlockersCard/BlockersCard.types.ts +0 -12
  80. package/packages/web/components/BlockersCard/index.ts +0 -2
  81. package/packages/web/components/CommandBar/CommandBar.tsx +0 -67
  82. package/packages/web/components/CommandBar/index.ts +0 -1
  83. package/packages/web/components/CommandButton/CommandButton.tsx +0 -46
  84. package/packages/web/components/CommandButton/index.ts +0 -1
  85. package/packages/web/components/ConnectionStatus/ConnectionStatus.tsx +0 -29
  86. package/packages/web/components/ConnectionStatus/index.ts +0 -1
  87. package/packages/web/components/DashboardContent/DashboardContent.tsx +0 -284
  88. package/packages/web/components/DashboardContent/index.ts +0 -1
  89. package/packages/web/components/DateGroup/DateGroup.tsx +0 -18
  90. package/packages/web/components/DateGroup/DateGroup.types.ts +0 -6
  91. package/packages/web/components/DateGroup/DateGroup.utils.ts +0 -11
  92. package/packages/web/components/DateGroup/index.ts +0 -2
  93. package/packages/web/components/EmptyState/EmptyState.tsx +0 -76
  94. package/packages/web/components/EmptyState/EmptyState.types.ts +0 -11
  95. package/packages/web/components/EmptyState/index.ts +0 -2
  96. package/packages/web/components/EventRow/EventRow.constants.ts +0 -10
  97. package/packages/web/components/EventRow/EventRow.tsx +0 -49
  98. package/packages/web/components/EventRow/EventRow.types.ts +0 -7
  99. package/packages/web/components/EventRow/EventRow.utils.ts +0 -49
  100. package/packages/web/components/EventRow/index.ts +0 -2
  101. package/packages/web/components/ExpandButton/ExpandButton.tsx +0 -18
  102. package/packages/web/components/ExpandButton/ExpandButton.types.ts +0 -6
  103. package/packages/web/components/ExpandButton/index.ts +0 -2
  104. package/packages/web/components/HealthGradientBackground/HealthGradientBackground.tsx +0 -14
  105. package/packages/web/components/HealthGradientBackground/HealthGradientBackground.types.ts +0 -5
  106. package/packages/web/components/HealthGradientBackground/HealthGradientBackground.utils.ts +0 -13
  107. package/packages/web/components/HealthGradientBackground/index.ts +0 -2
  108. package/packages/web/components/HeroSection/HeroSection.tsx +0 -92
  109. package/packages/web/components/HeroSection/HeroSection.types.ts +0 -14
  110. package/packages/web/components/HeroSection/HeroSection.utils.ts +0 -11
  111. package/packages/web/components/HeroSection/hooks/index.ts +0 -2
  112. package/packages/web/components/HeroSection/hooks/useCountUp.ts +0 -45
  113. package/packages/web/components/HeroSection/hooks/useWeeklyActivity.ts +0 -18
  114. package/packages/web/components/HeroSection/index.ts +0 -2
  115. package/packages/web/components/IdeasCard/IdeasCard.tsx +0 -115
  116. package/packages/web/components/IdeasCard/IdeasCard.types.ts +0 -10
  117. package/packages/web/components/IdeasCard/index.ts +0 -2
  118. package/packages/web/components/InsightMessage/InsightMessage.tsx +0 -9
  119. package/packages/web/components/InsightMessage/InsightMessage.types.ts +0 -3
  120. package/packages/web/components/InsightMessage/index.ts +0 -2
  121. package/packages/web/components/Logo/Logo.tsx +0 -65
  122. package/packages/web/components/Logo/index.ts +0 -1
  123. package/packages/web/components/MarkdownContent/MarkdownContent.tsx +0 -123
  124. package/packages/web/components/MarkdownContent/index.ts +0 -1
  125. package/packages/web/components/MasonryGrid/MasonryGrid.tsx +0 -18
  126. package/packages/web/components/MasonryGrid/index.ts +0 -1
  127. package/packages/web/components/MomentumWidget/MomentumWidget.tsx +0 -119
  128. package/packages/web/components/MomentumWidget/MomentumWidget.types.ts +0 -16
  129. package/packages/web/components/MomentumWidget/index.ts +0 -2
  130. package/packages/web/components/NowCard/NowCard.tsx +0 -118
  131. package/packages/web/components/NowCard/NowCard.types.ts +0 -16
  132. package/packages/web/components/NowCard/index.ts +0 -2
  133. package/packages/web/components/PageHeader/PageHeader.tsx +0 -24
  134. package/packages/web/components/PageHeader/index.ts +0 -1
  135. package/packages/web/components/ProgressRing/ProgressRing.constants.ts +0 -20
  136. package/packages/web/components/ProgressRing/ProgressRing.tsx +0 -51
  137. package/packages/web/components/ProgressRing/ProgressRing.types.ts +0 -11
  138. package/packages/web/components/ProgressRing/index.ts +0 -2
  139. package/packages/web/components/ProjectAvatar/ProjectAvatar.tsx +0 -54
  140. package/packages/web/components/ProjectAvatar/index.ts +0 -1
  141. package/packages/web/components/ProjectColorDot/ProjectColorDot.tsx +0 -37
  142. package/packages/web/components/ProjectColorDot/index.ts +0 -1
  143. package/packages/web/components/ProjectSelectorModal/ProjectSelectorModal.tsx +0 -104
  144. package/packages/web/components/ProjectSelectorModal/index.ts +0 -1
  145. package/packages/web/components/Providers/Providers.tsx +0 -48
  146. package/packages/web/components/Providers/index.ts +0 -1
  147. package/packages/web/components/QueueCard/QueueCard.tsx +0 -125
  148. package/packages/web/components/QueueCard/QueueCard.types.ts +0 -12
  149. package/packages/web/components/QueueCard/QueueCard.utils.ts +0 -12
  150. package/packages/web/components/QueueCard/index.ts +0 -2
  151. package/packages/web/components/RecoverCard/RecoverCard.tsx +0 -72
  152. package/packages/web/components/RecoverCard/RecoverCard.types.ts +0 -16
  153. package/packages/web/components/RecoverCard/index.ts +0 -2
  154. package/packages/web/components/RoadmapCard/RoadmapCard.tsx +0 -145
  155. package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +0 -16
  156. package/packages/web/components/RoadmapCard/index.ts +0 -2
  157. package/packages/web/components/ShipsCard/ShipsCard.tsx +0 -95
  158. package/packages/web/components/ShipsCard/ShipsCard.types.ts +0 -14
  159. package/packages/web/components/ShipsCard/ShipsCard.utils.ts +0 -4
  160. package/packages/web/components/ShipsCard/index.ts +0 -2
  161. package/packages/web/components/SparklineChart/SparklineChart.tsx +0 -40
  162. package/packages/web/components/SparklineChart/SparklineChart.types.ts +0 -6
  163. package/packages/web/components/SparklineChart/index.ts +0 -2
  164. package/packages/web/components/StatsMasonry/StatsMasonry.tsx +0 -95
  165. package/packages/web/components/StatsMasonry/index.ts +0 -1
  166. package/packages/web/components/StreakCard/StreakCard.constants.ts +0 -2
  167. package/packages/web/components/StreakCard/StreakCard.tsx +0 -55
  168. package/packages/web/components/StreakCard/StreakCard.types.ts +0 -4
  169. package/packages/web/components/StreakCard/index.ts +0 -2
  170. package/packages/web/components/TasksCounter/TasksCounter.tsx +0 -14
  171. package/packages/web/components/TasksCounter/TasksCounter.types.ts +0 -3
  172. package/packages/web/components/TasksCounter/index.ts +0 -2
  173. package/packages/web/components/TechStackBadges/TechStackBadges.tsx +0 -28
  174. package/packages/web/components/TechStackBadges/index.ts +0 -1
  175. package/packages/web/components/TerminalDock/DockToggleTab.tsx +0 -29
  176. package/packages/web/components/TerminalDock/TerminalDock.tsx +0 -386
  177. package/packages/web/components/TerminalDock/TerminalDockTab.tsx +0 -130
  178. package/packages/web/components/TerminalDock/TerminalTabBar.tsx +0 -142
  179. package/packages/web/components/TerminalDock/index.ts +0 -2
  180. package/packages/web/components/TerminalTabs/TerminalTab.tsx +0 -95
  181. package/packages/web/components/TerminalTabs/TerminalTabs.tsx +0 -211
  182. package/packages/web/components/TerminalTabs/index.ts +0 -1
  183. package/packages/web/components/VelocityBadge/VelocityBadge.tsx +0 -32
  184. package/packages/web/components/VelocityBadge/VelocityBadge.types.ts +0 -3
  185. package/packages/web/components/VelocityBadge/index.ts +0 -2
  186. package/packages/web/components/VelocityCard/VelocityCard.tsx +0 -73
  187. package/packages/web/components/VelocityCard/VelocityCard.types.ts +0 -7
  188. package/packages/web/components/VelocityCard/index.ts +0 -2
  189. package/packages/web/components/WeeklyReports/PrintableReport.tsx +0 -259
  190. package/packages/web/components/WeeklyReports/ReportPreviewCard.tsx +0 -187
  191. package/packages/web/components/WeeklyReports/WeekCalendar.tsx +0 -288
  192. package/packages/web/components/WeeklyReports/WeeklyReports.tsx +0 -149
  193. package/packages/web/components/WeeklyReports/index.ts +0 -4
  194. package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +0 -25
  195. package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +0 -4
  196. package/packages/web/components/WeeklySparkline/index.ts +0 -2
  197. package/packages/web/components/charts/SessionsChart.tsx +0 -175
  198. package/packages/web/components/ui/alert-dialog.tsx +0 -157
  199. package/packages/web/components/ui/badge.tsx +0 -46
  200. package/packages/web/components/ui/button.tsx +0 -60
  201. package/packages/web/components/ui/card.tsx +0 -92
  202. package/packages/web/components/ui/chart.tsx +0 -385
  203. package/packages/web/components/ui/dialog.tsx +0 -143
  204. package/packages/web/components/ui/drawer.tsx +0 -135
  205. package/packages/web/components/ui/dropdown-menu.tsx +0 -257
  206. package/packages/web/components/ui/input.tsx +0 -21
  207. package/packages/web/components/ui/scroll-area.tsx +0 -58
  208. package/packages/web/components/ui/select.tsx +0 -187
  209. package/packages/web/components/ui/sheet.tsx +0 -139
  210. package/packages/web/components/ui/tabs.tsx +0 -66
  211. package/packages/web/components/ui/tooltip.tsx +0 -61
  212. package/packages/web/components.json +0 -22
  213. package/packages/web/context/GlobalTerminalContext.tsx +0 -538
  214. package/packages/web/context/TerminalContext.tsx +0 -45
  215. package/packages/web/context/TerminalTabsContext.tsx +0 -181
  216. package/packages/web/eslint.config.mjs +0 -18
  217. package/packages/web/hooks/useClaudeTerminal.ts +0 -425
  218. package/packages/web/hooks/useProjectStats.ts +0 -93
  219. package/packages/web/hooks/useProjects.ts +0 -73
  220. package/packages/web/lib/actions/projects.ts +0 -15
  221. package/packages/web/lib/commands.ts +0 -81
  222. package/packages/web/lib/format.ts +0 -23
  223. package/packages/web/lib/generate-week-report.ts +0 -285
  224. package/packages/web/lib/parse-prjct-files.ts +0 -1123
  225. package/packages/web/lib/project-colors.ts +0 -58
  226. package/packages/web/lib/projects.ts +0 -506
  227. package/packages/web/lib/pty.ts +0 -101
  228. package/packages/web/lib/query-config.ts +0 -44
  229. package/packages/web/lib/services/index.ts +0 -9
  230. package/packages/web/lib/services/projects.server.ts +0 -66
  231. package/packages/web/lib/services/stats.server.ts +0 -562
  232. package/packages/web/lib/unified-loader.ts +0 -396
  233. package/packages/web/lib/utils.ts +0 -6
  234. package/packages/web/next-env.d.ts +0 -6
  235. package/packages/web/next.config.ts +0 -7
  236. package/packages/web/package.json +0 -57
  237. package/packages/web/postcss.config.mjs +0 -7
  238. package/packages/web/public/file.svg +0 -1
  239. package/packages/web/public/globe.svg +0 -1
  240. package/packages/web/public/next.svg +0 -1
  241. package/packages/web/public/vercel.svg +0 -1
  242. package/packages/web/public/window.svg +0 -1
  243. package/packages/web/server.ts +0 -312
  244. package/packages/web/tsconfig.json +0 -34
  245. package/templates/commands/serve.md +0 -121
@@ -1,6 +1,7 @@
1
1
  ---
2
- allowed-tools: [Bash, Read, Edit]
3
- description: 'Run tests with auto-fix'
2
+ allowed-tools: [Bash, Read, Write, Edit]
3
+ description: 'Run tests with auto-fix and AI generation'
4
+ timestamp-rule: 'GetTimestamp() for ALL timestamps'
4
5
  ---
5
6
 
6
7
  # /p:test
@@ -8,41 +9,347 @@ description: 'Run tests with auto-fix'
8
9
  ## Usage
9
10
 
10
11
  ```
11
- /p:test [all|unit|e2e|failed|fix] # Default: all
12
+ /p:test [all|unit|e2e|failed|fix|ai]
13
+ [--blocking] # Exit with error if tests fail
14
+ [--testsprite] # Force TestSprite even if native runner exists
15
+ [--scope=codebase|diff] # TestSprite: test all or only changed files
12
16
  ```
13
17
 
14
- ## Flow
18
+ ## Context Variables
19
+ - `{projectId}`: From `.prjct/prjct.config.json`
20
+ - `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
21
+ - `{configPath}`: `~/.prjct-cli/config.json`
22
+ - `{memoryPath}`: `{globalPath}/memory/events.jsonl`
15
23
 
16
- 1. Detect: test runner (jest/vitest/pytest/etc)
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`
24
+ ## Step 1: Read Project Config
21
25
 
22
- ## Response (success)
26
+ READ: `.prjct/prjct.config.json`
27
+ EXTRACT: `projectId`
23
28
 
29
+ IF file not found:
30
+ OUTPUT: "No prjct project. Run /p:init first."
31
+ STOP
32
+
33
+ ## Step 2: Parse Arguments
34
+
35
+ SET defaults:
36
+ - {testMode} = "all"
37
+ - {blocking} = false
38
+ - {useTestSprite} = false
39
+ - {testScope} = "diff"
40
+
41
+ PARSE args:
42
+ - IF arg is "ai": {useTestSprite} = true
43
+ - IF arg is "all|unit|e2e|failed|fix": {testMode} = arg
44
+ - IF arg contains "--blocking": {blocking} = true
45
+ - IF arg contains "--testsprite": {useTestSprite} = true
46
+ - IF arg contains "--scope=codebase": {testScope} = "codebase"
47
+
48
+ ## Step 3: Check TestSprite API Key (If Needed)
49
+
50
+ IF {useTestSprite}:
51
+ READ: `{configPath}`
52
+
53
+ ### Check if user dismissed TestSprite
54
+ IF config.testspriteSkip == "never":
55
+ OUTPUT: "ℹ️ TestSprite disabled. Using native tests."
56
+ {useTestSprite} = false
57
+ → Go to Step 4
58
+
59
+ IF config.testspriteSkip == "later" AND config.testspriteSkipUntil > now:
60
+ OUTPUT: "ℹ️ TestSprite reminder snoozed. Using native tests."
61
+ {useTestSprite} = false
62
+ → Go to Step 4
63
+
64
+ ### Check for existing API key
65
+ IF config.testspriteApiKey exists AND is not empty:
66
+ SET: {apiKey} = config.testspriteApiKey
67
+ → Continue to Step 4
68
+
69
+ ### No API key - show options (NON-BLOCKING)
70
+ OUTPUT: "🤖 TestSprite AI Testing (Optional)"
71
+ OUTPUT: ""
72
+ OUTPUT: "TestSprite can generate and run AI-powered tests."
73
+ OUTPUT: "Free API key at: https://testsprite.com/dashboard/api-keys"
74
+ OUTPUT: ""
75
+
76
+ ASK with options:
77
+ 1. "Enter API key" → Prompt for key
78
+ 2. "Skip for now" → Use native tests this time
79
+ 3. "Remind me in a week" → Snooze reminder
80
+ 4. "Never ask again" → Disable permanently
81
+
82
+ HANDLE response:
83
+
84
+ IF option 1 (Enter API key):
85
+ ASK: "Paste your TestSprite API key:"
86
+ SET: {apiKey} = user input
87
+
88
+ UPDATE config.json:
89
+ - testspriteApiKey: {apiKey}
90
+
91
+ OUTPUT: "✅ API key saved"
92
+ → Continue to Step 4
93
+
94
+ IF option 2 (Skip for now):
95
+ OUTPUT: "⏭️ Skipping TestSprite. Using native tests."
96
+ {useTestSprite} = false
97
+ → Go to Step 4
98
+
99
+ IF option 3 (Remind me in a week):
100
+ SET: {skipUntil} = now + 7 days
101
+
102
+ UPDATE config.json:
103
+ - testspriteSkip: "later"
104
+ - testspriteSkipUntil: {skipUntil}
105
+
106
+ OUTPUT: "⏰ Will ask again in a week. Using native tests."
107
+ {useTestSprite} = false
108
+ → Go to Step 4
109
+
110
+ IF option 4 (Never ask again):
111
+ UPDATE config.json:
112
+ - testspriteSkip: "never"
113
+
114
+ OUTPUT: "🔕 Won't ask again. Use --testsprite flag to enable manually."
115
+ {useTestSprite} = false
116
+ → Go to Step 4
117
+
118
+ ## Step 4: Detect Testing Strategy
119
+
120
+ IF {useTestSprite}:
121
+ → Go to Step 6 (TestSprite AI Testing)
122
+
123
+ ### Check for Native Test Runner
124
+
125
+ READ: `package.json`
126
+ IF has "scripts.test":
127
+ {runner} = "npm"
128
+ {runnerCmd} = "npm test"
129
+ → Go to Step 5 (Native Testing)
130
+
131
+ IF file exists: `pytest.ini` OR `pyproject.toml` with pytest:
132
+ {runner} = "pytest"
133
+ {runnerCmd} = "pytest"
134
+ → Go to Step 5
135
+
136
+ IF file exists: `Cargo.toml`:
137
+ {runner} = "cargo"
138
+ {runnerCmd} = "cargo test"
139
+ → Go to Step 5
140
+
141
+ IF no runner found:
142
+ OUTPUT: "No test runner detected."
143
+ OUTPUT: ""
144
+ OUTPUT: "Options:"
145
+ OUTPUT: "• /p:test ai - Generate tests with AI (TestSprite)"
146
+ OUTPUT: "• Add 'test' script to package.json"
147
+ STOP
148
+
149
+ ## Step 5: Native Test Runner
150
+
151
+ OUTPUT: "🧪 Running tests with {runner}..."
152
+
153
+ BASH: `{runnerCmd} 2>&1`
154
+ CAPTURE output as {testOutput}
155
+
156
+ ### Parse Results
157
+
158
+ IF {testOutput} contains "passed" AND NOT contains "failed":
159
+ {testStatus} = "passed"
160
+ {passed} = extract number of passed tests
161
+ {failed} = 0
162
+ ELSE IF {testOutput} contains "failed" OR contains "FAIL":
163
+ {testStatus} = "failed"
164
+ {passed} = extract passed count
165
+ {failed} = extract failed count
166
+ ELSE:
167
+ {testStatus} = "unknown"
168
+
169
+ ### Handle Fix Mode
170
+ IF {testMode} == "fix" AND {testStatus} == "failed":
171
+ OUTPUT: "🔧 Attempting auto-fix..."
172
+
173
+ IF {runner} == "npm":
174
+ BASH: `npm test -- -u 2>&1` # Update snapshots
175
+
176
+ OUTPUT: "Snapshots updated. Re-running tests..."
177
+ BASH: `{runnerCmd} 2>&1`
178
+ CAPTURE and re-parse results
179
+
180
+ → Go to Step 8 (Results)
181
+
182
+ ## Step 6: TestSprite AI Testing
183
+
184
+ OUTPUT: "🤖 Running AI-powered tests with TestSprite..."
185
+
186
+ ### 6.1 Bootstrap Tests
187
+
188
+ CALL MCP TOOL: `testsprite_bootstrap_tests`
189
+ PARAMETERS:
190
+ - projectPath: current working directory (absolute path)
191
+ - type: auto-detect based on project (frontend/backend)
192
+ - testScope: {testScope}
193
+
194
+ CAPTURE: bootstrap result
195
+
196
+ ### 6.2 Generate and Execute Tests
197
+
198
+ CALL MCP TOOL: `testsprite_generate_code_and_execute`
199
+ PARAMETERS:
200
+ - projectName: from package.json "name" or directory name
201
+ - projectPath: current working directory (absolute path)
202
+ - testIds: [] (run all)
203
+
204
+ CAPTURE: execution result
205
+
206
+ ### 6.3 Parse TestSprite Results
207
+
208
+ READ: `testsprite_tests/test_results.json`
209
+
210
+ EXTRACT:
211
+ - {passed}: count of passed tests
212
+ - {failed}: count of failed tests
213
+ - {coverage}: coverage percentage if available
214
+
215
+ IF {failed} == 0:
216
+ {testStatus} = "passed"
217
+ ELSE:
218
+ {testStatus} = "failed"
219
+
220
+ ### Handle Fix Mode with TestSprite
221
+ IF {testMode} == "fix" AND {testStatus} == "failed":
222
+ OUTPUT: "🔧 Running auto-healing..."
223
+
224
+ CALL MCP TOOL: `testsprite_rerun_tests`
225
+ PARAMETERS:
226
+ - projectPath: current working directory
227
+
228
+ READ: `testsprite_tests/test_results.json` (updated)
229
+ Re-parse results
230
+
231
+ → Go to Step 8 (Results)
232
+
233
+ ## Step 7: (Reserved for future expansion)
234
+
235
+ ## Step 8: Results & Response
236
+
237
+ ### Log to Memory
238
+
239
+ SET: {now} = GetTimestamp()
240
+
241
+ APPEND to `{memoryPath}`:
242
+ ```json
243
+ {"ts":"{now}","type":"test_run","tool":"{runner|testsprite}","passed":{passed},"failed":{failed},"mode":"{testMode}"}
24
244
  ```
245
+
246
+ ### Check Blocking Mode
247
+
248
+ IF {blocking} AND {failed} > 0:
249
+ OUTPUT: "❌ {failed} tests failed. Blocking."
250
+ OUTPUT: ""
251
+ OUTPUT: "Fix failing tests or run without --blocking flag."
252
+ EXIT with error (non-zero)
253
+
254
+ ### Success Response
255
+
256
+ IF {testStatus} == "passed":
257
+ OUTPUT: "✅ All tests passing!"
258
+ OUTPUT: ""
259
+ OUTPUT: "📊 Results:"
260
+ OUTPUT: "• Passed: {passed}"
261
+ IF {coverage}:
262
+ OUTPUT: "• Coverage: {coverage}%"
263
+ OUTPUT: ""
264
+ OUTPUT: "🎯 Next: /p:ship"
265
+
266
+ ### Failure Response
267
+
268
+ IF {testStatus} == "failed":
269
+ OUTPUT: "❌ {failed} tests failing"
270
+ OUTPUT: ""
271
+ IF {useTestSprite}:
272
+ OUTPUT: "📋 Report: testsprite_tests/TestSprite_MCP_Test_Report.html"
273
+ ELSE:
274
+ OUTPUT: "{testOutput}" # Show relevant failure output
275
+ OUTPUT: ""
276
+ OUTPUT: "💡 Auto-fix: /p:test fix"
277
+ OUTPUT: ""
278
+ OUTPUT: "📊 Summary: {passed}/{passed + failed} passed"
279
+
280
+ ## Error Handling
281
+
282
+ | Error | Response | Action |
283
+ |-------|----------|--------|
284
+ | No project | "No prjct project" | STOP |
285
+ | No test runner | "No test runner detected" | Suggest /p:test ai |
286
+ | TestSprite API key missing | Show options | Fallback to native (non-blocking) |
287
+ | TestSprite dismissed | Skip silently | Use native tests |
288
+ | Tests timeout | "Tests timed out" | Suggest increasing timeout |
289
+ | MCP tool not available | "TestSprite not configured" | Fallback to native tests |
290
+
291
+ ## Examples
292
+
293
+ ### Example 1: Native Tests Pass
294
+ ```
295
+ 🧪 Running tests with npm...
296
+
25
297
  ✅ All tests passing!
26
298
 
27
299
  📊 Results:
28
- Unit: {N}/{N}
29
- Integration: {N}/{N}
30
- • E2E: {N}/{N}
300
+ Passed: 42
301
+ Coverage: 87%
31
302
 
32
- 🎯 Coverage: {X}%
33
- ⚡ Time: {X}s
303
+ 🎯 Next: /p:ship
304
+ ```
34
305
 
35
- /p:ship
306
+ ### Example 2: AI Tests with Failures
36
307
  ```
308
+ 🤖 Running AI-powered tests with TestSprite...
309
+
310
+ ❌ 3 tests failing
37
311
 
38
- ## Response (failures)
312
+ 📋 Report: testsprite_tests/TestSprite_MCP_Test_Report.html
39
313
 
314
+ 💡 Auto-fix: /p:test fix
315
+
316
+ 📊 Summary: 39/42 passed
40
317
  ```
41
- ❌ {N} tests failing
42
318
 
43
- {failure_details}
319
+ ### Example 3: Blocking Mode
320
+ ```
321
+ 🧪 Running tests with npm...
44
322
 
45
- 💡 Auto-fix: /p:test fix
323
+ 2 tests failed. Blocking.
324
+
325
+ Fix failing tests or run without --blocking flag.
326
+ ```
327
+
328
+ ### Example 4: First Time TestSprite (No API Key)
329
+ ```
330
+ 🤖 TestSprite AI Testing (Optional)
331
+
332
+ TestSprite can generate and run AI-powered tests.
333
+ Free API key at: https://testsprite.com/dashboard/api-keys
334
+
335
+ Options:
336
+ 1. Enter API key
337
+ 2. Skip for now
338
+ 3. Remind me in a week
339
+ 4. Never ask again
340
+
341
+ > 2
342
+
343
+ ⏭️ Skipping TestSprite. Using native tests.
344
+
345
+ 🧪 Running tests with npm...
346
+ ...
347
+ ```
348
+
349
+ ### Example 5: TestSprite Snoozed
350
+ ```
351
+ ℹ️ TestSprite reminder snoozed. Using native tests.
46
352
 
47
- 📊 Summary: {passed}/{total} ({X}%)
353
+ 🧪 Running tests with npm...
354
+ ...
48
355
  ```
@@ -1,233 +1,68 @@
1
1
  <!-- prjct:start - DO NOT REMOVE THIS MARKER -->
2
- # prjct Configuration
2
+ # prjct-cli
3
3
 
4
- This section provides global context for all `/p:*` commands across any prjct project.
4
+ ## CRITICAL RULES (READ FIRST)
5
5
 
6
- **Auto-managed by prjct-cli** - This section is automatically updated when you install or update prjct.
6
+ ### 1. Path Resolution (MOST IMPORTANT)
7
+ **ALL writes go to global storage**: `~/.prjct-cli/projects/{projectId}/`
7
8
 
8
- ## 🚀 Quick Command Reference
9
+ - **NEVER** write to `.prjct/` (config only)
10
+ - **NEVER** write to `./` (current directory)
11
+ - **ALWAYS** use global storage path
9
12
 
10
- | Command | Purpose | Example |
11
- |---------|---------|---------|
12
- | `/p:sync` | Analyze project & generate agents | Run first in any project |
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
- ## 🎯 Recommended Workflow
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
- User: "p. feature add user authentication"
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
- **Never use:**
181
- - ❌ "Generated with Claude Code"
182
- - ❌ "Co-Authored-By: Claude"
29
+ ---
183
30
 
184
- ## ⚠️ Common Validation Patterns
31
+ ## Quick Reference
185
32
 
186
- ### Before /p:done:
187
- ```javascript
188
- const nowContent = await Read('~/.prjct-cli/projects/{projectId}/core/now.md')
189
- if (!nowContent || nowContent.trim() === '') {
190
- return "Not working on anything. Use /p:now to start a task."
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
- ### Before /p:ship:
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
- ## 🔧 Error Handling
42
+ ---
203
43
 
204
- | Error | Solution |
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
- ## 🎯 Command Execution Flow
46
+ For detailed information, read these files:
212
47
 
213
- Standard pattern for all `/p:*` commands:
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
- 1. **Validate**: Check `.prjct/prjct.config.json` exists
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
- ## 📚 Additional Context
57
+ ## Before Any Command
223
58
 
224
- - **Website**: https://prjct.app
225
- - **Documentation**: https://prjct.app/docs
226
- - **Support**: jlopezlira@gmail.com
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
- **Last updated**: Auto-managed by prjct-cli
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 -->