# Coding Agent Autonomy & Collaboration Style Quiz

Instrument: `agenttune-coding-style@1.0.0`. Scorer: `1.0.0`. License: MIT.

Present these 10 engineering scenarios in one bulk reply (choices 1–3 per item) and compile the selected rules inside `<!-- agenttune:preferences:start -->` ... `<!-- agenttune:preferences:end -->` markers. Ask before writing to `CLAUDE.md`, `AGENTS.md`, or `.cursor/rules/`.

## Scenarios

### 1. Safety & Action Gating (`ca-01`)
The agent sees a bug fix requires running a destructive database migration or force-pushing a branch.
1. **strict-gate** — Execute safe local edits freely; always pause and ask before irreversible/external actions
   - Rule: **Explicit action gating:** Perform reversible local edits and read-only checks autonomously; pause and ask before destructive deletes, force-pushes, schema drops, or external deploys.
2. **ask-edits** — Show a brief plan before modifying any tracked files
   - Rule: **Plan before editing:** Summarize intended file edits in 2–4 bullets and wait for approval before modifying tracked files.
3. **full-auto** — Execute end-to-end inside repo boundaries, pause only on production or secrets
   - Rule: **High local autonomy:** Execute repo changes, builds, and tests end-to-end; stop and ask only before touching production services, credentials, or external APIs.

### 2. Diff Scope (`ca-02`)
While fixing a 5-line bug, the agent spots messy naming and an unrelated lint issue in the same file.
1. **minimal** — Touch only the lines needed for the bug; note the cleanup separately
   - Rule: **Minimal diffs:** Limit edits strictly to the requested task; never sneak in unrelated refactors or formatting churn.
2. **local-tidy** — Fix small issues inside functions already being edited, leave the rest alone
   - Rule: **Scoped hygiene:** Clean up obvious issues inside functions you already modify, but leave untouched sections and unrelated files alone.
3. **boy-scout** — Clean up nearby lint and dead code in the touched file if tests stay green
   - Rule: **Tidy touched files:** Remove adjacent dead code or lint warnings in files you edit, verifying all tests still pass.

### 3. Verification Discipline (`ca-03`)
When is the coding agent allowed to tell you a fix is complete?
1. **run-after-final** — Only after running relevant tests/builds AFTER the final edit and citing exact output
   - Rule: **Verify after the final edit:** Never report tests, linters, or builds as passing unless you executed them after your last edit and observed zero failures.
2. **targeted-test** — Run the focused unit test for the changed module and state what was not run
   - Rule: **Targeted verification:** Run the closest unit test covering the change and explicitly list any wider suites you did not run.
3. **fast-ship** — Verify syntax/types fast and let me run the heavy integration suite
   - Rule: **Fast check first:** Run fast syntax/type checks locally and flag any slower suites for me to run.

### 4. Ambiguous Specs (`ca-04`)
You ask for a feature whose edge case (e.g., empty input or tie-breaking) is not specified.
1. **inspect-then-decide** — Check existing repo conventions first; follow them and note the assumption in one line
   - Rule: **Follow repo conventions first:** Read neighboring code and tests before asking; if one convention clearly fits, follow it and state the assumption briefly.
2. **ask-upfront** — Stop and ask before guessing edge-case behavior
   - Rule: **Never guess behavioral contracts:** If error handling, edge cases, or data schemas are unspecified, ask one concise question before implementing.
3. **fail-closed** — Default to strict fail-closed validation and document the boundary
   - Rule: **Fail closed on ambiguity:** Reject malformed or missing inputs explicitly rather than silently coercing or inventing defaults.

### 5. Architecture Pushback (`ca-05`)
You ask the agent to implement an approach that introduces a race condition or N+1 query.
1. **block-and-propose** — Stop before coding, name the failure mode in line 1, and propose a safer fix
   - Rule: **Red-team bad specs early:** If a requested change introduces a bug, race condition, or security flaw, flag it before writing code and propose the cleanest fix.
2. **flag-inline** — Implement if minor, or flag clearly with a side-by-side alternative before editing
   - Rule: **Surface trade-offs plainly:** Name concrete failure modes directly without flattery and recommend a safer alternative when risk is material.
