prjct-cli 0.28.2 → 0.28.4

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 (33) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/core/agentic/index.ts +11 -1
  3. package/core/agentic/memory-system.ts +44 -5
  4. package/core/agentic/smart-context.ts +36 -64
  5. package/core/agentic/token-estimator.ts +264 -0
  6. package/core/infrastructure/path-manager.ts +7 -7
  7. package/core/infrastructure/setup.ts +28 -0
  8. package/core/infrastructure/slash-command-registry.ts +176 -0
  9. package/core/types/integrations.ts +28 -1
  10. package/package.json +1 -1
  11. package/templates/agentic/subagent-generation.md +237 -90
  12. package/templates/commands/bug.md +51 -392
  13. package/templates/commands/done.md +53 -232
  14. package/templates/commands/setup-statusline.md +138 -0
  15. package/templates/commands/ship.md +86 -668
  16. package/templates/commands/sync.md +189 -552
  17. package/templates/commands/task.md +50 -276
  18. package/templates/global/CLAUDE.md +101 -161
  19. package/templates/guides/agent-generation.md +164 -0
  20. package/templates/guides/claude-code-ux.md +232 -0
  21. package/templates/guides/integrations.md +149 -0
  22. package/templates/mcp-config.json +23 -18
  23. package/templates/shared/git-operations.md +68 -0
  24. package/templates/shared/io-patterns.md +72 -0
  25. package/templates/shared/standard.md +70 -0
  26. package/templates/shared/validation.md +75 -0
  27. package/CLAUDE.md +0 -204
  28. package/templates/agentic/agents/uxui.md +0 -218
  29. package/templates/subagents/domain/backend.md +0 -106
  30. package/templates/subagents/domain/database.md +0 -118
  31. package/templates/subagents/domain/devops.md +0 -149
  32. package/templates/subagents/domain/frontend.md +0 -100
  33. package/templates/subagents/domain/testing.md +0 -166
@@ -11,7 +11,20 @@ backend-sync: 'sync/pending.json'
11
11
 
12
12
  # /p:sync - Deep Project Sync
13
13
 
14
- **CRITICAL**: This is a DEEP analysis. Sync EVERYTHING with the real state of the repository.
14
+ **PERFORMANCE**: Use parallel operations wherever possible. This sync should complete in <30 seconds.
15
+
16
+ ## Parallelization Strategy
17
+
18
+ | Phase | Operations | Parallel? |
19
+ |-------|------------|-----------|
20
+ | Git + Stats | git commands, package.json read | ✅ Yes |
21
+ | Storage Read | state, queue, ideas, shipped | ✅ Yes |
22
+ | Context Write | now, next, ideas, shipped, CLAUDE.md | ✅ Yes |
23
+ | Agent Gen | workflow agents, domain agents | ✅ Yes |
24
+
25
+ **CRITICAL**: Batch all Read/Write operations. Never do sequential reads when parallel is possible.
26
+
27
+ ---
15
28
 
16
29
  ## Architecture: Write-Through Pattern
17
30
 
@@ -101,285 +114,112 @@ IF file not found:
101
114
 
102
115
  ---
103
116
 
104
- ## Step 2: Deep Git Analysis
117
+ ## Step 2: Git Analysis (PARALLEL)
105
118
 
106
- ### 2.1 Git Status (Uncommitted Work)
107
- ```bash
108
- git status --porcelain
109
- ```
110
-
111
- EXTRACT:
112
- - `{stagedFiles}`: Files staged for commit
113
- - `{modifiedFiles}`: Modified but not staged
114
- - `{untrackedFiles}`: New files
115
- - `{hasUncommittedChanges}`: true/false
119
+ **Run ALL git commands in a single parallel batch:**
116
120
 
117
- ### 2.2 Recent Commits (Last 20)
118
121
  ```bash
119
- git log --oneline -20 --pretty=format:"%h|%s|%ad" --date=short
120
- ```
121
-
122
- ANALYZE each commit for completed tasks.
123
-
124
- EXTRACT: `{completedTasks}` - List of tasks found in commits
125
-
126
- ### 2.3 Current Branch Analysis
127
- ```bash
128
- git branch --show-current
129
- git log main..HEAD --oneline 2>/dev/null
122
+ # Run in parallel (single Bash call with &&)
123
+ git status --porcelain && \
124
+ git log --oneline -10 --pretty=format:"%h|%s" && \
125
+ git branch --show-current && \
126
+ git rev-list --count HEAD
130
127
  ```
131
128
 
132
- EXTRACT:
133
- - `{currentBranch}`: Current branch name
134
- - `{branchCommits}`: Commits ahead of main
129
+ EXTRACT from combined output:
130
+ - `{stagedFiles}`, `{modifiedFiles}`, `{untrackedFiles}`, `{hasUncommittedChanges}`
131
+ - `{recentCommits}`: Last 10 commits (reduced from 20)
132
+ - `{currentBranch}`, `{commitCount}`
135
133
  - `{isFeatureBranch}`: true if not main/master
136
134
 
137
135
  ---
138
136
 
