ai-diff-reviewer
AGENTS.md1 starsChanged 4 months agoMITView on GitHub
Purpose: Single source of truth for every AI coding assistant working on this repository (Claude Code, Cursor, OpenAI Codex, Google Gemini, GitHub Copilot, OpenClaw, and others). Human contributors are also welcome readers — this file is the fastest way to get oriented. The product name in user-facing strings is "AI Diff Reviewer" (capitalised exactly that way). The git repository slug is DailybotHQ/ai-diff-reviewer — renamed from DailybotHQ/ai-pr-reviewer on 2026-07-14 to unblock Marketplace publish (see Rule #9). Old uses: DailybotHQ/ai-pr-reviewer@v1 pins keep…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- add-providerSkill
- ai-diff-reviewerSkill
- dailybotSkill
- deepworkplanSkill
- prompt-testSkill
- releaseSkill
- ai-diff-reviewer-address-reviewSkill
- ai-diff-reviewer-apply-reviewSkill
- ai-diff-reviewer-generate-extensionSkill
- ai-diff-reviewer-open-prSkill
- ai-diff-reviewer-setupSkill
- ai-diff-reviewerSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
22 rules. About 0 are common, 7 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 148
Every one of these runs on a vanilla ubuntu-latest matching the CI environment (.github/workflows/code_check.yml) — if it passes locally, …
- Distinctive: line 156
All code, comments, documentation, and commit messages MUST be in English.
- Very specific: line 166
ALL Python code in scripts/ MUST use complete type hints — parameters, return types, and meaningful local variables.
- Distinctive: line 184
If you must break the contract:
- Very specific: line 193
Every commit that touches scripts/reviewer.py MUST compile cleanly:
- Distinctive: line 203
Every commit follows Conventional Commits:
- Very specific: line 338
Every event is emitted via the dailybot report sub-skill (dailybot agent update ...
- Very specific: line 344
Uninstall: Delete .dailybot/, .cursor/hooks.json, and remove the three hook entries from .agents/settings.json (every entry contains the …
- Very specific: line 396
Add a non-stdlib import to scripts/reviewer.py — see Rule #2.
- Very specific: line 405
Add a new top-level action.yml input "just to support a one-off use case" — every input is a long-lived public contract.
- Distinctive: line 414
Keep the runtime stdlib-only.
- Distinctive: line 415
Use type hints on every function signature and meaningful local.
- Very specific: line 416
Write # noqa: BLE001 on intentionally broad excepts and explain in a comment WHY (the patterns are: "best-effort GH API call", "surface to …
- Very specific: line 417
Run python3 -m py_compile scripts/reviewer.py before pushing.
- Very specific: line 418
Update README.md + CHANGELOG.md in the same PR as the behaviour change.
- Very specific: line 419
Use write_action_output() for any new value you want consumers to read in downstream steps.
- Very specific: line 420
Use safe_repo_path() for any new tool that takes a path argument — never resolve user-supplied paths manually.
- Distinctive: line 421
Add a row to the inputs table in README.md for any new input.
- Very specific: line 422
Verify the change via .github/workflows/self-review.yml running on the PR.
- Very specific: line 424
Use "AI Diff Reviewer" for product copy (Marketplace-facing), DailybotHQ/ai-diff-reviewer for the canonical repo slug (the old …
- Very specific: line 425
Follow the runner/backend checklist when adding one (docs/PROVIDERS.md § "Adding a runner or backend"): endpoint profile → provider class → …
- Distinctive: line 468
Every AI agent that works on this repo (Claude Code, Cursor, Codex, Gemini, Copilot, OpenClaw) is guided by this AGENTS.md — the single …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — Documentation for AI Agents
Purpose: Single source of truth for every AI coding assistant working on this repository (Claude Code, Cursor, OpenAI Codex, Google Gemini, GitHub Copilot, OpenClaw, and others). Human contributors are also welcome readers — this file is the fastest way to get oriented.
The product name in user-facing strings is "AI Diff Reviewer" (capitalised exactly that way). The git repository slug is DailybotHQ/ai-diff-reviewer — renamed from DailybotHQ/ai-pr-reviewer on 2026-07-14 to unblock Marketplace publish (see Rule #9). Old uses: DailybotHQ/ai-pr-reviewer@v1 pins keep working via GitHub's permanent 301 redirect for renamed repos; new copy-paste examples in the README always use the canonical DailybotHQ/ai-diff-reviewer path. The Marketplace listing slug is ai-diff-reviewer, derived from the action.yml name: field — matches the repo slug exactly. Vendor attribution is handled by GitHub automatically via the author: field (DailybotHQ) — the Marketplace tile renders "by DailybotHQ" beneath the title, so we do NOT embed "Dailybot" in the name: field. See Rule #9 for the naming rule, and the Marketplace rename decision log for the full chronology.
Working principles
Work with autonomy, ownership, and sound judgment. Pursue excellence through correctness, clarity, simplicity, and verified completion.
- Own the outcome. Carry authorized work through investigation, execution, and appropriate validation. Continue until the requested outcome is complete or a concrete blocker prevents further progress.
- Be resourceful before asking. Inspect available code, documentation, tools, and prior decisions. Resolve questions you can answer through reasonable investigation instead of transferring that work to the user.
- Make routine decisions independently. Choose sensible approaches within the authorized scope. State consequential assumptions. Avoid confirmation requests for routine steps or actions already authorized.
- Ask when judgment or authorization is missing. Consult the user when essential information is unavailable, a material decision cannot be inferred reliably, or an action requires approval not already granted. Bring the investigation, relevant options, and your recommendation.
- Make approvals concrete. Complete authorized preparation before asking for approval. Present a reviewable result and identify the action requiring approval and why it requires it.
- Work through obstacles. Investigate failures and attempt reasonable recovery within scope. Continue independent authorized work when possible. Respect applicable stop conditions; escalate when progress requires user input or an external change.
- Respect intent and scope. Analysis requests remain analysis. Propose broader improvements separately unless already authorized. Preserve the user's existing work, decisions, and repository-specific approval rules.
- Apply proportionate rigor. Address underlying causes and favor maintainable solutions. Match investigation, validation, and polish to the task's impact. Avoid unnecessary complexity and unrelated changes.
- Communicate directly and precisely. Lead with the result or decision. Explain consequential tradeoffs concisely. Distinguish verified facts, assumptions, and unresolved uncertainty.
- Verify before declaring completion. Review the result against the request, perform appropriate checks, and fix issues within scope. Report what was validated and any remaining limitations. Never claim actions, checks, or outcomes that did not occur.
Detailed Documentation
| Category | Document |
| Product Spec | docs/PRODUCT_SPEC.md |
| Architecture | docs/ARCHITECTURE.md |
| Security | docs/SECURITY.md |
| Testing | docs/TESTING_GUIDE.md |
| Development Commands | docs/DEVELOPMENT_COMMANDS.md |
| Release Recovery Playbook | docs/RELEASE_RECOVERY.md |
| Python Guidelines | docs/DEVELOPMENT_GUIDELINES.md |
| Repository Standards | docs/STANDARDS.md |
| Documentation Guide | docs/DOCUMENTATION_GUIDE.md |
| AI Agent Onboarding | docs/AI_AGENT_ONBOARDING.md |
| AI Agent Collaboration | docs/AI_AGENT_COLLAB.md |
| PR Review Workflow | docs/PR_REVIEW_WORKFLOW.md |
| Strictness (user-facing) | docs/STRICTNESS.md |
| Prompts (user-facing) | docs/PROMPTS.md |
| Providers (user-facing) | docs/PROVIDERS.md |
| Performance | docs/PERFORMANCE.md |
| Iteration-Aware Review | docs/ITERATION_AWARENESS.md |
| v2 pin + platform notes | docs/MIGRATION_v2.md |
| v3 design records (RFCs) | docs/rfc/v3/README.md |
| Docs index | docs/README.md |
| Skills & Agents Catalog | .agents/docs/skills_agents_catalog.md |
| Deep Work Plan skill | .agents/skills/deepworkplan/SKILL.md |
| Dailybot agent skill | .agents/skills/dailybot/SKILL.md |
Project Overview
AI Diff Reviewer is an LLM-driven pull-request reviewer packaged as a GitHub Action. It posts inline comments with severity tags, gates the GitHub check based on configurable strictness, applies a "reviewed" label, and collapses prior reviews — all from a single composite action with zero infrastructure.
Stack constraints (load-bearing):
- Python 3.10+ standard library only. No
requirements.txt, nopyproject.toml, no virtualenv. Every dependency is a supply-chain question for every consumer. - Composite GitHub Action — not Docker, not Node. The runtime is whatever Python ships with
ubuntu-latest. - Single source file for the runtime:
scripts/reviewer.py. The simplicity is the feature. - Runner × backend abstraction. Six runners (
anthropic,openaiin-process;claude-code,cursor,codex,grokCLIs) and anEndpointProfileresolved from the optionalapi-baseinput (Anthropic, OpenAI, Azure Foundry, xAI, Z.ai, custom). Every backend URL comes fromresolve_endpoint_profile; an emptyapi-baseselects the vendor's default endpoint (the v2 "byte-identical to earlier releases" promise ended with v3's request shape — BC-17,docs/MIGRATION_v3.md).
Project Structure
.
├── action.yml # Composite-action contract (inputs/outputs/branding)
├── scripts/
│ ├── reviewer.py # All runtime logic — stdlib only
│ └── check-public-hygiene.sh # CI-only public-hygiene scan (allowlist: .public-hygiene-allow)
├── prompts/
│ └── default.md # Bundled default system prompt (technology-agnostic)
├── examples/ # Copy-paste workflow snippets for common setups
├── tests/ # Stdlib-unittest suite for the runtime
├── docs/ # User-facing + contributor-facing documentation
├── .github/
│ ├── workflows/ # code_check, auto-release, release, self-review
│ ├── scripts/ # CI-only helpers (action.yml validator, changelog tools)
│ ├── ISSUE_TEMPLATE/ # Bug + feature issue forms
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── CODEOWNERS # Default reviewers (* @xergioalex)
│ └── dependabot.yml # Weekly GitHub Actions bumps
├── .agents/ # Canonical AI-agent configuration (symlinked from .claude)
│ ├── agents/ # Sub-agent definitions
│ ├── commands/ # Slash commands (commit, pr, release, prompt-test, …)
│ ├── docs/ # Catalog + agent-targeted docs
│ ├── skills/ # Skill definitions (release, prompt-test, add-provider, deepworkplan, dailybot, …)
│ ├── settings.json # Agent harness settings
│ └── README.md
├── skills-lock.json # skills.sh lockfile pinning vendored skill sources + hashes
├── README.md # Marketplace-facing readme
├── AGENTS.md # ← you are here (source of truth)
├── CLAUDE.md # Symlink → AGENTS.md
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md # Contributor Covenant 2.1
├── SECURITY.md # Private vulnerability reporting policy
├── .public-hygiene-allow # Allowlisted fake fixtures for the hygiene scan
└── LICENSE # MITQuick Commands
The real, runnable commands for local work on this repo. No install phase — Python 3.10+ ships with everything needed (the runtime is stdlib-only). See docs/DEVELOPMENT_COMMANDS.md for the full reference and local-debug envs.
| Purpose | Command |
Public-hygiene scan (CI job Public hygiene; allowlist .public-hygiene-allow) | bash scripts/check-public-hygiene.sh |
| Compile-check the runtime (MANDATORY before commit — Rule #5) | python3 -m py_compile scripts/reviewer.py |
Run the full unit-test suite (stdlib unittest, no third-party runner) | python3 -m unittest discover -s tests -v |
Validate the action.yml public contract (CI parity — needs pip install pyyaml) | python3 .github/scripts/validate_action.py |
Parse action.yml (quick sanity check, needs pip install pyyaml) | python3 -c 'import yaml; yaml.safe_load(open("action.yml"))' |
| Objectively verify DWP conformance | bash .agents/skills/deepworkplan/verify/conformance.sh |
Verify a v6/v7 plan (conformance.sh judges it by its own contract + journal records; the contract helper validates both generations) | python3 .agents/skills/deepworkplan/shared/contract_v6.py validate-contract <plan>/contract.json then … validate-journal <plan>/journal.ndjson --contract <plan>/contract.json |
| Verify auth to Dailybot (never prompts, safe to run) | dailybot status --auth |
Every one of these runs on a vanilla ubuntu-latest matching the CI environment (.github/workflows/code_check.yml) — if it passes locally, it passes in CI.
CRITICAL: Mandatory Rules
1. English Only
All code, comments, documentation, and commit messages MUST be in English. The action ships to a global audience; a Spanish comment in the prompt or the script becomes a usability bug for everyone outside the team.
2. Standard Library Only (MANDATORY)
scripts/reviewer.py MUST run on a vanilla ubuntu-latest runner with zero non-stdlib imports. No requests, no pyyaml at runtime, no httpx. This is the load-bearing constraint that lets the action stay a single composite step with no install phase. PRs that introduce a non-stdlib runtime dependency will be rejected.
CI tooling (lint, test) is allowed to use third-party packages; the runtime is the line. See docs/DEVELOPMENT_GUIDELINES.md.
3. Type Hints (MANDATORY)
ALL Python code in scripts/ MUST use complete type hints — parameters, return types, and meaningful local variables. The codebase is the documentation; readers shouldn't have to infer types.
# CORRECT — fully typed
def fetch_pr_context(
*, repo: str, pr_number: int, base_ref: str, token: str
) -> PRContext:
...
# WRONG — never generate untyped code
def fetch_pr_context(repo, pr_number, base_ref, token):
...4. Public Surface Stability (MANDATORY)
action.yml inputs and outputs are a public contract. Renaming, removing, or changing the type of an input is a breaking change that requires a major-version bump. Adding a new optional input is non-breaking.
If you must break the contract:
- Open an issue for discussion.
- Coordinate the rename across
action.yml,scripts/reviewer.py(env-var reads),README.md(input table),CHANGELOG.md, and at least one example workflow. - Cut a
v2.0.0release.
The AIPRR_* env-var prefix used internally by the script is a private contract — but it has bled into examples in CONTRIBUTING.md and docs/DEVELOPMENT_COMMANDS.md for local-debug instructions, so coordinate any rename there too.
5. Compile-Check Before Commit
Every commit that touches scripts/reviewer.py MUST compile cleanly:
python3 -m py_compile scripts/reviewer.pyCI runs this on every PR; pre-commit-checking it locally is courtesy, not optional. Beyond compilation there is a stdlib-unittest suite in tests/ covering the runtime's pure logic, plus dogfooding on real PRs. Run it locally with python3 -m unittest discover -s tests (see docs/TESTING_GUIDE.md).
6. Conventional Commits (MANDATORY)
Every commit follows Conventional Commits:
<type>(<optional-scope>): <short description>
<optional body — Summary, Change Log, Risks>Types: feat, fix, docs, chore, refactor, test, ci, perf. Scope is optional but useful for multi-file changes (feat(provider): add OpenAI support).
7. Documentation Stays in Sync
Whenever you change runtime behaviour:
README.mdinput/output tables → update ifaction.ymlchanged.CHANGELOG.md→ entry under[Unreleased].docs/STRICTNESS.md/PROMPTS.md/PROVIDERS.md→ update the section that covers the area you touched.examples/→ add an example if you added an input that has a non-trivial usage pattern.skills/ai-diff-reviewer/setup/reference.md→ update ifaction.ymlinputs, defaults, or descriptions changed (this file is the local companion skill's reference manual; drift breaks the "any agent can answer setup questions" promise).examples/README.md→ add a row for every newexamples/*.yml(the index is checked by script against the files on disk).skills/**/SKILL.mdfrontmatter →description≤ 1,024 characters andname≤ 64 (Open Agent Skills limits;scripts/validate-frontmatter.pyenforces both in CI — hosts such as Pi warn on longer descriptions). Put trigger catalogues in the body, not the frontmatter.AGENTS.md(this file) → update the "Critical Rules" or "DO/DON'T" sections if you change a project standard.
8. SemVer for Releases (MANDATORY)
Releases follow Semantic Versioning. Tags are vX.Y.Z. The release.yml workflow auto-updates the moving major tag for the current line (v3) on every v3.x.y release; consumers pinning @v3 get patches and minor features automatically (the frozen v2 line is maintained from release/v2 for six months — see MIGRATION_v3). Never delete a published tag — consumers pin to it. v3 adds an eval gate (BC-02): auto-release.yml cuts a release only when tests/eval/release_gate.py finds a current, non-blocking verdict/1.0 for the candidate's runtime + prompt; a missing or stale verdict skips the cut (see docs/RELEASE_RECOVERY.md).
9. Marketplace Branding Stable
action.yml name, description, branding.icon, and branding.color are visible in the GitHub Marketplace listing. Once published, treat them as immutable for cosmetic reasons (consumers' search results and tile UI depend on them). Editorial changes are fine; identity changes need a deliberate decision.
The current values are:
name: 'AI Diff Reviewer'(Marketplace tile + listing title; slugifies toai-diff-reviewer)description: 'Run an LLM-driven code review on every pull request — inline comments, severity-based gating, no infra required.'branding.icon: 'check-circle'branding.color: 'purple'
Repo slug ≠ Marketplace slug. The git repo lives at DailybotHQ/ai-diff-reviewer and copy-paste examples pin against that path (uses: DailybotHQ/ai-diff-reviewer@v3). The Marketplace listing is a separate slug derived from name: — currently ai-diff-reviewer. The two are decoupled by design: consumers see the friendly name in Marketplace search; their workflows keep using the stable repo path.
The Marketplace rename decision log records the release history and rationale.
Rule going forward: do NOT rename this again unless there's a similarly load-bearing reason (Marketplace publish blocker, trademark issue). The name 'AI Diff Reviewer' and the repo slug DailybotHQ/ai-diff-reviewer are now the stable public identity. Do not re-add the Dailybot-prefix (see the rename decision log for the rationale).
10. Dogfooding is Required
Two independent dogfooding surfaces enforce that we consume our own product the way our users do:
A. The CI action reviews its own PRs. Any change that affects the agentic loop, the prompt, or the review-submission path MUST be verified by .github/workflows/self-review.yml running successfully on the PR that introduces the change. If the change can't be verified by self-review (e.g. it only fires on the block-on-warning strictness path), describe the manual verification you did in the PR description.
B. The local companion skill is vendored into this repo. .agents/skills/ai-diff-reviewer/ is a vendored copy of the same skill package we ship, pinned via skills-lock.json — installed exactly the way any consumer would install it (npx skills add DailybotHQ/ai-diff-reviewer --skill ai-diff-reviewer). Refreshing that copy after every release is handled automatically by auto-release.yml Step 3.5: it runs npx skills update ai-diff-reviewer right after the new tag is pushed, commits the diff as chore(release): dogfood vendored ai-diff-reviewer to vX.Y.Z [skip release], and fails loudly if the just-published tag doesn't install cleanly. Do not manually edit .agents/skills/ai-diff-reviewer/ on a feature branch — that's the released-version snapshot; work on skills/ai-diff-reviewer/ (the source-of-truth copy that ships to consumers) and the vendored copy refreshes itself at the next release.
Together, (A) is the runtime-behavior gate; (B) is the install-flow gate. A skill change that ships broken npx skills add compatibility will fail Step 3.5 of the very release that publishes it.
Slash Commands
| Agent | Prefix | Example |
| Claude Code | / | /release |
| Codex / Cursor / Gemini | # | #release |
Defined in .agents/commands/. When invoked, look up the procedure file there and follow it exactly. The current set:
| Command | Purpose |
/commit | Generate a Conventional Commits message for the current diff. |
/pr | Generate a PR description from the branch's commits. |
/release | Cut a new vX.Y.Z tag and publish a GitHub Release. |
/prompt-test | Smoke-test a prompt change against a real PR. |
/add-provider | Scaffold a new Provider implementation. |
/code-review | Run a focused review on the current branch. |
/branch | Generate a branch name from intent. |
/dwp-create | Decompose a goal into a Deep Work Plan (numbered tasks + validation gates). |
/dwp-execute | Execute a Deep Work Plan task by task, validating each gate. |
/dwp-refine | Add, remove, or reorder tasks while preserving completed work. |
/dwp-resume | Reconstruct state and continue an interrupted plan. |
/dwp-status | Report progress on a plan without making changes. |
/dwp-verify | Objective pass/fail conformance report against the DWP spec. |
/dwp-upgrade | Check for a newer DeepWorkPlan skill; read-only until consent, then installs the accepted tag and re-onboards. |
/skill-create | Author or update a reusable skill under .agents/skills/. |
/agent-create | Author or update a sub-agent persona under .agents/agents/. |
The nine dwp-* / skill-create / agent-create entries are thin delegators to the installed deepworkplan skill at .agents/skills/deepworkplan/ — see the Deep Work Plan section below.
Deep Work Plan
This repository ships the Deep Work Plan (DWP) methodology as an installed skill so any AI agent can plan, execute, and verify structured engineering work here. DWP rests on two pillars: spec-driven development (the plan is the spec — atomic tasks with binary validation gates) and harness engineering (the repository itself is the harness: AGENTS.md, docs/, .agents/ kit, and the gitignored .dwp/ state layer). DWP standard: 7.0.0 (onboarded 2026-07-04; upgraded 2026-09-13, 2026-10-01, 2026-10-09, 2026-10-11, 2026-10-12, 2026-10-13 and 2026-10-25; skill 7.9.0, vendored 2026-10-25). New plans use v7 by default; existing v5 and v6 plans keep their recorded generation and move only through an explicit, previewed migration. The addon registry is the tracked .dwp/config.json (ai-diff-reviewer, dailybot, agentkit enabled; devcontainer, vim declined — .agents/skills/deepworkplan/spec/CONFIG.md).
Deep Work Plans — invocation
Structured work runs through the local DWP flows (.agents/commands/dwp-* delegators; the flows live in .agents/skills/deepworkplan/ — discovery is local, no network service is consulted):
| Intent | Route |
| "plan this work", "create a plan" | /dwp-create |
| "execute / run the plan" | /dwp-execute |
| "modify the plan", "change the scope", "promote Lite→Full" | /dwp-refine |
| "continue / resume the interrupted plan" | /dwp-resume |
| "plan status", "what's left" | /dwp-status (read-only) |
| "verify the repo / the plan" | /dwp-verify (read-only) |
| "upgrade the DWP skill / harness" | /dwp-upgrade (read-only until consent; then installs the accepted tag and re-onboards) |
| ordinary direct edit ("fix this", "rename that") | done directly — never silently becomes a plan |
Hosts without slash commands invoke the same flows by name (#deepworkplan-create or plain text). trust/auto authorizes unattended continuation within the requested flow; it is not a flow selector, and read-only routes stay read-only. The nine flows: sub-skill reference.
Where plans live
Deep Work Plan outputs — plans/ (PLAN_<id>_<name>/ directories, numeric ID allocated per plan; older unnumbered PLAN_{name}/ stay valid) and onboard/ (RECON.md + REPORT.md) — live under .dwp/ at the repo root. That directory is gitignored (see .gitignore: .dwp/*); plans are working artifacts, not tracked source. The one tracked file is the addon registry .dwp/config.json (decisions, never secrets), so teammates and CI read the same one. Full path convention: .agents/skills/deepworkplan/shared/dwp-paths.md.
Host and authority records (v6+)
- Host capabilities (
stop_agent,meter_spend,meter_tokens,meter_wall_clock,cancel_children,model_routing,subagents,telemetry): allfalseunless runtime support is verified; unstated meansfalse, and limits the host cannot meter are advisory.telemetryis opt-in and staysfalsewithout consent. - Authority: developers author and approve plans. Unattended runs stop before a push to
main, a release or publication, an external message or secret access unless authorized; prior authorization persists. - Outcome checks: acceptance criteria draw on the real commands in Quick Commands and docs/TESTING_GUIDE.md.
When to reach for it
Reach for a plan when work has multiple valid approaches, touches many files, or must survive across sessions (/dwp-create → /dwp-execute; /dwp-resume if interrupted; /dwp-verify for an objective gate). Small, obvious edits → work directly. DWP is complementary to the repo's existing /release, /prompt-test, and /add-provider skills — those remain the right tools for their specific workflows. DWP is for novel work that needs decomposition and gates.
Dailybot reporting (optional, non-blocking)
This repo has the Dailybot addon enabled. When the dailybot CLI is on PATH and authenticated (dailybot login), significant DWP work surfaces to the team's Dailybot standup as agent updates. If Dailybot is absent, unauthenticated, unreachable, or .dailybot/disabled exists at the repo root, reporting skips silently and never blocks the primary work.
Four lifecycle events (per DWP Dailybot addon SPEC §5.1):
| Event | When | Level |
| Kickoff | A plan is materialized and approved — describe what is being built and why. Fires once per plan. | regular |
| Significant task | A feature / bug fix / major refactor ships mid-plan. Intermediate setup tasks are not reported. | regular |
| Blocked | The plan halts on a stop condition and state.json.blocked is populated — the team sees what's stuck and what it needs. | regular (with blockers) |
| Completion | The plan finishes — describe what was built, never "completed a plan". Fires once per plan. | milestone |
Every event is emitted via the dailybot report sub-skill (dailybot agent update ... --milestone --json-data ...); payloads are derived from the plan's state layer when present (.dwp/plans/PLAN_{name}/state.json).
Deterministic hooks. This repo commits harness hook configs for both Claude Code (.agents/settings.json, resolved as .claude/settings.json via the symlink) and Cursor (.cursor/hooks.json). They call dailybot hook session-start|activity|stop at session start, after file writes, and end of turn — the harness itself reminds the agent about unreported work. All hook commands are local-only (no network), always exit 0, and cannot block. When a reminder fires, respond with either a lifecycle-appropriate report or dailybot hook dismiss — never ignore silently.
Repo identity. .dailybot/profile.json carries the credential-free repo identity (name, default_metadata, report policy). To silence Dailybot for a session or a whole clone, touch .dailybot/disabled. To turn reminders off while keeping manual reporting available, set "report": {"nudge": false} in profile.json.
Uninstall. Delete .dailybot/, .cursor/hooks.json, and remove the three hook entries from .agents/settings.json (every entry contains the string dailybot hook).
AI Diff Reviewer addon (Flow B — dual-surface)
This repo has the AI Diff Reviewer addon enabled in Flow B (local skill + CI Action). Detection for DWP create / execute is: vendored skill at .agents/skills/ai-diff-reviewer/ plus .review/extension.md. Spec: .agents/skills/deepworkplan/addons/ai-diff-reviewer/SPEC.md.
Final Review security-pass augmentation (both flows). Every 2.3.0+ plan ends in a single mandatory Final Review; its security pass runs the upstream parent default flow ("Review my current branch" / /ai-diff-reviewer), appends verdict + findings under ## AI Diff Reviewer local review in analysis_results/SECURITY_REVIEW.md, and treats open critical findings as Final Review blockers until fixed or explicitly accepted. A missing vendored skill or extension file is not a silent skip — record a local reviewer not installed finding (installation is onboarding-only). Soft-fail (warn once, continue the security pass) applies only to invocation errors (network down, upstream skill error) — an unset CI provider secret must not skip the local pass.
CI surface (this repo). Consumer Flow B normally installs .github/workflows/pr-review.yml via the upstream setup sub-skill. This repository is the Action, so the dual-surface CI gate is the dogfood workflow .github/workflows/self-review.yml (uses: ./ against the PR HEAD, label-gated on ready, stable gate job). Do not add a second consumer-style pr-review.yml here — that would double-review every PR. Provider secrets for the dogfood matrix: at least one of ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN, CURSOR_API_KEY, OPENAI_API_KEY, XAI_API_KEY (Grok), ZAI_CODING_API_KEY (Claude Code on Z.ai GLM via api-base), or AZURE_OPENAI_API_KEY + the repo variables AZURE_OPENAI_BASE_URL / AZURE_OPENAI_MODEL_DAILY (Codex on Azure Foundry); the in-process openai leg runs whenever OPENAI_API_KEY exists (opt out with the repo variable SELF_REVIEW_OPENAI_CHAT=false). Legs whose secret is absent are simply not in the matrix (see self-review.yml).
Optional post-CI companion (Flow B). After a plan's PR has been pushed and self-review has posted, developers MAY invoke the upstream apply-review sub-skill to walk CI findings per-finding (apply / defer / skip) with explicit consent. Read-only by default; never commits or pushes. For the whole round in one step, the address-review sub-skill resolves the findings, repairs any other workflow the PR runs that is failing (codecheck, tests, an out-of-date branch), commits, pushes and re-arms the reviewer per the repo's gating (label toggle or push). This is an available option during /dwp-execute, not a plan task file.
Vendor-neutral reminder. The core DWP methodology has zero dependency on this product. Declining the local reviewer elsewhere is allowed but recorded as a declared exception and reported non-conformant on that point until installed; enabling it here is dogfood + Final Review quality for plans that touch this codebase.
Skills & Agents
Reusable Skills (slash commands and one-shot workflows) and Agents (specialised personas) live in .agents/skills/ and .agents/agents/. The full catalog with tier classification is in .agents/docs/skills_agents_catalog.md.
This repo also ships a native skill of its own — ai-diff-reviewer — the local companion to the shipped GitHub Action. It lives at skills/ai-diff-reviewer/ in the ROOT (not under .agents/) because that is where skills.sh scans when consumers run npx skills add DailybotHQ/ai-diff-reviewer --skill ai-diff-reviewer. Two CI invariants guarantee action ↔ skill parity: (a) code_check.yml Skills — prompt-sync invariant job fails on PRs where skills/ai-diff-reviewer/prompt.md diverges from prompts/default.md; (b) auto-release.yml re-syncs the byte-copy AND bumps the skill's frontmatter version: field on every release cut so @v2.0.0 on both surfaces ships the same prompt. Frontmatter is validated in CI against the Open Agent Skills contract by scripts/validate-frontmatter.py (adapted from the DailybotHQ/agent-skill validator). Consumers layer repo-specific overrides at .review/extension.md (auto-detected by the skill; same path can be referenced from CI via the action's prompt-extension-file: input for local ↔ CI parity). See docs/PROMPTS.md § "Local coding-agent parity" for the extension-authoring guide.
Two other skills — deepworkplan and dailybot — are vendored dogfood copies of upstream skills (DailybotHQ/deepworkplan-skill and DailybotHQ/agent-skill), pinned via skills-lock.json at repo root. The lockfile is written by the skills.sh CLI (npx skills) and records the exact source repo + content hash for each vendored skill so any contributor can restore the same versions deterministically:
# Restore vendored skills from the lockfile (idempotent — no-op if already up to date)
npx skills experimental_install
# Pull the latest upstream release into the vendored copy + rewrite the hash in the lockfile
npx skills update deepworkplan dailybot
# Re-add a skill from scratch (e.g. after upstream renames the repo)
npx skills add DailybotHQ/deepworkplan-skill --skill deepworkplan -y
npx skills add DailybotHQ/agent-skill --skill dailybot -yThe four in-house skills (release, prompt-test, add-provider, plus the agent personas) are not vendored — they're authored directly in this repo and not tracked by the lockfile.
Tier Model
| Tier | Use case | Model |
| 1 — Light | Trivial fixes, doc edits | Haiku / cheap-fast |
| 2 — Standard | Single-file features, tests | Sonnet / standard |
| 3 — Heavy | Architecture, prompt redesign, provider implementation | Opus / frontier |
Common Mistakes
DON'T
- Add a non-stdlib import to
scripts/reviewer.py— see Rule #2. - Rename or remove an input in
action.ymlwithout bumping the major version — see Rule #4. - Skip the compile-check before pushing — see Rule #5.
- Hard-code provider-specific fields outside the
Providerimplementation — the abstraction has to stay clean for v1.1. - Inline secrets into the script (e.g. for "local debugging convenience") — they end up in commit history.
- Send a PR that changes the prompt without a before/after comparison on a real PR.
- Print the API key (or any sensitive env var) to stdout —
redact_for_logis the gate for tool-arg logging, but neverprint(os.environ["AIPRR_API_KEY"]). - Bypass the existing 422 fallback path when adding a new submission code path — preserve graceful degradation.
- Increase
max_tokensorMAX_TURNSdefaults without estimating the cost-per-review impact and documenting it. Since v3 the per-run turn budget comes fromBUDGET_MATRIX(a row per risk tier, RFC-06) — change a row, notDEFAULT_MAX_TURNS, and re-run the Phase 4 per-tier campaign (docs/PERFORMANCE.md § "Risk-tiered budgets") so the recall guard is re-measured. - Add a new top-level
action.ymlinput "just to support a one-off use case" — every input is a long-lived public contract. - Hardcode anything that should be a constant — magic numbers, paths, severity ranks. The top of
scripts/reviewer.pyis the canonical place for runtime constants. - Edit content in
.claude/...orCLAUDE.md— both are symlinks. Edit the canonical paths under.agents/...andAGENTS.md. - Spell the action name "AI-Diff-Reviewer" / "AIDR" / "AI/Diff Reviewer" / "AI PR Reviewer" (the old name) in user-facing copy — the canonical user-facing capitalisation is "AI Diff Reviewer". The git repo slug is
ai-diff-reviewer(renamed 2026-07-14; the oldai-pr-reviewerURL still resolves via GitHub's permanent 301 redirect), and the Marketplace listing slug isai-diff-reviewer(derived fromaction.ymlname:) — they match exactly. Rule #9 has the naming rule; the full chronology is in the Marketplace rename decision log. - Hand-edit
.agents/skills/ai-diff-reviewer/**on a feature branch — that's the vendored snapshot of the released version, refreshed automatically byauto-release.ymlStep 3.5 after each release. Work on the source-of-truth copy atskills/ai-diff-reviewer/**instead. Rule #10 has the two-layer dogfooding model. - Build a backend URL outside
resolve_endpoint_profile()/EndpointProfile.base_url, readAIPRR_API_BASEdirectly in a provider, or forward a credential to a CLI under a name it does not need —docs/SECURITY.md § "Custom endpoints"is the contract (.review/extension.mdflags all three ascritical).
DO
- Keep the runtime stdlib-only.
- Use type hints on every function signature and meaningful local.
- Write
# noqa: BLE001on intentionally broad excepts and explain in a comment WHY (the patterns are: "best-effort GH API call", "surface to model rather than crash", "wrap loop so failures hit the spinner"). - Run
python3 -m py_compile scripts/reviewer.pybefore pushing. - Update
README.md+CHANGELOG.mdin the same PR as the behaviour change. - Use
write_action_output()for any new value you want consumers to read in downstream steps. - Use
safe_repo_path()for any new tool that takes a path argument — never resolve user-supplied paths manually. - Add a row to the inputs table in
README.mdfor any new input. - Verify the change via
.github/workflows/self-review.ymlrunning on the PR. - Edit the canonical
AGENTS.md/.agents/...paths. - Use "AI Diff Reviewer" for product copy (Marketplace-facing),
DailybotHQ/ai-diff-reviewerfor the canonical repo slug (the oldDailybotHQ/ai-pr-reviewerstill redirects for back-compat),ai-diff-reviewerfor the Marketplace slug (derived fromaction.yml), andAIPRR_for the env-var prefix (private, unchanged). - Follow the runner/backend checklist when adding one (
docs/PROVIDERS.md § "Adding a runner or backend"): endpoint profile → provider class →DEFAULT_MODELS+ tier row →action.ymlinstall step (CLI only, skip-if-present) →cli-install-smokeentry →self-review.ymlleg →examples/provider-<id>.yml+ index row → README runners table + inputs row →setup/reference.md+ wizard Q1 table →docs/SECURITY.mdcredential lanes → CHANGELOG.
Pre-Commit Checklist
- All code in English with type hints.
- No new non-stdlib imports in
scripts/reviewer.py. python3 -m py_compile scripts/reviewer.pypasses.python3 -m unittest discover -s testspasses (if the runtime changed).action.ymlparses (the CI job validates this; locally:python3 -c 'import yaml; yaml.safe_load(open("action.yml"))').- If
action.ymlinputs/outputs changed: README's tables updated ANDskills/ai-diff-reviewer/setup/reference.mdupdated. - If runtime behaviour changed:
CHANGELOG.mdentry under[Unreleased]. - If a new input was added: there's an example in
examples/showing realistic usage. - If the default prompt changed: a before/after on a real PR linked in the PR description.
- No new files at
.claude/...orCLAUDE.md— those are symlinks; edit the canonical paths. - Commit message follows Conventional Commits.
.github/workflows/self-review.ymlran successfully on the PR (or manual verification is described).
Commit Message Format (MANDATORY)
<type>(<scope>): <short description>
## Summary
<1–2 sentences — the why, not the what>
## Change Log
- <bullet 1>
- <bullet 2>
## Risks
- <risk 1, or "None — content-only change">See the Conventional Commit example in STANDARDS.md § Commits for a complete message.
Shared Agent Coordination
Every AI agent that works on this repo (Claude Code, Cursor, Codex, Gemini, Copilot, OpenClaw) is guided by this AGENTS.md — the single source of truth. Agent-specific entry points (CLAUDE.md, .cursorrules, etc.) MUST be thin pointers and MUST NOT duplicate content.
The canonical configuration directory is .agents/. .claude/ is a tracked symlink to .agents/ for back-compat with Claude Code. Always reference .agents/... in new docs and commit messages — never .claude/.... If you ever need to recreate the symlink (e.g. on a clone that mishandled it):
rm -f .claude && ln -s .agents .claude
rm -f CLAUDE.md && ln -s AGENTS.md CLAUDE.mdFor the full collaboration model — when to spawn sub-agents, how to coordinate between agents, when to use a deep-work plan — see docs/AI_AGENT_COLLAB.md.
Reading PR Review Comments
This repo dogfoods itself (self-review.yml). When applying review feedback: skip isMinimized == true comments, anchor on the newest <!-- ai-pr-reviewer-marker --> (since v3 the single aggregate review also carries <!-- ai-pr-reviewer-aggregate -->), and prefer the review-output/3.0 artifact over scraping the body. Full workflow + GraphQL query: docs/PR_REVIEW_WORKFLOW.md.
Small-Batch Delivery
For larger initiatives (multi-provider rollout, prompt overhaul, output schema redesign): pick only tasks whose dependencies are complete; ship 1–3 tightly related tasks per PR, each self-reviewable via self-review.yml; verify each batch before the next; keep each batch publishable as a vX.Y.Z release with clear changelog entries.
Temporary Files (tmp/)
tmp/ at the project root is git-ignored scratch space (notes, inter-agent prompts, data exports): nothing inside it is ever tracked or committed.
License
MIT — by contributing to this repo you agree your contribution is licensed under MIT.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

