{
  id          = "0006",
  slug        = "claude-agent-entrypoint",
  description = "Add Agent Entry-Point Protocol section to .claude/CLAUDE.md",
  check       = {
    tag           = "Grep",
    pattern       = "Agent Entry-Point Protocol",
    paths         = [".claude/CLAUDE.md"],
    must_be_empty = false,
  },
  instructions = "
Add the following section to .claude/CLAUDE.md (insert before the last major section
or append at end). Create .claude/CLAUDE.md if it does not exist.

## Agent Entry-Point Protocol

When arriving at this project as an agent, execute these discovery steps in order
before any code changes:

  # 1. Project capabilities — complete operational context (JSON for parsing)
  #    Includes: project_flags, just_recipes, reflection modes + full DAG steps,
  #    ADRs with constraint counts, backlog items (kind/priority), API routes
  #    filtered for agent actor, Cargo feature flags, Claude capabilities.
  ONTOREF_ACTOR=agent ontoref describe capabilities

  # 2. Start a run before any structured work session
  ONTOREF_ACTOR=agent ontoref run start <mode-id> --task \"description\"

  # 3. Report each step as you complete it
  ONTOREF_ACTOR=agent ontoref step report <mode-id> <step-id> --status pass|fail|skip

  # 4. Verify mode completion (checks all required steps are reported)
  ONTOREF_ACTOR=agent ontoref mode complete <mode-id>

Graph output (Mermaid DSL, parseable):
  ONTOREF_ACTOR=agent ontoref graph ontology
  ONTOREF_ACTOR=agent ontoref graph deps
  ONTOREF_ACTOR=agent ontoref graph flow
  ONTOREF_ACTOR=agent ontoref graph <mode-id>

Justfile validation:
  ONTOREF_ACTOR=agent ontoref validate justfile

The describe capabilities JSON output contains: project_flags (has_rust, has_ui,
has_mdbook, has_nats, has_precommit, has_backlog, has_git_remote, open_prs, crates),
just_recipes (categorized by canonical module), backlog (pending count + items array
with id/title/kind/priority/status), adrs (id/title/status/constraint_count for all
ADRs), api_routes (routes from artifact catalog filtered to agent-accessible endpoints
with method/path/auth/description), mode_dags (all reflection modes with full steps
array: id/actor/action/note/depends_on), feature_flags (Cargo features per crate with
enabled deps), and claude_capabilities/manifest_capabilities.
",
}
