prjct-cli 0.27.0 → 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.
- package/CHANGELOG.md +19 -0
- package/CLAUDE.md +25 -17
- package/core/infrastructure/setup.ts +99 -0
- package/dist/bin/prjct.mjs +525 -267
- package/package.json +1 -1
- package/templates/commands/cleanup.md +74 -10
- package/templates/global/CLAUDE.md +25 -196
- package/templates/hooks/prjct-session-start.sh +50 -0
- package/templates/skills/prjct-done/SKILL.md +97 -0
- package/templates/skills/prjct-ship/SKILL.md +150 -0
- package/templates/skills/prjct-sync/SKILL.md +108 -0
- package/templates/skills/prjct-task/SKILL.md +101 -0
package/package.json
CHANGED
|
@@ -1,19 +1,83 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: [Read, Edit, Bash]
|
|
3
|
-
description: '
|
|
2
|
+
allowed-tools: [Read, Edit, Write, Bash, Glob, Grep, Task]
|
|
3
|
+
description: 'Deep code cleanup - dead code, comments, docs'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /p:cleanup
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
8
|
+
Limpieza profunda del código del proyecto.
|
|
9
|
+
|
|
10
|
+
## Alcance
|
|
11
|
+
|
|
12
|
+
### 1. Código Muerto
|
|
13
|
+
- Funciones/métodos no usados
|
|
14
|
+
- Variables declaradas sin usar
|
|
15
|
+
- Imports no utilizados
|
|
16
|
+
- Exports sin consumidores
|
|
17
|
+
- Código comentado (bloques `// old code...`)
|
|
18
|
+
- Condicionales siempre true/false
|
|
19
|
+
|
|
20
|
+
### 2. Comentarios Inútiles
|
|
21
|
+
- `// TODO` sin contexto útil
|
|
22
|
+
- `// fix this` genéricos
|
|
23
|
+
- Comentarios obvios (`// increment i`)
|
|
24
|
+
- Comentarios desactualizados vs código
|
|
25
|
+
- Console.log de debug olvidados
|
|
26
|
+
|
|
27
|
+
### 3. Documentación
|
|
28
|
+
- Actualizar README si hay cambios estructurales
|
|
29
|
+
- Sincronizar JSDoc/TSDoc con firmas actuales
|
|
30
|
+
- Limpiar docs de funciones eliminadas
|
|
14
31
|
|
|
15
32
|
## Flow
|
|
16
|
-
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
1. ANALYZE: Escanear codebase con Task(Explore)
|
|
36
|
+
- Buscar dead code patterns
|
|
37
|
+
- Identificar comentarios verbose
|
|
38
|
+
|
|
39
|
+
2. REPORT: Mostrar hallazgos al usuario
|
|
40
|
+
- Listar archivos afectados
|
|
41
|
+
- Mostrar qué se eliminará
|
|
42
|
+
|
|
43
|
+
3. CONFIRM: Pedir confirmación antes de cambios destructivos
|
|
44
|
+
|
|
45
|
+
4. CLEAN: Aplicar limpieza
|
|
46
|
+
- Editar archivos uno por uno
|
|
47
|
+
- Mantener formato/estilo existente
|
|
48
|
+
|
|
49
|
+
5. VALIDATE: Verificar que el código compila/funciona
|
|
50
|
+
- Run build si existe
|
|
51
|
+
- Run tests si existen
|
|
52
|
+
|
|
53
|
+
6. UPDATE DOCS: Si hay cambios significativos
|
|
54
|
+
- Actualizar README
|
|
55
|
+
- Actualizar CHANGELOG si existe
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Comandos
|
|
59
|
+
|
|
60
|
+
| Variante | Acción |
|
|
61
|
+
|----------|--------|
|
|
62
|
+
| `p. cleanup` | Análisis + reporte (sin cambios) |
|
|
63
|
+
| `p. cleanup fix` | Aplicar limpieza con confirmación |
|
|
64
|
+
| `p. cleanup --force` | Aplicar sin confirmación |
|
|
17
65
|
|
|
18
66
|
## Response
|
|
19
|
-
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
🧹 Cleanup Analysis
|
|
70
|
+
|
|
71
|
+
Dead Code:
|
|
72
|
+
- {file}: {N} unused functions
|
|
73
|
+
- {file}: {N} unused imports
|
|
74
|
+
|
|
75
|
+
Comments:
|
|
76
|
+
- {file}: {N} debug logs
|
|
77
|
+
- {file}: {N} TODO sin contexto
|
|
78
|
+
|
|
79
|
+
Docs:
|
|
80
|
+
- README.md: {status}
|
|
81
|
+
|
|
82
|
+
Total: {N} issues | Run `p. cleanup fix` to apply
|
|
83
|
+
```
|
|
@@ -1,163 +1,52 @@
|
|
|
1
1
|
<!-- prjct:start - DO NOT REMOVE THIS MARKER -->
|
|
2
2
|
# prjct-cli
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Developer momentum tool. Track progress with natural language commands.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## BEFORE ANY COMMAND
|
|
7
7
|
|
|
8
|
-
When user types `p. <command>`, load the template from `templates/commands/{command}.md` and execute it intelligently.
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
p. sync → templates/commands/sync.md
|
|
12
|
-
p. task X → templates/commands/task.md
|
|
13
|
-
p. done → templates/commands/done.md
|
|
14
|
-
p. ship X → templates/commands/ship.md
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Key Insight**: Templates are GUIDANCE, not scripts. Use your intelligence to adapt them to the situation.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## CRITICAL RULES
|
|
22
|
-
|
|
23
|
-
### 1. Path Resolution (MOST IMPORTANT)
|
|
24
|
-
**ALL writes go to global storage**: `~/.prjct-cli/projects/{projectId}/`
|
|
25
|
-
|
|
26
|
-
- **NEVER** write to `.prjct/` (config only, read-only)
|
|
27
|
-
- **NEVER** write to `./` (current directory)
|
|
28
|
-
- **ALWAYS** resolve projectId first from `.prjct/prjct.config.json`
|
|
29
|
-
|
|
30
|
-
### 2. Before Any Command
|
|
31
8
|
```
|
|
32
9
|
1. Read .prjct/prjct.config.json → get projectId
|
|
33
10
|
2. Set globalPath = ~/.prjct-cli/projects/{projectId}
|
|
34
|
-
3.
|
|
11
|
+
3. ALL writes go to globalPath (NEVER .prjct/)
|
|
35
12
|
4. Log to {globalPath}/memory/events.jsonl
|
|
36
13
|
```
|
|
37
14
|
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# Timestamp (NEVER hardcode)
|
|
41
|
-
bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"
|
|
42
|
-
|
|
43
|
-
# UUID
|
|
44
|
-
bun -e "console.log(crypto.randomUUID())" 2>/dev/null || node -e "console.log(require('crypto').randomUUID())"
|
|
45
|
-
```
|
|
15
|
+
## PATHS (CRITICAL)
|
|
46
16
|
|
|
47
|
-
|
|
17
|
+
| Type | Path | Access |
|
|
18
|
+
|------|------|--------|
|
|
19
|
+
| Config | `.prjct/prjct.config.json` | Read-only |
|
|
20
|
+
| Storage | `{globalPath}/storage/*.json` | Read-Write |
|
|
21
|
+
| Context | `{globalPath}/context/*.md` | Read-Write |
|
|
22
|
+
| Memory | `{globalPath}/memory/events.jsonl` | Append |
|
|
23
|
+
| Agents | `{globalPath}/agents/*.md` | Read |
|
|
48
24
|
|
|
49
|
-
|
|
25
|
+
## COMMANDS
|
|
50
26
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**This is NON-NEGOTIABLE. The prjct signature (`🤖 Generated with [p/]`) must appear in ALL commits.**
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## CORE WORKFLOW
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
p. sync → p. task "description" → [work] → p. done → p. ship
|
|
65
|
-
│ │ │ │
|
|
66
|
-
│ └─ Creates branch, breaks down │ │
|
|
67
|
-
│ task, starts tracking │ │
|
|
68
|
-
│ │ │
|
|
69
|
-
└─ Analyzes project, generates agents │ │
|
|
70
|
-
│ │
|
|
71
|
-
Completes subtask ─────┘ │
|
|
72
|
-
│
|
|
73
|
-
Ships feature, PR, tag ───┘
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Quick Reference
|
|
77
|
-
|
|
78
|
-
| Trigger | What It Does |
|
|
79
|
-
|---------|--------------|
|
|
80
|
-
| `p. sync` | Analyze project, generate domain agents |
|
|
81
|
-
| `p. task <desc>` | Start task with auto-classification |
|
|
27
|
+
| Trigger | Action |
|
|
28
|
+
|---------|--------|
|
|
29
|
+
| `p. sync` | Analyze project, generate agents |
|
|
30
|
+
| `p. task <desc>` | Start task with classification |
|
|
82
31
|
| `p. done` | Complete current subtask |
|
|
83
|
-
| `p. ship [name]` | Ship
|
|
84
|
-
| `p. pause` | Pause current task |
|
|
85
|
-
| `p. resume` | Resume paused task |
|
|
86
|
-
| `p. bug <desc>` | Report bug with auto-priority |
|
|
32
|
+
| `p. ship [name]` | Ship with PR + version bump |
|
|
87
33
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## ARCHITECTURE: Write-Through Pattern
|
|
34
|
+
## TIMESTAMPS
|
|
91
35
|
|
|
92
|
-
```
|
|
93
|
-
|
|
36
|
+
```bash
|
|
37
|
+
bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"
|
|
94
38
|
```
|
|
95
39
|
|
|
96
|
-
|
|
97
|
-
|-------|------|---------|
|
|
98
|
-
| **Storage** | `storage/*.json` | Source of truth |
|
|
99
|
-
| **Context** | `context/*.md` | Claude-readable summaries |
|
|
100
|
-
| **Memory** | `memory/events.jsonl` | Audit trail (append-only) |
|
|
101
|
-
| **Agents** | `agents/*.md` | Domain specialists |
|
|
102
|
-
| **Sync** | `sync/pending.json` | Backend sync queue |
|
|
40
|
+
## GIT COMMITS
|
|
103
41
|
|
|
104
|
-
|
|
42
|
+
Always include footer:
|
|
105
43
|
```
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
│ ├── state.json # Current task (SOURCE OF TRUTH)
|
|
109
|
-
│ ├── queue.json # Task queue
|
|
110
|
-
│ └── shipped.json # Shipped features
|
|
111
|
-
├── context/
|
|
112
|
-
│ ├── now.md # Current task (generated)
|
|
113
|
-
│ └── next.md # Queue (generated)
|
|
114
|
-
├── config/
|
|
115
|
-
│ └── skills.json # Agent-to-skill mappings (NEW)
|
|
116
|
-
├── memory/
|
|
117
|
-
│ └── events.jsonl # Audit trail
|
|
118
|
-
├── agents/ # Domain specialists (auto-generated)
|
|
119
|
-
└── sync/
|
|
120
|
-
└── pending.json # Events for backend
|
|
44
|
+
🤖 Generated with [p/](https://www.prjct.app/)
|
|
45
|
+
Designed for [Claude](https://www.anthropic.com/claude)
|
|
121
46
|
```
|
|
122
47
|
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
## INTELLIGENT BEHAVIOR
|
|
126
|
-
|
|
127
|
-
### When Starting Tasks (`p. task`)
|
|
128
|
-
1. **Analyze** - Understand what user wants to achieve
|
|
129
|
-
2. **Classify** - Determine type: feature, bug, improvement, refactor, chore
|
|
130
|
-
3. **Explore** - Find similar code, patterns, affected files
|
|
131
|
-
4. **Ask** - Clarify ambiguities (use AskUserQuestion)
|
|
132
|
-
5. **Design** - Propose 2-3 approaches, get approval
|
|
133
|
-
6. **Break down** - Create actionable subtasks
|
|
134
|
-
7. **Track** - Update storage/state.json
|
|
135
|
-
|
|
136
|
-
### When Completing Tasks (`p. done`)
|
|
137
|
-
1. Check if there are more subtasks
|
|
138
|
-
2. If yes, advance to next subtask
|
|
139
|
-
3. If no, task is complete
|
|
140
|
-
4. Update storage, generate context
|
|
141
|
-
|
|
142
|
-
### When Shipping (`p. ship`)
|
|
143
|
-
1. Run tests (if configured)
|
|
144
|
-
2. Create PR (if on feature branch)
|
|
145
|
-
3. Bump version
|
|
146
|
-
4. Update CHANGELOG
|
|
147
|
-
5. Create git tag
|
|
148
|
-
|
|
149
|
-
### Key Intelligence Rules
|
|
150
|
-
- **Read before write** - Always read existing files before modifying
|
|
151
|
-
- **Explore before coding** - Use Task(Explore) to understand codebase
|
|
152
|
-
- **Ask when uncertain** - Use AskUserQuestion to clarify
|
|
153
|
-
- **Adapt templates** - Templates are guidance, not rigid scripts
|
|
154
|
-
- **Log everything** - Append to memory/events.jsonl
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
48
|
## OUTPUT FORMAT
|
|
159
49
|
|
|
160
|
-
Concise responses (< 4 lines):
|
|
161
50
|
```
|
|
162
51
|
✅ [What was done]
|
|
163
52
|
|
|
@@ -167,66 +56,6 @@ Next: [suggested action]
|
|
|
167
56
|
|
|
168
57
|
---
|
|
169
58
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
When working on tasks, load relevant agents from `{globalPath}/agents/`:
|
|
173
|
-
- `frontend.md` - Frontend patterns, components
|
|
174
|
-
- `backend.md` - Backend patterns, APIs
|
|
175
|
-
- `database.md` - Database patterns, queries
|
|
176
|
-
- `uxui.md` - UX/UI guidelines
|
|
177
|
-
- `testing.md` - Testing patterns
|
|
178
|
-
- `devops.md` - CI/CD, containers
|
|
179
|
-
|
|
180
|
-
These agents contain project-specific patterns. **USE THEM**.
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## SKILL INTEGRATION (NEW in v0.27 - AGENTIC)
|
|
185
|
-
|
|
186
|
-
Agents are linked to Claude Code skills from claude-plugins.dev.
|
|
187
|
-
|
|
188
|
-
**Skills are discovered AGENTICALLY** - Claude searches the marketplace dynamically.
|
|
189
|
-
|
|
190
|
-
### How Skills Work
|
|
191
|
-
|
|
192
|
-
1. **During `p. sync`**: Search claude-plugins.dev, install best matches
|
|
193
|
-
2. **During `p. task`**: Skills are auto-invoked for domain expertise
|
|
194
|
-
3. **Agent frontmatter** has `skills: [discovered-skill-name]` field
|
|
195
|
-
|
|
196
|
-
### Agentic Discovery Process
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
FOR EACH generated agent:
|
|
200
|
-
1. Read search hints from templates/config/skill-mappings.json
|
|
201
|
-
2. Search: https://claude-plugins.dev/skills?q={searchTerm}
|
|
202
|
-
3. Analyze results (prefer @anthropics, high downloads)
|
|
203
|
-
4. Download skill markdown from GitHub
|
|
204
|
-
5. Write to ~/.claude/skills/{name}.md
|
|
205
|
-
6. Update agent frontmatter
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Search Terms by Agent
|
|
209
|
-
|
|
210
|
-
| Agent | Search Terms |
|
|
211
|
-
|-------|-------------|
|
|
212
|
-
| `frontend.md` | "frontend-design", "react", "ui components" |
|
|
213
|
-
| `uxui.md` | "ux-designer", "frontend-design", "ui ux" |
|
|
214
|
-
| `backend.md` | "{ecosystem} backend", "api design" |
|
|
215
|
-
| `testing.md` | "testing automation", "test patterns" |
|
|
216
|
-
| `devops.md` | "devops", "ci cd", "docker kubernetes" |
|
|
217
|
-
| `prjct-planner.md` | "architecture patterns", "feature development" |
|
|
218
|
-
| `prjct-shipper.md` | "code review", "pr review" |
|
|
219
|
-
|
|
220
|
-
### Skill Location
|
|
221
|
-
|
|
222
|
-
Skills are markdown files in `~/.claude/skills/`
|
|
223
|
-
|
|
224
|
-
### Skill Configuration
|
|
225
|
-
|
|
226
|
-
After sync: `{globalPath}/config/skills.json` contains discovered mappings.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
**Auto-managed by prjct-cli** | https://prjct.app | v0.27.0
|
|
59
|
+
Detailed instructions loaded via Skills. | https://prjct.app
|
|
231
60
|
|
|
232
61
|
<!-- prjct:end - DO NOT REMOVE THIS MARKER -->
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# prjct-cli SessionStart Hook
|
|
3
|
+
# Inyecta contexto fresco del proyecto al inicio de cada sesión Claude Code
|
|
4
|
+
# https://prjct.app
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Solo ejecutar si estamos en un proyecto prjct
|
|
9
|
+
if [[ -f ".prjct/prjct.config.json" ]]; then
|
|
10
|
+
# Extraer projectId
|
|
11
|
+
PROJECT_ID=$(cat .prjct/prjct.config.json 2>/dev/null | grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
|
|
12
|
+
|
|
13
|
+
if [[ -n "$PROJECT_ID" ]]; then
|
|
14
|
+
PRJCT_HOME="$HOME/.prjct-cli/projects/$PROJECT_ID"
|
|
15
|
+
|
|
16
|
+
if [[ -d "$PRJCT_HOME" ]]; then
|
|
17
|
+
# Leer versión CLI
|
|
18
|
+
CLI_VERSION="unknown"
|
|
19
|
+
if [[ -f "$PRJCT_HOME/project.json" ]]; then
|
|
20
|
+
CLI_VERSION=$(cat "$PRJCT_HOME/project.json" 2>/dev/null | grep -o '"cliVersion"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
|
|
21
|
+
[[ -z "$CLI_VERSION" ]] && CLI_VERSION="unknown"
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Leer tarea actual
|
|
25
|
+
CURRENT_TASK=""
|
|
26
|
+
if [[ -f "$PRJCT_HOME/context/now.md" ]]; then
|
|
27
|
+
CURRENT_TASK=$(cat "$PRJCT_HOME/context/now.md" 2>/dev/null | head -20)
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Leer nombre del proyecto
|
|
31
|
+
PROJECT_NAME=""
|
|
32
|
+
if [[ -f "$PRJCT_HOME/project.json" ]]; then
|
|
33
|
+
PROJECT_NAME=$(cat "$PRJCT_HOME/project.json" 2>/dev/null | grep -o '"name"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Output para Claude Code
|
|
37
|
+
echo "---"
|
|
38
|
+
echo "prjct-cli v$CLI_VERSION"
|
|
39
|
+
echo "Project: $PROJECT_NAME ($PROJECT_ID)"
|
|
40
|
+
echo "Storage: $PRJCT_HOME"
|
|
41
|
+
echo "---"
|
|
42
|
+
|
|
43
|
+
if [[ -n "$CURRENT_TASK" ]]; then
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Current Task:"
|
|
46
|
+
echo "$CURRENT_TASK"
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
fi
|
|
50
|
+
fi
|
|
@@ -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
|
+
```
|