prjct-cli 0.25.2 → 0.28.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 (37) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/CLAUDE.md +117 -110
  3. package/core/infrastructure/command-installer.ts +27 -0
  4. package/core/infrastructure/setup.ts +99 -0
  5. package/dist/bin/prjct.mjs +525 -267
  6. package/package.json +1 -1
  7. package/templates/agentic/agents/uxui.md +8 -0
  8. package/templates/agentic/skill-integration.md +311 -0
  9. package/templates/agentic/subagent-generation.md +28 -12
  10. package/templates/commands/bug.md +72 -17
  11. package/templates/commands/cleanup.md +74 -10
  12. package/templates/commands/done.md +158 -8
  13. package/templates/commands/git.md +21 -5
  14. package/templates/commands/merge.md +202 -0
  15. package/templates/commands/p.md +32 -0
  16. package/templates/commands/pause.md +40 -7
  17. package/templates/commands/resume.md +113 -33
  18. package/templates/commands/review.md +276 -0
  19. package/templates/commands/ship.md +193 -17
  20. package/templates/commands/sync.md +442 -47
  21. package/templates/commands/task.md +168 -542
  22. package/templates/commands/test.md +75 -3
  23. package/templates/commands/verify.md +204 -0
  24. package/templates/config/skill-mappings.json +87 -0
  25. package/templates/global/CLAUDE.md +38 -52
  26. package/templates/global/docs/commands.md +29 -31
  27. package/templates/hooks/prjct-session-start.sh +50 -0
  28. package/templates/skills/prjct-done/SKILL.md +97 -0
  29. package/templates/skills/prjct-ship/SKILL.md +150 -0
  30. package/templates/skills/prjct-sync/SKILL.md +108 -0
  31. package/templates/skills/prjct-task/SKILL.md +101 -0
  32. package/templates/subagents/domain/backend.md +1 -0
  33. package/templates/subagents/domain/devops.md +1 -0
  34. package/templates/subagents/domain/frontend.md +1 -0
  35. package/templates/subagents/domain/testing.md +1 -0
  36. package/templates/subagents/workflow/prjct-planner.md +1 -0
  37. package/templates/subagents/workflow/prjct-shipper.md +1 -0
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: prjct-done
3
+ description: Complete current task or subtask. Use when user says "p. done", "finished", "completed", or indicates they finished working on something.
4
+ allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task, TodoWrite]
5
+ user-invocable: true
6
+ ---
7
+
8
+ # prjct Done
9
+
10
+ Mark current task or subtask as complete and advance workflow.
11
+
12
+ ## Context Loading (ALWAYS FIRST)
13
+
14
+ ```
15
+ 1. Read `.prjct/prjct.config.json` → extract projectId
16
+ 2. Set globalPath = ~/.prjct-cli/projects/{projectId}
17
+ 3. Read {globalPath}/storage/state.json → current task
18
+ ```
19
+
20
+ ## Done Workflow
21
+
22
+ ### 1. Check Current State
23
+
24
+ Read `{globalPath}/storage/state.json`:
25
+ - If no currentTask: "No active task. Use p. task to start one."
26
+ - If has subtasks: Check which is in_progress
27
+
28
+ ### 2. Complete Subtask (if applicable)
29
+
30
+ If task has subtasks:
31
+ ```json
32
+ {
33
+ "subtasks": [
34
+ { "id": "1", "status": "completed", "completedAt": "..." },
35
+ { "id": "2", "status": "in_progress" }, // ← Mark complete, advance
36
+ { "id": "3", "status": "pending" } // ← Start this one
37
+ ]
38
+ }
39
+ ```
40
+
41
+ ### 3. Complete Task (if no more subtasks)
42
+
43
+ When all subtasks done OR no subtasks:
44
+ ```json
45
+ {
46
+ "currentTask": null,
47
+ "lastCompleted": {
48
+ "id": "...",
49
+ "title": "...",
50
+ "completedAt": "ISO timestamp"
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### 4. Update Context
56
+
57
+ Write to `{globalPath}/context/now.md`:
58
+ - If more subtasks: Show next subtask
59
+ - If task complete: Show completion + suggest next
60
+
61
+ ### 5. Log Event
62
+
63
+ Append to `{globalPath}/memory/events.jsonl`:
64
+ ```json
65
+ {"timestamp": "...", "action": "subtask_completed", "subtask": {...}}
66
+ ```
67
+ or
68
+ ```json
69
+ {"timestamp": "...", "action": "task_completed", "task": {...}}
70
+ ```
71
+
72
+ ## Paths (CRITICAL)
73
+
74
+ | Type | Path | Access |
75
+ |------|------|--------|
76
+ | Config | `.prjct/prjct.config.json` | Read-only |
77
+ | Storage | `{globalPath}/storage/state.json` | Read-Write |
78
+ | Context | `{globalPath}/context/now.md` | Write |
79
+ | Memory | `{globalPath}/memory/events.jsonl` | Append |
80
+
81
+ ## Output Format
82
+
83
+ **Subtask completed:**
84
+ ```
85
+ ✅ Subtask completed: {title}
86
+
87
+ Progress: {completed}/{total}
88
+ Next: {next subtask title}
89
+ ```
90
+
91
+ **Task completed:**
92
+ ```
93
+ ✅ Task completed: {title}
94
+
95
+ Duration: {time}
96
+ Next: p. ship "{feature}" or p. task "next thing"
97
+ ```
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: prjct-ship
3
+ description: Ship a feature with PR, version bump, and changelog. Use when user says "p. ship", wants to release/deploy, or is ready to merge their work.
4
+ allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task, AskUserQuestion, TodoWrite]
5
+ user-invocable: true
6
+ ---
7
+
8
+ # prjct Ship
9
+
10
+ Ship features with automated PR creation, version bumping, and changelog updates.
11
+
12
+ ## Context Loading (ALWAYS FIRST)
13
+
14
+ ```
15
+ 1. Read `.prjct/prjct.config.json` → extract projectId
16
+ 2. Set globalPath = ~/.prjct-cli/projects/{projectId}
17
+ 3. Read {globalPath}/storage/state.json → current/last task
18
+ 4. Check git status for branch and changes
19
+ ```
20
+
21
+ ## Ship Workflow
22
+
23
+ ### 1. Pre-Ship Checks
24
+
25
+ ```bash
26
+ # Check for uncommitted changes
27
+ git status --porcelain
28
+
29
+ # Check current branch (should not be main/master)
30
+ git branch --show-current
31
+
32
+ # Run tests if configured
33
+ npm test || bun test || yarn test
34
+ ```
35
+
36
+ ### 2. Create/Update PR
37
+
38
+ If on feature branch:
39
+ ```bash
40
+ # Push branch
41
+ git push -u origin $(git branch --show-current)
42
+
43
+ # Create PR with gh CLI
44
+ gh pr create --title "feat: {feature name}" --body "..."
45
+ ```
46
+
47
+ PR body template:
48
+ ```markdown
49
+ ## Summary
50
+ {Brief description}
51
+
52
+ ## Changes
53
+ - {change 1}
54
+ - {change 2}
55
+
56
+ ## Test Plan
57
+ - [ ] Tests pass
58
+ - [ ] Manual verification
59
+
60
+ ---
61
+ 🤖 Generated with [p/](https://www.prjct.app/)
62
+ Designed for [Claude](https://www.anthropic.com/claude)
63
+ ```
64
+
65
+ ### 3. Version Bump (if applicable)
66
+
67
+ Read `package.json`, determine bump type:
68
+ - **patch**: Bug fixes (0.0.x)
69
+ - **minor**: New features (0.x.0)
70
+ - **major**: Breaking changes (x.0.0)
71
+
72
+ ```bash
73
+ npm version patch -m "chore: bump version to %s"
74
+ ```
75
+
76
+ ### 4. Update Changelog
77
+
78
+ Prepend to `CHANGELOG.md`:
79
+ ```markdown
80
+ ## [x.x.x] - YYYY-MM-DD
81
+
82
+ ### Added
83
+ - {new feature}
84
+
85
+ ### Fixed
86
+ - {bug fix}
87
+ ```
88
+
89
+ ### 5. Record Shipment
90
+
91
+ Write to `{globalPath}/storage/shipped.json`:
92
+ ```json
93
+ {
94
+ "shipped": [
95
+ {
96
+ "id": "uuid",
97
+ "name": "{feature}",
98
+ "version": "x.x.x",
99
+ "prUrl": "https://github.com/...",
100
+ "shippedAt": "ISO timestamp"
101
+ }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ ### 6. Update Context
107
+
108
+ Write to `{globalPath}/context/shipped.md`:
109
+ ```markdown
110
+ # Recently Shipped
111
+
112
+ ## {feature name}
113
+ - Version: x.x.x
114
+ - PR: {url}
115
+ - Date: {date}
116
+ ```
117
+
118
+ ### 7. Log Event
119
+
120
+ Append to `{globalPath}/memory/events.jsonl`:
121
+ ```json
122
+ {"timestamp": "...", "action": "feature_shipped", "feature": {...}, "version": "..."}
123
+ ```
124
+
125
+ ## Paths (CRITICAL)
126
+
127
+ | Type | Path | Access |
128
+ |------|------|--------|
129
+ | Config | `.prjct/prjct.config.json` | Read-only |
130
+ | Storage | `{globalPath}/storage/shipped.json` | Read-Write |
131
+ | Context | `{globalPath}/context/shipped.md` | Write |
132
+ | Memory | `{globalPath}/memory/events.jsonl` | Append |
133
+
134
+ ## Git Commit Footer
135
+
136
+ ALWAYS include in commits:
137
+ ```
138
+ 🤖 Generated with [p/](https://www.prjct.app/)
139
+ Designed for [Claude](https://www.anthropic.com/claude)
140
+ ```
141
+
142
+ ## Output Format
143
+
144
+ ```
145
+ 🚀 SHIPPED: {feature name}
146
+
147
+ Version: {x.x.x}
148
+ PR: {url}
149
+ Next: Celebrate! Then p. task "next feature"
150
+ ```
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: prjct-sync
3
+ description: Analyze and sync project state. Use when user says "p. sync", wants to analyze the codebase, or needs to generate/update domain agents.
4
+ allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task, AskUserQuestion, TodoWrite]
5
+ user-invocable: true
6
+ ---
7
+
8
+ # prjct Sync
9
+
10
+ Analyze codebase and sync project state with intelligent agent generation.
11
+
12
+ ## Context Loading (ALWAYS FIRST)
13
+
14
+ ```
15
+ 1. Read `.prjct/prjct.config.json` → extract projectId
16
+ 2. Set globalPath = ~/.prjct-cli/projects/{projectId}
17
+ 3. Read {globalPath}/project.json → project metadata
18
+ ```
19
+
20
+ ## Sync Workflow
21
+
22
+ ### 1. Analyze Codebase
23
+
24
+ Use Task(Explore) to understand:
25
+ - Tech stack (languages, frameworks)
26
+ - Project structure (src/, lib/, etc.)
27
+ - Key patterns (API routes, components, etc.)
28
+ - Test coverage
29
+
30
+ ### 2. Update Project Metadata
31
+
32
+ Write to `{globalPath}/project.json`:
33
+ ```json
34
+ {
35
+ "projectId": "...",
36
+ "name": "project-name",
37
+ "repoPath": "/path/to/repo",
38
+ "techStack": ["typescript", "react", "node"],
39
+ "fileCount": 150,
40
+ "cliVersion": "0.28.0",
41
+ "lastSync": "ISO timestamp"
42
+ }
43
+ ```
44
+
45
+ ### 3. Generate Domain Agents
46
+
47
+ Based on tech stack, create agents in `{globalPath}/agents/`:
48
+
49
+ | Agent | When to Generate |
50
+ |-------|------------------|
51
+ | `frontend.md` | React, Vue, Svelte, CSS |
52
+ | `backend.md` | Node, Express, APIs |
53
+ | `database.md` | SQL, MongoDB, Prisma |
54
+ | `testing.md` | Jest, Vitest, Playwright |
55
+ | `devops.md` | Docker, CI/CD, K8s |
56
+
57
+ Agent template:
58
+ ```yaml
59
+ ---
60
+ name: {agent-name}
61
+ description: {domain expertise}
62
+ tools: [Read, Write, Edit, Bash, Glob, Grep]
63
+ ---
64
+
65
+ # {Agent Name} Specialist
66
+
67
+ ## Patterns Found
68
+ - {pattern 1}
69
+ - {pattern 2}
70
+
71
+ ## Conventions
72
+ - {convention 1}
73
+ - {convention 2}
74
+ ```
75
+
76
+ ### 4. Sync Context Files
77
+
78
+ Regenerate `{globalPath}/context/`:
79
+ - `now.md` - Current task (if any)
80
+ - `next.md` - Queue summary
81
+ - `shipped.md` - Recently shipped
82
+
83
+ ### 5. Log Event
84
+
85
+ Append to `{globalPath}/memory/events.jsonl`:
86
+ ```json
87
+ {"timestamp": "...", "action": "sync_completed", "agents": [...], "stats": {...}}
88
+ ```
89
+
90
+ ## Paths (CRITICAL)
91
+
92
+ | Type | Path | Access |
93
+ |------|------|--------|
94
+ | Config | `.prjct/prjct.config.json` | Read-only |
95
+ | Project | `{globalPath}/project.json` | Read-Write |
96
+ | Agents | `{globalPath}/agents/*.md` | Write |
97
+ | Context | `{globalPath}/context/*.md` | Write |
98
+ | Memory | `{globalPath}/memory/events.jsonl` | Append |
99
+
100
+ ## Output Format
101
+
102
+ ```
103
+ ✅ Project synced
104
+
105
+ Files: {n} | Stack: {techs}
106
+ Agents: {list}
107
+ Next: p. task "start working"
108
+ ```
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: prjct-task
3
+ description: Start and manage development tasks. Use when user says "p. task", wants to start working on something, or mentions starting a feature/bug/improvement/refactor.
4
+ allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task, AskUserQuestion, TodoWrite]
5
+ user-invocable: true
6
+ ---
7
+
8
+ # prjct Task Manager
9
+
10
+ Start and track development tasks with intelligent classification.
11
+
12
+ ## Context Loading (ALWAYS FIRST)
13
+
14
+ ```
15
+ 1. Read `.prjct/prjct.config.json` → extract projectId
16
+ 2. Set globalPath = ~/.prjct-cli/projects/{projectId}
17
+ 3. Read {globalPath}/storage/state.json → current state
18
+ 4. Read {globalPath}/agents/*.md → domain expertise (if exists)
19
+ ```
20
+
21
+ ## Task Workflow
22
+
23
+ ### 1. Classify Task Type
24
+ - **feature**: New functionality
25
+ - **bug**: Fix broken behavior
26
+ - **improvement**: Enhance existing feature
27
+ - **refactor**: Code restructure without behavior change
28
+ - **chore**: Maintenance, deps, config
29
+
30
+ ### 2. Explore Codebase
31
+ Use Task(Explore) to:
32
+ - Find related code patterns
33
+ - Identify affected files
34
+ - Understand dependencies
35
+
36
+ ### 3. Break Down (if complex)
37
+ Create subtasks with clear scope:
38
+ ```json
39
+ {
40
+ "subtasks": [
41
+ { "id": "1", "title": "...", "status": "pending" }
42
+ ]
43
+ }
44
+ ```
45
+
46
+ ### 4. Track in Storage
47
+ Write to `{globalPath}/storage/state.json`:
48
+ ```json
49
+ {
50
+ "currentTask": {
51
+ "id": "uuid",
52
+ "title": "Task description",
53
+ "type": "feature",
54
+ "status": "in_progress",
55
+ "subtasks": [...],
56
+ "startedAt": "ISO timestamp"
57
+ }
58
+ }
59
+ ```
60
+
61
+ ### 5. Generate Context
62
+ Write to `{globalPath}/context/now.md`:
63
+ ```markdown
64
+ # Current Task
65
+ **{title}** ({type})
66
+ Started: {timestamp}
67
+ Subtasks: {completed}/{total}
68
+ ```
69
+
70
+ ### 6. Log Event
71
+ Append to `{globalPath}/memory/events.jsonl`:
72
+ ```json
73
+ {"timestamp": "...", "action": "task_started", "task": {...}}
74
+ ```
75
+
76
+ ## Paths (CRITICAL)
77
+
78
+ | Type | Path | Access |
79
+ |------|------|--------|
80
+ | Config | `.prjct/prjct.config.json` | Read-only |
81
+ | Storage | `{globalPath}/storage/*.json` | Read-Write |
82
+ | Context | `{globalPath}/context/*.md` | Read-Write |
83
+ | Memory | `{globalPath}/memory/events.jsonl` | Append-only |
84
+ | Agents | `{globalPath}/agents/*.md` | Read-only |
85
+
86
+ ## Output Format
87
+
88
+ ```
89
+ ✅ Task started: {title}
90
+
91
+ Type: {type} | Subtasks: {n}
92
+ Next: {first subtask or suggested action}
93
+ ```
94
+
95
+ ## Git Commit Footer
96
+
97
+ When committing, ALWAYS include:
98
+ ```
99
+ 🤖 Generated with [p/](https://www.prjct.app/)
100
+ Designed for [Claude](https://www.anthropic.com/claude)
101
+ ```
@@ -3,6 +3,7 @@ name: backend
3
3
  description: Backend specialist for Node.js, Go, Python, REST APIs, and GraphQL. Use PROACTIVELY when user works on APIs, servers, or backend logic.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
5
  model: sonnet
6
+ skills: [javascript-typescript]
6
7
  ---
7
8
 
8
9
  You are a backend specialist agent for this project.
@@ -3,6 +3,7 @@ name: devops
3
3
  description: DevOps specialist for Docker, Kubernetes, CI/CD, and GitHub Actions. Use PROACTIVELY when user works on deployment, containers, or pipelines.
4
4
  tools: Read, Bash, Glob
5
5
  model: sonnet
6
+ skills: [developer-kit]
6
7
  ---
7
8
 
8
9
  You are a DevOps specialist agent for this project.
@@ -3,6 +3,7 @@ name: frontend
3
3
  description: Frontend specialist for React, Vue, Angular, Svelte, CSS, and UI work. Use PROACTIVELY when user works on components, styling, or UI features.
4
4
  tools: Read, Write, Glob, Grep
5
5
  model: sonnet
6
+ skills: [frontend-design]
6
7
  ---
7
8
 
8
9
  You are a frontend specialist agent for this project.
@@ -3,6 +3,7 @@ name: testing
3
3
  description: Testing specialist for Bun test, Jest, Pytest, and testing libraries. Use PROACTIVELY when user works on tests, coverage, or test infrastructure.
4
4
  tools: Read, Write, Bash
5
5
  model: sonnet
6
+ skills: [developer-kit]
6
7
  ---
7
8
 
8
9
  You are a testing specialist agent for this project.
@@ -3,6 +3,7 @@ name: prjct-planner
3
3
  description: Planning agent for /p:feature, /p:idea, /p:spec, /p:bug tasks. Use PROACTIVELY when user discusses features, ideas, specs, or bugs.
4
4
  tools: Read, Write, Glob, Grep
5
5
  model: sonnet
6
+ skills: [feature-dev]
6
7
  ---
7
8
 
8
9
  You are the prjct planning agent, specializing in feature planning and task breakdown.
@@ -3,6 +3,7 @@ name: prjct-shipper
3
3
  description: Shipping agent for /p:ship tasks. Use PROACTIVELY when user wants to commit, push, deploy, or ship features.
4
4
  tools: Read, Write, Bash, Glob
5
5
  model: sonnet
6
+ skills: [code-review]
6
7
  ---
7
8
 
8
9
  You are the prjct shipper agent, specializing in shipping features safely.