agentleFS
ldaumeldaume/agentic-engineering-harness/skills/engineering/build-autonomous-agents/SKILL.md

build-autonomous-agents

Skill3 starsChanged 3 months agoMITView on GitHub

Designs and implements a bounded agent for a product feature, or one finite agent workflow, with a runtime-neutral contract. Use when building an agent, finite workflow, subagent, tool, or channel integration into an application, adding Flue to an application, migrating an older Flue integration, or designing review loops and when an agent should ask a person.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 19 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep the workload contract portable even when Flue is the selected runtime, so the product does not have to change when the runtime does.

    line 10
  2. Distinctive:

    Read the target's instructions, domain context, architecture, tests, delivery controls, security boundaries, and existing runtime …

    line 15
  3. Distinctive:

    Use a subagent only when its independent context, tools, or evaluation boundary improves the result enough to justify delegation.

    line 40
  4. Distinctive:

    Use the target's existing runtime when it meets the contract.

    line 68
  5. Distinctive:

    Before adopting or changing Flue:

    line 72
  6. Very specific:

    Use the installed CLI's flue docs search and flue docs read commands first because those docs match the installed version.

    line 76
  7. Distinctive:

    Check official upstream docs, changelog, package metadata, and types when adopting or upgrading.

    line 78
  8. Distinctive:

    Prefer the latest reviewed stable release.

    line 80
  9. Distinctive:

    Read REFERENCE.md for current Flue boundaries and migration hazards.

    line 82
  10. Very specific:

    Do not copy imports from @flue/runtime/internal.

    line 85
  11. Distinctive:

    keep authentication, authorization, business data, provider credentials, persistence, and application of results application-owned

    line 93
  12. Distinctive:

    Start deterministic seams with a failing behavior test and agent judgment with a representative failing eval case.

    line 99
  13. Distinctive:

    Treat local host execution as trusted execution, not isolation.

    line 106
  14. Distinctive:

    Keep conversation state, workspace state, and business state distinct.

    line 107
  15. Distinctive:

    Do not assume an interrupted finite workflow resumes at an arbitrary TypeScript step.

    line 108
  16. Distinctive:

    Put external side effects behind application-owned idempotency keys.

    line 118
  17. Distinctive:

    When an agent hands work to an asynchronous job and resumes afterwards, put the finished job's outcome into its context and refuse a second …

    line 119
  18. Distinctive:

    Use a durable external orchestrator when step-level resumability is required.

    line 132
  19. Distinctive:

    Keep model-visible data, logs, traces, and run history free of unnecessary secrets and personal data.

    line 133
  20. Distinctive:

    Test representative success, refusal, malformed output, tool failure, timeout, retry, duplicate delivery, cancellation, and …

    line 138
  21. Distinctive:

    completion-gate: - verify before claiming completion

    line 160

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Build Autonomous Agents

Build the smallest agent that can produce and verify the intended outcome. Keep the workload contract portable even when Flue is the selected runtime, so the product does not have to change when the runtime does.

1. Ground the Workload

Read the target's instructions, domain context, architecture, tests, delivery controls, security boundaries, and existing runtime integration.

State:

  • the user or operational outcome
  • trigger, owner, input, output, and completion condition
  • allowed data, tools, repositories, network access, secrets, and side effects
  • required human approval, cancellation, and rollback points

First test whether deterministic code, an existing application service, a script, or a CI job can solve the problem. Do not add an agent when those are sufficient: they are cheaper, testable, and never improvise.

2. Select the Smallest Unit

NeedUnit
Deterministic operationFunction or application service
Bounded capability the model may callTool
Reusable application-controlled orchestrationAction
Finite inspectable operationWorkflow
Continuing stateful interactionAgent
Focused separable responsibilitySubagent

Use a subagent only when its independent context, tools, or evaluation boundary improves the result enough to justify delegation.

For review loops, questions to people, and repair bounds, read REVIEW-LOOPS.md. Core rules: a send-back always records what to fix; a person is asked only what only they can answer, after the agents repaired what they could within a shared bound.

3. Write the Execution Contract