139
- ## Step 3: Gather Project Stats
140
-
141
- ### Count Files
142
- ```bash
143
- find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.tsx" -o -name "*.py" \) -not -path "./node_modules/*" -not -path "./.git/*" | wc -l
144
- ```
145
- EXTRACT: `{fileCount}`
146
-
147
- ### Count Commits
148
- ```bash
149
- git rev-list --count HEAD
150
- ```
151
- EXTRACT: `{commitCount}`
152
-
153
- ### Get Version
154
- READ: `package.json` → version field
155
- EXTRACT: `{version}`
156
-
157
- ### Get Project Name
158
- READ: `package.json` → name field OR directory name
159
- EXTRACT: `{projectName}`
160
-
161
- ### Detect Stack
162
- GLOB for config files and analyze:
163
- - `package.json` → Node.js, detect React/Vue/Express/Next.js
164
- - `Cargo.toml` → Rust
165
- - `go.mod` → Go
166
- - `requirements.txt` / `pyproject.toml` → Python
167
-
168
- EXTRACT: `{languages}`, `{frameworks}`, `{techStack}`
169
-
170
- ### Detect Frontend/UI Stack (for UX/UI Agent)
171
-
172
- **CRITICAL**: If ANY frontend technology is detected, generate the UX/UI agent.
173
-
174
- #### Web Frontend Detection
175
- ```bash
176
- # Check package.json for web frameworks
177
- grep -E '"(react|react-dom|next|vue|nuxt|svelte|@sveltejs/kit|@angular/core)"' package.json 2>/dev/null
178
- ```
179
-
180
- SET: `{hasWebFrontend}` = true if any match
181
-
182
- #### Mobile Frontend Detection
183
- ```bash
184
- # React Native / Expo
185
- grep -E '"(react-native|expo)"' package.json 2>/dev/null
186
-
187
- # Flutter
188
- test -f pubspec.yaml && echo "flutter"
189
-
190
- # SwiftUI (iOS)
191
- find . -name "*.swift" -exec grep -l "import SwiftUI" {} \; 2>/dev/null | head -1
192
-
193
- # Jetpack Compose (Android)
194
- find . -name "*.kt" -exec grep -l "androidx.compose" {} \; 2>/dev/null | head -1
195
- ```
196
-
197
- SET: `{hasMobileFrontend}` = true if any match
137
+ ## Step 3: Project Stats (FAST)
198
138
 
199
- #### Combined Frontend Flag
200
- ```
201
- {hasFrontendUI} = {hasWebFrontend} OR {hasMobileFrontend}
202
- ```
139
+ **Use Glob tool instead of find - much faster:**
203
140
 
204
- EXTRACT: `{frontendType}` = "web" | "mobile" | "both" | null
205
-
206
- ---
141
+ ### 3.1 Quick Stats (Single Read)
207
142
 
208
- ## Step 3.5: Deep Project Analysis (TRULY AGENTIC)
143
+ READ: `package.json` extract `name`, `version`, `dependencies`, `devDependencies`, `scripts`
209
144
 
210
- **CRITICAL: Do NOT follow hardcoded rules. ANALYZE the actual project and UNDERSTAND what it is.**
145
+ From dependencies, detect:
146
+ - `{techStack}`: react, vue, express, etc.
147
+ - `{hasWebFrontend}`: react|vue|svelte|next in deps
148
+ - `{hasMobileFrontend}`: react-native|expo in deps
211
149
 
212
- ### 3.5.1 Detect Project Type (AGENTIC)
150
+ SET: `{projectName}` = package.name OR directory name
151
+ SET: `{version}` = package.version
213
152
 
214
- **Look at the project root and DETERMINE what kind of project this is:**
153
+ ### 3.2 File Count (Use Glob, NOT find)
215
154
 
216
- ```bash
217
- ls -la
218
155
  ```
219
-
220
- ANALYZE what files exist and REASON about the project type:
221
-
222
- | If you see... | Project is... | Ecosystem |
223
- |---------------|---------------|-----------|
224
- | `Gemfile` | Ruby/Rails | Ruby |
225
- | `requirements.txt`, `pyproject.toml`, `setup.py` | Python | Python |
226
- | `go.mod` | Go | Go |
227
- | `Cargo.toml` | Rust | Rust |
228
- | `composer.json` | PHP | PHP |
229
- | `pom.xml`, `build.gradle` | Java | JVM |
230
- | `*.csproj`, `*.sln` | .NET/C# | .NET |
231
- | `mix.exs` | Elixir | Elixir |
232
- | `Package.swift` | Swift | Apple |
233
- | `package.json` | Node.js/JavaScript | JavaScript |
234
- | `pubspec.yaml` | Flutter/Dart | Dart |
235
- | `Makefile` only | C/C++ or custom | Native |
236
-
237
- SET: `{ecosystem}` = detected ecosystem
238
- SET: `{projectType}` = specific type (e.g., "Rails", "Django", "Next.js", "Go API")
239
-
240
- ### 3.5.2 Detect Commands FOR THIS PROJECT (AGENTIC)
241
-
242
- **Based on the ecosystem, LOOK for the actual commands this project uses:**
243
-
244
- #### Ruby/Rails
245
- ```bash
246
- cat Gemfile | head -20 # See dependencies
247
- test -f bin/rails && echo "rails"
248
- test -f Rakefile && echo "rake"
156
+ GLOB: **/*.{ts,tsx,js,jsx,py,go,rs} (exclude node_modules, .git)
249
157
  ```
