Skip to content

feat: a guide for AI agents, and JSON from init and apply - #16

Merged
3ae3ae merged 1 commit into
general-clifrom
wp/guide
Oct 19, 2026
Merged

3ae3ae merged 1 commit into
general-clifrom
wp/guide

Conversation

@3ae3ae

@3ae3ae 3ae3ae commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

More and more, a CLI like this is driven by an AI agent on someone's behalf. This PR is the agent-facing half. The other half is the run-control PR: run --detach, stop, and JSON errors.

  • harness2 guide prints the contract an agent should follow, then the project's current settings, tasks and runs. The contract:
    • ask before spending, and bound runs with --max-calls
    • read --json output, and answer prompts with flags
    • never edit runs/ or the harness directly
    • the workflow: init → task → doctor → dry-run → run --detach → status --json / stop → diff / eval → apply --yes
    • where things are stored, and what the exit codes mean
  • guide --install claude installs the guide as a user-level Claude Code skill. harness2's own runs never load user skills, so it can't contaminate a run.
  • harness2 chat reuses the same guide, so it lives in one place.
  • init --json and apply --json print a result object on stdout and keep their human-readable text on stderr. apply --json never prompts: it requires --yes or --dry-run.

Test plan

  • 134 core tests pass, including the new apply-JSON and guide-contract tests.
  • harness2 guide checked by hand, inside and outside a project.
  • ruff

🤖 Generated with Claude Code

`harness2 guide` prints how an AI agent should drive harness2 on a
person's behalf: ask before spending, bound runs with --max-calls, read
--json, answer prompts with flags, never edit runs or harness files
directly, the init/task/doctor/run --detach/status/stop/diff/eval/apply
workflow, where things are stored and what the exit codes mean, followed
by the current project's settings, tasks and runs. `guide --install
claude` installs the same text as a user-level Claude Code skill, which
harness2's own runs never load. `harness2 chat` now builds on it.

`init --json` and `apply --json` print a result object on stdout and
keep their human-readable text on stderr; `apply --json` refuses to ask
for confirmation and needs --yes or --dry-run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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