aes-cli 0.2.0__py3-none-any.whl
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.
- aes/__init__.py +5 -0
- aes/__main__.py +37 -0
- aes/analyzer.py +487 -0
- aes/commands/__init__.py +0 -0
- aes/commands/init.py +727 -0
- aes/commands/inspect.py +204 -0
- aes/commands/install.py +379 -0
- aes/commands/publish.py +432 -0
- aes/commands/search.py +65 -0
- aes/commands/status.py +153 -0
- aes/commands/sync.py +413 -0
- aes/commands/validate.py +77 -0
- aes/config.py +43 -0
- aes/domains.py +1382 -0
- aes/frameworks.py +522 -0
- aes/mcp_server.py +213 -0
- aes/registry.py +294 -0
- aes/scaffold/agent.yaml.jinja +135 -0
- aes/scaffold/agentignore.jinja +61 -0
- aes/scaffold/instructions.md.jinja +311 -0
- aes/scaffold/local.example.yaml.jinja +35 -0
- aes/scaffold/local.yaml.jinja +29 -0
- aes/scaffold/operations.md.jinja +33 -0
- aes/scaffold/orchestrator.md.jinja +95 -0
- aes/scaffold/permissions.yaml.jinja +151 -0
- aes/scaffold/setup.md.jinja +244 -0
- aes/scaffold/skill.md.jinja +27 -0
- aes/scaffold/skill.yaml.jinja +175 -0
- aes/scaffold/workflow.yaml.jinja +44 -0
- aes/scaffold/workflow_command.md.jinja +48 -0
- aes/schemas/agent.schema.json +188 -0
- aes/schemas/permissions.schema.json +100 -0
- aes/schemas/registry.schema.json +72 -0
- aes/schemas/skill.schema.json +209 -0
- aes/schemas/workflow.schema.json +92 -0
- aes/targets/__init__.py +29 -0
- aes/targets/_base.py +77 -0
- aes/targets/_composer.py +338 -0
- aes/targets/claude.py +153 -0
- aes/targets/copilot.py +48 -0
- aes/targets/cursor.py +46 -0
- aes/targets/windsurf.py +46 -0
- aes/validator.py +394 -0
- aes_cli-0.2.0.dist-info/METADATA +110 -0
- aes_cli-0.2.0.dist-info/RECORD +48 -0
- aes_cli-0.2.0.dist-info/WHEEL +5 -0
- aes_cli-0.2.0.dist-info/entry_points.txt +3 -0
- aes_cli-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
{% if domain_config and domain_config.instructions_description %}
|
|
2
|
+
# {{ name }} — Agent Instructions
|
|
3
|
+
|
|
4
|
+
{{ domain_config.instructions_description }}
|
|
5
|
+
|
|
6
|
+
## Quick Reference
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
{{ domain_config.instructions_quick_ref }}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Project Structure
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
{{ domain_config.instructions_project_structure }}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Critical Rules
|
|
19
|
+
|
|
20
|
+
{% for rule in domain_config.instructions_rules %}
|
|
21
|
+
{{ loop.index }}. {{ rule }}
|
|
22
|
+
{% endfor %}
|
|
23
|
+
|
|
24
|
+
## Primary Workflow
|
|
25
|
+
|
|
26
|
+
{% for phase in domain_config.instructions_workflow_phases %}
|
|
27
|
+
### Phase {{ loop.index }}: {{ phase.title }}
|
|
28
|
+
|
|
29
|
+
{{ phase.content }}
|
|
30
|
+
|
|
31
|
+
{% endfor %}
|
|
32
|
+
|
|
33
|
+
## Key Principle
|
|
34
|
+
|
|
35
|
+
{{ domain_config.instructions_key_principle }}
|
|
36
|
+
|
|
37
|
+
## Common Gotchas
|
|
38
|
+
|
|
39
|
+
{% if domain_config.instructions_gotchas %}
|
|
40
|
+
{% for gotcha in domain_config.instructions_gotchas %}
|
|
41
|
+
- {{ gotcha }}
|
|
42
|
+
{% endfor %}
|
|
43
|
+
{% else %}
|
|
44
|
+
<!-- AGENT: Add project-specific gotchas — hard-won lessons, common mistakes, non-obvious behaviors. -->
|
|
45
|
+
{% endif %}
|
|
46
|
+
|
|
47
|
+
## AES File Formats
|
|
48
|
+
|
|
49
|
+
When creating or editing `.agent/` files, follow these formats exactly.
|
|
50
|
+
|
|
51
|
+
### Skill manifest (`.skill.yaml`)
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
aes_skill: "1.0"
|
|
55
|
+
|
|
56
|
+
id: "my-skill"
|
|
57
|
+
name: "My Skill"
|
|
58
|
+
version: "1.0.0"
|
|
59
|
+
description: "What this skill does"
|
|
60
|
+
|
|
61
|
+
stage: 1
|
|
62
|
+
phase: "processing"
|
|
63
|
+
|
|
64
|
+
inputs:
|
|
65
|
+
required:
|
|
66
|
+
- name: "input_name"
|
|
67
|
+
type: "string"
|
|
68
|
+
description: "What this input is"
|
|
69
|
+
optional:
|
|
70
|
+
- name: "limit"
|
|
71
|
+
type: "int"
|
|
72
|
+
default: 50
|
|
73
|
+
description: "Max items"
|
|
74
|
+
environment:
|
|
75
|
+
- "API_KEY"
|
|
76
|
+
|
|
77
|
+
outputs:
|
|
78
|
+
- name: "result"
|
|
79
|
+
type: "list[str]"
|
|
80
|
+
description: "What this produces"
|
|
81
|
+
|
|
82
|
+
triggers:
|
|
83
|
+
- type: "manual"
|
|
84
|
+
command: "python scripts/run.py --stage my-skill"
|
|
85
|
+
|
|
86
|
+
error_handling:
|
|
87
|
+
strategy: "per-item-isolation" # or: fail-fast, retry-with-backoff, skip-on-error
|
|
88
|
+
|
|
89
|
+
code:
|
|
90
|
+
primary: "pipeline/my_skill.py"
|
|
91
|
+
|
|
92
|
+
depends_on:
|
|
93
|
+
- "previous-skill"
|
|
94
|
+
blocks:
|
|
95
|
+
- "next-skill"
|
|
96
|
+
tags:
|
|
97
|
+
- "my-tag"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Workflow (`.yaml`)
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
aes_workflow: "1.0"
|
|
104
|
+
|
|
105
|
+
id: "my-workflow"
|
|
106
|
+
entity: "item"
|
|
107
|
+
description: "What this workflow tracks"
|
|
108
|
+
|
|
109
|
+
states:
|
|
110
|
+
pending:
|
|
111
|
+
description: "Awaiting processing"
|
|
112
|
+
initial: true
|
|
113
|
+
processed:
|
|
114
|
+
description: "Successfully processed"
|
|
115
|
+
terminal: true
|
|
116
|
+
failed:
|
|
117
|
+
description: "Processing failed"
|
|
118
|
+
terminal: true
|
|
119
|
+
|
|
120
|
+
transitions:
|
|
121
|
+
- from: "pending"
|
|
122
|
+
to: "processed"
|
|
123
|
+
skill: "process"
|
|
124
|
+
conditions:
|
|
125
|
+
- "Input is valid"
|
|
126
|
+
- from: "pending"
|
|
127
|
+
to: "failed"
|
|
128
|
+
conditions:
|
|
129
|
+
- "Processing error"
|
|
130
|
+
|
|
131
|
+
idempotency:
|
|
132
|
+
pattern: "status-gated"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Key rules: `aes_skill`/`aes_workflow` version key is **required**. `inputs` is an **object** with `required`/`optional`/`environment` arrays, not a flat list. `states` is an **object** keyed by state ID, not an array. Use `triggers` (array of objects with `type`), not `trigger` (string). Use `error_handling.strategy`, not `error_strategy`. Use `code.primary`, not `code_location`.
|
|
136
|
+
{% else %}
|
|
137
|
+
# {{ name }} — Agent Instructions
|
|
138
|
+
|
|
139
|
+
<!-- AGENT: Write 1-2 sentences describing what this system does and its primary constraints.
|
|
140
|
+
If code exists: read README + entry point + package config.
|
|
141
|
+
If greenfield: ask the user what they're building. -->
|
|
142
|
+
|
|
143
|
+
## Quick Reference
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
<!-- AGENT: List 3-5 common commands for this project.
|
|
147
|
+
If code exists: check package.json scripts, Makefile, pyproject.toml, Cargo.toml, go.mod.
|
|
148
|
+
If greenfield: infer from tech stack ({{ language }}) or ask the user. -->
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Project Structure
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
<!-- AGENT: Annotate the directory tree with purpose of each key directory.
|
|
155
|
+
If code exists: run a directory listing and describe what each dir contains.
|
|
156
|
+
If greenfield: describe the planned structure based on the tech stack. -->
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Critical Rules
|
|
160
|
+
|
|
161
|
+
<!-- AGENT: List 3-5 inviolable constraints for this project.
|
|
162
|
+
If code exists: extract from linter config (.eslintrc, ruff.toml, .golangci.yml),
|
|
163
|
+
CI pipeline (.github/workflows/), README, and code comments.
|
|
164
|
+
If greenfield: ask about language version, security requirements, conventions.
|
|
165
|
+
Example: "Python 3.9+ — use `from __future__ import annotations` everywhere." -->
|
|
166
|
+
|
|
167
|
+
1. **Fail graceful** — Each item wrapped in try/except, log error, continue.
|
|
168
|
+
|
|
169
|
+
## Domain Model
|
|
170
|
+
|
|
171
|
+
<!-- AGENT: Describe core entities, their relationships, and primary data flow.
|
|
172
|
+
If code exists: look for models/, schemas/, types/, database migrations, API routes.
|
|
173
|
+
If greenfield: ask "What are the main entities and how do they relate?" -->
|
|
174
|
+
|
|
175
|
+
## Primary Workflow
|
|
176
|
+
|
|
177
|
+
<!-- AGENT: Define 3-5 phases of the typical development cycle.
|
|
178
|
+
If code exists: infer from scripts, CI pipeline, and project structure.
|
|
179
|
+
If greenfield: ask "What's the typical workflow for a task in this project?" -->
|
|
180
|
+
|
|
181
|
+
### Phase 1: Gather Requirements
|
|
182
|
+
|
|
183
|
+
<!-- AGENT: What does the agent need to know before starting?
|
|
184
|
+
If code exists: look at test fixtures, config files, example inputs.
|
|
185
|
+
If greenfield: ask the user. -->
|
|
186
|
+
|
|
187
|
+
### Phase 2: Execute
|
|
188
|
+
|
|
189
|
+
<!-- AGENT: What does the agent do? What commands does it run?
|
|
190
|
+
If code exists: identify build, run, and test commands.
|
|
191
|
+
If greenfield: infer from tech stack. -->
|
|
192
|
+
|
|
193
|
+
### Phase 3: Analyze Results (DO NOT SKIP)
|
|
194
|
+
|
|
195
|
+
<!-- AGENT: What should the agent check after execution?
|
|
196
|
+
If code exists: look for test suites, linters, type checkers, CI checks.
|
|
197
|
+
If greenfield: ask about quality gates. -->
|
|
198
|
+
|
|
199
|
+
### Phase 4: Iterate
|
|
200
|
+
|
|
201
|
+
<!-- AGENT: What levers can the agent pull to improve results?
|
|
202
|
+
If code exists: look for configuration knobs, feature flags, optimization patterns.
|
|
203
|
+
If greenfield: ask the user. -->
|
|
204
|
+
|
|
205
|
+
### Phase 5: Deliver
|
|
206
|
+
|
|
207
|
+
<!-- AGENT: How does the agent deliver the final result?
|
|
208
|
+
If code exists: look for deploy scripts, publish commands, output directories.
|
|
209
|
+
If greenfield: ask about delivery mechanism. -->
|
|
210
|
+
|
|
211
|
+
## Key Principle
|
|
212
|
+
|
|
213
|
+
The agent's job is NOT just to run commands. It is to understand, analyze, iterate, and deliver quality.
|
|
214
|
+
|
|
215
|
+
## Common Gotchas
|
|
216
|
+
|
|
217
|
+
<!-- AGENT: List hard-won lessons and common pitfalls.
|
|
218
|
+
If code exists: look for workarounds in comments, TODO/FIXME/HACK markers,
|
|
219
|
+
error-prone patterns, and .env.example for config gotchas.
|
|
220
|
+
If greenfield: ask "anything that's bitten you before?" -->
|
|
221
|
+
|
|
222
|
+
## AES File Formats
|
|
223
|
+
|
|
224
|
+
When creating or editing `.agent/` files, follow these formats exactly.
|
|
225
|
+
|
|
226
|
+
### Skill manifest (`.skill.yaml`)
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
aes_skill: "1.0"
|
|
230
|
+
|
|
231
|
+
id: "my-skill"
|
|
232
|
+
name: "My Skill"
|
|
233
|
+
version: "1.0.0"
|
|
234
|
+
description: "What this skill does"
|
|
235
|
+
|
|
236
|
+
stage: 1
|
|
237
|
+
phase: "processing"
|
|
238
|
+
|
|
239
|
+
inputs:
|
|
240
|
+
required:
|
|
241
|
+
- name: "input_name"
|
|
242
|
+
type: "string"
|
|
243
|
+
description: "What this input is"
|
|
244
|
+
optional:
|
|
245
|
+
- name: "limit"
|
|
246
|
+
type: "int"
|
|
247
|
+
default: 50
|
|
248
|
+
description: "Max items"
|
|
249
|
+
environment:
|
|
250
|
+
- "API_KEY"
|
|
251
|
+
|
|
252
|
+
outputs:
|
|
253
|
+
- name: "result"
|
|
254
|
+
type: "list[str]"
|
|
255
|
+
description: "What this produces"
|
|
256
|
+
|
|
257
|
+
triggers:
|
|
258
|
+
- type: "manual"
|
|
259
|
+
command: "python scripts/run.py --stage my-skill"
|
|
260
|
+
|
|
261
|
+
error_handling:
|
|
262
|
+
strategy: "per-item-isolation" # or: fail-fast, retry-with-backoff, skip-on-error
|
|
263
|
+
|
|
264
|
+
code:
|
|
265
|
+
primary: "pipeline/my_skill.py"
|
|
266
|
+
|
|
267
|
+
depends_on:
|
|
268
|
+
- "previous-skill"
|
|
269
|
+
blocks:
|
|
270
|
+
- "next-skill"
|
|
271
|
+
tags:
|
|
272
|
+
- "my-tag"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Workflow (`.yaml`)
|
|
276
|
+
|
|
277
|
+
```yaml
|
|
278
|
+
aes_workflow: "1.0"
|
|
279
|
+
|
|
280
|
+
id: "my-workflow"
|
|
281
|
+
entity: "item"
|
|
282
|
+
description: "What this workflow tracks"
|
|
283
|
+
|
|
284
|
+
states:
|
|
285
|
+
pending:
|
|
286
|
+
description: "Awaiting processing"
|
|
287
|
+
initial: true
|
|
288
|
+
processed:
|
|
289
|
+
description: "Successfully processed"
|
|
290
|
+
terminal: true
|
|
291
|
+
failed:
|
|
292
|
+
description: "Processing failed"
|
|
293
|
+
terminal: true
|
|
294
|
+
|
|
295
|
+
transitions:
|
|
296
|
+
- from: "pending"
|
|
297
|
+
to: "processed"
|
|
298
|
+
skill: "process"
|
|
299
|
+
conditions:
|
|
300
|
+
- "Input is valid"
|
|
301
|
+
- from: "pending"
|
|
302
|
+
to: "failed"
|
|
303
|
+
conditions:
|
|
304
|
+
- "Processing error"
|
|
305
|
+
|
|
306
|
+
idempotency:
|
|
307
|
+
pattern: "status-gated"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Key rules: `aes_skill`/`aes_workflow` version key is **required**. `inputs` is an **object** with `required`/`optional`/`environment` arrays, not a flat list. `states` is an **object** keyed by state ID, not an array. Use `triggers` (array of objects with `type`), not `trigger` (string). Use `error_handling.strategy`, not `error_strategy`. Use `code.primary`, not `code_location`.
|
|
311
|
+
{% endif %}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# .agent/local.example.yaml — Template for local overrides
|
|
2
|
+
#
|
|
3
|
+
# Copy this to local.yaml and fill in your values:
|
|
4
|
+
# cp .agent/local.example.yaml .agent/local.yaml
|
|
5
|
+
#
|
|
6
|
+
# local.yaml is gitignored. It is merged on top of permissions.yaml
|
|
7
|
+
# during `aes sync` so your personal settings apply without modifying
|
|
8
|
+
# shared config files.
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
allow:
|
|
12
|
+
shell:
|
|
13
|
+
remote: []
|
|
14
|
+
# Add SSH commands for your remote servers:
|
|
15
|
+
# - "ssh -i ~/.ssh/my_key user@myhost *"
|
|
16
|
+
|
|
17
|
+
resources: {}
|
|
18
|
+
# Adjust resource limits for your machine:
|
|
19
|
+
# max_cpu_percent: 70
|
|
20
|
+
# max_memory_percent: 75
|
|
21
|
+
# notes: "Description of your machine constraints"
|
|
22
|
+
|
|
23
|
+
environment: {}
|
|
24
|
+
{% if domain_config and domain_config.env_required %}
|
|
25
|
+
# Required environment variables — set these in local.yaml:
|
|
26
|
+
{% for env in domain_config.env_required %}
|
|
27
|
+
# {{ env.name }}: "" # {{ env.description }}
|
|
28
|
+
{% endfor %}
|
|
29
|
+
{% endif %}
|
|
30
|
+
{% if domain_config and domain_config.env_optional %}
|
|
31
|
+
# Optional environment variables:
|
|
32
|
+
{% for env in domain_config.env_optional %}
|
|
33
|
+
# {{ env.name }}: "{{ env.default }}" # {{ env.description }}
|
|
34
|
+
{% endfor %}
|
|
35
|
+
{% endif %}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# .agent/local.yaml — Local overrides (NOT committed to git)
|
|
2
|
+
#
|
|
3
|
+
# This file contains project-specific settings that should NOT be shared:
|
|
4
|
+
# SSH keys, server IPs, API key values, resource limits for your machine.
|
|
5
|
+
#
|
|
6
|
+
# Merged on top of permissions.yaml during `aes sync`.
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
allow:
|
|
10
|
+
shell:
|
|
11
|
+
remote: []
|
|
12
|
+
# - "ssh -i ~/.ssh/my_key user@myhost *"
|
|
13
|
+
|
|
14
|
+
resources: {}
|
|
15
|
+
# max_cpu_percent: 70
|
|
16
|
+
# max_memory_percent: 75
|
|
17
|
+
# notes: "Shared VPS — respect other processes"
|
|
18
|
+
|
|
19
|
+
environment:
|
|
20
|
+
{% if domain_config and domain_config.env_required %}
|
|
21
|
+
{% for env in domain_config.env_required %}
|
|
22
|
+
# {{ env.name }}: "your-{{ env.name | lower | replace('_', '-') }}-here"
|
|
23
|
+
{% endfor %}
|
|
24
|
+
{% endif %}
|
|
25
|
+
{% if domain_config and domain_config.env_optional %}
|
|
26
|
+
{% for env in domain_config.env_optional %}
|
|
27
|
+
# {{ env.name }}: "{{ env.default }}"
|
|
28
|
+
{% endfor %}
|
|
29
|
+
{% endif %}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# {{ name }} — Operations Memory
|
|
2
|
+
|
|
3
|
+
> Unified chronological log across all commands.
|
|
4
|
+
> **Read the entire log** when starting any command — entries from other workers give you context.
|
|
5
|
+
> After reading, update your **Read Cursor** below so you know where you left off next time.
|
|
6
|
+
> Append new entries to the Activity Log tagged with your command.
|
|
7
|
+
|
|
8
|
+
## Workers
|
|
9
|
+
|
|
10
|
+
| Command | Specialty | Read Cursor |
|
|
11
|
+
|---------|-----------|-------------|
|
|
12
|
+
{% for cmd in workflow_commands %}| {{ cmd.trigger }} | {{ cmd.worker_specialty or cmd.description }} | 0 |
|
|
13
|
+
{% endfor %}
|
|
14
|
+
|
|
15
|
+
## Activity Log
|
|
16
|
+
|
|
17
|
+
_No activity recorded yet._
|
|
18
|
+
|
|
19
|
+
<!-- Append entries in this format:
|
|
20
|
+
1. [/build] YYYY-MM-DD: what was done — outcome
|
|
21
|
+
2. [/train] YYYY-MM-DD: what was done — outcome
|
|
22
|
+
Entries are numbered sequentially. Each command updates its Read Cursor to the
|
|
23
|
+
last entry number it has seen, so it knows what's new next session.
|
|
24
|
+
-->
|
|
25
|
+
|
|
26
|
+
## Issues & Decisions
|
|
27
|
+
|
|
28
|
+
_None yet._
|
|
29
|
+
|
|
30
|
+
<!-- Record cross-cutting issues and decisions here, tagged with command:
|
|
31
|
+
- [/build] Chose SQLite over Postgres for simplicity
|
|
32
|
+
- [/train] Ordinal targets should be reframed as regression
|
|
33
|
+
-->
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{% if domain_config %}
|
|
2
|
+
# {{ name }} — Orchestrator
|
|
3
|
+
|
|
4
|
+
## Operations Memory
|
|
5
|
+
|
|
6
|
+
Check `.agent/memory/operations.md` for the current state of each command worker.
|
|
7
|
+
Each command has its own indexed section with activity history and checkmarks.
|
|
8
|
+
{% if domain_config.workflow_commands %}
|
|
9
|
+
Commands tracked:
|
|
10
|
+
{% for cmd in domain_config.workflow_commands %}
|
|
11
|
+
- **{{ cmd.trigger }}** — {{ cmd.worker_specialty or cmd.description }}
|
|
12
|
+
{% endfor %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
|
|
15
|
+
## Pipeline
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
{{ domain_config.orchestrator_pipeline }}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Status Flow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
{{ domain_config.orchestrator_status_flow }}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Decision Tree
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
FIRST: Check if pipeline is already complete (all items at terminal status).
|
|
31
|
+
If complete → report status summary, ask user: re-run / new session / re-validate / exit.
|
|
32
|
+
If not → proceed:
|
|
33
|
+
|
|
34
|
+
{{ domain_config.orchestrator_decision_tree }}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## When to Stop
|
|
38
|
+
|
|
39
|
+
{{ domain_config.orchestrator_when_to_stop }}
|
|
40
|
+
{% else %}
|
|
41
|
+
# {{ name }} — Orchestrator
|
|
42
|
+
|
|
43
|
+
## Pipeline
|
|
44
|
+
|
|
45
|
+
<!-- AGENT: Define the execution order of skills for this project.
|
|
46
|
+
If code exists: identify major operations from CLI commands, API endpoints,
|
|
47
|
+
scripts/, pipeline stages, scheduled jobs. Order them by dependency.
|
|
48
|
+
If greenfield: ask "What are the main steps in your workflow, in order?" -->
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
skill_1 → skill_2 → skill_3 → ... → skill_n
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Status Flow
|
|
55
|
+
|
|
56
|
+
<!-- AGENT: Define entity status transitions.
|
|
57
|
+
If code exists: look for status columns in models, enums, state machines,
|
|
58
|
+
workflow definitions, or status fields in database schemas.
|
|
59
|
+
If greenfield: ask "What states does your primary entity move through?" -->
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
status_1 → status_2 → ... → status_n
|
|
63
|
+
↗
|
|
64
|
+
rejected (any stage)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Decision Tree
|
|
68
|
+
|
|
69
|
+
<!-- AGENT: Define the decision logic for processing items.
|
|
70
|
+
If code exists: trace the main processing loop — what checks happen,
|
|
71
|
+
what branches exist, what determines success vs failure.
|
|
72
|
+
If greenfield: ask about decision points and error handling. -->
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
FIRST: Check if pipeline is already complete (all items at terminal status).
|
|
76
|
+
If complete → report status summary, ask user: re-run / new session / re-validate / exit.
|
|
77
|
+
If not → proceed:
|
|
78
|
+
|
|
79
|
+
for each pending_stage:
|
|
80
|
+
1. Check prerequisites
|
|
81
|
+
2. Get items at current status
|
|
82
|
+
3. For each item:
|
|
83
|
+
a. Run stage skill
|
|
84
|
+
b. On success: advance status
|
|
85
|
+
c. On failure: log error, mark rejected if unrecoverable
|
|
86
|
+
4. Report results
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## When to Stop
|
|
90
|
+
|
|
91
|
+
- All items at terminal status
|
|
92
|
+
- Resource limits exceeded
|
|
93
|
+
- User requests stop
|
|
94
|
+
- No items to process
|
|
95
|
+
{% endif %}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{% if domain_config %}
|
|
2
|
+
# .agent/permissions.yaml — Agent Capability Boundaries
|
|
3
|
+
aes_permissions: "1.0"
|
|
4
|
+
|
|
5
|
+
allow:
|
|
6
|
+
shell:
|
|
7
|
+
read:
|
|
8
|
+
- "git status"
|
|
9
|
+
- "git log *"
|
|
10
|
+
- "git diff *"
|
|
11
|
+
- "ls *"
|
|
12
|
+
{% for cmd in domain_config.permissions_shell_read %}
|
|
13
|
+
- "{{ cmd }}"
|
|
14
|
+
{% endfor %}
|
|
15
|
+
{% if domain_config.permissions_shell_execute %}
|
|
16
|
+
execute:
|
|
17
|
+
{% for cmd in domain_config.permissions_shell_execute %}
|
|
18
|
+
- "{{ cmd }}"
|
|
19
|
+
{% endfor %}
|
|
20
|
+
{% else %}
|
|
21
|
+
execute: []
|
|
22
|
+
{% endif %}
|
|
23
|
+
|
|
24
|
+
files:
|
|
25
|
+
read: "**/*"
|
|
26
|
+
write:
|
|
27
|
+
{% for pattern in domain_config.permissions_file_write %}
|
|
28
|
+
- "{{ pattern }}"
|
|
29
|
+
{% endfor %}
|
|
30
|
+
- ".agent/memory/**"
|
|
31
|
+
|
|
32
|
+
deny:
|
|
33
|
+
{% if domain_config.permissions_deny_shell %}
|
|
34
|
+
shell:
|
|
35
|
+
{% for cmd in domain_config.permissions_deny_shell %}
|
|
36
|
+
- "{{ cmd }}"
|
|
37
|
+
{% endfor %}
|
|
38
|
+
{% else %}
|
|
39
|
+
shell: []
|
|
40
|
+
{% endif %}
|
|
41
|
+
files:
|
|
42
|
+
write:
|
|
43
|
+
- ".env"
|
|
44
|
+
- ".env.*"
|
|
45
|
+
- "*.pem"
|
|
46
|
+
- "*.key"
|
|
47
|
+
- ".git/**"
|
|
48
|
+
|
|
49
|
+
confirm:
|
|
50
|
+
{% if domain_config.permissions_confirm_shell %}
|
|
51
|
+
shell:
|
|
52
|
+
{% for cmd in domain_config.permissions_confirm_shell %}
|
|
53
|
+
- "{{ cmd }}"
|
|
54
|
+
{% endfor %}
|
|
55
|
+
{% else %}
|
|
56
|
+
shell: []
|
|
57
|
+
{% endif %}
|
|
58
|
+
files:
|
|
59
|
+
delete: "**/*"
|
|
60
|
+
{% if domain_config.permissions_confirm_actions %}
|
|
61
|
+
actions:
|
|
62
|
+
{% for action in domain_config.permissions_confirm_actions %}
|
|
63
|
+
- "{{ action }}"
|
|
64
|
+
{% endfor %}
|
|
65
|
+
{% else %}
|
|
66
|
+
actions: []
|
|
67
|
+
{% endif %}
|
|
68
|
+
{% if domain_config.permissions_resource_limits %}
|
|
69
|
+
|
|
70
|
+
resource_limits:
|
|
71
|
+
max_cpu_percent: {{ domain_config.permissions_resource_limits.max_cpu_percent }}
|
|
72
|
+
max_memory_percent: {{ domain_config.permissions_resource_limits.max_memory_percent }}
|
|
73
|
+
{% if domain_config.permissions_resource_limits.check_before is defined %}
|
|
74
|
+
check_before:
|
|
75
|
+
{% for stage in domain_config.permissions_resource_limits.check_before %}
|
|
76
|
+
- "{{ stage }}"
|
|
77
|
+
{% endfor %}
|
|
78
|
+
{% endif %}
|
|
79
|
+
{% if domain_config.permissions_resource_limits.on_exceeded is defined %}
|
|
80
|
+
on_exceeded: "{{ domain_config.permissions_resource_limits.on_exceeded }}"
|
|
81
|
+
{% endif %}
|
|
82
|
+
{% endif %}
|
|
83
|
+
{% else %}
|
|
84
|
+
# .agent/permissions.yaml — Agent Capability Boundaries
|
|
85
|
+
aes_permissions: "1.0"
|
|
86
|
+
|
|
87
|
+
allow:
|
|
88
|
+
shell:
|
|
89
|
+
read:
|
|
90
|
+
- "git status"
|
|
91
|
+
- "git log *"
|
|
92
|
+
- "git diff *"
|
|
93
|
+
- "ls *"
|
|
94
|
+
execute:
|
|
95
|
+
{% if language == "python" %}
|
|
96
|
+
- "python *"
|
|
97
|
+
- "python -m pytest *"
|
|
98
|
+
- "pip install *"
|
|
99
|
+
{% elif language == "javascript" or language == "typescript" %}
|
|
100
|
+
- "node *"
|
|
101
|
+
- "npm *"
|
|
102
|
+
- "npx *"
|
|
103
|
+
{% elif language == "go" %}
|
|
104
|
+
- "go build *"
|
|
105
|
+
- "go test *"
|
|
106
|
+
- "go run *"
|
|
107
|
+
{% elif language == "rust" %}
|
|
108
|
+
- "cargo build *"
|
|
109
|
+
- "cargo test *"
|
|
110
|
+
- "cargo run *"
|
|
111
|
+
{% else %}
|
|
112
|
+
# <!-- AGENT: Add execute permissions for your build/test/run tools.
|
|
113
|
+
# If code exists: check package config, Makefile, scripts/ directory.
|
|
114
|
+
# If greenfield: infer from tech stack or ask the user. -->
|
|
115
|
+
{% endif %}
|
|
116
|
+
|
|
117
|
+
files:
|
|
118
|
+
read: "**/*"
|
|
119
|
+
write:
|
|
120
|
+
# <!-- AGENT: List source directories the agent should be allowed to modify.
|
|
121
|
+
# If code exists: identify src/, lib/, app/, tests/, scripts/ directories.
|
|
122
|
+
# If greenfield: ask "where will your source code live?" -->
|
|
123
|
+
- "src/**"
|
|
124
|
+
- ".agent/memory/**"
|
|
125
|
+
|
|
126
|
+
deny:
|
|
127
|
+
shell:
|
|
128
|
+
# <!-- AGENT: Add project-specific destructive commands to deny.
|
|
129
|
+
# If code exists: check for database CLIs, cloud CLIs, or other dangerous tools.
|
|
130
|
+
# If greenfield: ask about infrastructure or deployment tools that could be destructive. -->
|
|
131
|
+
- "rm -rf *"
|
|
132
|
+
- "chmod 777 *"
|
|
133
|
+
files:
|
|
134
|
+
write:
|
|
135
|
+
- ".env"
|
|
136
|
+
- ".env.*"
|
|
137
|
+
- "*.pem"
|
|
138
|
+
- "*.key"
|
|
139
|
+
- ".git/**"
|
|
140
|
+
|
|
141
|
+
confirm:
|
|
142
|
+
shell:
|
|
143
|
+
# <!-- AGENT: Add high-impact commands that should require confirmation.
|
|
144
|
+
# If code exists: look for deploy, publish, push, or migration commands.
|
|
145
|
+
# If greenfield: ask about deployment and release processes. -->
|
|
146
|
+
- "git push *"
|
|
147
|
+
- "git reset *"
|
|
148
|
+
files:
|
|
149
|
+
delete: "**/*"
|
|
150
|
+
actions: []
|
|
151
|
+
{% endif %}
|