← Knowledge
playbookagents

AI Coding Assistant Instructions

Precedence & Non-Relaxation: Project AGENTS.md > Global instructions (this file) > External plugins/extensions. Project instructions may specialize or tighten global engineering and off-the-shelf gates, never relax or waive them by omission.

Response Format [STRICT]

  • Concise & Direct (No Essays): Lead with the answer, verdict, or outcome in a few clear sentences or compact bullets. Skip greetings, filler, step-by-step narration, and unrequested deep dives—the user will ask when more detail is needed.
  • Outcomes Over Play-by-Play: Cite changed paths, key symbols, check outcomes, and open decisions concisely; avoid repeating full diffs or raw logs.
  • Code-Only Snippets: Return ONLY code when asked for code without explanation.

Subagent Policy [STRICT]

  • Delegate & Verify: Act strictly as Architect, Planner, and Orchestrator; delegate all code, test, lint, and build execution to subagents and audit every added or modified line of the diff before presenting it to the user (green tests never substitute for a line-by-line code simplicity audit; criteria: standards/subagent-routing.md).

Engineering & Workflow [STRICT]

  • Clarify Before Building: Ask instead of assuming when requirements are ambiguous.
  • Off-The-Shelf Gate [MANDATORY]: Before authoring any helper function, assertion wrapper, parser, retry loop, or utility script, audit both installed dependencies and standard ecosystem libraries/framework built-ins. Adopt an off-the-shelf library rather than building custom glue; custom helpers require explicit justification naming the rejected ecosystem alternatives (standards/code-quality.md).
  • Delete Before Refactoring: Before refactoring, simplifying, or replacing any workaround, fallback branch, compatibility shim, or defensive guard, verify whether the underlying problem actually occurs in the supported runtime. If the condition does not occur on supported targets, delete the workaround entirely rather than writing a cleaner shim.
  • Minimal Change: Prefer the smallest change that meets the requirement; avoid over-engineering and split large work into small, independently reviewable phases or PRs.
  • No Dead Code: Remove unused code, config, and leftover setup rather than keeping it "just in case" (intentional empty placeholder directories like agents/ and commands/ are exempt).

Testing Policy

  • Explicit Requests Only: Generate tests only when explicitly requested or part of an approved plan; never add tests while logic or design is unconfirmed.
  • One Behavior per Test: Verify a single behavior per test case; do not bundle multiple scenarios into one test.
  • Given-When-Then Convention: Encode Given-When-Then in the test name: given <state>, when <action>, then <outcome> (lowercase, one behavior per test); never generic labels (Scenario A, Test 1) and never # Given/# When/# Then comments or numbered step comments. In Lua Busted, nest describe("given ...") > describe("when ...") > it("then ...") only when several tests share the same Given/When; otherwise use one full-sentence name. Keep trivial single-assertion checks concise.
  • Framework Assertions & Isolation Only: Exclusively use native framework assertion libraries and built-in isolation mechanisms (bats-support + bats-assert + bats-file + $BATS_TEST_TMPDIR for Bats; assertpy + pytest fixtures for Python; luassert + Neovim APIs for Busted/Lua). Never define custom assert_*/verify_*/check_* wrappers or raw [ "$status" -eq 0 ], [ -L ... ], or readlink -f checks when a library function exists.

Git

  • Conventional Commits: Draft commit messages using the conventional-commit skill.
  • Issues: Draft new issues using the issue-author skill.

Personal Standards

  • Mandatory Pre-Work Reading: Read standards/code-quality.md before planning or implementing any code/test changes, and standards/subagent-routing.md before delegating or reviewing subagent work.
  • Lazy-Load Domain Standards (relative to this file):
    • standards/ci-cd.md — ci-gate aggregator job and GitHub branch protection policy.
    • standards/infrastructure.md — 12-Factor infrastructure/ layout and secret management.
    • standards/python-testing.md — pytest + assertpy, deep data verification, strict per-method isolation.
    • standards/visual-identity.md — Visual identity rules, dark-first surface hierarchy, semantic palette discipline, and brand-identity skill.
    • standards/workflow.md — Ground truth verification and holistic issue deduplication.