Skip to content

Commit 3498b3f

Browse files
committed
docs(configuration): user example, Agent orchestration, subagents, and reusable skills
1 parent 60ec413 commit 3498b3f

1 file changed

Lines changed: 112 additions & 0 deletions

File tree

docs/config/examples.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,115 @@ If you think your config is relevant to be shared for other people, [open a pull
391391
(str/upper-case \"test\")
392392
- Very large outputs may be truncated
393393
```
394+
395+
??? quote "Agent orchestration, subagents, and reusable skills (@davidvujic)"
396+
This example shows a Eca `config.json` that define the models, and
397+
398+
- AGENTS.md (human-readable definitions for agents, their responsibilities, and global guidance for use)
399+
- agents/ (subagent configurations with task-specific instructions and expected outputs)
400+
- skills/ (small, repeatable procedures that agents invoke to perform specialized work)
401+
402+
```json title="config.json"
403+
{
404+
"defaultModel": "anthropic/claude-opus-4-6",
405+
"providers": {
406+
"anthropic": {
407+
"keyRc": "api.anthropic.com",
408+
"models": {
409+
"claude-opus-4-6": {},
410+
"anthropic/claude-sonnet-4-5": {}
411+
}
412+
},
413+
"google": {
414+
"keyRc": "generativelanguage.googleapis.com",
415+
"models": {
416+
"gemini-2.5-flash": {},
417+
"gemini-3-flash-preview": {},
418+
"gemini-3-pro-preview": {}
419+
}
420+
}
421+
}
422+
}
423+
```
424+
425+
```markdown title="AGENTS.md"
426+
# AGENTS.md
427+
428+
## Review instructions
429+
When the user asks for a code review / PR review / diff review, use the `code-review` subagent configured in `agents/code-review.md`.
430+
431+
## Five Whys instructions
432+
When the user asks for a 5 Whys analysis, use the `five-whys` subagent configured in `agents/five-whys.md`.
433+
434+
## Changes summary instructions
435+
When the user asks for a changes summary, use the `changes-summary` subagent configured in `agents/changes-summary.md`.
436+
437+
## Pull Request instructions
438+
When the user asks to make a pull request, use the `pull-request` subagent configured in `agents/pull-request.md`.
439+
440+
## Planning instructions
441+
When the user asks to plan an implementation or requests a step-by-step plan before coding, load the `plan` skill via `eca__skill` before writing the plan.
442+
443+
## Implementation instructions
444+
When the user asks to implement a plan, write code, refactor, or apply changes, use the `implement` subagent configured in `agents/implement.md`.
445+
```
446+
447+
```markdown title="agents/implement.md"
448+
---
449+
mode: subagent
450+
description: Implement planned changes by editing code in the repo; uses functional-leaning, idiomatic style and lightweight data structures.
451+
model: anthropic/claude-opus-4-6
452+
---
453+
454+
STYLE POLICY (REQUIRED):
455+
Load the `fp-idiomatic-style` skill via `eca__skill` before writing or modifying any code.
456+
All generated code MUST follow that policy.
457+
458+
WORKFLOW:
459+
- Identify target files and exact edits needed.
460+
- Make minimal, correct changes consistent with existing project conventions.
461+
- Prefer functional-leaning, idiomatic solutions; avoid dataclasses/pydantic unless clearly justified.
462+
463+
OUTPUT:
464+
- Provide exact code patches or file edits (as your usual workflow expects).
465+
```
466+
467+
```markdown title="skills/fp-idiomatic-style/SKILL.md"
468+
---
469+
name: "fp-idiomatic-style"
470+
description: "Coding style policy for generated code: prefer idiomatic language conventions with a functional-leaning approach (pure-ish functions, composability), and prefer lightweight data structures over heavy schema/class abstractions unless clearly justified."
471+
---
472+
473+
# Functional-leaning, idiomatic coding style policy
474+
475+
Applies whenever you write new code OR propose code changes, in any language.
476+
477+
## Priorities (in order)
478+
1) Correctness and clarity first.
479+
2) Idiomatic for the target language (e.g., Pythonic for Python, idiomatic TS for TypeScript).
480+
3) Functional-leaning style when it fits naturally:
481+
- explicit inputs/outputs
482+
- minimize side effects and shared mutable state
483+
- small composable functions
484+
- declarative transformations over imperative loops where readable
485+
486+
## Data modeling preference (important)
487+
- Prefer lightweight structures for transient data over heavy class/schema abstractions.
488+
- Only introduce richer types when clearly beneficial, e.g.:
489+
- validation/invariants are required
490+
- long-lived domain objects
491+
- meaningful behavior/methods beyond data transport
492+
493+
### Language examples
494+
- **Python:** prefer `dict`/`Mapping`/tuples; avoid `dataclasses` or `pydantic` models unless justified.
495+
- **TypeScript:** prefer plain objects, interfaces, or type aliases; avoid classes unless justified.
496+
- **Other languages:** follow the same principle — reach for the lightest idiomatic container first.
497+
498+
## Don't force FP purity
499+
- Avoid clever chaining, excessive `map`/`filter`, or recursion if it reduces readability.
500+
- Choose the most readable idiomatic solution, then make it functional-leaning where it remains clear.
501+
502+
## When editing existing code
503+
- Prefer the smallest change that satisfies requirements.
504+
- Preserve local conventions unless they conflict with correctness/security.
505+
```

0 commit comments

Comments
 (0)