prjct-cli 0.10.13 → 0.10.14

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 CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.14] - 2025-11-29
4
+
5
+ ### Refactored - 100% Agentic Subagent Delegation via Task Tool
6
+
7
+ Claude now delegates to specialist agents using the Task tool with efficient reference passing.
8
+
9
+ - **`command-executor.js`** - Eliminated all if/else agent assignment logic
10
+ - Removed: `MandatoryAgentRouter`, `ContextFilter`, `ContextEstimator`
11
+ - Removed: `isTaskCommand()`, `shouldUseAgent()` methods
12
+ - JS only loads templates and context, Claude decides everything
13
+ - Added: `agentsPath` and `agentRoutingPath` to context for Claude
14
+
15
+ - **Templates updated with Agent Delegation section**:
16
+ - `feature.md` - Added Task + Glob tools, agent delegation instructions
17
+ - `bug.md` - Added Task + Glob tools, agent delegation instructions
18
+ - `task.md` - Added Task + Glob tools, agent delegation instructions
19
+
20
+ - **`agent-routing.md`** - Added efficient Task tool invocation
21
+ - Pass file PATH (~200 bytes), not content (3-5KB)
22
+ - Subagent reads agent file itself
23
+ - Reduced context bloat by 95%
24
+
25
+ ### Architecture
26
+
27
+ ```
28
+ Usuario: "p. feature mejorar UX"
29
+
30
+ Claude lee agent-routing.md → decide: "ux-ui"
31
+
32
+ Claude: Task(prompt='Read: path/agents/ux-ui.md + Task: mejorar UX')
33
+
34
+ Subagente: Lee archivo → aplica expertise → ejecuta
35
+ ```
36
+
37
+ **Benefits:**
38
+ - 95% reduction in prompt size for delegation
39
+ - Lower hallucination risk
40
+ - True 100% agentic - JS is pure orchestration
41
+
3
42
  ## [0.10.12] - 2025-11-29
4
43
 
5
44
  ### Refactored - Mandatory Agent Assignment (100% Agentic)
package/CLAUDE.md CHANGED
@@ -55,8 +55,14 @@ p. ship → Lint/test/commit/push
55
55
 
56
56
  When message starts with `p.`:
57
57
  1. Check `.prjct/prjct.config.json` exists
58
- 2. If exists → Detect intent Execute `/p:*` command
59
- 3. If not exists "No prjct project. Run /p:init first."
58
+ 2. Detect intent from message
59
+ 3. **USE SlashCommand tool** to execute the command
60
+
61
+ ⚠️ **CRITICAL** - Always use SlashCommand, never work directly:
62
+ - ✅ `SlashCommand("/p:feature add dark mode")`
63
+ - ❌ Directly creating files without the command
64
+
65
+ If no project: "No prjct project. Run /p:init first."
60
66
 
61
67
  ### Intent Map
62
68
 
@@ -201,3 +207,42 @@ Use: `generator.generateDynamicAgent(name, config)`
201
207
  4. **Confirm before executing** - Always show plan first
202
208
  5. **Log actions** - Append to memory/context.jsonl
203
209
  6. **Suggest next actions** - Maintain user momentum
210
+
211
+ ## Output Philosophy
212
+
213
+ **Task completion responses MUST be concise (< 4 lines):**
214
+
215
+ Format:
216
+ ```
217
+ ✅ [What was done]
218
+
219
+ Files: [count] | Modified: [key file]
220
+ Next: [action]
221
+ ```
222
+
223
+ **NEVER include in task summaries:**
224
+ - Tables listing files
225
+ - "Created Files" / "Modified Files" sections
226
+ - "How It Works" explanations
227
+ - Code snippets or implementation details
228
+ - Detailed breakdowns of what was done
229
+
230
+ **Example (GOOD):**
231
+ ```
232
+ ✅ Agentic checklists integrated
233
+
234
+ Files: 11 created | Modified: prompt-builder.js
235
+ Next: /p:ship or test with /p:now
236
+ ```
237
+
238
+ **Example (BAD):**
239
+ ```
240
+ Created Files:
241
+ | File | Purpose |
242
+ |------|---------|
243
+ | x.md | Does X |
244
+ ...
245
+
246
+ How It Works:
247
+ Claude reads → decides → applies...
248
+ ```
@@ -1,16 +1,19 @@
1
1
  /**
2
2
  * Command Executor
3
- * WITH MANDATORY AGENT ASSIGNMENT
4
- * Every task MUST use a specialized agent
3
+ * 100% AGENTIC - Claude decides agent assignment via Task tool
5
4
  *
6
- * OPTIMIZATION (P0.2): Explicit Validation
7
- * - Pre-flight checks before execution
8
- * - Specific error messages, never generic failures
9
- * - Actionable suggestions in every error
5
+ * NO if/else logic for agent selection here.
6
+ * Claude reads templates/agentic/agent-routing.md and delegates via Task tool.
10
7
  *
11
- * P3.4: Plan Mode + Approval Flow
12
- * - Separates planning from execution
13
- * - Requires approval for destructive commands
8
+ * JS only:
9
+ * - Loads templates
10
+ * - Builds context
11
+ * - Returns prompt for Claude
12
+ *
13
+ * Claude:
14
+ * - Reads agent-routing.md
15
+ * - Decides best agent for task
16
+ * - Delegates via Task(subagent_type='general-purpose', prompt='Read: path/to/agent.md...')
14
17
  *
15
18
  * Source: Claude Code, Devin, Augment Code patterns
16
19
  */
@@ -22,9 +25,8 @@ const templateLoader = require('./template-loader')
22
25
  const contextBuilder = require('./context-builder')
23
26
  const promptBuilder = require('./prompt-builder')
24
27
  const toolRegistry = require('./tool-registry')
25
- const MandatoryAgentRouter = require('./agent-router')
26
- const ContextFilter = require('./context-filter')
27
- const ContextEstimator = require('../domain/context-estimator')
28
+ // REMOVED: MandatoryAgentRouter, ContextFilter, ContextEstimator
29
+ // Agent assignment is 100% agentic - Claude decides via templates
28
30
  const { validate, formatError } = require('./validation-rules')
29
31
  const loopDetector = require('./loop-detector')
30
32
  const chainOfThought = require('./chain-of-thought')
@@ -45,9 +47,8 @@ const RUNNING_FILE = path.join(os.homedir(), '.prjct-cli', '.running')
45
47
 
46
48
  class CommandExecutor {
47
49
  constructor() {
48
- this.agentRouter = new MandatoryAgentRouter()
49
- this.contextFilter = new ContextFilter()
50
- this.contextEstimator = null
50
+ // 100% AGENTIC: No agent router here
51
+ // Claude decides agent assignment via templates and Task tool
51
52
  }
52
53
 
53
54
  /**
@@ -173,72 +174,18 @@ class CommandExecutor {
173
174
  }
174
175
  }
175
176
 
176
- // 3. CRITICAL: Force agent assignment for ALL task-related commands
177
- const requiresAgent = template.metadata?.['required-agent'] !== false &&
178
- (template.metadata?.['required-agent'] === true ||
179
- this.isTaskCommand(commandName) ||
180
- this.shouldUseAgent(commandName))
181
-
177
+ // 3. AGENTIC: Claude decides agent assignment via templates
178
+ // NO if/else logic here - templates instruct Claude to use Task tool
179
+ // See templates/agentic/agent-routing.md for routing rules
182
180
  let context = metadataContext
183
- let assignedAgent = null
184
-
185
- // MANDATORY: Assign specialized agent for task commands
186
- if (requiresAgent) {
187
- // 4. Create task object for analysis
188
- const task = {
189
- description: params.task || params.description || commandName,
190
- type: commandName
191
- }
192
-
193
- // 5. LAZY CONTEXT: Analyze task FIRST, then estimate files needed
194
- // This avoids reading all files before knowing what we need
195
- const agentAssignment = await this.agentRouter.executeTask(
196
- task,
197
- metadataContext, // Only metadata, no files yet
198
- projectPath
199
- )
200
-
201
- assignedAgent = agentAssignment.agent
202
- const taskAnalysis = agentAssignment.taskAnalysis
203
-
204
- // Validate agent was assigned
205
- if (!assignedAgent || !assignedAgent.name) {
206
- throw new Error(
207
- `CRITICAL: Failed to assign agent for command "${commandName}". ` +
208
- `System requires ALL task commands to use specialized agents.`
209
- )
210
- }
211
-
212
- // 6. PRE-FILTER: Estimate which files are needed BEFORE reading
213
- if (!this.contextEstimator) {
214
- this.contextEstimator = new ContextEstimator()
215
- }
216
-
217
- const estimatedFiles = await this.contextEstimator.estimateFiles(
218
- taskAnalysis,
219
- projectPath
220
- )
221
181
 
222
- // 7. Build context ONLY with estimated files (lazy loading)
223
- const filtered = await this.contextFilter.filterForAgent(
224
- assignedAgent,
225
- task,
226
- projectPath,
227
- {
228
- ...metadataContext,
229
- estimatedFiles, // Pre-filtered file list
230
- fileCount: estimatedFiles.length
231
- }
232
- )
233
-
234
- context = {
235
- ...filtered,
236
- agent: assignedAgent,
237
- originalSize: estimatedFiles.length, // Estimated, not actual full size
238
- filteredSize: filtered.files?.length || 0,
239
- reduction: filtered.metrics?.reductionPercent || 0,
240
- lazyLoaded: true // Flag indicating lazy loading was used
241
- }
182
+ // Provide agent info to context so Claude can delegate
183
+ context = {
184
+ ...context,
185
+ agentsPath: path.join(os.homedir(), '.prjct-cli', 'projects', metadataContext.projectId || '', 'agents'),
186
+ agentRoutingPath: path.join(__dirname, '..', '..', 'templates', 'agentic', 'agent-routing.md'),
187
+ // Flag: Claude must delegate to subagent via Task tool
188
+ agenticDelegation: true
242
189
  }
243
190
 
244
191
  // 6. Load state with filtered context
@@ -285,7 +232,7 @@ class CommandExecutor {
285
232
  )
286
233
  }
287
234
 
288
- // 9. Build prompt with agent assignment, learned patterns, think blocks, memories, AND plan mode
235
+ // 9. Build prompt - NO agent assignment here, Claude decides via templates
289
236
  const planInfo = {
290
237
  isPlanning: requiresPlanning || isInPlanningMode,
291
238
  requiresApproval: isDestructive && !params.approved,
@@ -295,13 +242,11 @@ class CommandExecutor {
295
242
  template.frontmatter['allowed-tools'] || []
296
243
  )
297
244
  }
298
- const prompt = promptBuilder.build(template, context, state, assignedAgent, learnedPatterns, thinkBlock, relevantMemories, planInfo)
245
+ // Agent is null - Claude assigns via Task tool using agent-routing.md
246
+ const prompt = promptBuilder.build(template, context, state, null, learnedPatterns, thinkBlock, relevantMemories, planInfo)
299
247
 
300
- // 8. Log agent usage
301
- if (assignedAgent) {
302
- console.log(`🤖 Task assigned to: ${assignedAgent.name}`)
303
- console.log(`📉 Context reduced by: ${context.reduction}%`)
304
- }
248
+ // Log agentic mode
249
+ console.log(`🤖 Agentic delegation enabled - Claude will assign agent via Task tool`)
305
250
 
306
251
  // Record successful attempt
307
252
  loopDetector.recordSuccess(commandName, loopContext)
@@ -315,8 +260,10 @@ class CommandExecutor {
315
260
  context,
316
261
  state,
317
262
  prompt,
318
- assignedAgent,
319
- contextReduction: context.reduction,
263
+ // AGENTIC: No pre-assigned agent - Claude delegates via Task tool
264
+ agenticDelegation: true,
265
+ agentsPath: context.agentsPath,
266
+ agentRoutingPath: context.agentRoutingPath,
320
267
  reasoning, // Chain of thought results
321
268
  thinkBlock, // Think blocks (P3.1)
322
269
  groundTruth: groundTruthResult, // Ground truth verification (P1.3)
@@ -406,30 +353,9 @@ class CommandExecutor {
406
353
  }
407
354
  }
408
355
 
409
- /**
410
- * Check if command is task-related
411
- */
412
- isTaskCommand(commandName) {
413
- const taskCommands = [
414
- 'work', 'now', 'build', 'feature', 'bug', 'done',
415
- 'task', 'design', 'cleanup', 'fix', 'test'
416
- ]
417
- return taskCommands.includes(commandName)
418
- }
419
-
420
- /**
421
- * Determine if command should use an agent
422
- * Expanded list of commands that benefit from agent specialization
423
- */
424
- shouldUseAgent(commandName) {
425
- // Commands that should ALWAYS use agents
426
- const agentCommands = [
427
- 'work', 'now', 'build', 'feature', 'bug', 'done',
428
- 'task', 'design', 'cleanup', 'fix', 'test',
429
- 'sync', 'analyze' // These analyze/modify code, need specialization
430
- ]
431
- return agentCommands.includes(commandName)
432
- }
356
+ // REMOVED: isTaskCommand() and shouldUseAgent()
357
+ // Agent assignment is now 100% agentic - Claude decides via templates
358
+ // See templates/agentic/agent-routing.md
433
359
 
434
360
  /**
435
361
  * Execute tool with permission check
@@ -7,9 +7,65 @@
7
7
  * P3.1: Includes think blocks for anti-hallucination
8
8
  * P3.3: Includes relevant memories from semantic database
9
9
  * P3.4: Includes plan mode instructions
10
+ * P4.1: Includes quality checklists (Claude decides which to apply)
10
11
  */
11
12
 
13
+ const fs = require('fs')
14
+ const path = require('path')
15
+
12
16
  class PromptBuilder {
17
+ constructor() {
18
+ this._checklistsCache = null
19
+ this._checklistRoutingCache = null
20
+ }
21
+
22
+ /**
23
+ * Load quality checklists from templates/checklists/
24
+ * Returns checklist content - Claude decides which to apply
25
+ * NO if/else logic here - just load and provide
26
+ */
27
+ loadChecklists() {
28
+ if (this._checklistsCache) return this._checklistsCache
29
+
30
+ const checklistsDir = path.join(__dirname, '..', '..', 'templates', 'checklists')
31
+ const checklists = {}
32
+
33
+ try {
34
+ if (fs.existsSync(checklistsDir)) {
35
+ const files = fs.readdirSync(checklistsDir).filter(f => f.endsWith('.md'))
36
+ for (const file of files) {
37
+ const name = file.replace('.md', '')
38
+ const content = fs.readFileSync(path.join(checklistsDir, file), 'utf-8')
39
+ checklists[name] = content
40
+ }
41
+ }
42
+ } catch (err) {
43
+ // Silent fail - checklists are optional enhancement
44
+ }
45
+
46
+ this._checklistsCache = checklists
47
+ return checklists
48
+ }
49
+
50
+ /**
51
+ * Load checklist routing template
52
+ * Claude reads this to decide which checklists to apply
53
+ */
54
+ loadChecklistRouting() {
55
+ if (this._checklistRoutingCache) return this._checklistRoutingCache
56
+
57
+ const routingPath = path.join(__dirname, '..', '..', 'templates', 'agentic', 'checklist-routing.md')
58
+
59
+ try {
60
+ if (fs.existsSync(routingPath)) {
61
+ this._checklistRoutingCache = fs.readFileSync(routingPath, 'utf-8')
62
+ }
63
+ } catch (err) {
64
+ // Silent fail
65
+ }
66
+
67
+ return this._checklistRoutingCache || null
68
+ }
13
69
  /**
14
70
  * Build concise prompt - only essentials
15
71
  * CRITICAL: Includes full agent content if agent is provided
@@ -154,6 +210,22 @@ class PromptBuilder {
154
210
  parts.push(`\n## APPROVAL REQUIRED\nShow changes, list affected files, ask for confirmation.\n`)
155
211
  }
156
212
 
213
+ // P4.1: Quality Checklists (Claude decides which to apply)
214
+ // Only for code-modifying commands that benefit from quality gates
215
+ const checklistCommands = ['now', 'build', 'feature', 'design', 'fix', 'bug', 'cleanup', 'spec', 'work']
216
+ if (checklistCommands.includes(commandName)) {
217
+ const routing = this.loadChecklistRouting()
218
+ const checklists = this.loadChecklists()
219
+
220
+ if (routing && Object.keys(checklists).length > 0) {
221
+ parts.push('\n## QUALITY CHECKLISTS\n')
222
+ parts.push('Apply relevant checklists based on task. Read checklist-routing.md for guidance.\n')
223
+ parts.push(`Available: ${Object.keys(checklists).join(', ')}\n`)
224
+ parts.push('Path: templates/checklists/{name}.md\n')
225
+ parts.push('Use Read tool to load checklists you determine are relevant.\n')
226
+ }
227
+ }
228
+
157
229
  // Simple execution directive
158
230
  parts.push('\nEXECUTE: Follow flow. Use tools. Decide.\n')
159
231
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prjct-cli",
3
- "version": "0.10.13",
3
+ "version": "0.10.14",
4
4
  "description": "Built for Claude - Ship fast, track progress, stay focused. Developer momentum tool for indie hackers.",
5
5
  "main": "core/index.js",
6
6
  "bin": {
@@ -57,17 +57,49 @@ Consider these agent specializations:
57
57
  3. Consider secondary areas
58
58
  4. Choose agent with best expertise match
59
59
 
60
- ## Output
60
+ ## How to Invoke (EFFICIENT)
61
61
 
62
- Return the recommended agent with reasoning:
62
+ After deciding the best agent, **delegate via Task tool with REFERENCE, not content**:
63
63
 
64
- ```json
65
- {
66
- "agent": "recommended-agent-type",
67
- "reasoning": "why this agent is best for the task",
68
- "confidence": "high|medium|low",
69
- "alternatives": ["other agents that could help"]
70
- }
64
+ ```
65
+ Task(
66
+ subagent_type: 'general-purpose',
67
+ prompt: '
68
+ ## Agent Assignment
69
+ Read and apply: ~/.prjct-cli/projects/{projectId}/agents/{agent-name}.md
70
+
71
+ ## Task
72
+ {task description}
73
+
74
+ ## Context
75
+ - Project: {projectPath}
76
+ - Files affected: {file list if known}
77
+
78
+ ## Flow
79
+ 1. Read agent file FIRST
80
+ 2. Apply agent expertise and patterns
81
+ 3. Execute task following agent guidelines
82
+ 4. Return results
83
+ '
84
+ )
85
+ ```
86
+
87
+ ### Why References, Not Content
88
+
89
+ | Approach | Prompt Size | Issue |
90
+ |----------|-------------|-------|
91
+ | ❌ Inject content | 3-5KB | Bloats context, increases hallucinations |
92
+ | ✅ Pass reference | ~200 bytes | Subagent reads what it needs |
93
+
94
+ **CRITICAL:** The subagent reads the agent file itself. You do NOT need to read and inject the content.
95
+
96
+ ## Output (After Delegation)
97
+
98
+ After Task tool returns, summarize:
99
+
100
+ ```
101
+ ✅ Delegated to: {agent-name}
102
+ Result: {brief summary from subagent}
71
103
  ```
72
104
 
73
105
  ## Rules
@@ -75,4 +107,5 @@ Return the recommended agent with reasoning:
75
107
  - **Task-driven, not tech-driven** - Focus on what needs to be done
76
108
  - **Context matters** - Same tech can mean different things in different projects
77
109
  - **Be flexible** - One project's "backend" might be another's "full-stack"
110
+ - **Pass PATH, not CONTENT** - Let subagent read the agent file
78
111
  - **Explain your reasoning** - Don't just pick, justify
@@ -0,0 +1,98 @@
1
+ ---
2
+ allowed-tools: [Read, Glob]
3
+ description: 'Determine which quality checklists to apply - Claude decides'
4
+ ---
5
+
6
+ # Checklist Routing Instructions
7
+
8
+ ## Objective
9
+
10
+ Determine which quality checklists are relevant for a task by analyzing the ACTUAL task and its scope.
11
+
12
+ ## Step 1: Understand the Task
13
+
14
+ Read the task description and identify:
15
+
16
+ - What type of work is being done? (new feature, bug fix, refactor, infra, docs)
17
+ - What domains are affected? (code, UI, API, database, deployment)
18
+ - What is the scope? (small fix, major feature, architectural change)
19
+
20
+ ## Step 2: Consider Task Domains
21
+
22
+ Each task can touch multiple domains. Consider:
23
+
24
+ | Domain | Signals |
25
+ |--------|---------|
26
+ | Code Quality | Writing/modifying any code |
27
+ | Architecture | New components, services, or major refactors |
28
+ | UX/UI | User-facing changes, CLI output, visual elements |
29
+ | Infrastructure | Deployment, containers, CI/CD, cloud resources |
30
+ | Security | Auth, user data, external inputs, secrets |
31
+ | Testing | New functionality, bug fixes, critical paths |
32
+ | Documentation | Public APIs, complex features, breaking changes |
33
+ | Performance | Data processing, loops, network calls, rendering |
34
+ | Accessibility | User interfaces (web, mobile, CLI) |
35
+ | Data | Database operations, caching, data transformations |
36
+
37
+ ## Step 3: Match Task to Checklists
38
+
39
+ Based on your analysis, select relevant checklists:
40
+
41
+ **DO NOT assume:**
42
+ - Every task needs all checklists
43
+ - "Frontend" = only UX checklist
44
+ - "Backend" = only Code Quality checklist
45
+
46
+ **DO analyze:**
47
+ - What the task actually touches
48
+ - What quality dimensions matter for this specific work
49
+ - What could go wrong if not checked
50
+
51
+ ## Available Checklists
52
+
53
+ Located in `templates/checklists/`:
54
+
55
+ | Checklist | When to Apply |
56
+ |-----------|---------------|
57
+ | `code-quality.md` | Any code changes (any language) |
58
+ | `architecture.md` | New modules, services, significant structural changes |
59
+ | `ux-ui.md` | User-facing interfaces (web, mobile, CLI, API DX) |
60
+ | `infrastructure.md` | Deployment, containers, CI/CD, cloud resources |
61
+ | `security.md` | ALWAYS for: auth, user input, external APIs, secrets |
62
+ | `testing.md` | New features, bug fixes, refactors |
63
+ | `documentation.md` | Public APIs, complex features, configuration changes |
64
+ | `performance.md` | Data-intensive operations, critical paths |
65
+ | `accessibility.md` | Any user interface work |
66
+ | `data.md` | Database, caching, data transformations |
67
+
68
+ ## Decision Process
69
+
70
+ 1. Read task description
71
+ 2. Identify primary work domain
72
+ 3. List secondary domains affected
73
+ 4. Select 2-4 most relevant checklists
74
+ 5. Consider Security (almost always relevant)
75
+
76
+ ## Output
77
+
78
+ Return selected checklists with reasoning:
79
+
80
+ ```json
81
+ {
82
+ "checklists": ["code-quality", "security", "testing"],
83
+ "reasoning": "Task involves new API endpoint (code), handles user input (security), and adds business logic (testing)",
84
+ "priority_items": ["Input validation", "Error handling", "Happy path tests"],
85
+ "skipped": {
86
+ "accessibility": "No user interface changes",
87
+ "infrastructure": "No deployment changes"
88
+ }
89
+ }
90
+ ```
91
+
92
+ ## Rules
93
+
94
+ - **Task-driven** - Focus on what the specific task needs
95
+ - **Less is more** - 2-4 focused checklists beat 10 unfocused
96
+ - **Security is special** - Default to including unless clearly irrelevant
97
+ - **Explain your reasoning** - Don't just pick, justify selections AND skips
98
+ - **Context matters** - Small typo fix ≠ major refactor in checklist needs
@@ -0,0 +1,33 @@
1
+ # Accessibility Checklist
2
+
3
+ > Applies to: Web (WCAG), Mobile, CLI, Desktop
4
+
5
+ ## Perceivable
6
+ - [ ] Text alternatives for non-text content
7
+ - [ ] Sufficient color contrast (4.5:1 minimum)
8
+ - [ ] Content readable without color alone
9
+ - [ ] Resizable text supported (up to 200%)
10
+
11
+ ## Operable
12
+ - [ ] Keyboard accessible (all functionality)
13
+ - [ ] No keyboard traps
14
+ - [ ] Sufficient time for interactions
15
+ - [ ] Seizure-safe (no flashing > 3Hz)
16
+
17
+ ## Understandable
18
+ - [ ] Clear and simple language
19
+ - [ ] Consistent navigation
20
+ - [ ] Input assistance provided
21
+ - [ ] Error identification and suggestions
22
+
23
+ ## Robust
24
+ - [ ] Compatible with assistive technologies
25
+ - [ ] Valid markup/structure
26
+ - [ ] ARIA used correctly (web)
27
+ - [ ] Semantic HTML elements used
28
+
29
+ ## CLI Accessibility
30
+ - [ ] Screen reader compatible output
31
+ - [ ] No color-only information
32
+ - [ ] Clear text formatting
33
+ - [ ] Configurable output verbosity
@@ -0,0 +1,28 @@
1
+ # Architecture Checklist
2
+
3
+ > Applies to ANY system architecture
4
+
5
+ ## Design Principles
6
+ - [ ] Clear separation of concerns
7
+ - [ ] Loose coupling between components
8
+ - [ ] High cohesion within modules
9
+ - [ ] Single source of truth for data
10
+ - [ ] Explicit dependencies (no hidden coupling)
11
+
12
+ ## Scalability
13
+ - [ ] Stateless where possible
14
+ - [ ] Horizontal scaling considered
15
+ - [ ] Bottlenecks identified
16
+ - [ ] Caching strategy defined
17
+
18
+ ## Resilience
19
+ - [ ] Failure modes documented
20
+ - [ ] Graceful degradation planned
21
+ - [ ] Recovery procedures defined
22
+ - [ ] Circuit breakers where needed
23
+
24
+ ## Maintainability
25
+ - [ ] Clear boundaries between layers
26
+ - [ ] Easy to test in isolation
27
+ - [ ] Configuration externalized
28
+ - [ ] Logging and observability built-in
@@ -0,0 +1,28 @@
1
+ # Code Quality Checklist
2
+
3
+ > Universal principles for ANY programming language
4
+
5
+ ## Universal Principles
6
+ - [ ] Single Responsibility: Each unit does ONE thing well
7
+ - [ ] DRY: No duplicated logic (extract shared code)
8
+ - [ ] KISS: Simplest solution that works
9
+ - [ ] Clear naming: Self-documenting identifiers
10
+ - [ ] Consistent patterns: Match existing codebase style
11
+
12
+ ## Error Handling
13
+ - [ ] All error paths handled gracefully
14
+ - [ ] Meaningful error messages
15
+ - [ ] No silent failures
16
+ - [ ] Proper resource cleanup (files, connections, memory)
17
+
18
+ ## Edge Cases
19
+ - [ ] Null/nil/None handling
20
+ - [ ] Empty collections handled
21
+ - [ ] Boundary conditions tested
22
+ - [ ] Invalid input rejected early
23
+
24
+ ## Code Organization
25
+ - [ ] Functions/methods are small and focused
26
+ - [ ] Related code grouped together
27
+ - [ ] Clear module/package boundaries
28
+ - [ ] No circular dependencies
@@ -0,0 +1,33 @@
1
+ # Data Checklist
2
+
3
+ > Applies to: SQL, NoSQL, GraphQL, File storage, Caching
4
+
5
+ ## Data Integrity
6
+ - [ ] Schema/structure defined
7
+ - [ ] Constraints enforced
8
+ - [ ] Transactions used appropriately
9
+ - [ ] Referential integrity maintained
10
+
11
+ ## Query Performance
12
+ - [ ] Indexes on frequent queries
13
+ - [ ] N+1 queries eliminated
14
+ - [ ] Query complexity analyzed
15
+ - [ ] Pagination for large datasets
16
+
17
+ ## Data Operations
18
+ - [ ] Migrations versioned and reversible
19
+ - [ ] Backup and restore tested
20
+ - [ ] Data validation at boundary
21
+ - [ ] Soft deletes considered (if applicable)
22
+
23
+ ## Caching
24
+ - [ ] Cache invalidation strategy defined
25
+ - [ ] TTL values appropriate
26
+ - [ ] Cache warming considered
27
+ - [ ] Cache hit/miss monitored
28
+
29
+ ## Data Privacy
30
+ - [ ] PII identified and protected
31
+ - [ ] Data anonymization where needed
32
+ - [ ] Audit trail for sensitive data
33
+ - [ ] Data deletion procedures defined
@@ -0,0 +1,33 @@
1
+ # Documentation Checklist
2
+
3
+ > Applies to ALL projects
4
+
5
+ ## Essential Docs
6
+ - [ ] README with quick start
7
+ - [ ] Installation instructions
8
+ - [ ] Configuration options documented
9
+ - [ ] Common use cases shown
10
+
11
+ ## Code Documentation
12
+ - [ ] Public APIs documented
13
+ - [ ] Complex logic explained
14
+ - [ ] Architecture decisions recorded (ADRs)
15
+ - [ ] Diagrams for complex flows
16
+
17
+ ## Operational Docs
18
+ - [ ] Deployment process documented
19
+ - [ ] Troubleshooting guide
20
+ - [ ] Runbooks for common issues
21
+ - [ ] Changelog maintained
22
+
23
+ ## API Documentation
24
+ - [ ] All endpoints documented
25
+ - [ ] Request/response examples
26
+ - [ ] Error codes explained
27
+ - [ ] Authentication documented
28
+
29
+ ## Maintenance
30
+ - [ ] Docs updated with code changes
31
+ - [ ] Version-specific documentation
32
+ - [ ] Broken links checked
33
+ - [ ] Examples tested and working
@@ -0,0 +1,33 @@
1
+ # Infrastructure Checklist
2
+
3
+ > Applies to: Cloud, On-prem, Hybrid, Edge
4
+
5
+ ## Deployment
6
+ - [ ] Infrastructure as Code (Terraform, Pulumi, CloudFormation, etc.)
7
+ - [ ] Reproducible environments
8
+ - [ ] Rollback strategy defined
9
+ - [ ] Blue-green or canary deployment option
10
+
11
+ ## Observability
12
+ - [ ] Logging strategy defined
13
+ - [ ] Metrics collection configured
14
+ - [ ] Alerting thresholds set
15
+ - [ ] Distributed tracing (if applicable)
16
+
17
+ ## Security
18
+ - [ ] Secrets management (not in code)
19
+ - [ ] Network segmentation
20
+ - [ ] Least privilege access
21
+ - [ ] Encryption at rest and in transit
22
+
23
+ ## Reliability
24
+ - [ ] Backup strategy defined
25
+ - [ ] Disaster recovery plan
26
+ - [ ] Health checks configured
27
+ - [ ] Auto-scaling rules (if applicable)
28
+
29
+ ## Cost Management
30
+ - [ ] Resource sizing appropriate
31
+ - [ ] Unused resources identified
32
+ - [ ] Cost monitoring in place
33
+ - [ ] Budget alerts configured
@@ -0,0 +1,33 @@
1
+ # Performance Checklist
2
+
3
+ > Applies to: Backend, Frontend, Mobile, Database
4
+
5
+ ## Analysis
6
+ - [ ] Bottlenecks identified with profiling
7
+ - [ ] Baseline metrics established
8
+ - [ ] Performance budgets defined
9
+ - [ ] Benchmarks before/after changes
10
+
11
+ ## Optimization Strategies
12
+ - [ ] Algorithmic complexity reviewed (O(n) vs O(n²))
13
+ - [ ] Appropriate data structures used
14
+ - [ ] Caching implemented where beneficial
15
+ - [ ] Lazy loading for expensive operations
16
+
17
+ ## Resource Management
18
+ - [ ] Memory usage optimized
19
+ - [ ] Connection pooling used
20
+ - [ ] Batch operations where applicable
21
+ - [ ] Async/parallel processing considered
22
+
23
+ ## Frontend Specific
24
+ - [ ] Bundle size optimized
25
+ - [ ] Images optimized
26
+ - [ ] Critical rendering path optimized
27
+ - [ ] Network requests minimized
28
+
29
+ ## Backend Specific
30
+ - [ ] Database queries optimized
31
+ - [ ] Response compression enabled
32
+ - [ ] Proper indexing in place
33
+ - [ ] Connection limits configured
@@ -0,0 +1,33 @@
1
+ # Security Checklist
2
+
3
+ > ALWAYS ON - Applies to ALL applications
4
+
5
+ ## Input/Output
6
+ - [ ] All user input validated and sanitized
7
+ - [ ] Output encoded appropriately (prevent injection)
8
+ - [ ] File uploads restricted and scanned
9
+ - [ ] No sensitive data in logs or error messages
10
+
11
+ ## Authentication & Authorization
12
+ - [ ] Strong authentication mechanism
13
+ - [ ] Proper session management
14
+ - [ ] Authorization checked at every access point
15
+ - [ ] Principle of least privilege applied
16
+
17
+ ## Data Protection
18
+ - [ ] Sensitive data encrypted at rest
19
+ - [ ] Secure transmission (TLS/HTTPS)
20
+ - [ ] PII handled according to regulations
21
+ - [ ] Data retention policies followed
22
+
23
+ ## Dependencies
24
+ - [ ] Dependencies from trusted sources
25
+ - [ ] Known vulnerabilities checked
26
+ - [ ] Minimal dependency surface
27
+ - [ ] Regular security updates planned
28
+
29
+ ## API Security
30
+ - [ ] Rate limiting implemented
31
+ - [ ] Authentication required for sensitive endpoints
32
+ - [ ] CORS properly configured
33
+ - [ ] API keys/tokens secured
@@ -0,0 +1,33 @@
1
+ # Testing Checklist
2
+
3
+ > Applies to: Unit, Integration, E2E, Performance testing
4
+
5
+ ## Coverage Strategy
6
+ - [ ] Critical paths have high coverage
7
+ - [ ] Happy path tested
8
+ - [ ] Error paths tested
9
+ - [ ] Edge cases covered
10
+
11
+ ## Test Quality
12
+ - [ ] Tests are deterministic (no flaky tests)
13
+ - [ ] Tests are independent (no order dependency)
14
+ - [ ] Tests are fast (optimize slow tests)
15
+ - [ ] Tests are readable (clear intent)
16
+
17
+ ## Test Types
18
+ - [ ] Unit tests for business logic
19
+ - [ ] Integration tests for boundaries
20
+ - [ ] E2E tests for critical flows
21
+ - [ ] Performance tests for bottlenecks
22
+
23
+ ## Mocking Strategy
24
+ - [ ] External services mocked
25
+ - [ ] Database isolated or mocked
26
+ - [ ] Time-dependent code controlled
27
+ - [ ] Random values seeded
28
+
29
+ ## Test Maintenance
30
+ - [ ] Tests updated with code changes
31
+ - [ ] Dead tests removed
32
+ - [ ] Test data managed properly
33
+ - [ ] CI/CD integration working
@@ -0,0 +1,37 @@
1
+ # UX/UI Checklist
2
+
3
+ > Applies to: Web, Mobile, CLI, Desktop, API DX
4
+
5
+ ## User Experience
6
+ - [ ] Clear user journey/flow
7
+ - [ ] Feedback for every action
8
+ - [ ] Loading states shown
9
+ - [ ] Error states handled gracefully
10
+ - [ ] Success confirmation provided
11
+
12
+ ## Interface Design
13
+ - [ ] Consistent visual language
14
+ - [ ] Intuitive navigation
15
+ - [ ] Responsive/adaptive layout (if applicable)
16
+ - [ ] Touch targets adequate (mobile)
17
+ - [ ] Keyboard navigation (web/desktop)
18
+
19
+ ## CLI Specific
20
+ - [ ] Help text for all commands
21
+ - [ ] Clear error messages with suggestions
22
+ - [ ] Progress indicators for long operations
23
+ - [ ] Consistent flag naming conventions
24
+ - [ ] Exit codes meaningful
25
+
26
+ ## API DX (Developer Experience)
27
+ - [ ] Intuitive endpoint/function naming
28
+ - [ ] Consistent response format
29
+ - [ ] Helpful error messages with codes
30
+ - [ ] Good documentation with examples
31
+ - [ ] Predictable behavior
32
+
33
+ ## Information Architecture
34
+ - [ ] Content hierarchy clear
35
+ - [ ] Important actions prominent
36
+ - [ ] Related items grouped
37
+ - [ ] Search/filter for large datasets
@@ -1,10 +1,36 @@
1
1
  ---
2
- allowed-tools: [Read, Write]
2
+ allowed-tools: [Read, Write, Task, Glob]
3
3
  description: 'Report bug with auto-priority'
4
4
  ---
5
5
 
6
6
  # /p:bug
7
7
 
8
+ ## Agent Delegation (REQUIRED)
9
+
10
+ Before fixing a bug, delegate to specialist agent:
11
+
12
+ 1. **List agents**: `Glob("~/.prjct-cli/projects/{projectId}/agents/*.md")`
13
+ 2. **Analyze bug domain**: frontend, backend, database, etc.
14
+ 3. **Delegate via Task tool**:
15
+
16
+ ```
17
+ Task(
18
+ subagent_type: 'general-purpose',
19
+ prompt: '
20
+ ## Agent
21
+ Read: ~/.prjct-cli/projects/{projectId}/agents/{agent}.md
22
+
23
+ ## Bug
24
+ {bug description}
25
+
26
+ ## Flow
27
+ 1. Read agent file
28
+ 2. Apply expertise to fix bug
29
+ 3. Return fix
30
+ '
31
+ )
32
+ ```
33
+
8
34
  ## Severity Keywords
9
35
  - **Critical**: crash, down, broken, production
10
36
  - **High**: error, fail, issue
@@ -1,11 +1,48 @@
1
1
  ---
2
- allowed-tools: [Read, Write, Bash]
2
+ allowed-tools: [Read, Write, Bash, Task, Glob]
3
3
  description: 'Value analysis + roadmap + task breakdown + auto-start'
4
4
  timestamp-rule: 'GetTimestamp() and GetDate() for ALL timestamps'
5
5
  ---
6
6
 
7
7
  # /p:feature - Add Feature to Roadmap
8
8
 
9
+ ## Agent Delegation (REQUIRED)
10
+
11
+ Before executing any code-related task, delegate to a specialist agent:
12
+
13
+ ### Step 0: Assign Agent
14
+
15
+ 1. **List agents**: `Glob("~/.prjct-cli/projects/{projectId}/agents/*.md")`
16
+ 2. **Read routing**: `Read("templates/agentic/agent-routing.md")`
17
+ 3. **Analyze task**: Determine domain (frontend, backend, testing, etc.)
18
+ 4. **Select agent**: Match task to best agent
19
+ 5. **Delegate via Task tool** (pass reference, NOT content):
20
+
21
+ ```
22
+ Task(
23
+ subagent_type: 'general-purpose',
24
+ prompt: '
25
+ ## Agent Assignment
26
+ Read and apply: ~/.prjct-cli/projects/{projectId}/agents/{agent-name}.md
27
+
28
+ ## Task
29
+ {feature description}
30
+
31
+ ## Context
32
+ - Project: {projectPath}
33
+ - Feature: {feature}
34
+
35
+ ## Flow
36
+ 1. Read agent file FIRST
37
+ 2. Apply agent expertise
38
+ 3. Execute task
39
+ 4. Return results
40
+ '
41
+ )
42
+ ```
43
+
44
+ **CRITICAL:** Pass file PATH, not content. Subagent reads it (~200 bytes vs 3-5KB).
45
+
9
46
  ## Context Variables
10
47
  - `{projectId}`: From `.prjct/prjct.config.json`
11
48
  - `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
@@ -1,10 +1,36 @@
1
1
  ---
2
- allowed-tools: [Read, Write, TodoWrite]
2
+ allowed-tools: [Read, Write, TodoWrite, Task, Glob]
3
3
  description: 'Break down complex tasks'
4
4
  ---
5
5
 
6
6
  # /p:task
7
7
 
8
+ ## Agent Delegation (REQUIRED)
9
+
10
+ Before executing task, delegate to specialist agent:
11
+
12
+ 1. **List agents**: `Glob("~/.prjct-cli/projects/{projectId}/agents/*.md")`
13
+ 2. **Analyze task domain**: Match to agent expertise
14
+ 3. **Delegate via Task tool**:
15
+
16
+ ```
17
+ Task(
18
+ subagent_type: 'general-purpose',
19
+ prompt: '
20
+ ## Agent
21
+ Read: ~/.prjct-cli/projects/{projectId}/agents/{agent}.md
22
+
23
+ ## Task
24
+ {task description}
25
+
26
+ ## Flow
27
+ 1. Read agent file
28
+ 2. Apply expertise
29
+ 3. Execute task
30
+ '
31
+ )
32
+ ```
33
+
8
34
  ## Usage
9
35
 
10
36
  ```