gentle-agent-extensions 1.0.0 → 1.2.0
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/README.md +177 -287
- package/package.json +17 -14
- package/resources/agents/architecture-council.md +158 -0
- package/resources/overlays/orchestrator.overlay.md +162 -0
- package/resources/routing/architecture-council.md +65 -0
- package/resources/skills/architecture-quest/SKILL.md +238 -0
- package/resources/skills/gentle-agent-extension/SKILL.md +329 -0
- package/src/extension.ts +544 -0
- package/.manifest.json +0 -15
- package/agents/.gitkeep +0 -0
- package/assets/.gitkeep +0 -0
- package/docs/conventions.md +0 -278
- package/extensions/gentle-agent-extensions.ts +0 -547
- package/mcp/.gitkeep +0 -31
- package/overlays/.gitkeep +0 -0
- package/routing/.gitkeep +0 -0
- package/scripts/doctor.sh +0 -509
- package/scripts/install.sh +0 -206
- package/scripts/sync.sh +0 -513
- package/skills/gentle-agent-extension/SKILL.md +0 -360
- package/tests/gentle-extensions.test.ts +0 -653
package/docs/conventions.md
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
# Declarative Conventions for gentle-agent-extensions
|
|
2
|
-
|
|
3
|
-
This document defines the file structure and conventions for extending Gentle AI and Gentle Pi through this project.
|
|
4
|
-
|
|
5
|
-
## Directory Structure
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
gentle-agent-extensions/
|
|
9
|
-
├── agents/ # Custom agent definitions (Markdown with YAML frontmatter)
|
|
10
|
-
├── routing/ # Routing instructions for custom agents
|
|
11
|
-
├── overlays/ # Instruction overlays for orchestrator and existing agents
|
|
12
|
-
├── skills/ # Project skills for agent programming
|
|
13
|
-
├── mcp/ # MCP server definitions (JSON)
|
|
14
|
-
├── scripts/ # Installation and synchronization scripts
|
|
15
|
-
├── tests/ # Automated tests
|
|
16
|
-
├── assets/ # Templates, schemas, examples
|
|
17
|
-
├── docs/ # Documentation
|
|
18
|
-
└── .manifest.json # Track project-owned files
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## 1. Agent Definitions (`agents/`)
|
|
22
|
-
|
|
23
|
-
Custom agents follow Gentle Pi's native agent format: Markdown files with YAML frontmatter.
|
|
24
|
-
|
|
25
|
-
### File Naming
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
agents/{agent-name}.md
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Frontmatter Schema
|
|
32
|
-
|
|
33
|
-
```yaml
|
|
34
|
-
---
|
|
35
|
-
name: {agent-name}
|
|
36
|
-
description: "One-line description of when this agent should be used"
|
|
37
|
-
model: {provider/model} # optional, e.g. "anthropic/claude-opus-4"
|
|
38
|
-
thinking: {minimal|low|medium|high} # optional
|
|
39
|
-
mode: {task|background} # optional, default: task
|
|
40
|
-
tools: [tool1, tool2, ...] # optional, defaults to Pi defaults
|
|
41
|
-
---
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Body
|
|
45
|
-
|
|
46
|
-
The body contains the agent's instructions/prompt. This follows the same format as Gentle AI's agent definitions.
|
|
47
|
-
|
|
48
|
-
### Discovery
|
|
49
|
-
|
|
50
|
-
Agents are discovered by Gentle Pi from:
|
|
51
|
-
- Global: `~/.pi/agent/agents/`, `~/.pi/agent/subagents/`
|
|
52
|
-
- Project: `<cwd>/.pi/agents/`, `<cwd>/.pi/subagents/`
|
|
53
|
-
|
|
54
|
-
This project's `sync.sh` will symlink or copy agents from `agents/` to the appropriate project directory.
|
|
55
|
-
|
|
56
|
-
## 2. Routing Instructions (`routing/`)
|
|
57
|
-
|
|
58
|
-
Routing instructions tell the orchestrator when to delegate to a custom agent.
|
|
59
|
-
|
|
60
|
-
### File Naming
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
routing/{agent-name}.md
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Format
|
|
67
|
-
|
|
68
|
-
```markdown
|
|
69
|
-
---
|
|
70
|
-
agent: {agent-name}
|
|
71
|
-
triggers:
|
|
72
|
-
- "trigger phrase 1"
|
|
73
|
-
- "trigger phrase 2"
|
|
74
|
-
conditions:
|
|
75
|
-
- "condition description"
|
|
76
|
-
delegation: subagent_run
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
# Routing Instructions for {agent-name}
|
|
80
|
-
|
|
81
|
-
## When to Use
|
|
82
|
-
|
|
83
|
-
[Description of when this agent should be delegated to]
|
|
84
|
-
|
|
85
|
-
## How to Delegate
|
|
86
|
-
|
|
87
|
-
Use the `subagent_run` tool with:
|
|
88
|
-
- `agent`: "{agent-name}"
|
|
89
|
-
- `task`: "[specific task description]"
|
|
90
|
-
- `label`: "[3-6 word label]"
|
|
91
|
-
- `mode`: "task" | "background"
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Skill Integration
|
|
95
|
-
|
|
96
|
-
Each agent that needs semantic routing should have an associated skill in `skills/` with an explicit Activation Contract.
|
|
97
|
-
|
|
98
|
-
## 3. Overlays (`overlays/`)
|
|
99
|
-
|
|
100
|
-
Overlays add instructions to existing agents or the orchestrator without modifying their original definitions.
|
|
101
|
-
|
|
102
|
-
### File Naming
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
overlays/{target-name}.overlay.md
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Where `{target-name}` is either:
|
|
109
|
-
- An agent name (e.g., `gentle-ai-worker.overlay.md`)
|
|
110
|
-
- `orchestrator` for orchestrator-level overlays
|
|
111
|
-
|
|
112
|
-
### Format
|
|
113
|
-
|
|
114
|
-
```markdown
|
|
115
|
-
---
|
|
116
|
-
target: {agent-name|orchestrator}
|
|
117
|
-
priority: 100 # optional, higher = applied later
|
|
118
|
-
mode: append # currently only 'append' is supported
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
# Overlay for {target-name}
|
|
122
|
-
|
|
123
|
-
## Additional Instructions
|
|
124
|
-
|
|
125
|
-
[Instructions to append to the target's prompt]
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Application Mechanism
|
|
129
|
-
|
|
130
|
-
Overlays are applied via the `before_agent_start` event by mutating `systemPromptOptions.appendSystemPrompt`. This follows Gentle Pi's established pattern (see `lib/append-system-prompt.ts`).
|
|
131
|
-
|
|
132
|
-
## 4. Skills (`skills/`)
|
|
133
|
-
|
|
134
|
-
Skills follow the Gentle AI skill format with required sections:
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
skills/{skill-name}/
|
|
138
|
-
├── SKILL.md
|
|
139
|
-
├── assets/ # optional
|
|
140
|
-
└── references/ # optional
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Required SKILL.md Sections
|
|
144
|
-
|
|
145
|
-
1. **Activation Contract** - When to use this skill
|
|
146
|
-
2. **Hard Rules** - Constraints and restrictions
|
|
147
|
-
3. **Decision Gates** - Decision tables for choices
|
|
148
|
-
4. **Execution Steps** - Step-by-step procedures
|
|
149
|
-
5. **Output Contract** - What the agent should produce
|
|
150
|
-
6. **References** - Local file paths
|
|
151
|
-
|
|
152
|
-
## 5. Installation Profiles
|
|
153
|
-
|
|
154
|
-
The project supports multiple installation targets:
|
|
155
|
-
|
|
156
|
-
| Profile | Agent Home | Use Case |
|
|
157
|
-
|---------|------------|----------|
|
|
158
|
-
| `pi` | `~/.pi/agent` | Standard Pi installation |
|
|
159
|
-
| `gentle-shell` | `~/.local/share/gentle-shell/agent` | Isolated Gentle Shell |
|
|
160
|
-
| `gentle-shell-linked` | `~/.pi/agent` | Gentle Shell with `--link` |
|
|
161
|
-
|
|
162
|
-
## 6. Sync Behavior
|
|
163
|
-
|
|
164
|
-
`sync.sh` performs:
|
|
165
|
-
1. Detect declared features (agents, routing, overlays, skills, mcp)
|
|
166
|
-
2. Validate metadata and files
|
|
167
|
-
3. Resolve native agent/skill paths for the target profile
|
|
168
|
-
4. Install/update only project-owned files
|
|
169
|
-
5. Update skill registry via official mechanism
|
|
170
|
-
6. Prepare orchestrator routing context
|
|
171
|
-
7. Validate overlays, detect conflicts
|
|
172
|
-
8. Update manifest
|
|
173
|
-
9. Report issues requiring intervention
|
|
174
|
-
|
|
175
|
-
Idempotent: repeated runs with same config produce no changes.
|
|
176
|
-
|
|
177
|
-
## 7. MCP Server Definitions (`mcp/`)
|
|
178
|
-
|
|
179
|
-
MCP servers are defined as JSON files in the `mcp/` directory. Each file defines one server.
|
|
180
|
-
|
|
181
|
-
### File Naming
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
mcp/{server-name}.mcp.json
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Schema
|
|
188
|
-
|
|
189
|
-
```json
|
|
190
|
-
{
|
|
191
|
-
"name": "server-name",
|
|
192
|
-
"description": "What this server provides",
|
|
193
|
-
"transport": "stdio|http",
|
|
194
|
-
"command": "npx",
|
|
195
|
-
"args": ["-y", "@pkg/server"],
|
|
196
|
-
"url": "https://example.com/mcp",
|
|
197
|
-
"env": {"KEY": "${ENV_VAR}"},
|
|
198
|
-
"exposure": "codemode",
|
|
199
|
-
"toolExposure": {},
|
|
200
|
-
"enabled": true,
|
|
201
|
-
"timeout": 60,
|
|
202
|
-
"install": {
|
|
203
|
-
"package": "@pkg/server",
|
|
204
|
-
"version": "1.0.0",
|
|
205
|
-
"manager": "npx"
|
|
206
|
-
},
|
|
207
|
-
"auth": {
|
|
208
|
-
"type": "oauth|bearer|none",
|
|
209
|
-
"envVar": "TOKEN_ENV_VAR",
|
|
210
|
-
"description": "OAuth flow or bearer token"
|
|
211
|
-
},
|
|
212
|
-
"capabilities": ["tools", "resources"],
|
|
213
|
-
"agentDependencies": ["agent-name"]
|
|
214
|
-
}
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Field Descriptions
|
|
218
|
-
|
|
219
|
-
| Field | Required | Description |
|
|
220
|
-
|-------|----------|-------------|
|
|
221
|
-
| `name` | Yes | Unique identifier (letters, digits, `_`, `-` only) |
|
|
222
|
-
| `description` | Yes | One-line description for system prompt |
|
|
223
|
-
| `transport` | Yes | `stdio` or `http` (streamable HTTP) |
|
|
224
|
-
| `command` | stdio only | Executable (not shell command) |
|
|
225
|
-
| `args` | stdio only | Array of arguments |
|
|
226
|
-
| `url` | http only | Server URL |
|
|
227
|
-
| `env` | No | Environment variables; use `${VAR}` for substitution |
|
|
228
|
-
| `exposure` | No | Tool exposure: `codemode` (default), `direct`, `deferred`, `hidden` |
|
|
229
|
-
| `toolExposure` | No | Per-tool exposure overrides |
|
|
230
|
-
| `enabled` | No | Default `true`; `false` keeps entry without connecting |
|
|
231
|
-
| `timeout` | No | Per-request timeout in seconds (default 60) |
|
|
232
|
-
| `install` | No | Installation metadata for optional auto-install |
|
|
233
|
-
| `auth` | No | Authentication requirements (no secrets in repo) |
|
|
234
|
-
| `capabilities` | No | Declared: `tools`, `resources` |
|
|
235
|
-
| `agentDependencies` | No | List of agent names that need this server |
|
|
236
|
-
|
|
237
|
-
### Discovery
|
|
238
|
-
|
|
239
|
-
The extension discovers `*.mcp.json` files in `mcp/` on `session_start` and registers them via `pi.registerMcpServer()`.
|
|
240
|
-
|
|
241
|
-
### Agent MCP Dependencies
|
|
242
|
-
|
|
243
|
-
Agents can declare MCP dependencies in their routing files:
|
|
244
|
-
|
|
245
|
-
```markdown
|
|
246
|
-
---
|
|
247
|
-
agent: my-agent
|
|
248
|
-
mcpDependencies:
|
|
249
|
-
- github
|
|
250
|
-
- filesystem
|
|
251
|
-
---
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
The orchestrator overlay includes available MCP servers and their capabilities.
|
|
255
|
-
|
|
256
|
-
## 8. Manifest Format
|
|
257
|
-
|
|
258
|
-
`.manifest.json` tracks project-owned files:
|
|
259
|
-
|
|
260
|
-
```json
|
|
261
|
-
{
|
|
262
|
-
"version": "1.0",
|
|
263
|
-
"managedPaths": {
|
|
264
|
-
"extensions": [".pi/extensions/gentle-agent-extensions.ts"],
|
|
265
|
-
"agents": [".pi/agents/custom-agent.md"],
|
|
266
|
-
"routing": [".pi/routing/custom-agent.md"],
|
|
267
|
-
"overlays": [".pi/overlays/orchestrator.overlay.md"],
|
|
268
|
-
"skills": ["skills/custom-skill/SKILL.md"],
|
|
269
|
-
"mcp": ["mcp/server.mcp.json"],
|
|
270
|
-
"scripts": ["scripts/sync.sh"],
|
|
271
|
-
"assets": []
|
|
272
|
-
},
|
|
273
|
-
"installProfiles": {
|
|
274
|
-
"pi": { "agentHome": "~/.pi/agent" },
|
|
275
|
-
"gentle-shell": { "agentHome": "~/.local/share/gentle-shell/agent" }
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
```
|