feat: skills — additive instruction+tool bundles, clock + calc examples
Phase 6: skill.New constructor satisfying the agent.Skill contract; instruction-only skills; ordered additive composition; skill/clock (injectable-clock time tools) and skill/calc (recursive-descent arithmetic evaluator) as ready-made examples with full test suites incl. an agent-loop round trip. ADR-0013; README skills section + matrix synced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# ADR-0013: Skill model — additive instruction+tool bundles
|
||||
|
||||
**Status:** Accepted — 2026-06-10
|
||||
|
||||
## Context
|
||||
|
||||
mort's "skills" are reusable capabilities (a prompt fragment plus tools)
|
||||
attached to different agents at runtime. majordomo needs the same shape
|
||||
without mort specifics: attachable to any agent, on demand, composing
|
||||
additively and predictably.
|
||||
|
||||
## Decision
|
||||
|
||||
- The **contract** is the three-method `agent.Skill` interface (Name /
|
||||
Instructions / Tools). It lives in package agent — the consumer of the
|
||||
contract — so skill→agent and agent→skill never both happen (no import
|
||||
cycle, and third parties can satisfy it without importing package skill).
|
||||
- Package **skill** is the standard constructor: `skill.New(name,
|
||||
WithInstructions(...), WithTools(...)/WithToolbox(...))`. Instruction-only
|
||||
skills (nil toolbox) are legal — agent treats Tools()==nil as "no tools".
|
||||
- **Composition is additive and ordered:** instructions append to the
|
||||
agent's system prompt in attachment order, separated by blank lines;
|
||||
skill tools join the merged toolset with the same loud duplicate-name
|
||||
policy as toolboxes (ADR-0012). No hooks, no resources, no lifecycle —
|
||||
none of mort's skills need them, and out-of-scope discipline says don't
|
||||
build for hypotheticals (they'd be an additive interface upgrade later).
|
||||
- Two ready-made example skills ship as subpackages and double as the
|
||||
pattern reference: `skill/clock` (time awareness; injectable clock) and
|
||||
`skill/calc` (exact arithmetic via a hand-rolled recursive-descent
|
||||
evaluator — no eval, no dependencies).
|
||||
|
||||
## Consequences
|
||||
|
||||
- A skill instance is reusable across agents simultaneously (it is
|
||||
read-only after construction).
|
||||
- mort's skill registry maps onto plain values: build `*skill.Skill`s,
|
||||
attach per agent at invocation time.
|
||||
Reference in New Issue
Block a user