Agent rules index
This page is the canonical loader for repository governance instructions. AGENTS.md stays small and mandatory, but the detailed rules live here and in the linked rule files so new sessions do not have to absorb the full policy corpus up front.
Bootstrap sequence
- Read
AGENTS.md. - Load this index.
- Load
05-non-negotiable-checklist.md. - Load
10-session-bootstrap.md. - Detect repository, branch, and worktree state.
- Reject implementation from the
devormaincheckout unless the user explicitly overrides that rule. - If GitHub hierarchy metadata is needed and
.specfact/backlog/github_hierarchy_cache.mdis missing or stale, refresh it withpython scripts/sync_github_hierarchy_cache.py. - Load additional rule files from the applicability matrix below before implementation.
Precedence
- Direct system and developer instructions
- Explicit user override where repository governance allows it
AGENTS.mddocs/agent-rules/05-non-negotiable-checklist.md- Other
docs/agent-rules/*.mdfiles selected through this index - Change-local OpenSpec artifacts and workflow notes
Always-load rules
| Order | File | Purpose |
|---|---|---|
| 0 | INDEX.md |
Deterministic rule dispatch and precedence |
| 5 | 05-non-negotiable-checklist.md |
Invariant SHALL gates |
| 10 | 10-session-bootstrap.md |
Startup checks and stop conditions |
Applicability matrix
Task signal definitions
Use these canonical applies_when tokens in rule file frontmatter under docs/agent-rules/*.md.
| Canonical signal | Typical user intent |
|---|---|
session-bootstrap |
First-load and startup sequencing |
implementation |
Code or behavior change in a worktree |
openspec-change-selection |
Choosing, validating, or editing an OpenSpec change |
branch-management |
Branch and worktree operations |
github-public-work |
Public-repo GitHub issue linkage and hierarchy |
change-readiness |
Pre-flight metadata completeness before implementation |
finalization |
Closing out a change, evidence, or PR |
release |
Versioning, tagging, publish prep |
documentation-update |
User-facing docs and README edits |
repository-orientation |
Onboarding and repo layout questions |
command-lookup |
Hatch commands and workflow lookup |
detailed-reference |
Long-form catalog and preserved guidance |
verification |
Quality gates, tests, and review artifacts |
Validation: hatch run validate-agent-rule-signals runs scripts/validate_agent_rule_applies_when.py and checks every rule file’s applies_when list against this set.
| Matrix row (human summary) | Canonical signals (applies_when) |
Required rule files | Optional rule files |
|---|---|---|---|
| Any implementation request | implementation, openspec-change-selection, verification |
10-session-bootstrap.md, 40-openspec-and-tdd.md, 50-quality-gates-and-review.md |
20-repository-context.md |
| Code or docs changes on a branch | branch-management, implementation |
30-worktrees-and-branching.md |
80-current-guidance-catalog.md |
| Public GitHub issue work | github-public-work, change-readiness |
60-github-change-governance.md |
30-worktrees-and-branching.md |
| Release or finalization work | finalization, release, documentation-update, verification |
70-release-commit-and-docs.md, 50-quality-gates-and-review.md |
80-current-guidance-catalog.md |
| Repo orientation or command lookup | repository-orientation, command-lookup |
20-repository-context.md |
80-current-guidance-catalog.md |
Canonical rule files
05-non-negotiable-checklist.md: always-load SHALL gates10-session-bootstrap.md: startup checks, compact context loading, and stop behavior20-repository-context.md: project overview, commands, architecture, and layout30-worktrees-and-branching.md: branch protection, worktree policy, and conflict avoidance40-openspec-and-tdd.md: OpenSpec selection, change validity, strict TDD order, and archive rules50-quality-gates-and-review.md: required gates, code review JSON, clean-code enforcement, module signatures60-github-change-governance.md: cache-first GitHub metadata, dependency completeness, andin progressambiguity handling70-release-commit-and-docs.md: versioning, registry/signature consistency, docs, and release prep80-current-guidance-catalog.md: preserved migrated guidance not yet split into narrower documents
Preservation note
The prior long AGENTS.md content has been preserved by reference in these rule files. The goal of this migration is to reduce startup token cost without silently dropping repository instructions.