250
- → Commands: `bundle install`, `rails s`, `rails c`, `rake db:migrate`, `rspec`
158
+ SET: `{fileCount}` = count of matches
251
159
 
252
- #### Python
253
- ```bash
254
- test -f pyproject.toml && cat pyproject.toml | head -20
255
- test -f requirements.txt && echo "pip"
256
- which poetry && echo "poetry"
257
- which uv && echo "uv"
258
- ```
259
- → Commands: `pip install -r requirements.txt` OR `poetry install` OR `uv sync`
160
+ **NOTE**: commitCount already extracted in Step 2.
260
161
 
261
- #### Go
262
- ```bash
263
- cat go.mod | head -5
264
- ```
265
- → Commands: `go build`, `go test ./...`, `go run .`
162
+ ### 3.3 Detect Ecosystem (Single ls)
266
163
 
267
- #### Rust
268
164
  ```bash
269
- cat Cargo.toml | head -10
165
+ ls package.json bun.lockb pnpm-lock.yaml yarn.lock package-lock.json Cargo.toml go.mod pyproject.toml 2>/dev/null
270
166
  ```
271
- → Commands: `cargo build`, `cargo test`, `cargo run`
272
167
 
273
- #### Node.js/JavaScript
274
- ```bash
275
- # Check lockfile to determine package manager
276
- test -f bun.lockb && echo "bun"
277
- test -f pnpm-lock.yaml && echo "pnpm"
278
- test -f yarn.lock && echo "yarn"
279
- test -f package-lock.json && echo "npm"
280
- cat package.json | grep -A 20 '"scripts"'
281
- ```
282
- → Commands: Use detected package manager + scripts from package.json
168
+ | Found | Ecosystem | Package Manager |
169
+ |-------|-----------|-----------------|
170
+ | `bun.lockb` | JavaScript | bun |
171
+ | `pnpm-lock.yaml` | JavaScript | pnpm |
172
+ | `yarn.lock` | JavaScript | yarn |
173
+ | `package-lock.json` | JavaScript | npm |
174
+ | `Cargo.toml` | Rust | cargo |
175
+ | `go.mod` | Go | go |
176
+ | `pyproject.toml` | Python | uv/poetry |
283
177
 
284
- **EXTRACT the actual commands:**
285
- - `{installCommand}` = what installs dependencies
286
- - `{runCommand}` = how to run scripts
287
- - `{testCommand}` = how to run tests
288
- - `{buildCommand}` = how to build
289
- - `{devCommand}` = how to run dev server
178
+ SET: `{ecosystem}`, `{packageManager}`
290
179
 
291
- ### 3.5.3 Detect Code Conventions (AGENTIC)
180
+ ---
292
181
 
293
- **LOOK at actual files to understand patterns:**
182
+ ## Step 3.5: Extract Commands & Conventions
294
183
 
295
- ```bash
296
- # List some source files
297
- find . -type f \( -name "*.rb" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.ts" -o -name "*.js" \) -not -path "*/node_modules/*" -not -path "*/.git/*" | head -10
184
+ **Already have ecosystem from Step 3. Now extract commands from scripts.**
298
185
 
299
- # Check for linters/formatters
300
- ls .rubocop.yml .eslintrc* .prettierrc* pyproject.toml rustfmt.toml .golangci.yml 2>/dev/null
301
- ```
186
+ ### 3.5.1 Extract Commands (from package.json scripts already read)
302
187
 
303
- ANALYZE and DETERMINE:
304
- - `{namingConvention}` = based on actual file names
305
- - `{linter}` = what linter is configured
306
- - `{formatter}` = what formatter is used
188
+ From `package.json.scripts`:
189
+ - `{installCommand}` = `{packageManager} install`
190
+ - `{devCommand}` = scripts.dev || scripts.start
191
+ - `{testCommand}` = scripts.test
192
+ - `{buildCommand}` = scripts.build
193
+ - `{lintCommand}` = scripts.lint
307
194
 
308
- ### 3.5.4 Detect Project Structure (AGENTIC)
195
+ ### 3.5.2 Detect Conventions (Single ls)
309
196
 
310
197
  ```bash
311
- ls -d */ 2>/dev/null | head -10
198
+ ls .eslintrc* .prettierrc* tsconfig.json biome.json .editorconfig 2>/dev/null
312
199
  ```
313
200
 
314
- UNDERSTAND the structure:
315
- - Where is source code?
316
- - Where are tests?
317
- - Is it a monorepo?
318
- - What's the architecture?
319
-
320
- ### 3.5.5 Generate Project-Specific Rules (AGENTIC)
321
-
322
- **Based on YOUR ANALYSIS, generate rules that make sense for THIS project.**
201
+ SET: `{linter}` = eslint|biome, `{formatter}` = prettier|biome
323
202
 
324
- Think: "What does a developer working on this project need to know?"
325
-
326
- Examples:
327
- - Rails project: "Use `bundle exec` for Ruby commands", "Migrations: `rails db:migrate`"
328
- - Python/Poetry: "Use `poetry run` to run commands in venv"
329
- - Go project: "Use `go test ./...` to run all tests"
330
- - Rust project: "Use `cargo fmt` before commits"
331
- - Node/bun: "Use `bun` not npm - this project has bun.lockb"
332
-
333
- ### 3.5.6 Write analysis/repo-analysis.json
334
-
335
- ```bash
336
- mkdir -p {globalPath}/analysis
337
- ```
203
+ ### 3.5.3 Write Analysis
338
204
 