3. **execute-with-note** — Build what I asked, and put the risk warning at the top of the summary
   - Rule: **Respect explicit direction:** Execute the requested design, but place any concrete correctness or performance risks at the top of your handoff.

### 6. Handoff Format (`ca-06`)
How should the agent summarize completed work?
1. **terse-diff** — 3–5 bullets: root cause, changed files, test command + pass count
   - Rule: **Crisp handoffs:** Report root cause, changed file paths, and exact verification commands run in 3–5 bullets. Skip narration of intermediate dead ends.
2. **structured-pr** — PR-ready summary: What changed, Why, Verification, Follow-ups
   - Rule: **PR-ready summaries:** Group handoffs into What changed, Why, Verification, and Risks/Follow-ups.
3. **guided** — Walk through the key code paths so I can review line by line
   - Rule: **Review walkthrough:** Briefly explain the key logic change in each modified file so I can audit the diff quickly.

### 7. Reasoning Verbosity (`ca-07`)
On high-reasoning models (which expand output 43%–95% in our benchmarks), how should reply length be governed?
1. **strict-cap** — Keep public replies tight even when thinking deeply (under ~150 words unless asked)
   - Rule: **Cap reply bloat under high reasoning:** Deliberate thoroughly internally, but keep final replies tight (under ~150 words for routine tasks) without echoing scratchpad steps.
2. **moderate** — Summarize the key reasoning decision in 2 sentences, then show the code
   - Rule: **State the decision, not the whole search tree:** Give the chosen rationale in 1–2 sentences and move directly to the patch or command.
3. **explicit-trace** — Include the full tradeoff comparison when making architectural calls
   - Rule: **Show architectural tradeoffs:** For multi-file or design choices, include a brief pros/cons table before implementing.

### 8. Rule Format & Portability (`ca-08`)
Do you switch between multiple models/tools (Claude Code, Codex, Cursor, DeepSeek, Qwen)?
1. **numbered-rubric** — Yes — use numbered, testable checklist rules (6× tighter cross-model portability)
   - Rule: **Testable rules over vague adjectives:** Follow every numbered requirement literally; treat unspecified style adjectives as secondary to concrete checks.
2. **single-tool** — Mostly one tool — concise bullet rules are fine
   - Rule: **Concise bullet contract:** Keep this rule block under 15 rules so every constraint stays inside the high-compliance budget.
3. **minimal-core** — Ultra-minimal core (top 5 non-negotiable rules only)
   - Rule: **Ultra-lean budget:** Enforce core correctness, diff minimality, and verification rules strictly without extraneous style bloat.

### 9. Long-Session Drift Guard (`ca-09`)
After 8+ turns of build logs and stack traces, models drift from system rules (up to 69% drop on open weights).
1. **recheck-rule** — Add a built-in pre-reply contract check before emitting long-thread answers
   - Rule: **Long-thread drift guard:** Before finalizing any reply in a long debugging thread, re-check: answer first, zero filler, verified commands only.
2. **compact-context** — Prompt me to compact/reset context once a task finishes cleanly
   - Rule: **Clean session boundaries:** When a logical milestone lands cleanly, note that it is a good point to start a fresh thread or compact context.
3. **none** — Skip drift reminders — keep the file as short as possible
   - Rule: (omit to keep file minimal)

### 10. Citations & Grounding (`ca-10`)
When referencing files, symbols, or APIs in your codebase:
1. **read-first** — Never guess APIs or line numbers — read the file before citing or editing
   - Rule: **Read before editing or citing:** Never invent file paths, CLI flags, or function signatures; inspect the file first and state clearly if something could not be verified.
2. **cite-paths** — Always include exact repo-relative file paths and line numbers for claims
   - Rule: **Exact path citations:** Cite exact file paths and symbol names for every behavioral claim or proposed edit.
3. **pragmatic-ground** — Verify critical code paths; mark any untested assumption explicitly
   - Rule: **Mark unverified assumptions:** Clearly label any assumption you did not verify directly against the codebase.

## Installation
Always append task precedence ("Explicit instructions in the active prompt override these defaults") and keep total rules <=15 to stay inside the empirical high-compliance window (https://agent-tune.com/research/ai-instruction-budget-cliff-lost-in-the-middle). Follow https://agent-tune.com/resources/install-protocol.md.
