prjct-cli 0.6.0 → 0.7.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 (83) hide show
  1. package/CHANGELOG.md +67 -6
  2. package/CLAUDE.md +442 -36
  3. package/README.md +47 -54
  4. package/bin/prjct +170 -240
  5. package/core/agentic/command-executor.js +113 -0
  6. package/core/agentic/context-builder.js +85 -0
  7. package/core/agentic/prompt-builder.js +86 -0
  8. package/core/agentic/template-loader.js +104 -0
  9. package/core/agentic/tool-registry.js +117 -0
  10. package/core/command-registry.js +106 -62
  11. package/core/commands.js +2030 -2211
  12. package/core/domain/agent-generator.js +118 -0
  13. package/core/domain/analyzer.js +211 -0
  14. package/core/domain/architect-session.js +300 -0
  15. package/core/{agents → infrastructure/agents}/claude-agent.js +16 -13
  16. package/core/{author-detector.js → infrastructure/author-detector.js} +3 -1
  17. package/core/{capability-installer.js → infrastructure/capability-installer.js} +3 -6
  18. package/core/{command-installer.js → infrastructure/command-installer.js} +4 -2
  19. package/core/{config-manager.js → infrastructure/config-manager.js} +4 -4
  20. package/core/{editors-config.js → infrastructure/editors-config.js} +2 -10
  21. package/core/{migrator.js → infrastructure/migrator.js} +34 -19
  22. package/core/{path-manager.js → infrastructure/path-manager.js} +20 -44
  23. package/core/{session-manager.js → infrastructure/session-manager.js} +45 -105
  24. package/core/{update-checker.js → infrastructure/update-checker.js} +67 -67
  25. package/core/{animations-simple.js → utils/animations.js} +3 -23
  26. package/core/utils/date-helper.js +238 -0
  27. package/core/utils/file-helper.js +327 -0
  28. package/core/utils/jsonl-helper.js +206 -0
  29. package/core/{project-capabilities.js → utils/project-capabilities.js} +21 -22
  30. package/core/utils/session-helper.js +277 -0
  31. package/core/{version.js → utils/version.js} +1 -1
  32. package/package.json +4 -12
  33. package/templates/agents/AGENTS.md +101 -27
  34. package/templates/analysis/analyze.md +84 -0
  35. package/templates/commands/analyze.md +9 -2
  36. package/templates/commands/bug.md +79 -0
  37. package/templates/commands/build.md +5 -2
  38. package/templates/commands/cleanup.md +5 -2
  39. package/templates/commands/design.md +5 -2
  40. package/templates/commands/done.md +4 -2
  41. package/templates/commands/feature.md +113 -0
  42. package/templates/commands/fix.md +41 -10
  43. package/templates/commands/git.md +7 -2
  44. package/templates/commands/help.md +2 -2
  45. package/templates/commands/idea.md +14 -5
  46. package/templates/commands/init.md +62 -7
  47. package/templates/commands/next.md +4 -2
  48. package/templates/commands/now.md +4 -2
  49. package/templates/commands/progress.md +27 -5
  50. package/templates/commands/recap.md +39 -10
  51. package/templates/commands/roadmap.md +19 -5
  52. package/templates/commands/ship.md +118 -16
  53. package/templates/commands/status.md +4 -2
  54. package/templates/commands/sync.md +19 -15
  55. package/templates/commands/task.md +4 -2
  56. package/templates/commands/test.md +5 -2
  57. package/templates/commands/workflow.md +4 -2
  58. package/core/agent-generator.js +0 -525
  59. package/core/analyzer.js +0 -600
  60. package/core/animations.js +0 -277
  61. package/core/ascii-graphics.js +0 -433
  62. package/core/git-integration.js +0 -401
  63. package/core/task-schema.js +0 -342
  64. package/core/workflow-engine.js +0 -213
  65. package/core/workflow-prompts.js +0 -192
  66. package/core/workflow-rules.js +0 -147
  67. package/scripts/post-install.js +0 -121
  68. package/scripts/preuninstall.js +0 -94
  69. package/scripts/verify-installation.sh +0 -158
  70. package/templates/agents/be.template.md +0 -27
  71. package/templates/agents/coordinator.template.md +0 -34
  72. package/templates/agents/data.template.md +0 -27
  73. package/templates/agents/devops.template.md +0 -27
  74. package/templates/agents/fe.template.md +0 -27
  75. package/templates/agents/mobile.template.md +0 -27
  76. package/templates/agents/qa.template.md +0 -27
  77. package/templates/agents/scribe.template.md +0 -29
  78. package/templates/agents/security.template.md +0 -27
  79. package/templates/agents/ux.template.md +0 -27
  80. package/templates/commands/context.md +0 -36
  81. package/templates/commands/stuck.md +0 -36
  82. package/templates/examples/natural-language-examples.md +0 -532
  83. /package/core/{agent-detector.js → infrastructure/agent-detector.js} +0 -0
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write]
3
- description: "Manage current focus task"
3
+ description: 'Manage current focus task'
4
4
  ---