Define before implementation:

  • validated input and output schemas
  • model-visible context, Skills, and tools
  • deterministic validation and application of results
  • work identity, deduplication key, state owner, and retention
  • isolation and permission boundary
  • timeout, token or spend budget, concurrency, and stop condition
  • retry, idempotency, recovery, duplicate-effect handling, and failure owner
  • durable checkpoint, next wake condition, progress deadline, and reconciliation
  • eval cases, telemetry, alerts, and incident owner

Separate probabilistic judgment from deterministic effects. Prefer a typed proposal that application code validates and applies over letting model output mutate business state directly.

4. Select and Verify the Runtime

Use the target's existing runtime when it meets the contract. For a TypeScript system that needs a harness-first agent runtime, Flue is the current default candidate, not part of the product contract.

Before adopting or changing Flue:

  1. Detect the installed version, package manager, deployment target, and existing integration.
  2. Use the installed CLI's flue docs search and flue docs read commands first because those docs match the installed version.
  3. Check official upstream docs, changelog, package metadata, and types when adopting or upgrading.
  4. Prefer the latest reviewed stable release. Do not adopt a nightly merely because it is newer.
  5. Read REFERENCE.md for current Flue boundaries and migration hazards.

Do not copy imports from @flue/runtime/internal; they are not a portable public integration boundary.

5. Implement One Vertical Slice

The application stays the authority over its users and data, because an agent runtime that owns them turns every model mistake into a business-state defect:

  • keep authentication, authorization, business data, provider credentials, persistence, and application of results application-owned
  • expose meaningful queued, running, review, success, and failure states
  • make any consequential result reviewable before application where risk requires it

Start deterministic seams with a failing behavior test and agent judgment with a representative failing eval case. Implement the narrowest path from input through verified outcome before adding channels, schedules, subagents, or generalized abstractions.

6. Prove Safety and Recovery

  • Treat local host execution as trusted execution, not isolation.
  • Keep conversation state, workspace state, and business state distinct.
  • Do not assume an interrupted finite workflow resumes at an arbitrary TypeScript step.
  • Persist every useful increment and the next eligible action outside the live model session. Every routine non-terminal state must have a wake condition or a reconciler that owns progress; a human prompt is not a scheduler. A required human response waits on a durable correlated event with a deadline and escalation; it is never inferred or auto-approved.
  • Detect expired claims and missed progress deadlines. Inspect retained state and external effects before a bounded requeue; alert the named failure owner when safe recovery is not possible.
  • Put external side effects behind application-owned idempotency keys.
  • When an agent hands work to an asynchronous job and resumes afterwards, put the finished job's outcome into its context and refuse a second hand-off of unchanged input deterministically. Without both, a review agent re-delegated a paid review after every clean one, for hours.
  • A deterministic backstop that moves a stage forward when the agent does not must also fire on the agent's failure paths (turn limit, idle turns) once the stage's output exists. A person's newer decision - sending work back - must outrank any prompt text telling the agent to move on: make it a typed condition on the transition, not an instruction.
  • Answer a call to a tool the run does not hold with an explicit refusal that names the available tools, and keep the conversation after a turn without a valid tool call. Dropping either silently made agents ask the user for context they already had.
  • Use a durable external orchestrator when step-level resumability is required.
  • Keep model-visible data, logs, traces, and run history free of unnecessary secrets and personal data.

7. Evaluate and Observe

Test representative success, refusal, malformed output, tool failure, timeout, retry, duplicate delivery, cancellation, and permission-denied cases. Assert schemas, tool calls, side effects, latency, and cost where relevant.

Emit enough structured evidence to answer:

  • what triggered the run
  • which version and configuration ran
  • what tools and effects occurred
  • why it stopped
  • whether the outcome passed deterministic checks and evals

Complete the work only when the bounded outcome works end to end, failure and recovery behavior is demonstrated, permissions and budgets are explicit, and the runtime can be replaced without changing the product contract. An idle system has no admissible signal; a paused, blocked, or partial run exposes its reason, owner, retained checkpoint, and next wake or escalation condition.

Related Skills

  • scaffold-harness - assess maturity and the repository harness
  • coding-discipline - implement the smallest safe change
  • completion-gate - verify before claiming completion
  • product-craft - define product value and human oversight
  • upstream tdd - drive deterministic seams from behavior

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.