This walks through wiring ASIL into an existing TypeScript codebase. End-to-end in five minutes if you already have a target repo.
- Node ≥ 20, pnpm ≥ 9
- Target repo uses pnpm and has working
pnpm install,pnpm test,pnpm typecheckscripts - Anthropic API key (primary LLM)
- OpenAI API key (adversarial gate)
Clone or vendor the four packages alongside your code, then add them to your pnpm-workspace.yaml:
packages:
- "packages/*"
- "asil/packages/*" # add this linepnpm install will link them in. Or, once published, install the library packages from npm:
pnpm add asil-cost-controller asil-thought-multiplier asil-improvement-loop asil-analyzer(asil-runners is the reference CLI/app, not a published library — vendor it or copy its wiring. The four libraries above are what you compose into your own runner.)
Create .env in your repo root:
ANTHROPIC_API_KEY=sk-ant-…
OPENAI_API_KEY=sk-…
REPO_ROOT=/absolute/path/to/your/repo
ASIL's thinkers expect Markdown skill files at <REPO_ROOT>/.asil/skills/. The simplest setup:
mkdir -p .asil/skills
# Copy or symlink any Markdown skills (e.g. from a public skill library) you want to use.
# A minimal install is fine — the thinkers fall back to inline defaults
# if a skill file is missing.Override the location with ASIL_SKILLS_PATH if you want them somewhere else.
This is the lowest-risk way to try ASIL — no code mutations, just generates a build brief.
pnpm --filter asil-runners run:b "add rate limiting to the connect API endpoint"You'll get a Markdown brief with merged recommendations, conflict resolutions, and acceptance criteria. Use it as a prompt to your editor agent of choice.
pnpm --filter asil-runners auto grind --dry-runThis scans, queues tasks, and reports — without touching git or making any LLM calls past the scan. Use it to verify the scanner picks up what you expect.
pnpm --filter asil-runners auto grind --max-tasks 3 --skip dependency-update,documentationThe runner will:
- Scan and queue tasks
- Pause on any unresolved
// DOMAIN_QUESTION:markers and offer triage - For each task: isolate, execute, typecheck, test, self-review × 3, adversarial gate, domain guard, open PR
- Print a summary with cost spent and PRs opened
pnpm --filter asil-runners auto report
pnpm --filter asil-runners auto report weeklyReports come out as Markdown tables with per-task, per-system, and per-day cost rollups.
- Customize project rules. Pass
projectNameandprojectDoNotChangeviaThoughtMultiplierConfigto inject your house rules into every brief. - Plug in a different provider. Replace
createAnthropicCaller/createCodexCallerinasil-runners/src/wiring.tswith a wrapper around any LLM that returns{content, inputTokens, outputTokens}. - Tighten the budget. Configure
BudgetManagerwith per-category caps and a daily ceiling; the kill switch will halt the loop if either is breached. - Mark unresolved domain logic. Sprinkle
// DOMAIN_QUESTION: <one-line question>comments in code paths that need human input. The loop will block on them until you triage.
| Symptom | Likely cause | Fix |
|---|---|---|
git worktree add fails |
Filesystem doesn't support worktrees (Google Drive, some FUSE mounts) | The runner auto-falls-back to git clone. If both fail, check git status in REPO_ROOT. |
pnpm install fails inside worktree |
Worktree lacks node_modules symlinks |
The loop runs pnpm install in each worktree by design. Ensure the worktree path is writable. |
| Adversarial gate keeps blocking | Diff is genuinely contradictory or oversized | Check the gate's reason string; usually the LLM has a real point. Lower maxAttempts to fail faster. |
| Cost cap hit immediately | Budget too low for selected models | Either bump dailyBudgetUSD or downgrade executionModel from opus to sonnet. |