@swarp/cli 0.0.4 → 0.1.0-rc.33
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/.claude-plugin/plugin.json +7 -0
- package/.mcp.json +8 -0
- package/hooks/confirm-cost.sh +40 -0
- package/hooks/hooks.json +18 -0
- package/package.json +6 -4
- package/skills/swarp/SKILL.md +88 -0
- package/src/init/index.mjs +11 -142
- package/src/init/index.test.mjs +21 -143
- package/src/mcp-server/index.mjs +23 -11
- package/src/mcp-server/onboard.mjs +291 -0
- package/proto/swarp/v1/swarp.proto +0 -157
- package/src/init/wizard.mjs +0 -38
- package/src/skill/generate.mjs +0 -141
- package/src/templates/agent.yaml +0 -132
- package/src/templates/agent.yaml.example.hbs +0 -137
- package/src/templates/agent.yaml.hbs +0 -40
- package/src/templates/router.yaml.hbs +0 -11
- package/src/templates/workflow.yml +0 -20
- package/src/templates/workflow.yml.hbs +0 -16
package/src/templates/agent.yaml
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# agents/example/agent.yaml
|
|
2
|
-
#
|
|
3
|
-
# SWARP agent configuration — all fields shown with explanations.
|
|
4
|
-
# Required fields: name, version, grpc_port, router_url, modes
|
|
5
|
-
# All other fields are optional.
|
|
6
|
-
|
|
7
|
-
# ── Identity ──────────────────────────────────────────────────────────────────
|
|
8
|
-
|
|
9
|
-
# Unique agent name. Used as the key in the router registry and as the MCP tool
|
|
10
|
-
# name exposed to Claude Code.
|
|
11
|
-
name: example
|
|
12
|
-
|
|
13
|
-
# Semantic version of this agent's configuration. The runner reports this
|
|
14
|
-
# version to the router on registration and includes it in AgentEvent metadata.
|
|
15
|
-
version: '1.0.0'
|
|
16
|
-
|
|
17
|
-
# ── Network ───────────────────────────────────────────────────────────────────
|
|
18
|
-
|
|
19
|
-
# gRPC port this runner listens on. Each agent on the same Fly Machine must
|
|
20
|
-
# use a unique port. The router connects to this port for Dispatch calls.
|
|
21
|
-
grpc_port: 50052
|
|
22
|
-
|
|
23
|
-
# Address of the SWARP router. Use an env var reference so the value is not
|
|
24
|
-
# hardcoded and can differ between local dev and production.
|
|
25
|
-
router_url: '${SWARP_ROUTER_URL}'
|
|
26
|
-
|
|
27
|
-
# ── Persona ───────────────────────────────────────────────────────────────────
|
|
28
|
-
|
|
29
|
-
# persona sets the character of this agent. It is prepended to every prompt
|
|
30
|
-
# as a system-level instruction before any mode-specific content.
|
|
31
|
-
persona: |
|
|
32
|
-
You are example, a focused software engineer.
|
|
33
|
-
You write clean, tested, idiomatic code.
|
|
34
|
-
You ask clarifying questions before starting large tasks.
|
|
35
|
-
You never make up facts.
|
|
36
|
-
|
|
37
|
-
# ── Preamble ──────────────────────────────────────────────────────────────────
|
|
38
|
-
|
|
39
|
-
# preamble is injected after the persona and before the user's task. Use it
|
|
40
|
-
# for project-specific conventions that every mode should know about.
|
|
41
|
-
preamble: |
|
|
42
|
-
Project: monorepo (Bun + React + Supabase)
|
|
43
|
-
Branch policy: never push to main; always use feature branches.
|
|
44
|
-
Test runner: bun test
|
|
45
|
-
Linter: bun run lint
|
|
46
|
-
|
|
47
|
-
# ── Modes ─────────────────────────────────────────────────────────────────────
|
|
48
|
-
|
|
49
|
-
# A mode is a named capability of this agent. The router's classifier selects
|
|
50
|
-
# a mode based on keywords in the incoming task description.
|
|
51
|
-
#
|
|
52
|
-
# Required per mode: name
|
|
53
|
-
# Optional: description, model, max_turns, timeout_minutes, tools, skills, hooks, env
|
|
54
|
-
modes:
|
|
55
|
-
- name: implement
|
|
56
|
-
description: 'Implement a feature or fix a bug from a spec'
|
|
57
|
-
# Model to use for this mode. Defaults to the runner's configured default.
|
|
58
|
-
model: claude-opus-4-5
|
|
59
|
-
# Maximum number of agentic turns before the runner halts the session.
|
|
60
|
-
max_turns: 40
|
|
61
|
-
# Session wall-clock timeout in minutes. The runner cancels the claude
|
|
62
|
-
# process when this expires.
|
|
63
|
-
timeout_minutes: 30
|
|
64
|
-
# tools lists MCP tool names this mode is allowed to call.
|
|
65
|
-
tools:
|
|
66
|
-
- Read
|
|
67
|
-
- Edit
|
|
68
|
-
- Write
|
|
69
|
-
- Bash
|
|
70
|
-
- Glob
|
|
71
|
-
- Grep
|
|
72
|
-
# skills lists slash-command skill names this mode loads on startup.
|
|
73
|
-
skills:
|
|
74
|
-
- superpowers:test-driven-development
|
|
75
|
-
- superpowers:systematic-debugging
|
|
76
|
-
# hooks are shell commands run before or after the session.
|
|
77
|
-
hooks:
|
|
78
|
-
pre_session:
|
|
79
|
-
- 'git fetch origin'
|
|
80
|
-
post_session:
|
|
81
|
-
- 'bun run lint'
|
|
82
|
-
- 'bun test'
|
|
83
|
-
# env injects key=value pairs into the runner's process environment.
|
|
84
|
-
# Secrets should use ${SECRET_NAME} references.
|
|
85
|
-
env:
|
|
86
|
-
NODE_ENV: development
|
|
87
|
-
|
|
88
|
-
- name: review
|
|
89
|
-
description: 'Review code and provide structured feedback'
|
|
90
|
-
model: claude-sonnet-4-5
|
|
91
|
-
max_turns: 20
|
|
92
|
-
timeout_minutes: 15
|
|
93
|
-
tools:
|
|
94
|
-
- Read
|
|
95
|
-
- Glob
|
|
96
|
-
- Grep
|
|
97
|
-
skills:
|
|
98
|
-
- superpowers:requesting-code-review
|
|
99
|
-
|
|
100
|
-
- name: debug
|
|
101
|
-
description: 'Diagnose and fix a failing test or runtime error'
|
|
102
|
-
model: claude-opus-4-5
|
|
103
|
-
max_turns: 30
|
|
104
|
-
timeout_minutes: 25
|
|
105
|
-
tools:
|
|
106
|
-
- Read
|
|
107
|
-
- Edit
|
|
108
|
-
- Write
|
|
109
|
-
- Bash
|
|
110
|
-
- Glob
|
|
111
|
-
- Grep
|
|
112
|
-
skills:
|
|
113
|
-
- superpowers:systematic-debugging
|
|
114
|
-
- superpowers:test-driven-development
|
|
115
|
-
|
|
116
|
-
- name: plan
|
|
117
|
-
description: 'Write an implementation plan for a feature or refactor'
|
|
118
|
-
model: claude-sonnet-4-5
|
|
119
|
-
max_turns: 15
|
|
120
|
-
timeout_minutes: 15
|
|
121
|
-
tools:
|
|
122
|
-
- Read
|
|
123
|
-
- Glob
|
|
124
|
-
- Grep
|
|
125
|
-
skills:
|
|
126
|
-
- superpowers:writing-plans
|
|
127
|
-
|
|
128
|
-
# ── Env file ──────────────────────────────────────────────────────────────────
|
|
129
|
-
|
|
130
|
-
# Path to a .env file loaded before any session starts. Relative to the agent
|
|
131
|
-
# config file. Use this for secrets that differ between environments.
|
|
132
|
-
# env_file: .env
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# agents/{{firstAgentName}}/agent.yaml
|
|
2
|
-
#
|
|
3
|
-
# SWARP agent configuration — all fields shown with explanations.
|
|
4
|
-
# Required fields: name, version, grpc_port, router_url, modes
|
|
5
|
-
# All other fields are optional.
|
|
6
|
-
|
|
7
|
-
# ── Identity ──────────────────────────────────────────────────────────────────
|
|
8
|
-
|
|
9
|
-
# Unique agent name. Used as the key in the router registry and as the MCP tool
|
|
10
|
-
# name exposed to Claude Code.
|
|
11
|
-
name: {{firstAgentName}}
|
|
12
|
-
|
|
13
|
-
# Semantic version of this agent's configuration. The runner reports this
|
|
14
|
-
# version to the router on registration and includes it in AgentEvent metadata.
|
|
15
|
-
version: '1.0.0'
|
|
16
|
-
|
|
17
|
-
# ── Network ───────────────────────────────────────────────────────────────────
|
|
18
|
-
|
|
19
|
-
# gRPC port this runner listens on. Each agent on the same Fly Machine must
|
|
20
|
-
# use a unique port. The router connects to this port for Dispatch calls.
|
|
21
|
-
grpc_port: 50052
|
|
22
|
-
|
|
23
|
-
# Address of the SWARP router. Use an env var reference so the value is not
|
|
24
|
-
# hardcoded and can differ between local dev and production.
|
|
25
|
-
router_url: '${SWARP_ROUTER_URL}'
|
|
26
|
-
|
|
27
|
-
# ── Persona ───────────────────────────────────────────────────────────────────
|
|
28
|
-
|
|
29
|
-
# persona sets the character of this agent. It is prepended to every prompt
|
|
30
|
-
# as a system-level instruction before any mode-specific content.
|
|
31
|
-
persona: |
|
|
32
|
-
You are {{firstAgentName}}, a focused software engineer.
|
|
33
|
-
You write clean, tested, idiomatic code.
|
|
34
|
-
You ask clarifying questions before starting large tasks.
|
|
35
|
-
You never make up facts.
|
|
36
|
-
|
|
37
|
-
# ── Preamble ──────────────────────────────────────────────────────────────────
|
|
38
|
-
|
|
39
|
-
# preamble is injected after the persona and before the user's task. Use it
|
|
40
|
-
# for project-specific conventions that every mode should know about.
|
|
41
|
-
preamble: |
|
|
42
|
-
Project: monorepo (Bun + React + Supabase)
|
|
43
|
-
Branch policy: never push to main; always use feature branches.
|
|
44
|
-
Test runner: bun test
|
|
45
|
-
Linter: bun run lint
|
|
46
|
-
|
|
47
|
-
# ── Modes ─────────────────────────────────────────────────────────────────────
|
|
48
|
-
|
|
49
|
-
# A mode is a named capability of this agent. The router's classifier selects
|
|
50
|
-
# a mode based on keywords in the incoming task description.
|
|
51
|
-
#
|
|
52
|
-
# Required per mode: name
|
|
53
|
-
# Optional: description, model, max_turns, timeout_minutes, tools, skills, hooks, env
|
|
54
|
-
modes:
|
|
55
|
-
- name: implement
|
|
56
|
-
description: 'Implement a feature or fix a bug from a spec'
|
|
57
|
-
# Model to use for this mode. Defaults to the runner's configured default.
|
|
58
|
-
model: claude-opus-4-5
|
|
59
|
-
# Maximum number of agentic turns before the runner halts the session.
|
|
60
|
-
max_turns: 40
|
|
61
|
-
# Session wall-clock timeout in minutes. The runner cancels the claude
|
|
62
|
-
# process when this expires.
|
|
63
|
-
timeout_minutes: 30
|
|
64
|
-
# tools lists MCP tool names this mode is allowed to call.
|
|
65
|
-
# Use an allowlist to prevent accidental side effects.
|
|
66
|
-
tools:
|
|
67
|
-
- Read
|
|
68
|
-
- Edit
|
|
69
|
-
- Write
|
|
70
|
-
- Bash
|
|
71
|
-
- Glob
|
|
72
|
-
- Grep
|
|
73
|
-
# skills lists slash-command skill names this mode loads on startup.
|
|
74
|
-
skills:
|
|
75
|
-
- superpowers:test-driven-development
|
|
76
|
-
- superpowers:systematic-debugging
|
|
77
|
-
# hooks are shell commands run before or after the session.
|
|
78
|
-
hooks:
|
|
79
|
-
pre_session:
|
|
80
|
-
- 'git fetch origin'
|
|
81
|
-
post_session:
|
|
82
|
-
- 'bun run lint'
|
|
83
|
-
- 'bun test'
|
|
84
|
-
# env injects key=value pairs into the runner's process environment for
|
|
85
|
-
# this mode only. Secrets should use ${SECRET_NAME} references.
|
|
86
|
-
env:
|
|
87
|
-
NODE_ENV: development
|
|
88
|
-
SOME_API_KEY: '${SOME_API_KEY}'
|
|
89
|
-
|
|
90
|
-
- name: review
|
|
91
|
-
description: 'Review code and provide structured feedback'
|
|
92
|
-
model: claude-sonnet-4-5
|
|
93
|
-
max_turns: 20
|
|
94
|
-
timeout_minutes: 15
|
|
95
|
-
tools:
|
|
96
|
-
- Read
|
|
97
|
-
- Glob
|
|
98
|
-
- Grep
|
|
99
|
-
skills:
|
|
100
|
-
- superpowers:requesting-code-review
|
|
101
|
-
|
|
102
|
-
- name: debug
|
|
103
|
-
description: 'Diagnose and fix a failing test or runtime error'
|
|
104
|
-
model: claude-opus-4-5
|
|
105
|
-
max_turns: 30
|
|
106
|
-
timeout_minutes: 25
|
|
107
|
-
tools:
|
|
108
|
-
- Read
|
|
109
|
-
- Edit
|
|
110
|
-
- Write
|
|
111
|
-
- Bash
|
|
112
|
-
- Glob
|
|
113
|
-
- Grep
|
|
114
|
-
skills:
|
|
115
|
-
- superpowers:systematic-debugging
|
|
116
|
-
- superpowers:test-driven-development
|
|
117
|
-
hooks:
|
|
118
|
-
pre_session:
|
|
119
|
-
- 'bun test 2>&1 | tail -30'
|
|
120
|
-
|
|
121
|
-
- name: plan
|
|
122
|
-
description: 'Write an implementation plan for a feature or refactor'
|
|
123
|
-
model: claude-sonnet-4-5
|
|
124
|
-
max_turns: 15
|
|
125
|
-
timeout_minutes: 15
|
|
126
|
-
tools:
|
|
127
|
-
- Read
|
|
128
|
-
- Glob
|
|
129
|
-
- Grep
|
|
130
|
-
skills:
|
|
131
|
-
- superpowers:writing-plans
|
|
132
|
-
|
|
133
|
-
# ── Env file ──────────────────────────────────────────────────────────────────
|
|
134
|
-
|
|
135
|
-
# Path to a .env file loaded before any session starts. Relative to the agent
|
|
136
|
-
# config file. Use this for secrets that differ between environments.
|
|
137
|
-
# env_file: .env
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: {{name}}
|
|
2
|
-
display_name: "{{display_name}}"
|
|
3
|
-
version: "1.0.0"
|
|
4
|
-
grpc_port: 50052
|
|
5
|
-
router_url: "${SWARP_ROUTER_URL}"
|
|
6
|
-
region: iad
|
|
7
|
-
|
|
8
|
-
sprite: "{{name}}"
|
|
9
|
-
sprite_url: "{{sprite_url}}"
|
|
10
|
-
|
|
11
|
-
persona:
|
|
12
|
-
role: "Agent"
|
|
13
|
-
bio: "A SWARP agent."
|
|
14
|
-
avatar: "avatar.png"
|
|
15
|
-
|
|
16
|
-
preamble: |
|
|
17
|
-
You are {{display_name}}, a capable AI agent.
|
|
18
|
-
|
|
19
|
-
skills: []
|
|
20
|
-
|
|
21
|
-
modes:
|
|
22
|
-
chat:
|
|
23
|
-
description: "Chat with the agent"
|
|
24
|
-
model: haiku
|
|
25
|
-
max_turns: 1
|
|
26
|
-
timeout_minutes: 5
|
|
27
|
-
tools:
|
|
28
|
-
allowed: []
|
|
29
|
-
blocked: []
|
|
30
|
-
input:
|
|
31
|
-
message:
|
|
32
|
-
type: string
|
|
33
|
-
required: true
|
|
34
|
-
description: "User message"
|
|
35
|
-
output:
|
|
36
|
-
schema:
|
|
37
|
-
reply:
|
|
38
|
-
type: string
|
|
39
|
-
prompt: |
|
|
40
|
-
{{ message }}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# .github/workflows/deploy-agents.yml
|
|
2
|
-
#
|
|
3
|
-
# Generated by `npx @swarp/cli init`
|
|
4
|
-
# Triggers on changes to agent configs or router config, deploys via SWARP CI.
|
|
5
|
-
name: Deploy Agents
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [main]
|
|
9
|
-
paths: [agents/**, router.yaml]
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
inputs:
|
|
12
|
-
force_rebuild:
|
|
13
|
-
type: boolean
|
|
14
|
-
default: false
|
|
15
|
-
jobs:
|
|
16
|
-
deploy:
|
|
17
|
-
uses: dl3consulting/swarp-actions/.github/workflows/deploy.yml@v1
|
|
18
|
-
secrets: inherit
|
|
19
|
-
with:
|
|
20
|
-
force_rebuild: ${{ inputs.force_rebuild || false }}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
name: Deploy Agents
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
paths: [agents/**, router.yaml]
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
inputs:
|
|
8
|
-
force_rebuild:
|
|
9
|
-
type: boolean
|
|
10
|
-
default: false
|
|
11
|
-
jobs:
|
|
12
|
-
deploy:
|
|
13
|
-
uses: dl3consulting/swarp-actions/.github/workflows/deploy.yml@v1
|
|
14
|
-
secrets: inherit
|
|
15
|
-
with:
|
|
16
|
-
force_rebuild: ${{"{{"}} inputs.force_rebuild || false {{"}}"}}
|