Skip to content

docs(onboarding): add AGENT_SETUP.md playbook (Path B final piece) - #21

Merged
ArkNill merged 1 commit into
mainfrom
feat/agent-setup-playbook
May 20, 2026
Merged

docs(onboarding): add AGENT_SETUP.md playbook (Path B final piece)#21
ArkNill merged 1 commit into
mainfrom
feat/agent-setup-playbook

Conversation

@ArkNill

@ArkNill ArkNill commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

Third and final piece of Path B (LLM-driven onboarding):

What it does PR
env-fingerprint Describes environment state #19
verify * Asserts expectations about that state #20
docs/AGENT_SETUP.md Sequences the two into an end-to-end install flow this PR

Audience

AI coding agents (Claude Code / Codex / Gemini) automating an llm-relay
install on a user's behalf. The document explicitly states it is not a
human tutorial — humans should use README.md and llm-relay init.

Structure

Five phases, each ending in a verify call with explicit pass / warn / fail
guidance:

Phase What happens
0 — Probe env-fingerprint --format json
1 — Install / upgrade pip install llm-relay[<extras>] (decision table for extras)
2 — Initialize llm-relay init --port <port>
3 — Per-CLI integration verify integration --cli <id> per detected CLI
4 — (Optional) start server llm-relay serve or Windows service
5 — Final acceptance verify all [--live]

Permission protocol

The playbook never assumes consent. Five [PERMISSION: …] markers gate any
system-modifying action:

  • install-packagepip install
  • write-configllm-relay init (writes ~/.llm-relay/, edits ~/.claude/settings.json)
  • edit-claude-settings — direct edit, last resort only
  • fix-permissionschmod / chown on home dir
  • install-service — Windows background service registration

Stop-and-ask rules

Explicit list of ambiguous states where the agent defers to the user:

  • No CLI installed
  • verify fails with no remediation string
  • Remediation proposes editing a file outside the standard paths
  • Multiple Python interpreters or Claude Code installs
  • Schema version mismatch on env-fingerprint / verify

What not to do

The agent's scope is bounded:

  • Do not modify usage.db or CC *.jsonl transcripts
  • Do not install LLM CLIs on the user's behalf (each vendor has its own path)
  • Do not auto-edit shell rc files to fix PATH
  • Do not retry a failing verify more than once with the same remediation

Other changes

  • README.md — new "Agent-driven setup" section linking to the playbook and
    showing the four entry-point commands.
  • CHANGELOG.md — entry under Unreleased ### Added.

Test plan

  • No code changes (documentation only); existing 593-test suite passes
    unchanged.
  • Ruff clean (no Python files touched).
  • NDA grep on diff: 0 hits.
  • Cross-checked playbook against actual CLI behaviour (verify install
    / verify config / verify integration --cli claude-code smoke-tested
    on this host before writing).

What's next (after this lands)

Path B is structurally complete: an agent can probe, install, configure,
verify, and report. Realistic next tracks:

  • Dogfood it: have Claude Code itself run the playbook against a fresh VM
    and capture the friction points.
  • 0.9.4 release cut combining all Unreleased entries
    (composition incremental cache, zone 1M restore, dup_reads fix, CSS fix(dashboard): status-text shrinks correctly when sibling text grows #15,
    env-fingerprint, verify primitives, AGENT_SETUP).
  • Path A polish: add a --guide mode to llm-relay init that surfaces
    the same decision tree the playbook describes, for humans who prefer
    doing it themselves.

Third and final slice of Path B (LLM-driven onboarding). With
env-fingerprint (PR #19) describing state and verify (PR #20)
asserting expectations, this document sequences them into an
end-to-end install flow an agent can follow without scraping
human-friendly output.

Audience: AI coding agents (Claude Code / Codex / Gemini) running
an llm-relay setup on a user's behalf. The document is explicit
that it is NOT a human tutorial -- humans should use README.md and
`llm-relay init` directly.

Structure:

  Phase 0 — Probe (env-fingerprint)
  Phase 1 — Install or upgrade the package (with extras decision table)
  Phase 2 — Initialize local state (llm-relay init)
  Phase 3 — Per-CLI integration (claude-code / openai-codex / gemini-cli)
  Phase 4 — Optional: start the server (Linux/macOS vs Windows service)
  Phase 5 — Final acceptance (verify all)

Each phase ends with a `verify` call, and the playbook spells out how
to respond to pass / warn / fail outcomes.

Permission protocol:

The playbook never assumes consent for system-modifying actions. Five
explicit markers gate any operation that touches outside of read-only
probes:

  [PERMISSION: install-package]      pip install
  [PERMISSION: write-config]          llm-relay init (writes ~/.llm-relay/, edits ~/.claude/settings.json)
  [PERMISSION: edit-claude-settings] direct settings.json edit (last resort)
  [PERMISSION: fix-permissions]       chmod / chown on home dir files
  [PERMISSION: install-service]       Windows background service registration

"When to stop and ask" section enumerates ambiguous states (no CLI
installed, verify fail with no remediation, multiple Python
interpreters, etc.) where the agent must defer to the user instead
of improvising.

"What not to do" section pins down the agent's scope: do not modify
session transcripts, do not install LLM CLIs on the user's behalf,
do not auto-edit shell rc files, do not retry a failing remediation
more than once.

README updated with an "Agent-driven setup" section linking to the
playbook and showing the four entry-point commands.

CHANGELOG documents the playbook under Unreleased ### Added.

Schema contract: both env-fingerprint and verify use
schema_version "1"; the playbook calls out that an agent should
fall back to the in-tree playbook for whatever release it has
installed if the schema version differs.
@ArkNill
ArkNill merged commit e01f79c into main May 20, 2026
6 checks passed
@ArkNill
ArkNill deleted the feat/agent-setup-playbook branch May 20, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant