AGENTS.md ยท diff
git:20260804.4ea3437 to git:20260806.cfc9c1b
3 added, 3 removed. Audit A to A.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
# Repository Guidelines
## Project Structure & Module Organization
This repository provides shared Claude Code and Codex guidance for epidemiology and biostatistics. `CLAUDE.md` holds cross-task rules; `README.md` covers installation and architecture. Each `skills/` directory is self-contained: keep `SKILL.md` concise, detailed guidance in `references/`, utilities in `scripts/`, and templates or media in `assets/`. Enforcement scripts live in `hooks/`. The allowlist `.gitignore` excludes runtime state, credentials, caches, histories, and local settings.
- Keep the two backup branches separate. Superseded formal repository deliverables that must remain recoverable belong in `09_backup/archive/YYYY-MM-DD_HHMM_<topic>_<stage>/`; `09_backup/INDEX.md` indexes only those archive batches. Repository-maintenance experiments, one-off scripts and diagnostic outputs belong in `09_backup/workbench/YYYY-MM-DD_HHMM_<topic>_<purpose>/`, with `PLAN.md` before execution and `FINDINGS.md` after execution. Run them there; do not place agent-created work in the system temp directory or the repository root. Point the current test process's `TEMP`, `TMP` and `TMPDIR` to that batch's `runtime/` directory, then remove only that runtime cache after the command finishes.
+ Keep the two backup branches separate. Superseded formal repository deliverables that must remain recoverable belong in `09_backup/archive/YYYY-MM-DD_HHMM_<topic>_<stage>/`; `09_backup/INDEX.md` indexes only those archive batches. Repository-maintenance experiments, one-off scripts and diagnostic outputs belong in `09_backup/workbench/YYYY-MM-DD_HHMM_<topic>_<purpose>/`, with `PLAN.md` before execution and `FINDINGS.md` after execution. The entire `09_backup/` tree is local-only and must remain ignored by Git; do not add `.gitkeep` files or public-document links that depend on its contents. Run workbench tasks there; do not place agent-created work in the system temp directory or the repository root. Point the current test process's `TEMP`, `TMP` and `TMPDIR` to that batch's `runtime/` directory, then remove only that runtime cache after the command finishes.
## Build, Test, and Development Commands
There is no unified build or test runner. Validate the component you changed:
```bash
python skills/skill-creator/scripts/quick_validate.py skills/<skill-name>
bash -n hooks/*.sh
python -m py_compile path/to/changed_script.py
Rscript -e 'parse(file="path/to/changed_script.R")'
python scripts/epiagentkit.py doctor --target all
```
The validator checks skill metadata and structure; the other commands check syntax and installed Claude/Codex parity. Changes to the installer or synchronizer must also pass `python scripts/audit_workflow_contracts.py`, which performs an isolated dual-platform install and idempotency check. Run affected scripts with representative inputs when behavior changes.
## Coding Style & Naming Conventions
Use UTF-8 Markdown, imperative instructions, and descriptive headings. Skill directories use lowercase kebab-case, such as `academic-publishing/`. Every `SKILL.md` starts with YAML fields `name` and `description`. Use four spaces in Python, two in R, and portable Bash with `#!/usr/bin/env bash`. Keep shell files LF-only. Prefer relative paths and reusable scripts over large embedded code blocks.
- On Windows PowerShell, set `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8` and read text with `Get-Content -Encoding utf8`. Treat mojibake as a failed read: discard it and reread with explicit UTF-8 before making any decision or edit.
+ On Windows, identify the active shell executable and version before relying on shell-specific behavior. Treat `powershell.exe` as Windows PowerShell 5.1 and use PowerShell 7 only when `pwsh` is actually available; do not install it or silently pass PowerShell 7-only scripts to 5.1. Set `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8` and read text with `Get-Content -Encoding utf8`. Treat mojibake as a failed read. Use `-LiteralPath` only for cmdlets that support it, request terminating errors for critical cmdlets, and check native-command exit codes immediately. Put multiline logic, JSON, regular expressions, non-ASCII paths, or complex native arguments in a repository script under the appropriate workbench or persistent script directory. Avoid nested `powershell|pwsh -Command`, `Invoke-Expression`, string-built commands, and unverified `cmd.exe /c` or `Start-Process -ArgumentList` calls.
## Skill Maintenance
Every request to add, revise, repair, rename or remove a skill automatically uses `epiagentkit-maintenance` together with `skill-creator`; the user does not need to restate this requirement. Treat skill improvement as regression-safe optimization, not append-only documentation. Treat a reported word, file, or project failure as a representative case: define the shared cause and scan all affected workflows before editing, while preserving legitimate legal, technical, and domain-specific uses. Do not stop at a literal replacement or the named file. Before editing, identify the observed failure or new use case, behaviors that must remain unchanged, the smallest coherent change, and representative old and new evaluations. Classify existing material as keep, rewrite, merge, move, script, or delete before adding rules or files. Keep each concept in one source: global constraints in `CLAUDE.md`, core task selection and workflow in `SKILL.md`, conditional detail and examples in `references/`, and repeated deterministic operations in `scripts/`. Prefer the smaller change when two designs pass the same evaluations; remove stale, redundant, conflicting, speculative, or overly project-specific content. Do not trade away existing behavior under the label of simplification unless the user explicitly changes the governing rule.
## Testing Guidelines
There is no central coverage target or test tree. Use validators, syntax checks, and focused execution. Reproduce bugs before fixing them, record verification commands in the pull request, and never use private research data as fixtures.
## Commit & Pull Request Guidelines
- Use Conventional Commits: `feat(scope): summary`, `fix(scope): summary`, `docs(scope): summary`, or `refactor(scope): summary`. Make each commit one coherent, reversible unit; use a specific scope and action-object summary, and add a body covering motivation, key behavior, validation, and compatibility for non-trivial changes. After a completed request passes validation, commit the coherent change automatically unless the user says not to commit, but only when Git is available and the current directory is a repository. Skill additions, edits, repairs, renames and removals are the exception: follow the pre-commit review gate in `epiagentkit-maintenance` and wait for the user's explicit approval of the current review artifacts. After every successful commit in this repository, run `python scripts/epiagentkit.py sync --target all` followed by `python scripts/epiagentkit.py doctor --target all` so the local Claude Code and Codex installations match the committed source. If a post-commit check requires another commit, repeat synchronization and doctor after that commit. If Git is unavailable or the directory is not a repository, skip all Git operations; do not initialize a repository or install Git. Push only when the user explicitly requests it in the current turn; do not ask, remind, or batch-push on the user's behalf. Never force-push or rewrite remote history. Review the entire worktree before committing and do not sweep unexplained pre-existing changes into the commit. Pull requests must explain the problem, affected skills or hooks, verification commands, and compatibility effects. Link issues; include screenshots only for visual or document output.
+ Use Conventional Commits: `feat(scope): summary`, `fix(scope): summary`, `docs(scope): summary`, or `refactor(scope): summary`. Make each commit one coherent, reversible unit; use a specific scope and action-object summary, and add a body covering motivation, key behavior, validation, and compatibility for non-trivial changes. After a completed request passes validation, commit the coherent change automatically unless the user says not to commit, but only when Git is available and the current directory is a repository. New skill additions follow the pre-commit review gate in `epiagentkit-maintenance`; edits, repairs, renames and removals of existing skills use that gate only when the user explicitly requests review artifacts. After every successful commit in this repository, run `python scripts/epiagentkit.py sync --target all` followed by `python scripts/epiagentkit.py doctor --target all` so the local Claude Code and Codex installations match the committed source. If a post-commit check requires another commit, repeat synchronization and doctor after that commit. If Git is unavailable or the directory is not a repository, skip all Git operations; do not initialize a repository or install Git. Push only when the user explicitly requests it in the current turn; do not ask, remind, or batch-push on the user's behalf. Never force-push or rewrite remote history. Review the entire worktree before committing and do not sweep unexplained pre-existing changes into the commit. Pull requests must explain the problem, affected skills or hooks, verification commands, and compatibility effects. Link issues; include screenshots only for visual or document output.
## Agent-Specific Instructions
Use `epiagentkit-maintenance` for changes to this repository's rules, skills, hooks, scripts, synchronization contracts, or maintenance documentation. Read `CLAUDE.md` before changing domain workflows. Preserve raw data and never guess analytical definitions. Claude Code and Codex share one rule, skill, and hook set; synchronize both runtime homes after changes and verify file parity. Update references and helpers together when a workflow contract changes.