prjct-cli 0.13.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/bin/prjct +10 -13
  3. package/core/agentic/memory-system/semantic-memories.ts +2 -1
  4. package/core/agentic/plan-mode/plan-mode.ts +2 -1
  5. package/core/agentic/prompt-builder.ts +22 -43
  6. package/core/agentic/services.ts +5 -5
  7. package/core/agentic/smart-context.ts +7 -2
  8. package/core/command-registry/core-commands.ts +54 -29
  9. package/core/command-registry/optional-commands.ts +64 -0
  10. package/core/command-registry/setup-commands.ts +18 -3
  11. package/core/commands/analysis.ts +21 -68
  12. package/core/commands/analytics.ts +247 -213
  13. package/core/commands/base.ts +1 -1
  14. package/core/commands/index.ts +41 -36
  15. package/core/commands/maintenance.ts +300 -31
  16. package/core/commands/planning.ts +233 -22
  17. package/core/commands/setup.ts +3 -8
  18. package/core/commands/shipping.ts +14 -18
  19. package/core/commands/types.ts +8 -6
  20. package/core/commands/workflow.ts +105 -100
  21. package/core/context/generator.ts +317 -0
  22. package/core/context-sync.ts +7 -350
  23. package/core/data/index.ts +13 -32
  24. package/core/data/md-ideas-manager.ts +155 -0
  25. package/core/data/md-queue-manager.ts +4 -3
  26. package/core/data/md-shipped-manager.ts +90 -0
  27. package/core/data/md-state-manager.ts +11 -7
  28. package/core/domain/agent-generator.ts +23 -63
  29. package/core/events/index.ts +143 -0
  30. package/core/index.ts +17 -14
  31. package/core/infrastructure/capability-installer.ts +13 -149
  32. package/core/infrastructure/migrator/project-scanner.ts +2 -1
  33. package/core/infrastructure/path-manager.ts +4 -6
  34. package/core/infrastructure/setup.ts +3 -0
  35. package/core/infrastructure/uuid-migration.ts +750 -0
  36. package/core/outcomes/recorder.ts +2 -1
  37. package/core/plugin/loader.ts +4 -7
  38. package/core/plugin/registry.ts +3 -3
  39. package/core/schemas/index.ts +23 -25
  40. package/core/schemas/state.ts +1 -0
  41. package/core/serializers/ideas-serializer.ts +187 -0
  42. package/core/serializers/index.ts +16 -0
  43. package/core/serializers/shipped-serializer.ts +108 -0
  44. package/core/session/utils.ts +3 -9
  45. package/core/storage/ideas-storage.ts +273 -0
  46. package/core/storage/index.ts +204 -0
  47. package/core/storage/queue-storage.ts +297 -0
  48. package/core/storage/shipped-storage.ts +223 -0
  49. package/core/storage/state-storage.ts +235 -0
  50. package/core/storage/storage-manager.ts +175 -0
  51. package/package.json +1 -1
  52. package/packages/web/app/api/projects/[id]/momentum/route.ts +257 -0
  53. package/packages/web/app/api/sessions/current/route.ts +132 -0
  54. package/packages/web/app/api/sessions/history/route.ts +96 -14
  55. package/packages/web/app/globals.css +5 -0
  56. package/packages/web/app/layout.tsx +2 -0
  57. package/packages/web/app/project/[id]/code/layout.tsx +18 -0
  58. package/packages/web/app/project/[id]/code/page.tsx +408 -0
  59. package/packages/web/app/project/[id]/page.tsx +359 -389
  60. package/packages/web/app/project/[id]/reports/page.tsx +59 -0
  61. package/packages/web/app/project/[id]/reports/print/page.tsx +58 -0
  62. package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +0 -1
  63. package/packages/web/components/AgentsCard/AgentsCard.tsx +64 -34
  64. package/packages/web/components/AgentsCard/AgentsCard.types.ts +1 -0
  65. package/packages/web/components/AppSidebar/AppSidebar.tsx +135 -11
  66. package/packages/web/components/BentoCard/BentoCard.constants.ts +3 -3
  67. package/packages/web/components/BentoCard/BentoCard.tsx +2 -1
  68. package/packages/web/components/BentoGrid/BentoGrid.tsx +2 -2
  69. package/packages/web/components/BlockersCard/BlockersCard.tsx +65 -57
  70. package/packages/web/components/BlockersCard/BlockersCard.types.ts +1 -0
  71. package/packages/web/components/CommandBar/CommandBar.tsx +67 -0
  72. package/packages/web/components/CommandBar/index.ts +1 -0
  73. package/packages/web/components/DashboardContent/DashboardContent.tsx +35 -5
  74. package/packages/web/components/DateGroup/DateGroup.tsx +1 -1
  75. package/packages/web/components/EmptyState/EmptyState.tsx +39 -21
  76. package/packages/web/components/EmptyState/EmptyState.types.ts +1 -0
  77. package/packages/web/components/EventRow/EventRow.tsx +4 -4
  78. package/packages/web/components/EventRow/EventRow.utils.ts +3 -3
  79. package/packages/web/components/HeroSection/HeroSection.tsx +52 -15
  80. package/packages/web/components/HeroSection/HeroSection.types.ts +4 -4
  81. package/packages/web/components/HeroSection/HeroSection.utils.ts +7 -3
  82. package/packages/web/components/IdeasCard/IdeasCard.tsx +94 -27
  83. package/packages/web/components/IdeasCard/IdeasCard.types.ts +1 -0
  84. package/packages/web/components/MasonryGrid/MasonryGrid.tsx +18 -0
  85. package/packages/web/components/MasonryGrid/index.ts +1 -0
  86. package/packages/web/components/MomentumWidget/MomentumWidget.tsx +119 -0
  87. package/packages/web/components/MomentumWidget/MomentumWidget.types.ts +16 -0
  88. package/packages/web/components/MomentumWidget/index.ts +2 -0
  89. package/packages/web/components/NowCard/NowCard.tsx +81 -56
  90. package/packages/web/components/NowCard/NowCard.types.ts +1 -0
  91. package/packages/web/components/PageHeader/PageHeader.tsx +24 -0
  92. package/packages/web/components/PageHeader/index.ts +1 -0
  93. package/packages/web/components/ProgressRing/ProgressRing.constants.ts +2 -2
  94. package/packages/web/components/ProjectAvatar/ProjectAvatar.tsx +2 -2
  95. package/packages/web/components/ProjectColorDot/ProjectColorDot.tsx +37 -0
  96. package/packages/web/components/ProjectColorDot/index.ts +1 -0
  97. package/packages/web/components/ProjectSelectorModal/ProjectSelectorModal.tsx +104 -0
  98. package/packages/web/components/ProjectSelectorModal/index.ts +1 -0
  99. package/packages/web/components/Providers/Providers.tsx +4 -1
  100. package/packages/web/components/QueueCard/QueueCard.tsx +78 -25
  101. package/packages/web/components/QueueCard/QueueCard.types.ts +1 -0
  102. package/packages/web/components/QueueCard/QueueCard.utils.ts +3 -3
  103. package/packages/web/components/RecoverCard/RecoverCard.tsx +72 -0
  104. package/packages/web/components/RecoverCard/RecoverCard.types.ts +16 -0
  105. package/packages/web/components/RecoverCard/index.ts +2 -0
  106. package/packages/web/components/RoadmapCard/RoadmapCard.tsx +101 -33
  107. package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +1 -0
  108. package/packages/web/components/ShipsCard/ShipsCard.tsx +71 -28
  109. package/packages/web/components/ShipsCard/ShipsCard.types.ts +2 -0
  110. package/packages/web/components/SparklineChart/SparklineChart.tsx +20 -18
  111. package/packages/web/components/StatsMasonry/StatsMasonry.tsx +95 -0
  112. package/packages/web/components/StatsMasonry/index.ts +1 -0
  113. package/packages/web/components/StreakCard/StreakCard.tsx +37 -35
  114. package/packages/web/components/TasksCounter/TasksCounter.tsx +1 -1
  115. package/packages/web/components/TechStackBadges/TechStackBadges.tsx +12 -4
  116. package/packages/web/components/TerminalDock/DockToggleTab.tsx +29 -0
  117. package/packages/web/components/TerminalDock/TerminalDock.tsx +386 -0
  118. package/packages/web/components/TerminalDock/TerminalDockTab.tsx +130 -0
  119. package/packages/web/components/TerminalDock/TerminalTabBar.tsx +142 -0
  120. package/packages/web/components/TerminalDock/index.ts +2 -0
  121. package/packages/web/components/VelocityBadge/VelocityBadge.tsx +8 -3
  122. package/packages/web/components/VelocityCard/VelocityCard.tsx +49 -47
  123. package/packages/web/components/WeeklyReports/PrintableReport.tsx +259 -0
  124. package/packages/web/components/WeeklyReports/ReportPreviewCard.tsx +187 -0
  125. package/packages/web/components/WeeklyReports/WeekCalendar.tsx +288 -0
  126. package/packages/web/components/WeeklyReports/WeeklyReports.tsx +149 -0
  127. package/packages/web/components/WeeklyReports/index.ts +4 -0
  128. package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +16 -4
  129. package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +1 -0
  130. package/packages/web/components/charts/SessionsChart.tsx +6 -3
  131. package/packages/web/components/ui/dialog.tsx +143 -0
  132. package/packages/web/components/ui/drawer.tsx +135 -0
  133. package/packages/web/components/ui/select.tsx +187 -0
  134. package/packages/web/context/GlobalTerminalContext.tsx +538 -0
  135. package/packages/web/lib/commands.ts +81 -0
  136. package/packages/web/lib/generate-week-report.ts +285 -0
  137. package/packages/web/lib/parse-prjct-files.ts +56 -55
  138. package/packages/web/lib/project-colors.ts +58 -0
  139. package/packages/web/lib/projects.ts +58 -5
  140. package/packages/web/lib/services/projects.server.ts +11 -1
  141. package/packages/web/next-env.d.ts +1 -1
  142. package/packages/web/package.json +5 -1
  143. package/templates/commands/analyze.md +39 -3
  144. package/templates/commands/ask.md +58 -3
  145. package/templates/commands/bug.md +117 -26
  146. package/templates/commands/dash.md +95 -158
  147. package/templates/commands/done.md +130 -148
  148. package/templates/commands/feature.md +125 -103
  149. package/templates/commands/git.md +18 -3
  150. package/templates/commands/idea.md +121 -38
  151. package/templates/commands/init.md +124 -20
  152. package/templates/commands/migrate-all.md +63 -28
  153. package/templates/commands/migrate.md +140 -0
  154. package/templates/commands/next.md +115 -5
  155. package/templates/commands/now.md +146 -82
  156. package/templates/commands/pause.md +89 -74
  157. package/templates/commands/redo.md +6 -4
  158. package/templates/commands/resume.md +141 -59
  159. package/templates/commands/ship.md +103 -231
  160. package/templates/commands/spec.md +98 -8
  161. package/templates/commands/suggest.md +22 -2
  162. package/templates/commands/sync.md +192 -203
  163. package/templates/commands/undo.md +6 -4
  164. package/core/data/agents-manager.ts +0 -76
  165. package/core/data/analysis-manager.ts +0 -83
  166. package/core/data/base-manager.ts +0 -156
  167. package/core/data/ideas-manager.ts +0 -81
  168. package/core/data/outcomes-manager.ts +0 -96
  169. package/core/data/project-manager.ts +0 -75
  170. package/core/data/roadmap-manager.ts +0 -118
  171. package/core/data/shipped-manager.ts +0 -65
  172. package/core/data/state-manager.ts +0 -214
  173. package/core/state/index.ts +0 -25
  174. package/core/state/manager.ts +0 -376
  175. package/core/state/types.ts +0 -185
  176. package/core/utils/project-capabilities.ts +0 -156
  177. package/core/view-generator.ts +0 -536
  178. package/packages/web/app/project/[id]/stats/loading.tsx +0 -43
  179. package/packages/web/app/project/[id]/stats/page.tsx +0 -253
  180. package/templates/agent-assignment.md +0 -72
  181. package/templates/analysis/project-analysis.md +0 -78
  182. package/templates/checklists/accessibility.md +0 -33
  183. package/templates/commands/build.md +0 -17
  184. package/templates/commands/decision.md +0 -226
  185. package/templates/commands/fix.md +0 -79
  186. package/templates/commands/help.md +0 -61
  187. package/templates/commands/progress.md +0 -14
  188. package/templates/commands/recap.md +0 -14
  189. package/templates/commands/roadmap.md +0 -52
  190. package/templates/commands/status.md +0 -17
  191. package/templates/commands/task.md +0 -63
  192. package/templates/commands/work.md +0 -44
  193. package/templates/commands/workflow.md +0 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,111 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.0] - 2025-12-15