339
205
  WRITE: `{globalPath}/analysis/repo-analysis.json`
340
-
341
206
  ```json
342
- {
343
- "analyzedAt": "{timestamp}",
344
- "ecosystem": "{ecosystem}",
345
- "projectType": "{projectType}",
346
- "commands": {
347
- "install": "{installCommand}",
348
- "run": "{runCommand}",
349
- "test": "{testCommand}",
350
- "build": "{buildCommand}",
351
- "dev": "{devCommand}",
352
- "lint": "{lintCommand}",
353
- "format": "{formatCommand}"
354
- },
355
- "conventions": {
356
- "naming": "{namingConvention}",
357
- "linter": "{linter}",
358
- "formatter": "{formatter}"
359
- },
360
- "structure": {
361
- "srcDir": "{srcDir}",
362
- "testDir": "{testDir}",
363
- "isMonorepo": {isMonorepo}
364
- },
365
- "rules": [
366
- "{rule1 - generated based on analysis}",
367
- "{rule2 - generated based on analysis}",
368
- "..."
369
- ]
370
- }
207
+ {"ecosystem":"{ecosystem}","packageManager":"{packageManager}","commands":{...},"linter":"{linter}"}
371
208
  ```
372
209
 
373
210
  ---
374
211
 
375
- ## Step 4: Regenerate ALL Context Files
212
+ ## Step 4: Regenerate Context Files (PARALLEL READS)
213
+
214
+ ### 4.1 Read ALL Storage (PARALLEL)
376
215
 
377
- ### 4.1 Read Storage (Source of Truth)
216
+ **Read all 4 files in parallel (single tool call batch):**
378
217
 
379
- READ: `{globalPath}/storage/state.json`
380
- READ: `{globalPath}/storage/queue.json`
381
- READ: `{globalPath}/storage/ideas.json`
382
- READ: `{globalPath}/storage/shipped.json`
218
+ READ (parallel):
219
+ - `{globalPath}/storage/state.json` → `{state}`
220
+ - `{globalPath}/storage/queue.json` → `{queue}`
221
+ - `{globalPath}/storage/ideas.json` → `{ideas}`
222
+ - `{globalPath}/storage/shipped.json` → `{shipped}`
383
223
 
384
224
  ### 4.2 Generate context/now.md
385
225
 