5
5
 
6
6
  # /p:now
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:now # Show
11
12
  /p:now [task] # Set
@@ -16,11 +17,13 @@ description: "Manage current focus task"
16
17
  **Show**: Read `core/now.md` → display task + elapsed
17
18
 
18
19
  **Set**:
20
+
19
21
  1. Write: `core/now.md` with task + timestamp
20
22
  2. Update: `core/context.md`, `progress/metrics.md`
21
23
  3. Log: `memory/context.jsonl`
22
24
 
23
25
  ## Response
26
+
24
27
  ```
25
28
  🎯 {task}
26
29
  Started: {time}
@@ -28,4 +31,3 @@ Started: {time}
28
31
  Done? → /p:done
29
32
  Stuck? → /p:stuck
30
33
  ```
31
-
@@ -1,22 +1,45 @@
1
1
  ---
2
2
  allowed-tools: [Read]
3
- description: "Progress metrics for period"
3
+ description: 'Progress metrics for period'
4
4
  ---
5
5
 
6
6
  # /p:progress
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:progress [day|week|month] # Default: week
11
12
  ```
12
13
 
13
14
  ## Flow
15
+
14
16
  1. Parse: timeframe (day/week/month)
15
- 2. Read: `progress/shipped.md` + `progress/metrics.md`
16
- 3. Calculate: velocity, trends, quality
17
- 4. Display: detailed metrics
17
+ 2. **Calculate date range**: Based on timeframe
18
+ 3. **Read sessions**: Query `progress/sessions/{YYYY-MM}/` for date range
19
+ 4. **Aggregate**: Ships, tasks, duration from sessions
20
+ 5. **Calculate**: Velocity, trends, quality metrics
21
+ 6. Display: detailed metrics
22
+
23
+ ## Session Queries by Period
24
+
25
+ ```javascript
26
+ // Day: Today's sessions
27
+ const today = await readSessionFile('progress/sessions', today)
28
+ const shipped = today.filter(s => s.type === 'feature_ship')
29
+
30
+ // Week: Last 7 days
31
+ const weekSessions = await readSessions('progress/sessions', -7, 'now')
32
+ const velocity = weekSessions.filter(s => s.type === 'feature_ship').length / 7
33
+
34
+ // Month: Last 30 days
35
+ const monthSessions = await readSessions('progress/sessions', -30, 'now')
36
+ const totalTime = monthSessions
37
+ .filter(s => s.type === 'feature_ship')
38
+ .reduce((sum, s) => sum + parseTime(s.duration), 0)
39
+ ```
18
40
 
19
41
  ## Response
42
+
20
43
  ```
21
44
  📈 PROGRESS - This {period}
22
45
  ━━━━━━━━━━━━━━━━━━━━━
@@ -34,4 +57,3 @@ Recent ships:
34
57
 
35
58
  /p:ship | /p:status