4
+
5
+ ### Template Optimization - Aggressive Consolidation
6
+
7
+ Reduced command templates from 39 to 27 through strategic consolidation and elimination of redundancy.
8
+
9
+ - **Command Consolidation**
10
+ - `/p:dash` absorbs status, progress, recap (views: default, week, month, compact)
11
+ - `/p:now` absorbs work, build (single task-start command)
12
+ - `/p:resume` absorbs recover (--recover flag for abandoned sessions)
13
+ - `/p:next` adds roadmap view (feature-grouped queue)
14
+ - `/p:ask` absorbs fix (troubleshooting mode)
15
+ - `/p:spec` absorbs decision (inline decision logging)
16
+
17
+ - **Eliminated Redundant Commands**
18
+ - Removed: work, build, task, status, progress, recap, help
19
+ - Removed: roadmap, decision, fix, workflow, recover
20
+ - Total: 12 command templates deleted
21
+
22
+ - **Auxiliary Template Cleanup**
23
+ - Merged accessibility.md → ux-ui.md
24
+ - Merged project-analysis.md → analyze.md
25
+ - Merged agent-assignment.md → agent-routing.md
26
+
27
+ - **Template Enhancements**
28
+ - Agent detection table in now.md
29
+ - KPI metrics and velocity calculation in dash.md
30
+ - Recovery mode with 4 options in resume.md
31
+ - Standardized frontmatter across all templates
32
+
33
+ - **Registry Updates**
34
+ - Updated core-commands.ts with consolidated commands
35
+ - Updated optional-commands.ts with git, test, serve
36
+
37
+ ## [0.14.0] - 2025-12-11
38
+
39
+ ### Actionable Dashboard + Session Recovery
40
+
41
+ Dashboard is now fully actionable - click any item to execute commands in the terminal.
42
+
43
+ - **Session Recovery System**
44
+ - `/p:recover` command to recover abandoned sessions (>8h inactive)
45
+ - Captures session prompts for context restoration
46
+ - RecoverCard shows abandoned sessions across all projects
47
+
48
+ - **Actionable Dashboard Cards**
49
+ - QueueCard: Start (Play) and Delete (X) buttons always visible
50
+ - IdeasCard: Convert to Feature (Rocket) and Delete (X) buttons always visible
51
+ - ExpandButton pattern for "Show more" (DRY with ActivityTimeline)
52
+ - Click any item → navigate to /code → auto-execute command
53
+
54
+ - **Click-to-Action Pattern**
55
+ - URL pattern: `/project/{id}/code?cmd=p.%20now%20"task"`
56
+ - Auto-executes command on terminal load
57
+ - Works for: Queue items, Ideas, Roadmap features, NowCard actions
58
+
59
+ - **NowCard Enhancements**
60
+ - Done/Pause/Resume action buttons
61
+ - Project color dot indicator
62
+
63
+ - **Code Workspace Improvements**
64
+ - PageHeader component with project context
65
+ - Auto-command execution from URL params
66
+
67
+ ## [0.13.3] - 2025-12-11
68
+
69
+ ### MomentumWidget + Code Workspace + Weekly Reports
70
+
71
+ New features for project dashboard and code workspace.
72
+
73
+ - **MomentumWidget** - Motivational sparkline in `/code` header
74
+ - 7-day activity visualization (tasks + ships)
75
+ - Smart color coding: green for streaks/trending up, gray for normal, red only for abandoned (7+ days)
76
+ - Status messages: "On fire!", "X tasks this week", "Miss you!"
77
+
78
+ - **Code Workspace** (`/project/[id]/code`)
79
+ - Full terminal-based project workspace
80
+ - Command sidebar with workflow commands
81
+ - Mobile support with floating action button
82
+
83
+ - **Weekly Reports** (`/project/[id]/reports`)
84
+ - Generate and preview project progress reports
85
+ - Printable report view
86
+
87
+ - **Dashboard Improvements**
88
+ - "Start working" quick action in project dropdown
89
+ - Project version displayed in detail page header
90
+
91
+ - **Bug Fixes**
92
+ - TechStackBadges: Handle both array and object formats for techStack
93
+
94
+ ## [0.13.2] - 2025-12-10
95
+
96
+ ### Fixed - Remove Migration Gate
97
+
98
+ - Removed MigrationGate from production build
99
+ - Projects now load directly without migration checks
100
+
101
+ ## [0.13.1] - 2025-12-10
102
+
103
+ ### Fixed - Server Start Mode
104
+
105
+ - Fixed serve.js to use `start` instead of `start:prod`
106
+ - Restored sidebar collapse functionality
107
+ - Fixed server OOM crash
108
+
3
109
  ## [0.13.0] - 2025-12-10
