Code Generation Skills

Code skills empower Achilles Agents to reason about and execute code safely. They are perfect for validating generated SQL, transforming data pipelines, or running remediation snippets with guardrails. Each skill wraps a sandbox policy around the task so that human reviewers can trust the outcome.

Descriptor Snapshot

Every code generation skill lives in .AchillesSkills/<domain>/<skill_name>/cgskill.md. The descriptor explains the persona, coding standards, and safety expectations for the sandbox:

# Math Expression Evaluator

Interpret natural-language requests that describe mathematical operations and produce precise numeric answers.

## Prompt
You are a careful mathematician who writes concise JavaScript to compute results...

## LLM Mode
deep

Companion entrypoints such as mathEval.js can extend the skill with exact sandbox controls, custom presenters, or role checks. The descriptor remains the single source of truth for tone and guardrails.

How Execution Unfolds

When a code skill runs, Achilles Agents expect a single input string argument. The subsystem either asks the LLM whether to respond directly or to emit a JavaScript snippet, or it loads the optional module’s action executor. Snippets run inside a guarded eval wrapper with timeouts and basic sanitisation before results are returned as strings.

Authoring Checklist

  1. Draft cgskill.md with persona guidance, prompt instructions, and safety notes.
  2. Add a JavaScript entrypoint when you need custom sandbox behaviour or audit logging.
  3. Specify confirmation rules for mutating tasks so users approve critical actions.
  4. Exercise the skill via tests (see tests/cgSkills) to confirm guardrails behave as expected.

The focus stays on what the skill accomplishes—Achilles Agents handle the environment wiring, letting teams iterate on prompts and policies.