36
59
  ```
37
-
@@ -1,34 +1,63 @@
1
1
  ---
2
2
  allowed-tools: [Read]
3
- description: "Project status overview"
3
+ description: 'Project context and status overview'
4
4
  ---
5
5
 
6
6
  # /p:recap
7
7
 
8
+ ## Usage
9
+
10
+ ```
11
+ /p:recap # Full overview
12
+ /p:context # Alias for recap
13
+ ```
14
+
8
15
  ## Flow
9
- 1. Read: all data layers (core, progress, planning, analysis, memory)
10
- 2. Aggregate: metrics and status from each layer
11
- 3. Display: comprehensive overview
16
+
17
+ 1. **Read indexes**: Recent data from core/, progress/, planning/ (last 30 days)
18
+ 2. **Read sessions**: Last 7 days from all session directories
19
+ 3. **Aggregate**: Metrics from sessions (features added, tasks done, ships)
20
+ 4. **Display**: Comprehensive context and status
21
+
22
+ ## Session Queries
23
+
24
+ ```javascript
25
+ // Aggregate last 7 days activity
26
+ const recentSessions = await readSessions('*/sessions', -7, 'now')
27
+ const shipped = recentSessions.filter(s => s.type === 'feature_ship').length
28
+ const tasksComplete = recentSessions.filter(s => s.type === 'task_complete').length
29
+ const velocity = shipped / 7 // features per day
30
+ ```
12
31
 
13
32
  ## Response
33
+
14
34
  ```
15
- 📊 PROJECT RECAP
16
- ━━━━━━━━━━━━━━━━
35
+ 📊 PROJECT OVERVIEW
36
+ ━━━━━━━━━━━━━━━━━━
17
37
 
18
- 🎯 FOCUS
19
- Current: {task} ({duration})
20
- Queue: {N} tasks
38
+ 📦 PROJECT
39
+ Type: {type}
40
+ Stack: {stack}
41
+
42
+ 🎯 CURRENT FOCUS
43
+ Task: {task}
44
+ Started: {time_ago} ({duration})
21
45
 
22
46
  📈 PROGRESS
23
47
  Shipped: {X} this week
24
48
  Velocity: {X.X} features/day
25
49
 
26
50
  💡 PLANNING
51
+ Queue: {N} tasks
27
52
  Ideas: {M} captured
28
53
  Roadmap: {X}% complete
29
54
 
55
+ 🔄 RECENT ACTIVITY
56
+ • {event}: {desc} ({time_ago})
57
+ • {event}: {desc} ({time_ago})
58
+ • {event}: {desc} ({time_ago})
59
+
30
60
  {motivational_message}
31
61
 
32
62
  /p:now | /p:status | /p:next
33
63
  ```
34
-
@@ -1,22 +1,37 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write]
3
- description: "Strategic roadmap management"
3
+ description: 'Strategic roadmap management'
4
4
  ---
5
5
 
6
6
  # /p:roadmap
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:roadmap [show|add|complete|next] # Default: show
11
12
  ```
12
13
 
13
14
  ## Flow
15
+
14
16
  1. Parse: action (show/add/complete/next)
15
- 2. Read: `planning/roadmap.md`
16
- 3. Execute: based on action
17
- 4. Update: roadmap file if needed
17
+ 2. **Read index**: `planning/roadmap.md` (last 30 days)
18
+ 3. **Read sessions**: Last 3-7 days from `planning/sessions/{YYYY-MM}/` for details
19
+ 4. Execute: based on action
20
+ 5. Update: roadmap index if needed
21
+ 6. Archive: entries > 30 days to `planning/archive/roadmap-{YYYY-MM}.md`
22
+
23
+ ## Query Sessions
24
+
25
+ To get complete roadmap history or specific date range:
26
+
27
+ ```javascript
28
+ // Read sessions for date range
29
+ const sessions = await readSessions('planning/sessions', startDate, endDate)
30
+ const features = sessions.filter(s => s.type === 'feature_add')
31
+ ```
18
32
 
19
33
  ## Response (show)
34
+
20
35
  ```
21
36
  📍 PRODUCT ROADMAP
22
37
 
@@ -35,4 +50,3 @@ description: "Strategic roadmap management"
35
50
 
36
51
  /p:now "{next_feature}"
37
52
  ```