4
110
 
5
111
  ### Deep Sync + Cleanup migrations
package/bin/prjct CHANGED
@@ -6,23 +6,22 @@
6
6
  * Auto-setup on first use (like Astro, Vite, etc.)
7
7
  */
8
8
 
9
- const { VERSION } = require('../core/utils/version.ts')
10
- const editorsConfig = require('../core/infrastructure/editors-config.ts').default
9
+ import { VERSION } from '../core/utils/version.ts'
10
+ import editorsConfig from '../core/infrastructure/editors-config.ts'
11
11
 
12
12
  // Check for special subcommands that bypass normal CLI
13
13
  const args = process.argv.slice(2)
14
+
14
15
  if (args[0] === 'dev') {
15
16
  // Launch prjct dev environment
16
- require('./dev.js')
17
+ await import('./dev.js')
17
18
  process.exitCode = 0
18
19
  } else if (args[0] === 'web' || args[0] === 'serve') {
19
20
  // Launch prjct web server
20
- require('./serve.js')
21
+ await import('./serve.js')
21
22
  process.exitCode = 0
22
23
  } else {
23
-
24
- // Ensure setup has run for this version
25
- ;(async function ensureSetup() {
24
+ // Ensure setup has run for this version
26
25
  try {
27
26
  const lastVersion = await editorsConfig.getLastVersion()
28
27
 
@@ -31,18 +30,16 @@ if (args[0] === 'dev') {
31
30
  console.log('🔧 One-time setup (v' + VERSION + ')...')
32
31
  console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n')
33
32
 
34
- const setup = require('../core/infrastructure/setup.ts').default
33
+ const { default: setup } = await import('../core/infrastructure/setup.ts')
35
34
  await setup.run()
36
35
 
37
36
  console.log('✓ Setup complete!\n')
38
37
  }
39
38
  } catch (error) {
40
- console.error('\n⚠️ Setup warning:', error.message)
39
+ console.error('\n⚠️ Setup warning:', (error as Error).message)
41
40
  console.error('You can run setup manually: prjct setup\n')
42
41
  }
43
42
 
44
43
  // Continue to main CLI logic
45
- require('../core/index.ts')
46
- })()
47
-
48
- } // end else
44
+ await import('../core/index.ts')
45
+ }
@@ -6,6 +6,7 @@
6
6
  import fs from 'fs/promises'
