prjct-cli 0.10.4 → 0.10.6
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 +30 -0
- package/core/context-sync.js +214 -69
- package/package.json +1 -1
- package/templates/global/CLAUDE.md +137 -135
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.6] - 2025-11-27
|
|
4
|
+
|
|
5
|
+
### Enhanced
|
|
6
|
+
|
|
7
|
+
- **Global CLAUDE.md Template** - Improved to help Claude use prjct-cli better
|
|
8
|
+
- Quick command reference table with examples
|
|
9
|
+
- Recommended workflow (sync → feature → now → done → ship)
|
|
10
|
+
- Common usage patterns with examples
|
|
11
|
+
- Anti-patterns table (what NOT to do)
|
|
12
|
+
- Using agents effectively section
|
|
13
|
+
- Simplified file structure overview
|
|
14
|
+
- Error handling table
|
|
15
|
+
|
|
16
|
+
## [0.10.5] - 2025-11-27
|
|
17
|
+
|
|
18
|
+
### Enhanced
|
|
19
|
+
|
|
20
|
+
- **Rich Project Context** - CLAUDE.md now includes comprehensive project info
|
|
21
|
+
- Quick reference table (project, stack, files, commits, contributors)
|
|
22
|
+
- Full tech stack details (languages, frameworks, dependencies)
|
|
23
|
+
- Project structure (directories)
|
|
24
|
+
- Agent summaries with roles and expertise
|
|
25
|
+
- Current task and priority queue (top 5)
|
|
26
|
+
- Active roadmap features
|
|
27
|
+
- Recent ideas (top 3)
|
|
28
|
+
- Git activity (last 5 commits)
|
|
29
|
+
- Deep dive section with file paths for detailed info
|
|
30
|
+
|
|
31
|
+
- **Reduced LLM Context Overhead** - Claude gets all key info in one file instead of reading multiple
|
|
32
|
+
|
|
3
33
|
## [0.10.4] - 2025-11-27
|
|
4
34
|
|
|
5
35
|
### Fixed
|
package/core/context-sync.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Context Sync - Generates dynamic project context for Claude
|
|
2
|
+
* Context Sync - Generates RICH dynamic project context for Claude
|
|
3
3
|
*
|
|
4
4
|
* Creates ~/.prjct-cli/projects/{id}/CLAUDE.md with:
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
5
|
+
* - Full stack info (languages, frameworks, dependencies)
|
|
6
|
+
* - Project structure and stats
|
|
7
|
+
* - Agent expertise summaries
|
|
8
|
+
* - Current task and priority queue
|
|
9
|
+
* - Active features from roadmap
|
|
10
|
+
*
|
|
11
|
+
* GOAL: Give Claude ALL the context it needs WITHOUT extra file reads
|
|
9
12
|
*
|
|
10
13
|
* Called by: /p:sync, /p:analyze, /p:init
|
|
11
14
|
*/
|
|
@@ -15,17 +18,27 @@ const path = require('path')
|
|
|
15
18
|
const os = require('os')
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
|
-
* Generate project context file for Claude
|
|
19
|
-
*
|
|
21
|
+
* Generate RICH project context file for Claude
|
|
22
|
+
* Embeds key information so Claude doesn't need to read multiple files
|
|
20
23
|
*
|
|
21
24
|
* @param {string} projectPath - Local project path
|
|
22
25
|
* @param {string} projectId - Project ID from config
|
|
23
|
-
* @returns {Promise<{agents: string[], stack:
|
|
26
|
+
* @returns {Promise<{agents: string[], stack: object, currentTask: string|null}>}
|
|
24
27
|
*/
|
|
25
28
|
async function generateLocalContext(projectPath, projectId) {
|
|
26
29
|
const globalPath = path.join(os.homedir(), '.prjct-cli/projects', projectId)
|
|
30
|
+
const projectName = path.basename(projectPath)
|
|
31
|
+
|
|
32
|
+
// Helper to read files safely
|
|
33
|
+
const readSafe = async (p) => {
|
|
34
|
+
try {
|
|
35
|
+
return await fs.readFile(p, 'utf-8')
|
|
36
|
+
} catch {
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
}
|
|
27
40
|
|
|
28
|
-
// 1. Read ALL
|
|
41
|
+
// 1. Read ALL data sources in parallel
|
|
29
42
|
const agentsDir = path.join(globalPath, 'agents')
|
|
30
43
|
let agentFiles = []
|
|
31
44
|
try {
|
|
@@ -35,91 +48,210 @@ async function generateLocalContext(projectPath, projectId) {
|
|
|
35
48
|
// No agents directory yet
|
|
36
49
|
}
|
|
37
50
|
|
|
38
|
-
|
|
39
|
-
const readSafe = async (p) => {
|
|
40
|
-
try {
|
|
41
|
-
return await fs.readFile(p, 'utf-8')
|
|
42
|
-
} catch {
|
|
43
|
-
return null
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const [repoSummary, now, next, roadmap] = await Promise.all([
|
|
51
|
+
const [repoSummary, now, next, roadmap, ideas] = await Promise.all([
|
|
48
52
|
readSafe(path.join(globalPath, 'analysis/repo-summary.md')),
|
|
49
53
|
readSafe(path.join(globalPath, 'core/now.md')),
|
|
50
54
|
readSafe(path.join(globalPath, 'core/next.md')),
|
|
51
|
-
readSafe(path.join(globalPath, 'planning/roadmap.md'))
|
|
55
|
+
readSafe(path.join(globalPath, 'planning/roadmap.md')),
|
|
56
|
+
readSafe(path.join(globalPath, 'planning/ideas.md'))
|
|
52
57
|
])
|
|
53
58
|
|
|
54
|
-
//
|
|
55
|
-
const
|
|
59
|
+
// 2. Extract RICH stack info from repo-summary
|
|
60
|
+
const stackInfo = extractFullStack(repoSummary)
|
|
61
|
+
|
|
62
|
+
// 3. Extract project structure from repo-summary
|
|
63
|
+
const projectStructure = extractProjectStructure(repoSummary)
|
|
64
|
+
|
|
65
|
+
// 4. Extract git stats
|
|
66
|
+
const gitStats = extractGitStats(repoSummary)
|
|
56
67
|
|
|
57
|
-
//
|
|
58
|
-
const
|
|
68
|
+
// 5. Read agent expertise (just the key parts, not full templates)
|
|
69
|
+
const agentExpertise = await extractAgentExpertise(agentsDir, agentFiles)
|
|
59
70
|
|
|
60
|
-
//
|
|
71
|
+
// 6. Extract current task
|
|
61
72
|
const currentTask = extractCurrentTask(now)
|
|
62
73
|
|
|
63
|
-
//
|
|
64
|
-
const nextTasks = extractTopTasks(next,
|
|
74
|
+
// 7. Extract priority queue (top 5)
|
|
75
|
+
const nextTasks = extractTopTasks(next, 5)
|
|
65
76
|
|
|
66
|
-
//
|
|
77
|
+
// 8. Extract active features from roadmap
|
|
67
78
|
const activeFeatures = extractActiveFeatures(roadmap)
|
|
68
79
|
|
|
69
|
-
//
|
|
70
|
-
const
|
|
71
|
-
|
|
80
|
+
// 9. Extract recent ideas
|
|
81
|
+
const recentIdeas = extractRecentIdeas(ideas)
|
|
82
|
+
|
|
83
|
+
// 10. Generate RICH CLAUDE.md content
|
|
84
|
+
const content = `# ${projectName} - Project Context
|
|
85
|
+
<!-- Auto-generated by /p:sync - DO NOT EDIT MANUALLY -->
|
|
72
86
|
<!-- projectId: ${projectId} -->
|
|
73
87
|
<!-- Last sync: ${new Date().toISOString()} -->
|
|
74
88
|
|
|
75
|
-
##
|
|
76
|
-
|
|
89
|
+
## Quick Reference
|
|
90
|
+
|
|
91
|
+
| Attribute | Value |
|
|
92
|
+
|-----------|-------|
|
|
93
|
+
| **Project** | ${projectName} |
|
|
94
|
+
| **Stack** | ${stackInfo.primary || 'Not detected'} |
|
|
95
|
+
| **Files** | ${projectStructure.fileCount || '?'} |
|
|
96
|
+
| **Commits** | ${gitStats.commits || '?'} |
|
|
97
|
+
| **Contributors** | ${gitStats.contributors || '?'} |
|
|
98
|
+
|
|
99
|
+
## Tech Stack
|
|
100
|
+
|
|
101
|
+
${stackInfo.full || 'Run /p:analyze to detect stack'}
|
|
102
|
+
|
|
103
|
+
## Project Structure
|
|
104
|
+
|
|
105
|
+
${projectStructure.directories?.length ? projectStructure.directories.map(d => `- \`${d}/\``).join('\n') : 'Run /p:analyze to detect structure'}
|
|
77
106
|
|
|
78
107
|
## Available Agents
|
|
79
|
-
${agents.length ? agents.map(a => `- ${a}`).join('\n') : 'None. Run /p:sync to generate.'}
|
|
80
108
|
|
|
81
|
-
|
|
82
|
-
${
|
|
109
|
+
${agentExpertise.length ? agentExpertise.map(a => `### ${a.name}
|
|
110
|
+
- **Role**: ${a.role}
|
|
111
|
+
- **Expertise**: ${a.expertise}
|
|
112
|
+
`).join('\n') : 'None. Run /p:sync to generate agents.'}
|
|
113
|
+
|
|
114
|
+
## Current Focus
|
|
115
|
+
|
|
116
|
+
${currentTask ? `**Active Task**: ${currentTask}` : 'No active task. Use /p:now to start.'}
|
|
117
|
+
|
|
118
|
+
## Priority Queue
|
|
119
|
+
|
|
120
|
+
${nextTasks.length ? nextTasks.map((t, i) => `${i + 1}. ${t}`).join('\n') : 'Empty queue. Use /p:next to add tasks.'}
|
|
83
121
|
|
|
84
|
-
##
|
|
85
|
-
${nextTasks.length ? nextTasks.map((t, i) => `${i + 1}. ${t}`).join('\n') : 'Empty queue.'}
|
|
122
|
+
## Active Features (Roadmap)
|
|
86
123
|
|
|
87
|
-
|
|
88
|
-
${activeFeatures.length ? activeFeatures.map(f => `- ${f}`).join('\n') : 'None in progress.'}
|
|
124
|
+
${activeFeatures.length ? activeFeatures.map(f => `- [ ] ${f}`).join('\n') : 'No features in progress.'}
|
|
89
125
|
|
|
90
|
-
##
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
126
|
+
## Recent Ideas
|
|
127
|
+
|
|
128
|
+
${recentIdeas.length ? recentIdeas.map(i => `- ${i}`).join('\n') : 'No recent ideas.'}
|
|
129
|
+
|
|
130
|
+
## Git Activity
|
|
131
|
+
|
|
132
|
+
${gitStats.recentCommits?.length ? gitStats.recentCommits.map(c => `- \`${c.hash}\` ${c.message}`).join('\n') : 'No recent commits.'}
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Deep Dive (Read When Needed)
|
|
137
|
+
|
|
138
|
+
For detailed information, read these files:
|
|
139
|
+
- \`~/.prjct-cli/projects/${projectId}/agents/*.md\` - Full agent templates with code patterns
|
|
140
|
+
- \`~/.prjct-cli/projects/${projectId}/analysis/repo-summary.md\` - Complete technical analysis
|
|
141
|
+
- \`~/.prjct-cli/projects/${projectId}/planning/roadmap.md\` - Full feature roadmap
|
|
142
|
+
- \`~/.prjct-cli/projects/${projectId}/memory/context.jsonl\` - Decision history
|
|
95
143
|
`
|
|
96
144
|
|
|
97
|
-
//
|
|
145
|
+
// 11. Write to global storage
|
|
98
146
|
const contextPath = path.join(globalPath, 'CLAUDE.md')
|
|
99
147
|
await fs.writeFile(contextPath, content, 'utf-8')
|
|
100
148
|
|
|
101
|
-
return { agents, stack, currentTask }
|
|
149
|
+
return { agents: agentFiles.map(f => f.replace('.md', '')), stack: stackInfo, currentTask }
|
|
102
150
|
}
|
|
103
151
|
|
|
104
152
|
/**
|
|
105
|
-
* Extract stack from repo-summary
|
|
153
|
+
* Extract FULL stack info from repo-summary
|
|
106
154
|
*/
|
|
107
|
-
function
|
|
108
|
-
if (!summary) return null
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
function extractFullStack(summary) {
|
|
156
|
+
if (!summary) return { primary: null, full: null }
|
|
157
|
+
|
|
158
|
+
const result = { primary: null, full: null, languages: [], frameworks: [], dependencies: [] }
|
|
159
|
+
|
|
160
|
+
// Extract languages (e.g., "### JavaScript/TypeScript")
|
|
161
|
+
const langMatch = summary.match(/###\s*(JavaScript|TypeScript|Python|Go|Rust|Ruby|Java|C#|PHP)/i)
|
|
162
|
+
if (langMatch) result.primary = langMatch[1]
|
|
163
|
+
|
|
164
|
+
// Extract dependencies
|
|
165
|
+
const depsMatch = summary.match(/\*\*Dependencies\*\*:\s*([^\n]+)/i)
|
|
166
|
+
if (depsMatch) result.dependencies = depsMatch[1].split(',').map(d => d.trim())
|
|
167
|
+
|
|
168
|
+
// Extract full stack section (between ## Stack Detected and next ##)
|
|
169
|
+
const stackSection = summary.match(/## Stack Detected\n([\s\S]*?)(?=\n## |$)/i)
|
|
170
|
+
if (stackSection && stackSection[1]) {
|
|
171
|
+
result.full = stackSection[1].trim()
|
|
120
172
|
}
|
|
121
173
|
|
|
122
|
-
return
|
|
174
|
+
return result
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Extract project structure from repo-summary
|
|
179
|
+
*/
|
|
180
|
+
function extractProjectStructure(summary) {
|
|
181
|
+
if (!summary) return { fileCount: null, directories: [] }
|
|
182
|
+
|
|
183
|
+
const result = { fileCount: null, directories: [] }
|
|
184
|
+
|
|
185
|
+
// Extract file count
|
|
186
|
+
const fileMatch = summary.match(/\*\*Total Files\*\*:\s*(\d+)/i)
|
|
187
|
+
if (fileMatch) result.fileCount = parseInt(fileMatch[1])
|
|
188
|
+
|
|
189
|
+
// Extract directories
|
|
190
|
+
const dirMatch = summary.match(/\*\*Directories\*\*:\s*([^\n]+)/i)
|
|
191
|
+
if (dirMatch) result.directories = dirMatch[1].split(',').map(d => d.trim())
|
|
192
|
+
|
|
193
|
+
return result
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Extract git stats from repo-summary
|
|
198
|
+
*/
|
|
199
|
+
function extractGitStats(summary) {
|
|
200
|
+
if (!summary) return { commits: null, contributors: null, recentCommits: [] }
|
|
201
|
+
|
|
202
|
+
const result = { commits: null, contributors: null, recentCommits: [] }
|
|
203
|
+
|
|
204
|
+
// Extract commit count
|
|
205
|
+
const commitMatch = summary.match(/\*\*Total Commits\*\*:\s*(\d+)/i)
|
|
206
|
+
if (commitMatch) result.commits = parseInt(commitMatch[1])
|
|
207
|
+
|
|
208
|
+
// Extract contributors
|
|
209
|
+
const contribMatch = summary.match(/\*\*Contributors\*\*:\s*(\d+)/i)
|
|
210
|
+
if (contribMatch) result.contributors = parseInt(contribMatch[1])
|
|
211
|
+
|
|
212
|
+
// Extract recent commits
|
|
213
|
+
const recentSection = summary.match(/## Recent Activity[\s\S]*?(?=##|$)/i)
|
|
214
|
+
if (recentSection) {
|
|
215
|
+
const commitLines = recentSection[0].match(/- `([a-f0-9]+)` (.+?) \(/g)
|
|
216
|
+
if (commitLines) {
|
|
217
|
+
result.recentCommits = commitLines.slice(0, 5).map(line => {
|
|
218
|
+
const match = line.match(/- `([a-f0-9]+)` (.+?) \(/)
|
|
219
|
+
return match ? { hash: match[1], message: match[2] } : null
|
|
220
|
+
}).filter(Boolean)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return result
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Extract agent expertise from agent files
|
|
229
|
+
*/
|
|
230
|
+
async function extractAgentExpertise(agentsDir, agentFiles) {
|
|
231
|
+
const expertise = []
|
|
232
|
+
|
|
233
|
+
for (const file of agentFiles.slice(0, 6)) { // Max 6 agents to keep context small
|
|
234
|
+
try {
|
|
235
|
+
const content = await fs.readFile(path.join(agentsDir, file), 'utf-8')
|
|
236
|
+
const name = file.replace('.md', '')
|
|
237
|
+
|
|
238
|
+
// Extract role
|
|
239
|
+
const roleMatch = content.match(/Role:\s*([^\n]+)/i)
|
|
240
|
+
const role = roleMatch ? roleMatch[1].trim() : 'Specialist'
|
|
241
|
+
|
|
242
|
+
// Extract domain or expertise
|
|
243
|
+
const domainMatch = content.match(/domain[:\s]+([^\n]+)/i) ||
|
|
244
|
+
content.match(/expertise[:\s]+([^\n]+)/i) ||
|
|
245
|
+
content.match(/owner of the ([^\n.]+)/i)
|
|
246
|
+
const expertiseText = domainMatch ? domainMatch[1].trim() : 'General'
|
|
247
|
+
|
|
248
|
+
expertise.push({ name, role, expertise: expertiseText })
|
|
249
|
+
} catch {
|
|
250
|
+
// Skip unreadable agents
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return expertise
|
|
123
255
|
}
|
|
124
256
|
|
|
125
257
|
/**
|
|
@@ -128,11 +260,10 @@ function extractStack(summary) {
|
|
|
128
260
|
function extractCurrentTask(now) {
|
|
129
261
|
if (!now) return null
|
|
130
262
|
|
|
131
|
-
// Skip headers and empty lines, get first content line
|
|
132
263
|
const lines = now.split('\n')
|
|
133
264
|
for (const line of lines) {
|
|
134
265
|
const trimmed = line.trim()
|
|
135
|
-
if (trimmed && !trimmed.startsWith('#') && !trimmed.startsWith('<!--')) {
|
|
266
|
+
if (trimmed && !trimmed.startsWith('#') && !trimmed.startsWith('<!--') && !trimmed.startsWith('No current')) {
|
|
136
267
|
return trimmed
|
|
137
268
|
}
|
|
138
269
|
}
|
|
@@ -164,20 +295,34 @@ function extractActiveFeatures(roadmap) {
|
|
|
164
295
|
let inActive = false
|
|
165
296
|
|
|
166
297
|
for (const line of lines) {
|
|
167
|
-
if (line.includes('Active') || line.includes('In Progress')) {
|
|
298
|
+
if (line.includes('Active') || line.includes('In Progress') || line.includes('Current')) {
|
|
168
299
|
inActive = true
|
|
169
300
|
continue
|
|
170
301
|
}
|
|
171
302
|
if (line.startsWith('## ') && inActive) {
|
|
172
|
-
break
|
|
303
|
+
break
|
|
173
304
|
}
|
|
174
|
-
if (inActive && line.match(
|
|
175
|
-
const feature = line.replace(
|
|
305
|
+
if (inActive && line.match(/^[-*]\s*\[[ x]\]/i)) {
|
|
306
|
+
const feature = line.replace(/^[-*]\s*\[[ x]\]\s*/, '').replace(/\*\*/g, '').trim()
|
|
176
307
|
if (feature) features.push(feature)
|
|
177
308
|
}
|
|
178
309
|
}
|
|
179
310
|
|
|
180
|
-
return features.slice(0,
|
|
311
|
+
return features.slice(0, 5)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Extract recent ideas from ideas.md
|
|
316
|
+
*/
|
|
317
|
+
function extractRecentIdeas(ideas) {
|
|
318
|
+
if (!ideas) return []
|
|
319
|
+
|
|
320
|
+
return ideas
|
|
321
|
+
.split('\n')
|
|
322
|
+
.filter(l => l.match(/^[-*]\s/))
|
|
323
|
+
.slice(0, 3)
|
|
324
|
+
.map(l => l.replace(/^[-*]\s+/, '').trim())
|
|
325
|
+
.filter(Boolean)
|
|
181
326
|
}
|
|
182
327
|
|
|
183
328
|
module.exports = { generateLocalContext }
|
package/package.json
CHANGED
|
@@ -5,22 +5,92 @@ This section provides global context for all `/p:*` commands across any prjct pr
|
|
|
5
5
|
|
|
6
6
|
**Auto-managed by prjct-cli** - This section is automatically updated when you install or update prjct.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## 🚀 Quick Command Reference
|
|
9
|
+
|
|
10
|
+
| Command | Purpose | Example |
|
|
11
|
+
|---------|---------|---------|
|
|
12
|
+
| `/p:sync` | Analyze project & generate agents | Run first in any project |
|
|
13
|
+
| `/p:now [task]` | Set current focus | `/p:now "implement auth"` |
|
|
14
|
+
| `/p:done` | Complete current task | After finishing work |
|
|
15
|
+
| `/p:next` | Show priority queue | See what's pending |
|
|
16
|
+
| `/p:ship [feature]` | Ship & celebrate | `/p:ship "user login"` |
|
|
17
|
+
| `/p:feature [desc]` | Add feature to roadmap | `/p:feature "dark mode"` |
|
|
18
|
+
| `/p:idea [text]` | Quick idea capture | `/p:idea "add caching"` |
|
|
19
|
+
| `/p:recap` | Project overview | Status check |
|
|
20
|
+
| `/p:progress` | Show metrics | Weekly/monthly stats |
|
|
21
|
+
|
|
22
|
+
## 🎯 Recommended Workflow
|
|
9
23
|
|
|
10
|
-
|
|
24
|
+
```
|
|
25
|
+
1. /p:sync → Analyze project, generate agents
|
|
26
|
+
2. /p:feature → Plan what to build
|
|
27
|
+
3. /p:now → Start working
|
|
28
|
+
4. [code...] → Do the actual work
|
|
29
|
+
5. /p:done → Mark complete
|
|
30
|
+
6. /p:ship → Celebrate & commit
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 🤖 Project Context (CRITICAL)
|
|
34
|
+
|
|
35
|
+
**BEFORE working on any prjct project, READ the project context:**
|
|
36
|
+
|
|
37
|
+
1. Read `.prjct/prjct.config.json` → get `projectId`
|
|
38
|
+
2. Read `~/.prjct-cli/projects/{projectId}/CLAUDE.md` → dynamic project context
|
|
39
|
+
|
|
40
|
+
The project CLAUDE.md contains:
|
|
41
|
+
- Tech stack (languages, frameworks, dependencies)
|
|
42
|
+
- Project structure (directories)
|
|
43
|
+
- Available agents with their expertise
|
|
44
|
+
- Current task and priority queue
|
|
45
|
+
- Recent git activity
|
|
46
|
+
- Active roadmap features
|
|
47
|
+
|
|
48
|
+
**If CLAUDE.md doesn't exist**: Suggest running `/p:sync` to generate it.
|
|
49
|
+
|
|
50
|
+
## 📋 Common Usage Patterns
|
|
51
|
+
|
|
52
|
+
### Starting Work on a Project
|
|
53
|
+
```
|
|
54
|
+
User: "p. sync"
|
|
55
|
+
→ Analyze repo, generate agents, create context
|
|
56
|
+
→ Now Claude knows: stack, structure, agents available
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Adding a New Feature
|
|
60
|
+
```
|
|
61
|
+
User: "p. feature add user authentication"
|
|
62
|
+
→ Creates roadmap entry with tasks
|
|
63
|
+
→ Analyzes impact and effort
|
|
64
|
+
→ Suggests starting first task
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Daily Development Flow
|
|
68
|
+
```
|
|
69
|
+
User: "p. now implement login form"
|
|
70
|
+
→ Sets current focus
|
|
71
|
+
→ [User works on code]
|
|
72
|
+
User: "p. done"
|
|
73
|
+
→ Marks complete, suggests next task
|
|
74
|
+
User: "p. ship authentication"
|
|
75
|
+
→ Commits, celebrates, updates metrics
|
|
76
|
+
```
|
|
11
77
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
78
|
+
### Quick Idea Capture
|
|
79
|
+
```
|
|
80
|
+
User: "p. idea we should add dark mode later"
|
|
81
|
+
→ Saves to ideas.md
|
|
82
|
+
→ Doesn't interrupt current work
|
|
83
|
+
```
|
|
15
84
|
|
|
16
|
-
|
|
17
|
-
- Stack detectado del proyecto
|
|
18
|
-
- Agentes disponibles (varían por proyecto)
|
|
19
|
-
- Tarea actual
|
|
20
|
-
- Cola de prioridades
|
|
21
|
-
- Rutas a documentación detallada
|
|
85
|
+
## ⚠️ Anti-Patterns (What NOT to Do)
|
|
22
86
|
|
|
23
|
-
|
|
87
|
+
| ❌ Don't | ✅ Do Instead |
|
|
88
|
+
|----------|---------------|
|
|
89
|
+
| Write to `.prjct/` folder | Write to `~/.prjct-cli/projects/{id}/` |
|
|
90
|
+
| Skip reading project context | Always read CLAUDE.md first |
|
|
91
|
+
| Execute without projectId | Check `.prjct/prjct.config.json` exists |
|
|
92
|
+
| Hardcode file paths | Use projectId to construct paths |
|
|
93
|
+
| Ignore agents | Use specialized agents for their domains |
|
|
24
94
|
|
|
25
95
|
## 🎯 Path Resolution for ALL /p:* Commands
|
|
26
96
|
|
|
@@ -28,10 +98,10 @@ El archivo `CLAUDE.md` del proyecto contiene:
|
|
|
28
98
|
|
|
29
99
|
### Resolution Steps:
|
|
30
100
|
|
|
31
|
-
1. **Detect prjct project**: Check if `.prjct/prjct.config.json` exists
|
|
32
|
-
2. **Read config**: Extract `projectId` from
|
|
101
|
+
1. **Detect prjct project**: Check if `.prjct/prjct.config.json` exists
|
|
102
|
+
2. **Read config**: Extract `projectId` from config
|
|
33
103
|
3. **Construct base path**: `~/.prjct-cli/projects/{projectId}/`
|
|
34
|
-
4. **Resolve all file operations**:
|
|
104
|
+
4. **Resolve all file operations**: Paths are relative to base path
|
|
35
105
|
|
|
36
106
|
### Examples:
|
|
37
107
|
|
|
@@ -41,75 +111,61 @@ Actual path: ~/.prjct-cli/projects/{projectId}/core/now.md
|
|
|
41
111
|
|
|
42
112
|
Template says: "Read: memory/context.jsonl"
|
|
43
113
|
Actual path: ~/.prjct-cli/projects/{projectId}/memory/context.jsonl
|
|
44
|
-
|
|
45
|
-
Template says: "Update: progress/shipped.md"
|
|
46
|
-
Actual path: ~/.prjct-cli/projects/{projectId}/progress/shipped.md
|
|
47
114
|
```
|
|
48
115
|
|
|
49
116
|
### Validation Rules:
|
|
50
117
|
|
|
51
118
|
- ❌ **NEVER** write to `.prjct/core/now.md` (local project directory)
|
|
52
119
|
- ❌ **NEVER** write to `./core/now.md` (current working directory)
|
|
53
|
-
- ✅ **ALWAYS** write to `~/.prjct-cli/projects/{projectId}/core/now.md`
|
|
120
|
+
- ✅ **ALWAYS** write to `~/.prjct-cli/projects/{projectId}/core/now.md`
|
|
54
121
|
|
|
55
122
|
### When NOT in prjct Project:
|
|
56
123
|
|
|
57
|
-
If `.prjct/prjct.config.json` doesn't exist
|
|
124
|
+
If `.prjct/prjct.config.json` doesn't exist:
|
|
58
125
|
- Respond: "No prjct project detected. Initialize first with `/p:init`"
|
|
59
126
|
- Do NOT execute the command
|
|
60
127
|
- Do NOT create files
|
|
61
128
|
|
|
62
129
|
## 📁 File Structure
|
|
63
130
|
|
|
64
|
-
All prjct data lives in global storage
|
|
131
|
+
All prjct data lives in global storage:
|
|
65
132
|
|
|
66
133
|
```
|
|
67
134
|
~/.prjct-cli/projects/{projectId}/
|
|
68
|
-
├──
|
|
69
|
-
|
|
70
|
-
│ ├──
|
|
71
|
-
│ └──
|
|
72
|
-
├── progress/
|
|
73
|
-
│ ├── shipped.md
|
|
74
|
-
│
|
|
75
|
-
|
|
76
|
-
│
|
|
77
|
-
│
|
|
78
|
-
|
|
79
|
-
│
|
|
80
|
-
├──
|
|
81
|
-
│
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Session Format (JSONL):
|
|
105
|
-
|
|
106
|
-
One JSON object per line, append-only:
|
|
107
|
-
|
|
108
|
-
```jsonl
|
|
109
|
-
{"ts":"2025-10-05T14:30:00Z","type":"feature_add","name":"auth","tasks":5,"impact":"high","effort":"6h"}
|
|
110
|
-
{"ts":"2025-10-05T15:00:00Z","type":"task_start","task":"JWT middleware","agent":"be","estimate":"2h"}
|
|
111
|
-
{"ts":"2025-10-05T17:15:00Z","type":"task_complete","task":"JWT middleware","duration":"2h15m"}
|
|
112
|
-
{"ts":"2025-10-05T18:00:00Z","type":"feature_ship","name":"auth","tasks_done":5,"total_time":"6h"}
|
|
135
|
+
├── CLAUDE.md # ⭐ READ THIS FIRST - Rich project context
|
|
136
|
+
├── core/ # Current focus
|
|
137
|
+
│ ├── now.md # Single current task
|
|
138
|
+
│ └── next.md # Priority queue
|
|
139
|
+
├── progress/ # Completed work
|
|
140
|
+
│ ├── shipped.md # Recent ships
|
|
141
|
+
│ └── metrics.md # Aggregated metrics
|
|
142
|
+
├── planning/ # Future planning
|
|
143
|
+
│ ├── ideas.md # Quick ideas
|
|
144
|
+
│ └── roadmap.md # Feature roadmap
|
|
145
|
+
├── analysis/ # Technical analysis
|
|
146
|
+
│ └── repo-summary.md # Full repo analysis
|
|
147
|
+
├── memory/ # Decision history
|
|
148
|
+
│ └── context.jsonl # Append-only log
|
|
149
|
+
└── agents/ # ⭐ Specialized AI agents
|
|
150
|
+
├── fe.md # Frontend specialist
|
|
151
|
+
├── be.md # Backend specialist
|
|
152
|
+
└── ... # More based on stack
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 🤖 Using Agents Effectively
|
|
156
|
+
|
|
157
|
+
When project has specialized agents:
|
|
158
|
+
|
|
159
|
+
1. **Read agent file** before working in that domain
|
|
160
|
+
2. **Follow agent patterns** for code style and architecture
|
|
161
|
+
3. **Agent expertise** is in CLAUDE.md summary
|
|
162
|
+
|
|
163
|
+
Example:
|
|
164
|
+
```
|
|
165
|
+
Task: "implement React component"
|
|
166
|
+
→ Check CLAUDE.md for frontend agent
|
|
167
|
+
→ Read agents/fe.md for React patterns
|
|
168
|
+
→ Follow detected conventions
|
|
113
169
|
```
|
|
114
170
|
|
|
115
171
|
## 🤖 Git Commit Format
|
|
@@ -125,107 +181,53 @@ Designed for [Claude](https://www.anthropic.com/claude)
|
|
|
125
181
|
- ❌ "Generated with Claude Code"
|
|
126
182
|
- ❌ "Co-Authored-By: Claude"
|
|
127
183
|
|
|
128
|
-
**Always use:**
|
|
129
|
-
- ✅ The prjct footer format above
|
|
130
|
-
|
|
131
|
-
## 👤 Author Detection
|
|
132
|
-
|
|
133
|
-
All operations include author information. Detection order:
|
|
134
|
-
|
|
135
|
-
1. **GitHub CLI**: `gh api user` (preferred)
|
|
136
|
-
- Provides: name, email, username, avatarUrl
|
|
137
|
-
2. **Git Config**: Fallback if GitHub CLI not available
|
|
138
|
-
- `git config user.name`
|
|
139
|
-
- `git config user.email`
|
|
140
|
-
3. **Default**: If both fail
|
|
141
|
-
- name: "Unknown"
|
|
142
|
-
- email: "unknown@localhost"
|
|
143
|
-
|
|
144
|
-
Every log entry in `memory/context.jsonl` includes author field.
|
|
145
|
-
|
|
146
184
|
## ⚠️ Common Validation Patterns
|
|
147
185
|
|
|
148
|
-
### Before
|
|
186
|
+
### Before /p:done:
|
|
149
187
|
```javascript
|
|
150
|
-
// Check if there's an active task
|
|
151
188
|
const nowContent = await Read('~/.prjct-cli/projects/{projectId}/core/now.md')
|
|
152
189
|
if (!nowContent || nowContent.trim() === '') {
|
|
153
190
|
return "Not working on anything. Use /p:now to start a task."
|
|
154
191
|
}
|
|
155
192
|
```
|
|
156
193
|
|
|
157
|
-
### Before
|
|
194
|
+
### Before /p:ship:
|
|
158
195
|
```javascript
|
|
159
|
-
// Check if there's something to ship
|
|
160
|
-
const shippedContent = await Read('~/.prjct-cli/projects/{projectId}/progress/shipped.md')
|
|
161
196
|
const nowContent = await Read('~/.prjct-cli/projects/{projectId}/core/now.md')
|
|
162
|
-
if (
|
|
163
|
-
(!shippedContent || shippedContent.trim() === '')) {
|
|
197
|
+
if (!nowContent || nowContent.trim() === '') {
|
|
164
198
|
return "Nothing to ship yet. Build something first with /p:now."
|
|
165
199
|
}
|
|
166
200
|
```
|
|
167
201
|
|
|
168
|
-
### Reading Project Config:
|
|
169
|
-
```javascript
|
|
170
|
-
// Always read config first
|
|
171
|
-
const configPath = '.prjct/prjct.config.json'
|
|
172
|
-
const configContent = await Read(configPath)
|
|
173
|
-
const config = JSON.parse(configContent)
|
|
174
|
-
const projectId = config.projectId
|
|
175
|
-
const basePath = `~/.prjct-cli/projects/${projectId}/`
|
|
176
|
-
```
|
|
177
|
-
|
|
178
202
|
## 🔧 Error Handling
|
|
179
203
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
- If config file is corrupted → suggest running `/p:init` again
|
|
187
|
-
- Log error to `memory/context.jsonl` for debugging
|
|
188
|
-
|
|
189
|
-
### Permission Issues:
|
|
190
|
-
- If can't write to `~/.prjct-cli/` → check directory permissions
|
|
191
|
-
- Suggest: `chmod -R u+w ~/.prjct-cli/`
|
|
192
|
-
|
|
193
|
-
## 📊 Performance Guidelines
|
|
194
|
-
|
|
195
|
-
### Archive Rules:
|
|
196
|
-
- Index files (roadmap.md, shipped.md) keep only last 30 days
|
|
197
|
-
- Sessions older than 30 days → automatically moved to archive/
|
|
198
|
-
- When querying across time: read relevant session files from archive/
|
|
199
|
-
- Commands only read current index + today's session for performance
|
|
200
|
-
|
|
201
|
-
### File Size Limits:
|
|
202
|
-
- `core/now.md`: Single task only (< 1KB)
|
|
203
|
-
- `core/next.md`: Max 100 tasks (< 50KB)
|
|
204
|
-
- `progress/shipped.md`: Last 30 days only (auto-archive older)
|
|
205
|
-
- Session files: One file per day, JSONL format for efficient appending
|
|
204
|
+
| Error | Solution |
|
|
205
|
+
|-------|----------|
|
|
206
|
+
| File not found | Return empty state, don't fail |
|
|
207
|
+
| Invalid JSON config | Suggest `/p:init` again |
|
|
208
|
+
| Permission denied | Suggest `chmod -R u+w ~/.prjct-cli/` |
|
|
209
|
+
| No project detected | Suggest `/p:init` |
|
|
206
210
|
|
|
207
211
|
## 🎯 Command Execution Flow
|
|
208
212
|
|
|
209
213
|
Standard pattern for all `/p:*` commands:
|
|
210
214
|
|
|
211
|
-
1. **Validate
|
|
215
|
+
1. **Validate**: Check `.prjct/prjct.config.json` exists
|
|
212
216
|
2. **Read config**: Extract projectId
|
|
213
|
-
3. **
|
|
214
|
-
4. **Execute
|
|
215
|
-
5. **Log
|
|
216
|
-
6. **
|
|
217
|
+
3. **Read context**: Load `~/.prjct-cli/projects/{id}/CLAUDE.md`
|
|
218
|
+
4. **Execute**: Read/write files in global storage
|
|
219
|
+
5. **Log**: Append to `memory/context.jsonl`
|
|
220
|
+
6. **Respond**: Formatted response with next action suggestions
|
|
217
221
|
|
|
218
222
|
## 📚 Additional Context
|
|
219
223
|
|
|
220
224
|
- **Website**: https://prjct.app
|
|
221
225
|
- **Documentation**: https://prjct.app/docs
|
|
222
|
-
- **Repository**: Private (proprietary software)
|
|
223
226
|
- **Support**: jlopezlira@gmail.com
|
|
224
|
-
- **Version**: Auto-updated with prjct-cli
|
|
225
227
|
|
|
226
228
|
---
|
|
227
229
|
|
|
228
230
|
**Last updated**: Auto-managed by prjct-cli
|
|
229
|
-
**Config version**: 0.
|
|
231
|
+
**Config version**: 0.10.5
|
|
230
232
|
|
|
231
233
|
<!-- prjct:end - DO NOT REMOVE THIS MARKER -->
|