38
-
@@ -1,27 +1,109 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write, Bash]
3
- description: "Ship feature with Git commit/push"
3
+ description: 'Ship feature with complete automated workflow'
4
4
  ---
5
5
 
6
6
  # /p:ship
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:ship # Current task
11
- /p:ship <feature> # Named feature
12
+ /p:ship "<feature>" # Named feature
13
+ ```
14
+
15
+ ## Complete Workflow (Automated)
16
+
17
+ 1. ✅ **Lint checks** → Run project linters
18
+ 2. ✅ **Run tests** → Execute test suite (does NOT block if fail)
19
+ 3. ✅ **Update docs** → Update relevant documentation
20
+ 4. ✅ **Update version** → Bump version (patch/minor based on changes)
21
+ 5. ✅ **Update CHANGELOG** → Add entry with changes
22
+ 6. ✅ **Git commit** → Create commit with metadata
23
+ 7. ✅ **Git push** → Push to remote
24
+ 8. ✅ **Recommend compact** → Suggest conversation compacting
25
+
26
+ ## Workflow Steps Detail
27
+
28
+ ### Step 1: Lint Checks
29
+
30
+ ```bash
31
+ npm run lint || yarn lint || pnpm lint
32
+ # If fails: Show errors but continue
33
+ ```
34
+
35
+ ### Step 2: Run Tests
36
+
37
+ ```bash
38
+ npm test || yarn test || pnpm test
39
+ # If fails: Show results but DO NOT block (no infinite loop)
40
+ # User decides if acceptable to ship
41
+ ```
42
+
43
+ ### Step 3: Update Docs
44
+
45
+ - Update README if needed
46
+ - Update API docs if endpoints changed
47
+ - Update component docs if UI changed
48
+
49
+ ### Step 4: Update Version
50
+
51
+ ```json
52
+ // package.json
53
+ "version": "X.Y.Z" → "X.Y.(Z+1)" // patch for fixes
54
+ "version": "X.Y.Z" → "X.(Y+1).0" // minor for features
55
+ ```
56
+
57
+ ### Step 5: Update CHANGELOG
58
+
59
+ ```markdown
60
+ ## [X.Y.Z] - YYYY-MM-DD
61
+
62
+ ### Added / Changed / Fixed
63
+
64
+ - {feature_description}
65
+ - Agent: {agent}
66
+ - Time: {actual_time}
67
+ ```
68
+
69
+ ### Step 6-7: Git Commit + Push
70
+
71
+ Auto-commit with metadata and push
72
+
73
+ ### Step 8: Log to Session
74
+
75
+ Append to `progress/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`:
76
+
77
+ ```jsonl
78
+ {"ts":"2025-10-04T18:00:00Z","type":"feature_ship","name":"{feature}","tasks_done":{N},"duration":"{Xh}","agent":"{agent}","version":"{X.Y.Z}"}
12
79
  ```
13
80
 
14
- ## Flow
15
- 1. Get: feature name (from arg or `core/now.md`)
16
- 2. Git: `add .` check status
17
- 3. Create: commit message with metadata
18
- 4. Commit: with message
19
- 5. Prompt: "Push? (y/n)"
20
- 6. If yes: `git push`
21
- 7. Update: `progress/shipped.md`, clear `core/now.md`
22
- 8. Log: `memory/context.jsonl`
81
+ ### Step 9: Update Index
82
+
83
+ Prepend to `progress/shipped.md` (keep only last 30 days):
84
+
85
+ ```markdown
86
+ ## 2025-10-04
87
+ - {feature_name} ({Xh}, {N} tasks, v{X.Y.Z})
88
+ ```
89
+
90
+ If shipped.md has entries > 30 days old, archive to `progress/archive/shipped-{YYYY-MM}.md`
91
+
92
+ ### Step 10: Update Roadmap
93
+
94
+ Mark feature as complete in `planning/roadmap.md`:
95
+
96
+ ```markdown
97
+ ## Completed
98
+ - [x] {feature_name} - Shipped 2025-10-04
99
+ ```
100
+
101
+ ### Step 11: Recommend Compact
102
+
103
+ Suggest compacting conversation after ship
104
+
105
+ ## Commit Message Format
23
106
 
24
- ## Commit Message
25
107
  ```
