Agent skill
script-agents
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/script-agents
SKILL.md
Script Agents
Design and maintain small, high-signal scripts where deterministic local orchestration feeds a configurable coding-agent harness for one-shot analysis.
Standard (2026-02)
For every new or updated script-agent script:
- CLI ergonomics
- Support
--no-dispatchfor deterministic local execution. - Support
--debugwhen artifact inspection is useful. - Keep defaults zero-config for this machine, but all runtime integrations overrideable via env vars.
- Dispatch contract
- Use exactly these knobs for model dispatch:
AGENT_DISPATCH_DIRAGENT_DISPATCH_CMD
- Parse dispatch command safely for shell array execution:
typeset -a DISPATCH_CMD_ARRDISPATCH_CMD_ARR=(${(z)AGENT_DISPATCH_CMD})
- Artifact contract
- Write timestamped artifacts to a predictable project-owned directory.
- Write/update a stable
latest-*pointer when repeated runs are expected. - In
--no-dispatch, still emit a useful local report artifact (do not no-op).
- Validation contract
- Fail fast on missing inputs and empty outputs.
- Validate required headings/fields for machine-readability.
- Include a cheap smoke path that can run without networked model calls.
- Prompt contract
- Keep static instructions at top and variable context at bottom.
- Favor XML/section-tagged blocks for deterministic parsing.
- Prefer schema-constrained outputs for structured sections where possible.
Core Pattern (Fresh-Eyes + RR Prompt A)
Use this exact sequence:
- Goal sentence
- State the project goal in one sentence.
- Input contract
- List exact files/directories consumed.
- Prefer one JSON context artifact.
- Output contract
- Define exact output files and section requirements.
- Keep outputs self-contained and machine-readable where possible.
- Scope trim (RR A discipline)
- Keep only what is needed for the current milestone.
- Defer speculative integrations and abstraction layers.
- Dispatch contract
- Use two knobs only:
AGENT_DISPATCH_DIRAGENT_DISPATCH_CMD
- Provide a sensible project default, but keep it overrideable.
- Allow override to any compatible pi harness command.
- Validation
- Verify script can run with and without dispatch (
--no-dispatchstyle path when useful). - Verify artifacts are non-empty and linked via a
latest-*pointer when applicable.
Hard Rules
- Keep scripts close to the owning project (for example
scripts/). - Keep prompts and context artifacts in predictable artifact paths.
- Avoid role-specific hardcoding in code when a profile file already contains source-of-truth data.
- Prefer deterministic generation steps before LLM dispatch.
- Do not introduce a framework; use shell + small embedded Python/Node only where required.
- Follow the
dogfoodskill (/Users/amar/agi/skills/dogfood/SKILL.md). - Do not work around broken script UX with manual path gymnastics or direct replacement commands.
- If a script is awkward or fails in normal usage, fix the script and re-run it.
SOTA Guardrails
Apply these defaults unless the project has a hard reason not to:
- Schema-first outputs
- Prefer Structured Outputs / strict tool schemas over free-form JSON.
- Avoid plain "JSON mode" when schema adherence is needed.
- Explicit tool control
- Use
tool_choicedeliberately (auto,required/any, or forced tool) per step intent. - Keep tool surface minimal and role-specific.
- Cache-friendly prompt layout
- Put reusable static content first, dynamic context last, so prompt caching works predictably.
- Eval + trace loop
- Add lightweight regression checks for output shape/sections.
- Add periodic trace/eval review for agentic steps, not just final output snapshots.
- Injection resistance
- Treat external text as untrusted.
- Extract validated fields before allowing downstream tool-driving behavior.
Minimal Script Skeleton
#!/usr/bin/env zsh
set -euo pipefail
AGENT_DISPATCH_DIR="${AGENT_DISPATCH_DIR:-/Users/amar/agi/claudette}"
AGENT_DISPATCH_CMD="${AGENT_DISPATCH_CMD:-node --import tsx bin/claudette.ts --profile scope --provider codex --no-session}"
typeset -a DISPATCH_CMD_ARR
DISPATCH_CMD_ARR=(${(z)AGENT_DISPATCH_CMD})
# 1) Build deterministic context JSON
# 2) Assemble prompt
# 3) Optional no-dispatch path
# 4) Dispatch
(
cd "$AGENT_DISPATCH_DIR" && \
CLAUDETTE_SKIP_FORCED_EVAL=1 "${DISPATCH_CMD_ARR[@]}" -p "$(cat "$PROMPT_FILE")"
) > "$REPORT_FILE"
Reusable Outputs
context-<ts>.json(deterministic input snapshot)prompt-<ts>.md(exact prompt sent to harness)report-<ts>.md(dispatch output)latest-*pointers where continuous refresh is useful
Example Mapping (Clunkers + Claudette)
clunkers/scripts/*as orchestration ownerAGENT_DISPATCH_DIR=/Users/amar/agi/claudetteAGENT_DISPATCH_CMD="node --import tsx bin/claudette.ts --profile scope --provider codex --no-session"
Treat this as an example instantiation, not a required stack.
Sources (SOTA References)
As of 2026-02-17:
- OpenAI Structured Outputs: https://developers.openai.com/api/docs/guides/structured-outputs
- OpenAI Function Calling (
tool_choice, strict schemas): https://developers.openai.com/api/docs/guides/function-calling - OpenAI Safety in building agents: https://developers.openai.com/api/docs/guides/agent-builder-safety
- OpenAI Trace grading: https://developers.openai.com/api/docs/guides/trace-grading
- OpenAI Evaluation best practices: https://developers.openai.com/api/docs/guides/evaluation-best-practices
- Anthropic prompt caching: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- Anthropic tool use implementation (
tool_choice, strict tools): https://platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use - Anthropic prompt structuring (XML tags): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/use-xml-tags
- MCP spec (official repo): https://github.com/modelcontextprotocol/modelcontextprotocol
- Google A2A protocol overview: https://a2a.cx/
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?