Skip to content

docs: add agent-facing documentation system#61

Merged
dgenio merged 2 commits intomainfrom
docs/agent-instruction-system
Mar 9, 2026
Merged

docs: add agent-facing documentation system#61
dgenio merged 2 commits intomainfrom
docs/agent-instruction-system

Conversation

@dgenio
Copy link
Owner

@dgenio dgenio commented Mar 9, 2026

Summary

Adds a comprehensive, layered documentation system for AI coding agents (Copilot, Claude, and others) operating in this repository.

What changed

Rewritten:

  • AGENTS.md — expanded from 41 lines to ~145 lines with full domain vocabulary, security rules, code conventions, weaver-spec references, and a documentation map pointing to all canonical sources.

Created (canonical shared layer — docs/agent-context/):

  • architecture.md — architectural intent, major boundaries, key tradeoffs, things not to simplify.
  • workflows.md — authoritative commands table, PR conventions, definition of done, documentation governance.
  • invariants.md — weaver-spec compliance (I-01, I-02, I-06), forbidden shortcuts ("never do" list), security-critical ordering traps, safe vs. unsafe changes.
  • lessons-learned.md — failure-capture workflow, recurring mistake patterns (docstring mismatch, whitespace bypass, dead code).
  • review-checklist.md — pre-submit self-check (CI gate, correctness, security, backward compat, code hygiene, documentation), cross-file consistency table.

Created (tool-specific layers):

  • .github/copilot-instructions.md — projects review-critical rules visible during GitHub PR review (review checklist, invariants, convention discipline).
  • .claude/CLAUDE.md — Claude-specific operating instructions (explore before acting, implement safely, validate, handle contradictions, capture lessons).

Updated:

  • CHANGELOG.md — added entries for the new documentation system.

Why

The previous AGENTS.md was a minimal 41-line file that lacked security rules, code conventions, weaver-spec references, and a documentation map. AI agents had no guidance on invariants, review checks, or architectural boundaries. This change establishes a structured, layered system where:

  • Shared rules live in one canonical place (AGENTS.md + docs/agent-context/)
  • Tool-specific files reference the shared layer and add only tool-specific guidance
  • Every durable rule has exactly one canonical home (no duplicate authority)

Testing

  • ruff format — 36 files unchanged
  • ruff check — 2 pre-existing UP038 warnings in summarize.py (not from this PR)
  • mypy — 0 issues
  • pytest — 216 passed, 96% coverage
  • All 3 example scripts pass

Docs & AI agent instructions

This PR is the documentation and AI agent instruction update. All 8 files are documentation files.

Rewrite AGENTS.md with full domain vocabulary, security rules, code conventions, weaver-spec references, and documentation map.

Add docs/agent-context/ canonical shared layer:
- architecture.md: intent, boundaries, tradeoffs
- workflows.md: authoritative commands, PR conventions, doc governance
- invariants.md: weaver-spec compliance, forbidden shortcuts, ordering traps
- lessons-learned.md: failure-capture workflow, recurring mistakes
- review-checklist.md: pre-submit self-check, cross-file consistency

Add tool-specific instruction files:
- .github/copilot-instructions.md: review-critical projections for Copilot
- .claude/CLAUDE.md: Claude-specific operating instructions

Update CHANGELOG.md with new documentation entries.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a layered, canonical documentation system for AI coding agents in this repository, centralizing shared rules in AGENTS.md and docs/agent-context/, with tool-specific “projection” files for Copilot and Claude.

Changes:

  • Rewrites AGENTS.md into the canonical shared instruction layer (vocabulary, security rules, conventions, documentation map).
  • Adds docs/agent-context/ canonical docs (architecture, workflows, invariants, lessons learned, review checklist).
  • Adds tool-specific instruction layers (.github/copilot-instructions.md, .claude/CLAUDE.md) and updates CHANGELOG.md.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/agent-context/workflows.md Defines authoritative commands, PR conventions, definition of done, and doc governance.
docs/agent-context/review-checklist.md Adds a structured pre-submit/review checklist and cross-file consistency table.
docs/agent-context/lessons-learned.md Captures a process for recording reusable mistakes/patterns.
docs/agent-context/invariants.md Documents security invariants, forbidden shortcuts, and ordering traps.
docs/agent-context/architecture.md Summarizes architectural intent, boundaries, and non-negotiable tradeoffs.
AGENTS.md Establishes canonical agent instructions and a documentation map to all sources.
.github/copilot-instructions.md Copilot-facing “review-critical” projection of canonical rules for PR review.
.claude/CLAUDE.md Claude-specific operating guidance aligned to canonical shared docs.
CHANGELOG.md Records the addition of the agent-facing documentation system.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@dgenio dgenio merged commit 658b33e into main Mar 9, 2026
3 checks passed
@dgenio dgenio deleted the docs/agent-instruction-system branch March 9, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants