prjct-cli 0.10.11 → 0.10.13
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 +35 -0
- package/core/agentic/agent-router.js +79 -372
- package/core/agentic/command-executor.js +45 -0
- package/core/commands.js +177 -24
- package/core/domain/agent-matcher.js +71 -185
- package/core/index.js +11 -0
- package/core/utils/branding.js +47 -0
- package/core/utils/output.js +19 -4
- package/package.json +1 -1
- package/templates/agent-assignment.md +72 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branding Configuration for prjct-cli
|
|
3
|
+
* Single source of truth for all branding across CLI and Claude Code
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const chalk = require('chalk')
|
|
7
|
+
|
|
8
|
+
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
|
|
9
|
+
const SPINNER_SPEED = 80
|
|
10
|
+
|
|
11
|
+
const branding = {
|
|
12
|
+
// Core identity
|
|
13
|
+
name: 'prjct',
|
|
14
|
+
icon: '⚡',
|
|
15
|
+
signature: '⚡ prjct',
|
|
16
|
+
|
|
17
|
+
// Spinner config
|
|
18
|
+
spinner: {
|
|
19
|
+
frames: SPINNER_FRAMES,
|
|
20
|
+
speed: SPINNER_SPEED
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// CLI output (with chalk colors)
|
|
24
|
+
cli: {
|
|
25
|
+
header: () => chalk.cyan.bold('⚡') + ' ' + chalk.cyan('prjct'),
|
|
26
|
+
footer: () => chalk.dim('⚡ prjct'),
|
|
27
|
+
spin: (frame, msg) => chalk.cyan('⚡') + ' ' + chalk.cyan('prjct') + ' ' + chalk.cyan(SPINNER_FRAMES[frame % 10]) + ' ' + chalk.dim(msg || '')
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
// Template/Claude (plain text)
|
|
31
|
+
template: {
|
|
32
|
+
header: '⚡ prjct',
|
|
33
|
+
footer: '⚡ prjct'
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Git commit footer
|
|
37
|
+
commitFooter: `🤖 Generated with [p/](https://www.prjct.app/)
|
|
38
|
+
Designed for [Claude](https://www.anthropic.com/claude)`,
|
|
39
|
+
|
|
40
|
+
// URLs
|
|
41
|
+
urls: {
|
|
42
|
+
website: 'https://prjct.app',
|
|
43
|
+
docs: 'https://prjct.app/docs'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = branding
|
package/core/utils/output.js
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal Output System for prjct-cli
|
|
3
3
|
* Spinner while working → Single line result
|
|
4
|
+
* With ⚡ prjct branding
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
const chalk = require('chalk')
|
|
8
|
+
const branding = require('./branding')
|
|
7
9
|
|
|
8
|
-
const FRAMES =
|
|
9
|
-
const SPEED =
|
|
10
|
+
const FRAMES = branding.spinner.frames
|
|
11
|
+
const SPEED = branding.spinner.speed
|
|
10
12
|
|
|
11
13
|
let interval = null
|
|
12
14
|
let frame = 0
|
|
13
15
|
|
|
14
16
|
const truncate = (s, max = 50) => (s && s.length > max ? s.slice(0, max - 1) + '…' : s || '')
|
|
15
|
-
const clear = () => process.stdout.write('\r' + ' '.repeat(
|
|
17
|
+
const clear = () => process.stdout.write('\r' + ' '.repeat(80) + '\r')
|
|
16
18
|
|
|
17
19
|
const out = {
|
|
20
|
+
// Branding: Show header at start
|
|
21
|
+
start() {
|
|
22
|
+
console.log(branding.cli.header())
|
|
23
|
+
return this
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
// Branding: Show footer at end
|
|
27
|
+
end() {
|
|
28
|
+
console.log(branding.cli.footer())
|
|
29
|
+
return this
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// Branded spinner: ⚡ prjct ⠋ message...
|
|
18
33
|
spin(msg) {
|
|
19
34
|
this.stop()
|
|
20
35
|
interval = setInterval(() => {
|
|
21
|
-
process.stdout.write(`\r${
|
|
36
|
+
process.stdout.write(`\r${branding.cli.spin(frame++, truncate(msg, 45))}`)
|
|
22
37
|
}, SPEED)
|
|
23
38
|
return this
|
|
24
39
|
},
|
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-assignment
|
|
3
|
+
description: Assign the best agent for a task
|
|
4
|
+
allowed-tools: [Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Assignment
|
|
8
|
+
|
|
9
|
+
Select the best agent for the given task based on semantic understanding.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
- **Task**: {{task}}
|
|
14
|
+
- **Available Agents**: {{agents}}
|
|
15
|
+
- **Project Context**: {{context}}
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
1. **Understand the Task**
|
|
20
|
+
- What domain does this task belong to?
|
|
21
|
+
- What skills are required?
|
|
22
|
+
- What is the complexity level?
|
|
23
|
+
|
|
24
|
+
2. **Analyze Available Agents**
|
|
25
|
+
- Read each agent's expertise and domain
|
|
26
|
+
- Consider their skills and past success
|
|
27
|
+
- Match capabilities to task requirements
|
|
28
|
+
|
|
29
|
+
3. **Select Best Agent**
|
|
30
|
+
- Choose the agent with highest relevance
|
|
31
|
+
- If multiple agents fit, prefer the specialist over generalist
|
|
32
|
+
- If no good match, use 'generalist' or 'full-stack'
|
|
33
|
+
|
|
34
|
+
## Decision Criteria
|
|
35
|
+
|
|
36
|
+
- **Domain Match**: Does the agent's domain align with the task?
|
|
37
|
+
- **Skills Match**: Does the agent have the required skills?
|
|
38
|
+
- **Complexity Fit**: Is the agent appropriate for this complexity level?
|
|
39
|
+
|
|
40
|
+
## Output Format
|
|
41
|
+
|
|
42
|
+
Return JSON with your decision:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"agent": "agent-name",
|
|
47
|
+
"confidence": 0.85,
|
|
48
|
+
"reason": "Brief explanation of why this agent was selected",
|
|
49
|
+
"domain": "detected domain of the task"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
**Task**: "Implement React login component with form validation"
|
|
56
|
+
**Decision**: `{ "agent": "frontend-specialist", "confidence": 0.95, "reason": "React component work requires frontend expertise", "domain": "frontend" }`
|
|
57
|
+
|
|
58
|
+
**Task**: "Fix database connection timeout issue"
|
|
59
|
+
**Decision**: `{ "agent": "backend-specialist", "confidence": 0.90, "reason": "Database issues require backend/infrastructure knowledge", "domain": "backend" }`
|
|
60
|
+
|
|
61
|
+
**Task**: "Write unit tests for user service"
|
|
62
|
+
**Decision**: `{ "agent": "qa-specialist", "confidence": 0.85, "reason": "Testing tasks benefit from QA expertise", "domain": "qa" }`
|
|
63
|
+
|
|
64
|
+
**Task**: "Update README documentation"
|
|
65
|
+
**Decision**: `{ "agent": "generalist", "confidence": 0.70, "reason": "Documentation is general task, no specialist needed", "domain": "docs" }`
|
|
66
|
+
|
|
67
|
+
## Guidelines
|
|
68
|
+
|
|
69
|
+
- Prefer specialists when task clearly fits their domain
|
|
70
|
+
- Use generalist only when no specialist matches
|
|
71
|
+
- Higher confidence = stronger match
|
|
72
|
+
- Always provide a reason for transparency
|