ad-harness
Skill0 starsChanged 7 days agoMITView on GitHub
Use when work should be handed to agent-daemon's own agent harness instead of done inline — \"run this in the background\", \"keep working until it's done\", \"loop on this\", \"schedule this every morning\", \"har roz chalao\", \"background mein karwa do\", \"ad run / ad loop / ad schedule\", \"let the agent do it\", \"spawn a worker\". Picks the command (ad run, ad loop, ad schedule, ad sp; ad tui for the user), sets budgets and the sandbox, and verifies the result yourself afterwards.
In this repository174 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ad-ci-readinessSkill
- ad-pre-pushSkill
- accessibilitySkill
- agent-evalSkill
- agent-harness-constructionSkill
- agentic-engineeringSkill
- agent-introspection-debuggingSkill
- agent-sortSkill
- ai-first-engineeringSkill
- ai-regression-testingSkill
- api-connector-builderSkill
- architecture-decision-recordsSkill
- article-writingSkill
- automation-audit-opsSkill
- autonomous-agent-harnessSkill
- autonomous-loopsSkill
- backend-patternsSkill
- benchmarkSkill
- blueprintSkill
- brand-voiceSkill
- browser-qaSkill
- bun-runtimeSkill
- canary-watchSkill
- cavemanSkill
- ckSkill
- claude-devfleetSkill
- click-path-auditSkill
- codebase-onboardingSkill
- code-tourSkill
- coding-standardsSkill
- content-engineSkill
- content-hash-cache-patternSkill
- context-budgetSkill
- continuous-agent-loopSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- cost-aware-llm-pipelineSkill
- councilSkill
- crosspostSkill
- ad-state-migrateSkill
- ad-tui-devSkill
- agent-daemon-memorySkill
- big-feature-flowSkill
- bootstrap-daemonSkill
- bug-flowSkill
- engine-upgradeSkill
- feature-flowSkill
- gepa-evolve-inlineSkill
- harness-troubleshootSkill
- orchestrate-teamSkill
- release-flowSkill
- session-closeSkill
- skill-authorSkill
- skill-installerSkill
- dashboard-builderSkill
- database-migrationsSkill
- deep-researchSkill
- deployment-patternsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Distinctive: line 22
Don't delegate one-line edits or anything that needs back-and-forth design.
- Very specific: line 45
Set brakes: Always pass --max-iterations / --max-minutes for loops.
- Very specific: line 69
Check that ad service status shows the watcher registered.
- Distinctive: line 74
Trusting "done": Always re-run the verification yourself.
- Distinctive: line 75
Delegating secrets: Never put keys or passwords in a prompt.
≈ “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.
Files
Hand work to the ad harness
agent-daemon v2 can run agents itself on its own engine, with the daemon's memory, hooks and skills wired in. This skill decides when to delegate to it, which command fits, and how to check the result. Full reference: docs/harness.md in the agent-daemon repo.
When to use
- The task is long, repetitive or should keep going without the user (fix until green, nightly summaries).
- The user wants something on a schedule.
- The work can run in parallel on separate branches (team workers).
Don't delegate one-line edits or anything that needs back-and-forth design. Do those inline.
Procedure
- Check the harness is ready:
No working account: ask the user to runad auth status # what ad uses now, and whether each account worksad auth login <provider>(openai,openrouter,chatgpt, others inad auth login --help) in their own terminal; keys are typed at a hidden prompt, never put on a command line or in a prompt. On Windows alsoad sandbox status. Unattended runs refuse to start without a ready sandbox. Run in a project folder (--cwd <repo>). In a home folder, or a folder under a home that is a git repo, the user's own engine skills and settings would load, so ad refuses (ad tui,ad schedule add) or runs with a warning that it will need--allow-home-folder(ad run,ad chat,ad loop). Pass that flag only when the user asked. Pick the command:
Need Command one bounded task, no questions ad run "<task>" --cwd <repo>(add--jsonto parse the result)iterate until an objective is met ad loop "<objective>" --max-iterations N --max-minutes Mrecurring ad schedule add "<cron>" run|loop "<prompt>" --cwd <repo>, which needsad watchorad service installrunningparallel workers on branches ad tc(team create), thenad sp(anadworker by default, sandboxed;--engine claudefor Claude Code, which runs unsandboxed with--dangerously-skip-permissions;AD_CLAUDE_BINpicks the Claude Code)the user wants to work with the agent themselves, watching and approving tell them to run ad tui(ad tui --lastcontinues). It needs an interactive terminal, so you can't drive it from a tool call. Guide:docs/tui.mdmove ad (memory, settings, accounts list) to another computer or OS the ad-state-migrateskill (ad state export/verify/import); the review and sign-ins stay the user's- Write the prompt as a spec: the goal, the files involved, how to verify ("
node --testpasses"), and what not to touch. Forad loop, state a verifiable finish line. The loop stops only when the agent reportsdone+exit_signal, or a brake trips. - Pick the account when the user named one:
--account <provider>/<label>(with--modeland--effort) onad run,ad loopandad sp(workers run on it too);ad runprints the target it used on stderr (target: …, andtargetin--json), orAD_ACCOUNTfor a scheduled job (ad auth use <account> --sessionprints the line).ad auth listshows what exists. Account changes (ad auth login/use/logout/remove) refuse from the agent's own shell: ask the user to run them. Without either, ad uses the project's choice (trusted folders) or the default account. An account that needs its key again stops the start: tell the user the command it prints. API keys stay in ad's local gateway and never reach the engine. Providers that speak only Chat Completions go through a translation there, and what they can't carry (live web search, images for a text-only model) is refused before anything is sent: pick another model orad tools disable web-search. The fallback order (ad fallback, where a task may continue when a limit runs out) is the user's too: from the agent's shell you can runad fallback,ad fallback previewand the dryad fallback test;add,remove,order,move,set,enableandtest --liverefuse there, andenable, a trial endpoint's consent andtest --liveneed a terminal even with--yes, so ask the user to run them. With the order on,ad tuimoves a turn that ran out of its limit to the next model by itself;AD_FALLBACK=0turns that off for a run. Unattended runs need their own opt-in:ad run --fallback,ad loop --fallback, a job's--fallback,ad team set <team> fallback on. Each refuses from the agent's own shell (exit 2), so ask the user to add it; a job or team the user already set uses it. - Set brakes. Always pass
--max-iterations/--max-minutesfor loops. Default sandbox isworkspace-write; never pass--sandbox danger-full-accessunless the user asked for it. - Verify yourself. Read the diff (
git diff), run the tests, and report what actually changed. The agent's summary is a claim, not proof. Exit codes:ad run0 = turn completed, 1 = failed, 2 = refused;ad loop0 = done, 3 = a brake stopped it; both 4 = fallback paused (readreasonin--jsonor the[ad] ⏸ Paused:line; the sessionses_…keeps the work, re-run later). With--fallback,--jsonalso hastarget(who finished) andfallback(each switch): say which model did the work when you report.ad sessions show --last(or theses_…id) lists each turn's target and every tool call with its effect (read,exec,write) and how it ended: compare it with the agent's summary. - Stop a runaway loop:
touch .agent-daemon/STOP(delete it before the next loop).
Examples
Example 1: fix until green
User: "tests fail, keep fixing till they pass, I'm going for lunch."
ad loop "Make 'npm test' pass in this repo. Don't edit test files. Verify by running npm test." --max-iterations 15 --max-minutes 45
git diff --stat && npm testExample 2: weekday summary
User: "har subah 9 baje kal ke commits summarize karo" (every morning at 9, summarize yesterday's commits).
ad schedule add "0 9 * * 1-5" run "Summarize yesterday's commits on main in 5 bullets." --cwd ~/code/app
ad schedule listCheck that ad service status shows the watcher registered; otherwise the job never runs.
Anti-patterns
- Unbounded loops. No
--max-*flags means up to 20 iterations / 60 minutes of spend. - Trusting "done". Always re-run the verification yourself.
- Delegating secrets. Never put keys or passwords in a prompt. Keys ad stores stay in its gateway and the gateway token is hidden from tool shells, but the rest of the user's environment still reaches the agent's shell.
- Running guarded commands through the agent. The agent's shell carries
AD_TOOL_SHELL=1; account changes, fallback changes, memory accepts andad staterefuse there by design. Hand the user the command. - Scheduling without a watcher.
ad schedulejobs only run insidead watch/ the service. - Windows
node --testinside the agent. It hitsspawn EPERMin the unelevated sandbox; ask the agent to run test files directly, or verify yourself afterwards.
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
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.