7
7
  import path from 'path'
8
8
  import pathManager from '../../infrastructure/path-manager'
9
+ import { generateUUID } from '../../schemas'
9
10
  import type { Memory, MemoryDatabase, Context } from './types'
10
11
  import { MEMORY_TAGS } from './types'
11
12
 
@@ -59,7 +60,7 @@ export class SemanticMemories {
59
60
  const db = await this.loadMemories(projectId)
60
61
 
61
62
  const memory: Memory = {
62
- id: `mem_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
63
+ id: generateUUID(),
63
64
  title,
64
65
  content,
65
66
  tags,
@@ -6,6 +6,7 @@
6
6
  import type { Plan, PlanParams, GatheredInfo, ProposedPlan, PlanStep, ApprovalContext, ApprovalPrompt } from './types'
7
7
  import { PLAN_STATUS, PLAN_REQUIRED_COMMANDS, DESTRUCTIVE_COMMANDS, PLANNING_TOOLS } from './constants'
8
8
  import { generateApprovalPrompt } from './approval'
9
+ import { generateUUID } from '../../schemas'
9
10
 
10
11
  export class PlanMode {
11
12
  activePlans: Map<string, Plan>
@@ -51,7 +52,7 @@ export class PlanMode {
51
52
  */
52
53
  startPlanning(projectId: string, commandName: string, params: PlanParams): Plan {
53
54
  const plan: Plan = {
54
- id: `plan_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
55
+ id: generateUUID(),
55
56
  projectId,
56
57
  command: commandName,
57
58
  params,
@@ -11,11 +11,18 @@
11
11
 
12
12
  import fs from 'fs'
13
13
  import path from 'path'
14
- import stateManager from '../state'
14
+ import { mdStateManager, mdQueueManager } from '../data'
15
15
  import { outcomeAnalyzer } from '../outcomes'
16
- import type { ProjectState } from '../state/types'
16
+ import type { StateJson, QueueJson } from '../schemas/state'
17
17
  import type { DetectedPattern } from '../outcomes/analyzer'
18
18
 
19
+ // Unified state for prompt context
20
+ interface ProjectState {
21
+ projectId: string
22
+ currentTask: StateJson['currentTask']
23
+ queue: QueueJson['tasks']
24
+ }
25
+
19
26
  interface Frontmatter {
20
27
  name?: string
21
28
  description?: string
@@ -108,7 +115,7 @@ class PromptBuilder {
108
115
  }
109
116
 
110
117
  /**
111
- * Get unified project state with caching.
118
+ * Get unified project state from MD managers.
112
119
  */
113
120
  async getProjectState(projectId: string): Promise<ProjectState | null> {
114
121
  if (!projectId) return null
@@ -119,7 +126,17 @@ class PromptBuilder {
119
126
  }
120
127
 
121
128
  try {
122
- const state = await stateManager.read(projectId)
129
+ const [stateData, queueData] = await Promise.all([
130
+ mdStateManager.read(projectId),
131
+ mdQueueManager.read(projectId)
132
+ ])
133
+
134
+ const state: ProjectState = {
135
+ projectId,
136
+ currentTask: stateData.currentTask,
137
+ queue: queueData.tasks
138
+ }
139
+
123
140
  this._stateCache.set(projectId, { state, timestamp: Date.now() })
124
141
  return state
125
142
  } catch {
@@ -128,7 +145,7 @@ class PromptBuilder {
128
145
  }
129
146
 
130
147
  /**
131
- * Build auto-injected context from unified state.
148
+ * Build auto-injected context from MD state.
132
149
  * This is automatically added to every prompt.
133
150
  */
134
151
  async buildInjectedContext(projectId: string): Promise<string | null> {
@@ -148,27 +165,11 @@ class PromptBuilder {
148
165
  const elapsed = this.calculateElapsed(state.currentTask.startedAt)
149
166
  parts.push(`**Current Task**: ${state.currentTask.description}`)
150
167
  parts.push(`- Started: ${elapsed} ago`)
151
- if (state.currentTask.agent) {
152
- parts.push(`- Agent: ${state.currentTask.agent}`)
153
- }
154
- if (state.currentTask.pausedAt) {
155
- parts.push(`- Status: PAUSED (${state.currentTask.pauseReason || 'no reason'})`)
156
- }
157
168
  } else {
158
169
  parts.push('**Current Task**: None')
159
170
  }
160
171
  parts.push('')
161
172
 
162
- // Active feature
163
- if (state.activeFeature) {
164
- const progress = state.activeFeature.tasksCompleted + state.activeFeature.tasksRemaining
165
- const pct = progress > 0
166
- ? Math.round((state.activeFeature.tasksCompleted / progress) * 100)
167
- : 0
168
- parts.push(`**Feature**: ${state.activeFeature.name} (${pct}% complete)`)
169
- parts.push(`- Tasks: ${state.activeFeature.tasksCompleted}/${progress}`)
170
- }
171
-
172
173
  // Queue summary
173
174
  if (state.queue.length > 0) {
174
175
  parts.push(`**Queue**: ${state.queue.length} tasks pending`)
@@ -182,18 +183,6 @@ class PromptBuilder {
182
183
  }
183
184
  parts.push('')
184
185
 
185
- // Performance stats
186
- if (state.stats.tasksToday > 0 || state.stats.streak > 0) {
187
- parts.push('**Performance**')
188
- parts.push(`- Today: ${state.stats.tasksToday} tasks`)
189
- parts.push(`- Velocity: ${state.stats.velocity}`)
190
- parts.push(`- Estimate accuracy: ${state.stats.estimateAccuracy}%`)
191
- if (state.stats.streak > 1) {
192
- parts.push(`- Streak: ${state.stats.streak} days`)
193
- }
194
- parts.push('')
195
- }
196
-
197
186
  // Get detected patterns from outcomes
198
187
  try {
199
188
  const patterns = await outcomeAnalyzer.detectPatterns(projectId)
@@ -211,16 +200,6 @@ class PromptBuilder {
211
200
  // Outcomes not available yet
212
201
  }
213
202
 
214
- // Recent activity
215
- if (state.recentActivity.length > 0) {
216
- parts.push('**Recent Activity**')
217
- for (const activity of state.recentActivity.slice(0, 3)) {
218
- const ago = this.calculateElapsed(activity.timestamp)
219
- parts.push(`- ${activity.type}: ${activity.description} (${ago} ago)`)
220
- }
221
- parts.push('')
222
- }
223
-
224
203
  parts.push('---')
225
204
  parts.push('')
226
205
 
@@ -39,7 +39,7 @@ import contextFilter from './context-filter'
39
39
  import validationRules from './validation-rules'
40
40
  import agentRouter from './agent-router'
41
41
  import smartContext from './smart-context'
42
- import stateManager from '../state'
42
+ import { mdManagers } from '../data'
43
43
  import { outcomeRecorder, outcomeAnalyzer } from '../outcomes'
44
44
  import { agentPerformanceTracker } from '../agents'
45
45
 
@@ -151,10 +151,10 @@ export interface AgenticServices {
151
151
  smartContext: typeof smartContext
152
152
 
153
153
  /**
154
- * State manager - unified project state (read/write state.json)
155
- * @see stateManager
154
+ * MD managers - MD-first state management
155
+ * @see mdManagers
156
156
  */
157
- state: typeof stateManager
157
+ data: typeof mdManagers
158
158
 
159
159
  /**
160
160
  * Outcome recorder - records execution outcomes
@@ -197,7 +197,7 @@ export const services: AgenticServices = {
197
197
  validation: validationRules,
198
198
  router: agentRouter,
199
199
  smartContext: smartContext,
200
- state: stateManager,
200
+ data: mdManagers,
201
201
  outcomes: outcomeRecorder,
202
202
  outcomeAnalysis: outcomeAnalyzer,
203
203
  agentPerformance: agentPerformanceTracker,
@@ -8,12 +8,17 @@
8
8
  * @version 1.0
9
9
  */
10
10
 
11
- import stateManager from '../state'
12
11
  import { agentPerformanceTracker } from '../agents'
13
12
  import { outcomeAnalyzer } from '../outcomes'
14
- import type { ProjectState } from '../state/types'
15
13
  import type { TaskType } from '../agents/types'
16
14
 
15
+ // Local interface for context state
16
+ interface ProjectState {
17
+ projectId: string
18
+ currentTask: { description: string; startedAt: string } | null
19
+ queue: { description: string; priority: string }[]
20
+ }
21
+
17
22
  /**
18
23
  * Context domain for filtering.
19
24
  */
@@ -98,14 +98,14 @@ export const CORE_COMMANDS: Command[] = [
98
98
  },
99
99
 
100
100
  {
101
- name: 'work',
101
+ name: 'now',
102
102
  category: 'core',
103
- description: 'Show current or start new task',
103
+ description: 'Set or show current task with session tracking',
104
104
  usage: {
105
- claude: '/p:work ["task"]',
106
- terminal: 'prjct work ["task"]',
105
+ claude: '/p:now ["task"] [estimate]',
106
+ terminal: 'prjct now ["task"] [estimate]',
107
107
  },
108
- params: '[task]',
108
+ params: '[task] [estimate]',
109
109
  implemented: true,
110
110
  hasTemplate: true,
111
111
  requiresInit: true,
@@ -113,9 +113,10 @@ export const CORE_COMMANDS: Command[] = [
113
113
  features: [
114
114
  'No params -> Show current task',
115
115
  'With task -> Start new task',
116
- 'Auto agent assignment',
117
- 'Supports task numbers',
118
- 'Replaces /p:now and /p:build',
116
+ 'Time estimates (2h, 30m, 1d)',
117
+ 'Abandoned session detection',
118
+ 'Auto agent detection',
119
+ 'Session tracking',
119
120
  ],
120
121
  },
121
122
 
@@ -146,36 +147,38 @@ export const CORE_COMMANDS: Command[] = [
146
147
  {
147
148
  name: 'resume',
148
149
  category: 'core',
149
- description: 'Resume most recently paused task',
150
+ description: 'Resume paused task or recover abandoned session',
150
151
  usage: {
151
- claude: '/p:resume [task_id]',
152
- terminal: 'prjct resume [task_id]',
152
+ claude: '/p:resume [--recover]',
153
+ terminal: 'prjct resume [--recover]',
153
154
  },
154
- params: '[task_id]',
155
+ params: '[task_id] [--recover]',
155
156
  implemented: true,
156
157
  hasTemplate: true,
157
158
  requiresInit: true,
158
159
  blockingRules: {
159
- check: 'Paused tasks exist',
160
+ check: 'Paused tasks or abandoned session exists',
160
161
  message: 'No paused tasks to resume',
161
162
  },
162
163
  features: [
163
164
  'Resume last paused',
164
165
  'Resume specific task',
165
- 'Resume by number',
166
166
  'Calculates active time',
167
+ 'Recovery mode for abandoned sessions',
168
+ 'Close as partial (metrics)',
169
+ 'Save for later reference',
167
170
  ],
168
171
  },
169
172
 
170
173
  {
171
174
  name: 'next',
172
175
  category: 'core',
173
- description: 'Show top 5 non-blocking priority tasks',
176
+ description: 'Show priority queue or roadmap view',
174
177
  usage: {
175
- claude: '/p:next',
176
- terminal: 'prjct next',
178
+ claude: '/p:next [roadmap]',
179
+ terminal: 'prjct next [roadmap]',
177
180
  },
178
- params: null,
181
+ params: '[roadmap]',
179
182
  implemented: true,
180
183
  hasTemplate: true,
181
184
  requiresInit: true,
@@ -184,10 +187,11 @@ export const CORE_COMMANDS: Command[] = [
184
187
  message: 'Shows warning if now.md is active',
185
188
  },
186
189
  features: [
187
- 'Filters out blocked tasks',
190
+ 'Priority queue view (default)',
191
+ 'Roadmap view (feature-grouped)',
188
192
  'Shows top 5 by priority',
189
- 'Numbered 1-5 for quick selection',
190
- 'Warns if active task exists',
193
+ 'Numbered for quick selection',
194
+ 'Velocity calculation',
191
195
  ],
192
196
  },
193
197
 
@@ -277,23 +281,23 @@ export const CORE_COMMANDS: Command[] = [
277
281
  },
278
282
 
279
283
  {
280
- name: 'help',
284
+ name: 'ask',
281
285
  category: 'core',
282
- description: 'Contextual help and guidance',
286
+ description: 'Intent translator - helps understand what command to use',
283
287
  usage: {
284
- claude: '/p:help [topic]',
285
- terminal: 'prjct help [topic]',
288
+ claude: '/p:ask "I want to add dark mode"',
289
+ terminal: 'prjct ask "I want to add dark mode"',
286
290
  },
287
- params: '[topic]',
291
+ params: '<intent>',
288
292
  implemented: true,
289
293
  hasTemplate: true,
290
294
  requiresInit: false,
291
295
  blockingRules: null,
292
296
  features: [
297
+ 'Natural language intent parsing',
298
+ 'Command flow recommendations',
299
+ 'Troubleshooting guidance',
293
300
  'Context-aware suggestions',
294
- 'Intent to action translator',
295
- 'Problem solving guidance',
296
- 'Absorbs ask/suggest/stuck',
297
301
  ],
298
302
  },
299
303
 
@@ -316,4 +320,25 @@ export const CORE_COMMANDS: Command[] = [
316
320
  'Refreshes context',
317
321
  ],
318
322
  },
323
+
324
+ {
325
+ name: 'suggest',
326
+ category: 'core',
327
+ description: 'Smart recommendations based on project state',
328
+ usage: {
329
+ claude: '/p:suggest',
330
+ terminal: 'prjct suggest',
331
+ },
332
+ params: null,
333
+ implemented: true,
334
+ hasTemplate: true,
335
+ requiresInit: true,
336
+ blockingRules: null,
337
+ features: [
338
+ 'Context-aware recommendations',
339
+ 'Momentum-based suggestions',
340
+ 'Next action guidance',
341
+ 'Pattern detection',
342
+ ],
343
+ },
319
344
  ]
@@ -116,4 +116,68 @@ export const OPTIONAL_COMMANDS: Command[] = [
116
116
  'Redo availability count',
117
117
  ],
118
118
  },
119
+
120
+ {
121
+ name: 'git',
122
+ category: 'optional',
123
+ description: 'Smart git operations with context',
124
+ usage: {
125
+ claude: '/p:git [operation]',
126
+ terminal: 'prjct git [operation]',
127
+ },
128
+ params: '[operation]',
129
+ implemented: true,
130
+ hasTemplate: true,
131
+ requiresInit: true,
132
+ blockingRules: null,
133
+ isOptional: true,
134
+ features: [
135
+ 'Context-aware commits',
136
+ 'Smart branch naming',
137
+ 'Task-linked commits',
138
+ 'Memory trail logging',
139
+ ],
140
+ },
141
+
142
+ {
143
+ name: 'test',
144
+ category: 'optional',
145
+ description: 'Run tests with auto-fix',
146
+ usage: {
147
+ claude: '/p:test',
148
+ terminal: 'prjct test',
149
+ },
150
+ params: null,
151
+ implemented: true,
152
+ hasTemplate: true,
153
+ requiresInit: true,
154
+ blockingRules: null,
155
+ isOptional: true,
156
+ features: [
157
+ 'Run project tests',
158
+ 'Auto-fix suggestions',
159
+ 'Coverage reporting',
160
+ ],
161
+ },
162
+
163
+ {
164
+ name: 'serve',
165
+ category: 'optional',
166
+ description: 'Start prjct web server',
167
+ usage: {
168
+ claude: '/p:serve',
169
+ terminal: 'prjct serve',
170
+ },
171
+ params: '[port]',
172
+ implemented: true,
173
+ hasTemplate: true,
174
+ requiresInit: true,
175
+ blockingRules: null,
176
+ isOptional: true,
177
+ features: [
178
+ 'Local dashboard server',
179
+ 'API endpoints',
180
+ 'Real-time updates',
181
+ ],
182
+ },
119
183
  ]
@@ -36,15 +36,30 @@ export const SETUP_COMMANDS: Command[] = [
36
36
  blockingRules: null,
37
37
  },
38
38
 
39
+ {
40
+ name: 'migrate',
41
+ category: 'setup',
42
+ description: 'Migrate project to UUID format + sync',
43
+ usage: {
44
+ claude: '/p:migrate',
45
+ terminal: null, // Claude-only
46
+ },
47
+ params: null,
48
+ implemented: true,
49
+ hasTemplate: true,
50
+ requiresInit: true,
51
+ blockingRules: null,
52
+ },
53
+
39
54
  {
40
55
  name: 'migrate-all',
41
56
  category: 'setup',
42
- description: 'Migrate all legacy projects',
57
+ description: 'Migrate all legacy projects to UUID format',
43
58
  usage: {
44
59
  claude: '/p:migrate-all',
45
- terminal: 'prjct migrate-all [--deep-scan] [--remove-legacy] [--dry-run]',
60
+ terminal: 'prjct migrate-all [--deep-scan] [--dry-run]',
46
61
  },
47
- params: '[--deep-scan] [--remove-legacy] [--dry-run]',
62
+ params: '[--deep-scan] [--dry-run]',
48
63
  implemented: true,
49
64
  hasTemplate: true,
50
65
  requiresInit: false,