26
108
  feat: {feature_name}
27
109
 
@@ -30,17 +112,37 @@ Dev: @{github_dev}
30
112
  Complexity: {complexity}
31
113
  Time: {actual_time}
32
114
 
33
- Generated-by: prjct/cli
34
- Co-Authored-By: @{github_dev}
115
+ 🤖 Generated with [p/](https://www.prjct.app/)
116
+ Designed for [Claude](https://www.anthropic.com/claude)
35
117
  ```
36
118
 
119
+ **IMPORTANT**: This footer format MUST be used in ALL commits made by prjct.
120
+
37
121
  ## Response
122
+
38
123
  ```
39
124
  🚀 {feature} shipped!
40
125
 
41
- Committed {+ pushed}
126
+ Workflow completed:
127
+ ✅ Lint checks: {pass/fail_continued}
128
+ ✅ Tests: {pass/fail_continued}
129
+ ✅ Docs: updated
130
+ ✅ Version: {old} → {new}
131
+ ✅ CHANGELOG: updated
132
+ ✅ Git: committed + pushed
133
+
42
134
  {agent_icon} {agent} • {actual_time}
43
135
 
44
- /p:next | /p:status
136
+ 💡 Recommendation: Compact conversation now
137
+ (Keeps context clean for next feature)
138
+
139
+ /p:feature | /p:done
45
140
  ```
46
141
 
142
+ ## Important Notes
143
+
144
+ - **Tests/Lint failures DO NOT block shipping**
145
+ - User sees results and decides
146
+ - Prevents infinite loop of "fix → test → fail → fix"
147
+ - ALWAYS updates version and CHANGELOG
148
+ - ALWAYS commits and pushes if workflow completes
@@ -1,16 +1,18 @@
1
1
  ---
2
2
  allowed-tools: [Read]
3
- description: "KPI dashboard with ASCII graphics"
3
+ description: 'KPI dashboard with ASCII graphics'
4
4
  ---
5
5
 
6
6
  # /p:status
7
7
 
8
8
  ## Flow
9
+
9
10
  1. Read: all core files + progress files
10
11
  2. Calculate: metrics (sprint %, tasks complete, days since ship, etc.)
11
12
  3. Render: `ASCIIGraphics.createDashboard(data)`
12
13
 
13
14
  ## Data Structure
15
+
14
16
  ```js
15
17
  {
16
18
  sprintProgress: (complete / total) * 100,
@@ -24,6 +26,7 @@ description: "KPI dashboard with ASCII graphics"
24
26
  ```
25
27
 
26
28
  ## Output (Catppuccin Mocha)
29
+
27
30
  ```
28
31
  ┌─ Project Status ────────────────┐
29
32
  │ Sprint Progress [████░] 80% │
@@ -37,4 +40,3 @@ description: "KPI dashboard with ASCII graphics"
37
40
  ```
38
41
 
39
42
  **Colors**: Mauve borders, Teal progress, Sapphire highlights, Green/Yellow/Red for status
40
-
@@ -1,30 +1,34 @@
1
1
  ---
2
- allowed-tools: [Read, Bash, TodoWrite]
3
- description: "Sync project state and agents"
2
+ allowed-tools: [Read, Write, Bash, TodoWrite]
3
+ description: 'Sync project state and generate dynamic agents'
4
4
  ---
5
5
 
6
6
  # /p:sync
7
7
 
8
8
  ## Flow
9
+
9
10
  1. Run: `/p:analyze` → get current state
10
- 2. Compare: with previous analysis
11
- 3. Update: all existing agents with new context
12
- 4. Add: newly required agents
13
- 5. Remove: obsolete agents (with confirmation)
14
- 6. Log: changes to `memory/context.jsonl`
11
+ 2. **Read**: `analysis/repo-summary.md`
12
+ 3. **Generate**: Dynamic agents for each technology
13
+ 4. Log: changes to `memory/context.jsonl`
14
+
15
+ ## Agent Generation
16
+
17
+ **See `templates/agents/AGENTS.md` for complete reference** with examples and guidelines.
18
+
19
+ Use `generator.generateDynamicAgent(name, config)` for each specialist.
15
20
 
16
21
  ## Response
22
+
17
23
  ```
18
24
  🔄 Sync complete!
19
25
 
20
- 📊 Changes:
21
- • {N} agents updated
22
- • {N} agents added
23
- • {N} agents removed
26
+ 🤖 Agents Generated:
27
+ • {agent_name_1} - {role}
28
+ • {agent_name_2} - {role}
24
29
 
25
- Stack changes:
26
- {changes_list}
30
+ 📋 Based on: analysis/repo-summary.md
31
+ 💡 See templates/agents/AGENTS.md for generation reference
27
32
 
28
- /p:status | /p:context
33
+ /p:context
29
34
  ```
30
-
@@ -1,16 +1,18 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write, TodoWrite]
3
- description: "Break down complex tasks"
3
+ description: 'Break down complex tasks'
4
4
  ---
5
5
 
6
6
  # /p:task
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:task <description>
11
12
  ```
12
13
 
13
14
  ## Flow
15
+
14
16
  1. Analyze: task complexity
15
17
  2. Break down: into 3-7 subtasks
16
18
  3. Create: execution plan
@@ -18,6 +20,7 @@ description: "Break down complex tasks"
18
20
  5. Track: progress in `planning/tasks/`
19
21
 
20
22
  ## Response
23
+
21
24
  ```
22
25
  📋 Task Plan: {description}
23
26
 
@@ -32,4 +35,3 @@ Est total: {total_time}
32
35
  [1/{N}] {subtask}... ✅
33
36
  [2/{N}] {subtask}... 🔄
34
37
  ```
35
-
@@ -1,16 +1,18 @@
1
1
  ---
2
2
  allowed-tools: [Bash, Read, Edit]
3
- description: "Run tests with auto-fix"
3
+ description: 'Run tests with auto-fix'
4
4
  ---
5
5
 
6
6
  # /p:test
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:test [all|unit|e2e|failed|fix] # Default: all
11
12
  ```
12
13
 
13
14
  ## Flow
15
+
14
16
  1. Detect: test runner (jest/vitest/pytest/etc)
15
17
  2. Run: tests with appropriate command
16
18
  3. Parse: results
@@ -18,6 +20,7 @@ description: "Run tests with auto-fix"
18
20
  5. Update: coverage in `progress/metrics.md`
19
21
 
20
22
  ## Response (success)
23
+
21
24
  ```
22
25
  ✅ All tests passing!
23
26
 
@@ -33,6 +36,7 @@ description: "Run tests with auto-fix"
33
36
  ```
34
37
 
35
38
  ## Response (failures)
39
+
36
40
  ```
37
41
  ❌ {N} tests failing
38
42
 
@@ -42,4 +46,3 @@ description: "Run tests with auto-fix"
42
46
 
43
47
  📊 Summary: {passed}/{total} ({X}%)
44
48
  ```
45
-
@@ -1,22 +1,25 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write]
3
- description: "Show workflow status"
3
+ description: 'Show workflow status'
4
4
  ---
5
5
 
6
6
  # /p:workflow
7
7
 
8
8
  ## Usage
9
+
9
10
  ```
10
11
  /p:workflow # Show status
11
12
  /p:workflow skip # Skip current step
12
13
  ```
13
14
 
14
15
  ## Flow
16
+
15
17
  1. Read: `workflow/state.json`
16
18
  2. Display: current step + progress
17
19
  3. Check: capabilities for next steps
18
20
 
19
21
  ## Response
22
+
20
23
  ```
21
24
  🔄 Workflow: {task_type}
22
25
 
@@ -29,4 +32,3 @@ Next: {next_step}
29
32
 
30
33
  /p:done | /p:workflow skip
31
34
  ```
32
-