@@ -639,6 +479,44 @@ WRITE: `{globalPath}/project.json` (merge with existing, but ALWAYS update these
639
479
 
640
480
  ---
641
481
 
482
+ ## Step 6b: Update Global CLAUDE.md (CRITICAL)
483
+
484
+ **ALWAYS update `~/.claude/CLAUDE.md`** with the latest prjct instructions.
485
+
486
+ This ensures Claude has the newest features and commands available.
487
+
488
+ ### 6b.1 Read Current Global Config
489
+
490
+ READ: `~/.claude/CLAUDE.md`
491
+
492
+ ### 6b.2 Read Template
493
+
494
+ The template is at the prjct-cli install location. For development:
495
+ READ: `templates/global/CLAUDE.md` (from the prjct-cli repo/package)
496
+
497
+ ### 6b.3 Intelligent Merge
498
+
499
+ The file has markers:
500
+ - `<!-- prjct:start - DO NOT REMOVE THIS MARKER -->`
501
+ - `<!-- prjct:end - DO NOT REMOVE THIS MARKER -->`
502
+
503
+ **IF markers exist in ~/.claude/CLAUDE.md:**
504
+ 1. Extract content BEFORE the start marker (user's custom content)
505
+ 2. Extract content AFTER the end marker (user's custom content)
506
+ 3. Replace the section between markers with template content
507
+ 4. Write merged content
508
+
509
+ **IF no markers:**
510
+ 1. Append template content to end of file
511
+
512
+ ### 6b.4 Write Updated Config
513
+
514
+ WRITE: `~/.claude/CLAUDE.md`
515
+
516
+ OUTPUT: "📝 Updated ~/.claude/CLAUDE.md to v{cliVersion}"
517
+
518
+ ---
519
+
642
520
  ## Step 7: Generate Claude Code Sub-Agents (AGENTIC)
643
521
 
644
522
  Generate sub-agents for Claude Code in the GLOBAL storage `{globalPath}/agents/` directory.
@@ -675,240 +553,73 @@ This template contains:
675
553
 
676
554
  ### 7.3 Generate Workflow Agents (ALWAYS)
677
555
 
678
- These 3 agents are ALWAYS created for every prjct project.
679
-
680
- **CRITICAL: Each agent MUST include `agentId` in frontmatter.**
681
-
682
- The `agentId` format is: `p.agent.{name}` where `{name}` is derived from filename without `.md`.
683
-
684
- **prjct-workflow.md** - Handles: /p:now, /p:done, /p:next, /p:pause, /p:resume
685
- READ template: `templates/subagents/workflow/prjct-workflow.md`
686
- ADAPT with: projectId, projectPath
687
- ADD to frontmatter: `agentId: p.agent.workflow`
688
- WRITE to: `{globalPath}/agents/prjct-workflow.md`
689
-
690
- **prjct-planner.md** - Handles: /p:feature, /p:idea, /p:spec, /p:bug
691
- READ template: `templates/subagents/workflow/prjct-planner.md`
692
- ADAPT with: projectId, projectPath
693
- ADD to frontmatter: `agentId: p.agent.planner`
694
- WRITE to: `{globalPath}/agents/prjct-planner.md`
695
-
696
- **prjct-shipper.md** - Handles: /p:ship
697
- READ template: `templates/subagents/workflow/prjct-shipper.md`
698
- ADAPT with: projectId, projectPath, detected test/lint commands
699
- ADD to frontmatter: `agentId: p.agent.shipper`
700
- WRITE to: `{globalPath}/agents/prjct-shipper.md`
701
-
702
- ### 7.4 Generate Domain Agents (Based on Stack)
703
-
704
- Analyze `{techStack}` from Step 3 and generate ONLY relevant domain agents:
556
+ **Generate 3 workflow agents for every project:**
705
557
 
706
- | If Detected | Generate | Template | agentId |
707
- |-------------|----------|----------|---------|
708
- | React, Vue, Angular, Svelte, CSS | `frontend.md` | `templates/subagents/domain/frontend.md` | `p.agent.frontend` |
709
- | Node.js, Express, Go, Python API | `backend.md` | `templates/subagents/domain/backend.md` | `p.agent.backend` |
710
- | PostgreSQL, MySQL, MongoDB, Prisma | `database.md` | `templates/subagents/domain/database.md` | `p.agent.database` |
711
- | Docker, Kubernetes, GitHub Actions | `devops.md` | `templates/subagents/domain/devops.md` | `p.agent.devops` |
712
- | Bun test, Jest, Pytest, testing | `testing.md` | `templates/subagents/domain/testing.md` | `p.agent.testing` |
713
- | **{hasFrontendUI} = true** | `uxui.md` | `templates/agentic/agents/uxui.md` | `p.agent.uxui` |
558
+ | Agent | agentId | Handles |
559
+ |-------|---------|---------|
560
+ | `prjct-workflow.md` | `p.agent.workflow` | /p:task, /p:done, /p:pause, /p:resume |
561
+ | `prjct-planner.md` | `p.agent.planner` | /p:idea, /p:spec, /p:bug |
562
+ | `prjct-shipper.md` | `p.agent.shipper` | /p:ship |
714
563
 
715
- For EACH detected stack:
716
- 1. READ template from `templates/subagents/domain/{name}.md`
717
- 2. ADAPT description with detected frameworks (e.g., "React specialist" not just "frontend")
718
- 3. ADD to frontmatter: `agentId: p.agent.{name}` (e.g., `p.agent.backend`)
719
- 4. WRITE to `{globalPath}/agents/{name}.md`
564
+ READ templates from: `templates/subagents/workflow/`
565
+ ADAPT with: projectId, projectPath, detected commands
566
+ WRITE to: `{globalPath}/agents/`
720
567
 
721
- ### 7.5 Generate UX/UI Agent (CRITICAL for Frontend Projects)
568
+ ### 7.4 Generate Domain Agents (AGENTIC)
722
569
 
723
- **Priority: UX > UI** - User experience is more important than visuals.
570
+ **See:** `templates/guides/agent-generation.md` for complete instructions.
724
571
 
725
- IF `{hasFrontendUI}` == true:
572
+ **Summary:**
573
+ 1. FIND representative files for each domain
574
+ 2. READ 3-5 files and EXTRACT real patterns
575
+ 3. GENERATE agents that enforce those patterns
726
576
 
727
- 1. READ template: `templates/agentic/agents/uxui.md`
728
- 2. WRITE to: `{globalPath}/agents/uxui.md`
729
- 3. ADD to `{domainAgents}`: "uxui"
577
+ **Domains to detect:**
730
578
 
731
- OUTPUT: "🎨 Generated UX/UI agent for {frontendType} ({frameworks detected})"
579
+ | If Found | Generate | Temperature |
580
+ |----------|----------|-------------|
581
+ | React/Vue/Svelte | `frontend.md` | 0.3 |
582
+ | Express/Fastify/Hono | `backend.md` | 0.2 |
583
+ | Prisma/Drizzle/SQL | `database.md` | 0.1 |
584
+ | Docker/K8s/Actions | `devops.md` | 0.2 |
585
+ | Jest/Vitest/tests | `testing.md` | 0.2 |
586
+ | UI + design system | `uxui.md` | 0.4 |
732
587
 
733
- The UX/UI agent ensures:
734
- - **UX First**: Clarity, feedback, reduced friction, error handling, accessibility
735
- - **Modern UI**: Distinctive typography, bold colors, purposeful animation
736
- - **Anti-patterns avoided**: No "AI slop" (Inter font, purple gradients, generic layouts)
737
- - **Checklists**: UX and UI quality gates before shipping
738
-
739
- ### 7.6 Report Generated Agents
740
-
741
- Track which agents were generated for output:
742
- - `{workflowAgents}`: Always 3 (prjct-workflow, prjct-planner, prjct-shipper)
743
- - `{domainAgents}`: List of domain agents generated
744
-
745
- ---
746
-
747
- ## Step 7.5: Install Claude Code Skills (AGENTIC)
748
-
749
- **CRITICAL: This step is AGENTIC. Search claude-plugins.dev dynamically to find the best skills.**
750
-
751
- Skills in Claude Code are markdown files in `~/.claude/skills/`. We search the marketplace and download the best matching skills for each agent.
752
-
753
- ### 7.5.1 Check Existing Skills
754
-
755
- ```bash
756
- ls ~/.claude/skills/*.md 2>/dev/null || echo "none"
588
+ **Output per agent:**
757
589
  ```
758
-
759
- SET: `{existingSkills}` = list of installed skill files
760
-
761
- ### 7.5.2 Search & Install Skills (AGENTIC)
762
-
763
- **For each generated agent, search claude-plugins.dev and install the best skill.**
764
-
590
+ 🤖 Generated: {agent}.md
591
+ Stack: {technologies}
592
+ Patterns: {count} from {files}
765
593
  ```
766
- {skillsToFind} = [
767
- { agent: "frontend", searchTerms: ["frontend-design", "react", "ui components"] },
768
- { agent: "uxui", searchTerms: ["ux-designer", "frontend-design", "ui ux"] },
769
- { agent: "backend", searchTerms: ["{ecosystem} backend", "api design", "backend patterns"] },
770
- { agent: "testing", searchTerms: ["testing", "test automation", "{ecosystem} testing"] },
771
- { agent: "devops", searchTerms: ["devops", "ci cd", "docker kubernetes"] },
772
- { agent: "prjct-planner", searchTerms: ["feature development", "architecture", "planning"] },
773
- { agent: "prjct-shipper", searchTerms: ["code review", "pr review", "shipping"] }
774
- ]
775
-
776
- FOR EACH entry in {skillsToFind}:
777
- IF {entry.agent} IN {generatedAgents}:
778
-
779
- # Step A: Search claude-plugins.dev
780
- USE WebFetch:
781
- url: "https://claude-plugins.dev/skills?q={entry.searchTerms[0]}"
782
- prompt: "Find the best skill for {entry.agent}. Return: skill name, author, install URL"
783
-
784
- SET: {searchResult} = result
785
-
786
- # Step B: Analyze results and pick best match
787
- ANALYZE {searchResult}:
788
- - Prefer @anthropics skills (official)
789
- - Prefer skills with high download count
790
- - Match the agent's domain
791
-
792
- SET: {bestSkill} = selected skill
793
-
794
- # Step C: Check if already installed
795
- IF {bestSkill.name}.md NOT IN {existingSkills}:
796
-
797
- # Step D: Get skill content from GitHub
798
- USE WebFetch:
799
- url: "{bestSkill.githubUrl}/raw/main/skills/{bestSkill.name}.md"
800
- prompt: "Get the complete skill markdown content"
801
-
802
- SET: {skillContent} = result
803
-
804
- # Step E: Install to ~/.claude/skills/
805
- ```bash
806
- mkdir -p ~/.claude/skills
807
- ```
808
-
809
- WRITE: `~/.claude/skills/{bestSkill.name}.md`
810
- CONTENT: {skillContent}
811
-
812
- OUTPUT: "📦 Installed skill: {bestSkill.name} (from {bestSkill.author})"
813
- ADD {bestSkill} to {installedSkills}
814
-
815
- ELSE:
816
- OUTPUT: "✓ Skill exists: {bestSkill.name}"
817
- ADD {bestSkill.name} to {verifiedSkills}
818
- ```
819
-
820
- ### 7.5.3 Skill Search Fallbacks
821
594
 
822
- If WebFetch fails or no results found:
823
-
824
- ```
825
- FALLBACK SKILLS (use these if search fails):
826
- - frontend/uxui → "frontend-design" from @anthropics/claude-code
827
- - backend (JS/TS) → Search "typescript backend patterns"
828
- - backend (Python) → Search "python backend patterns"
829
- - testing → Search "testing automation"
830
- - devops → Search "devops ci cd"
831
- - planner → Search "architecture planning"
832
- - shipper → Search "code review"
833
- ```
834
-
835
- ### 7.5.4 Create Custom Skill if Not Found
836
-
837
- If no suitable skill found on marketplace, CREATE a minimal skill:
838
-
839
- ```markdown
840
595
  ---
841
- name: {agent}-skill
842
- description: Custom skill for {agent} agent
843
- ---
844
-
845
- # {Agent} Skill
846
596
 
847
- This is a custom skill for the {agent} domain.
597
+ ### 7.5 Integrations (Skills + MCP) - CONDITIONAL
848
598
 
849
- ## Expertise
850
- {Based on agent's domain - frontend, backend, etc.}
599
+ **Only if agents were generated, configure integrations.**
851
600
 
852
- ## Patterns
853
- {Common patterns for this domain}
854
- ```
601
+ See: `templates/guides/integrations.md`
855
602
 
856
- WRITE to: `~/.claude/skills/{agent}-custom.md`
603
+ | Agent | Default Skill | MCP |
604
+ |-------|---------------|-----|
605
+ | frontend/uxui | `frontend-design` | context7 |
606
+ | backend | - | context7 |
607
+ | testing | - | - |
857
608
 
858
- ### 7.5.5 Save Skills Configuration
609
+ WRITE: `{globalPath}/config/skills.json` (if skills configured)
859
610
 
860
- ```bash
861
- mkdir -p {globalPath}/config
862
- ```
611
+ ---
863
612
 
864
- WRITE: `{globalPath}/config/skills.json`
613
+ ### 7.6 Scan Quick Commands
865
614
 
866
- ```json
867
- {
868
- "projectId": "{projectId}",
869
- "ecosystem": "{ecosystem}",
870
- "installedAt": "{GetTimestamp()}",
871
- "searchedAt": "{GetTimestamp()}",
872
- "skills": [
873
- {
874
- "name": "{skill.name}",
875
- "source": "{skill.source}",
876
- "author": "{skill.author}",
877
- "path": "~/.claude/skills/{skill.name}.md",
878
- "linkedAgents": ["{agents that use this skill}"]
879
- }
880
- ],
881
- "agentSkillMap": {
882
- "{agent}": "{skill.name}"
883
- }
884
- }
615
+ ```bash
616
+ ls ~/.prjct-cli/commands/*.md 2>/dev/null | head -20
885
617
  ```
886
618
 
887
- ### 7.5.6 Update Agent Frontmatter
888
-
889
- FOR EACH agent file in `{globalPath}/agents/`:
890
- READ agent file
891
- GET skill from agentSkillMap[agent.name]
892
-
893
- IF skill exists AND frontmatter.skills is missing:
894
- UPDATE frontmatter to include: `skills: [{skill}]`
895
- WRITE updated agent file
896
-
897
- ### 7.5.7 Output Summary
898
-
899
- ```
900
- SET: {skillsInstalled} = list of newly installed
901
- SET: {skillsVerified} = list of already existing
902
- SET: {skillsCreated} = list of custom-created
903
- SET: {totalSkills} = count of all
904
-
905
- OUTPUT:
906
- 📦 Skills Synchronized
907
- ├── Installed: {skillsInstalled.length} new from marketplace
908
- ├── Verified: {skillsVerified.length} already exist
909
- ├── Created: {skillsCreated.length} custom skills
910
- └── Location: ~/.claude/skills/
911
- ```
619
+ IF files found:
620
+ SET: `{quickCommandCount}` = count
621
+ FOR EACH file: extract `description` from frontmatter
622
+ SET: `{quickCommandList}` = [{name, description}, ...]
912
623
 
913
624
  ---
914
625
 
@@ -917,7 +628,7 @@ OUTPUT:
917
628
  APPEND to: `{globalPath}/memory/events.jsonl`
918
629
 
919
630
  ```json
920
- {"ts":"{GetTimestamp()}","action":"sync","branch":"{currentBranch}","uncommitted":{hasUncommittedChanges},"fileCount":{fileCount},"commitCount":{commitCount}}
631
+ {"ts":"{GetTimestamp()}","action":"sync","branch":"{currentBranch}","uncommitted":{hasUncommittedChanges},"fileCount":{fileCount},"commitCount":{commitCount},"tokensUsed":{totalContextTokens}}
921
632
  ```
922
633
 
923
634
  ---
@@ -968,86 +679,22 @@ IF cloudSync AND no syncError:
968
679
 
969
680
  ---
970
681
 
971
- ## Output
682
+ ## Output (Compact)
972
683
 
973
684
  ```
974
- 🔄 Project synced to prjct v{cliVersion}
975
-
976
- 📊 Project Stats
977
- ├── Files: {fileCount}
978
- ├── Commits: {commitCount}
979
- ├── Version: {version}
980
- └── Stack: {stack}
981
-
982
- 🌿 Git Status
983
- ├── Branch: {currentBranch}
984
- ├── Uncommitted: {hasUncommittedChanges ? "Yes - " + modifiedCount + " files" : "Clean"}
985
- └── Recent: {recentCommitCount} commits this week
986
-
987
- 📁 Context Updated
988
- ├── context/now.md
989
- ├── context/next.md
990
- ├── context/ideas.md
991
- ├── context/shipped.md
992
- └── context/CLAUDE.md
993
-
994
- 🤖 Agents Regenerated ({workflowAgents.length + domainAgents.length})
995
- ├── Workflow: prjct-workflow, prjct-planner, prjct-shipper
996
- ├── Domain: {domainAgents.join(', ') || 'none'}
997
- {IF hasFrontendUI}
998
- └── 🎨 UX/UI: uxui.md (Priority: UX > UI)
999
- {ENDIF}
1000
-
1001
- 🏷️ Agent Mentions (use in prompts)
1002
- ├── p.agent.workflow, p.agent.planner, p.agent.shipper
1003
- {IF domainAgents.length > 0}
1004
- ├── {domainAgents.map(a => 'p.agent.' + a).join(', ')}
1005
- {ENDIF}
1006
- └── Example: "p.agent.backend help me create an API endpoint"
1007
-
1008
- 📦 Skills ({totalSkills})
1009
- ├── Installed: {skillsInstalled.length ? skillsInstalled.join(', ') : 'none'}
1010
- ├── Verified: {skillsVerified.length ? skillsVerified.join(', ') : 'none'}
1011
- └── Config: {globalPath}/config/skills.json
1012
-
1013
- 🔗 Agent → Skill Mapping
1014
- {FOR EACH entry in agentSkillMap WHERE entry.skill != null}
1015
- ├── {entry.agent}.md → /{entry.skill}
1016
- {END FOR}
1017
-
1018
- {IF isVersionUpgrade}
1019
- ✨ New Features Available in v{cliVersion}:
685
+ 🔄 {projectName} v{version} | {ecosystem} | prjct v{cliVersion}
1020
686
 
1021
- /p:task - Unified task command with agentic classification
1022
- • Automatic type detection (feature, bug, improvement, refactor, chore)
1023
- • 7-phase development workflow for all task types
1024
- • Git branch management with type-based prefixes
1025
- • UX/UI design workflow for frontend tasks
1026
- • Design expert integration
687
+ {currentBranch} {hasUncommittedChanges ? "⚠️" : "✓"} | {fileCount} files | {commitCount} commits
1027
688
 
1028
- Note: /p:now and /p:feature are deprecated. Use /p:task instead.
1029
- {ENDIF}
1030
-
1031
- {IF cloudSync}
1032
- ☁️ Cloud Sync
1033
- ├── Pushed: {pushedCount} events
1034
- ├── Pulled: {pulledCount} updates
1035
- └── Status: {syncError ? "⚠️ " + syncError : "✓ Synced"}
1036
- {ELSE}
1037
- 💡 Cloud sync disabled. Run `prjct auth` to enable.
1038
- {ENDIF}
689
+ 🤖 Agents: {domainAgents.join(', ') || 'workflow only'}
690
+ {IF quickCommandCount > 0}⚡ Commands: {quickCommandList.map(c => c.name).join(', ')}{ENDIF}
691
+ {IF cloudSync}☁️ {pushedCount}↑ {pulledCount}↓{ENDIF}
1039
692
 
1040
- {IF hasUncommittedChanges}
1041
- ⚠️ You have uncommitted changes
1042
-
1043
- Next: Commit your work or continue coding
1044
- {ELSE}
1045
- ✨ Repository is clean!
1046
-
1047
- Next: /p:task "your next task"
1048
- {ENDIF}
693
+ Next: p. task "description"
1049
694
  ```
1050
695
 
696
+ **Keep output under 6 lines unless errors occur.**
697
+
1051
698
  ---
1052
699
 
1053
700
  ## Error Handling
@@ -1064,35 +711,25 @@ Next: /p:task "your next task"
1064
711
  ## File Structure Reference
1065
712
 
1066
713
  ```
1067
- ~/.prjct-cli/projects/{projectId}/
1068
- ├── storage/ # Source of Truth (JSON)
1069
- ├── state.json # Current + paused task
1070
- │ ├── queue.json # Task queue
1071
- ├── ideas.json # Ideas list
1072
- │ └── shipped.json # Shipped features
1073
- ├── context/ # For Claude (MD)
1074
- ├── CLAUDE.md # Full context
1075
- ├── now.md # Current task
1076
- ├── next.md # Queue
1077
- ├── ideas.md # Ideas
1078
- └── shipped.md # Shipped
1079
- ├── config/ # Configuration (NEW)
1080
- │ └── skills.json # Agent-to-skill mappings
1081
- ├── sync/ # Backend Sync
1082
- │ └── pending.json # Events queue
1083
- ├── agents/ # Specialists
1084
- ├── memory/ # Audit Trail
1085
- │ └── events.jsonl
1086
- └── project.json # Metadata
1087
-
1088
- # Sub-Agents are in {globalPath}/agents/ (NOT in project .claude/)
1089
- ├── prjct-workflow.md # /p:now, /p:done, /p:next
1090
- ├── prjct-planner.md # /p:feature, /p:idea, /p:spec
1091
- ├── prjct-shipper.md # /p:ship
1092
- ├── frontend.md # (if React/Vue/Angular detected)
1093
- ├── backend.md # (if Node/Go/Python API detected)
1094
- ├── database.md # (if DB detected)
1095
- ├── devops.md # (if Docker/K8s detected)
1096
- ├── testing.md # (if test framework detected)
1097
- └── uxui.md # (if ANY frontend UI detected - web or mobile)
714
+ ~/.prjct-cli/
715
+ ├── commands/ # User Quick Commands (global, priority over built-in)
716
+ └── {command}.md # Custom command templates
717
+ └── projects/{projectId}/
718
+ ├── storage/ # Source of Truth: state.json, queue.json, ideas.json, shipped.json
719
+ ├── context/ # Claude Context: CLAUDE.md, now.md, next.md, ideas.md, shipped.md
720
+ ├── config/ # Config: skills.json, mcp-servers.json, slash-commands.json
721
+ ├── agents/ # Domain agents: prjct-*.md, frontend.md, backend.md, etc.
722
+ ├── analysis/ # repo-analysis.json
723
+ ├── memory/ # events.jsonl
724
+ ├── sync/ # pending.json
725
+ └── project.json # Metadata + cliVersion
726
+ ```
727
+
728
+ **Agent Frontmatter (v0.28+):**
729
+ ```yaml
730
+ name: backend
731
+ agentId: p.agent.backend
732
+ skills: [skill-name] # Auto-invoked
733
+ mcp: [context7] # Auto-used
734
+ generatedAt: {timestamp} # For refresh detection
1098
735
  ```