AGENTS.md TemplatesAGENTS.md Template

AGENTS.md Template for Document Collaboration Architecture

AGENTS.md Template for document collaboration architecture guiding AI coding agents in multi-agent orchestration for drafting, editing, and publishing documents with governance.

AGENTS.md Templatedocument collaborationAI coding agentsmulti-agent orchestrationagent handoff rulestool governancehuman reviewdocument workflow

Target User

Developers, founders, product teams, engineering leaders

Use Cases

  • Document drafting with AI agents
  • Editorial workflow orchestration
  • Content review and publication with governance

Markdown Template

AGENTS.md Template for Document Collaboration Architecture

# AGENTS.md

Project Role
- Define the document collaboration architecture and operating context for AI agents.
- Maintain audit trails and ensure traceability from drafting to publication.

Agent roster and responsibilities
- Planner/Orchestrator: coordinates work, assigns tasks, tracks handoffs, and enforces tags, memory, and sources of truth.
- Implementer: drafts document sections, formats content, and ensures alignment with templates and style guides.
- Researcher: fetches background information, sources data, and validates claims.
- Domain Specialist: provides subject-matter accuracy, terminology, and domain-specific constraints.
- Reviewer: checks quality, consistency, and alignment with governance rules.
- Tester: validates outputs against requirements and tests end-to-end workflows.
- Security Officer: enforces access controls, secrets handling, and production safety.

Supervisor or orchestrator behavior
- The Planner issues tasks with explicit inputs, outputs, and decision thresholds.
- Orchestrator continuously monitors progress, triggers handoffs, and surfaces escalation when risk exceeds tolerance.
- All agents log actions to the central source of truth and reference artifacts by task ID.

Handoff rules between agents
- Handoffs occur only on explicit task completion events and must include artifacts: draft, sources, references, and validation results.
- Each handoff records the previous agent, next agent, timestamp, and task ID in history logs.
- If an agent cannot complete a task, it must request a handoff to the Planner with escalation details.

Context, memory, and source-of-truth rules
- Central document repo is the source of truth. All edits are versioned and traceable.
- Memory scope is restricted to the active drafting session and relevant prompts; no long-term memory leakage.
- Context passed between agents includes task IDs, user intent, and relevant excerpts from sources.

Tool access and permission rules
- Agents may read/write to the document repository and ancillary systems only within their role scope.
- Secrets must never be stored in prompts; use a secrets vault with short-lived tokens.
- External tools require approval gates and logging of all calls.

Architecture rules
- Services must be modular, with clear interfaces and versioned prompts.
- All artifacts are versioned and linked to their source and task IDs.
- Use idempotent operations and deterministic prompts where possible.

File structure rules
- Maintain a single root docs/ tree with subfolders: drafts/, reviews/, templates/, prompts/,. memory/
- Each document version has a unique ID and a changelog entry.

Data, API, or integration rules when relevant
- Integrations with document storage, translation, or CMS must expose read/write via governed endpoints.
- All data transfers are logged and auditable.

Validation rules
- Each draft must pass content quality, source validation, and stylistic checks before handoff.
- All claims must be backed by verifiable sources.

Security rules
- Least-privilege access; authentication required for each tool.
- Secrets must never be emitted in prompts or logs.
- Production changes require formal approval and rollback capability.

Testing rules
- Unit tests for formatting and prompts; integration tests for end-to-end drafting to publishing.
- Regression tests for template updates.

Deployment rules
- Deploy prompts and templates to production after passing tests and approvals.
- Maintain rollback artifacts for each deployment.

Human review and escalation rules
- If confidence scores fall below threshold, escalate to a human reviewer with a clear action path.
- Escalation should surface the relevant document version, sources, and context.

Failure handling and rollback rules
- On failure, revert to the last known-good draft; log the rollback and notify stakeholders.
- Maintain a changelog entry for rollback events.

Things Agents must not do
- Do not modify production documents without explicit approval.
- Do not bypass the Planner or misrepresent sources.
- Do not persist sensitive prompts in memory beyond the current task.

Overview

Direct answer: This AGENTS.md template defines the operating manual for coordinating AI coding agents in a document collaboration architecture, enabling both single-agent operation and multi-agent orchestration.

This page provides a practical, copyable template that codifies roles, handoffs, tool governance, memory, and security for a document workflow from drafting to publication. It supports AI coding agents working solo or as a coordinated team to produce high-quality, auditable documents.

When to Use This AGENTS.md Template

  • When you have multiple editors, reviewers, researchers, and domain experts needing coordinated contributions.
  • When you require a single source of truth and traceability for all changes and decisions.
  • When governance, security, and escalation with human review are necessary for publication-ready content.

Copyable AGENTS.md Template

# AGENTS.md

Project Role
- Define the document collaboration architecture and operating context for AI agents.
- Maintain audit trails and ensure traceability from drafting to publication.

Agent roster and responsibilities
- Planner/Orchestrator: coordinates work, assigns tasks, tracks handoffs, and enforces tags, memory, and sources of truth.
- Implementer: drafts document sections, formats content, and ensures alignment with templates and style guides.
- Researcher: fetches background information, sources data, and validates claims.
- Domain Specialist: provides subject-matter accuracy, terminology, and domain-specific constraints.
- Reviewer: checks quality, consistency, and alignment with governance rules.
- Tester: validates outputs against requirements and tests end-to-end workflows.
- Security Officer: enforces access controls, secrets handling, and production safety.

Supervisor or orchestrator behavior
- The Planner issues tasks with explicit inputs, outputs, and decision thresholds.
- Orchestrator continuously monitors progress, triggers handoffs, and surfaces escalation when risk exceeds tolerance.
- All agents log actions to the central source of truth and reference artifacts by task ID.

Handoff rules between agents
- Handoffs occur only on explicit task completion events and must include artifacts: draft, sources, references, and validation results.
- Each handoff records the previous agent, next agent, timestamp, and task ID in history logs.
- If an agent cannot complete a task, it must request a handoff to the Planner with escalation details.

Context, memory, and source-of-truth rules
- Central document repo is the source of truth. All edits are versioned and traceable.
- Memory scope is restricted to the active drafting session and relevant prompts; no long-term memory leakage.
- Context passed between agents includes task IDs, user intent, and relevant excerpts from sources.

Tool access and permission rules
- Agents may read/write to the document repository and ancillary systems only within their role scope.
- Secrets must never be stored in prompts; use a secrets vault with short-lived tokens.
- External tools require approval gates and logging of all calls.

Architecture rules
- Services must be modular, with clear interfaces and versioned prompts.
- All artifacts are versioned and linked to their source and task IDs.
- Use idempotent operations and deterministic prompts where possible.

File structure rules
- Maintain a single root docs/ tree with subfolders: drafts/, reviews/, templates/, prompts/,. memory/
- Each document version has a unique ID and a changelog entry.

Data, API, or integration rules when relevant
- Integrations with document storage, translation, or CMS must expose read/write via governed endpoints.
- All data transfers are logged and auditable.

Validation rules
- Each draft must pass content quality, source validation, and stylistic checks before handoff.
- All claims must be backed by verifiable sources.

Security rules
- Least-privilege access; authentication required for each tool.
- Secrets must never be emitted in prompts or logs.
- Production changes require formal approval and rollback capability.

Testing rules
- Unit tests for formatting and prompts; integration tests for end-to-end drafting to publishing.
- Regression tests for template updates.

Deployment rules
- Deploy prompts and templates to production after passing tests and approvals.
- Maintain rollback artifacts for each deployment.

Human review and escalation rules
- If confidence scores fall below threshold, escalate to a human reviewer with a clear action path.
- Escalation should surface the relevant document version, sources, and context.

Failure handling and rollback rules
- On failure, revert to the last known-good draft; log the rollback and notify stakeholders.
- Maintain a changelog entry for rollback events.

Things Agents must not do
- Do not modify production documents without explicit approval.
- Do not bypass the Planner or misrepresent sources.
- Do not persist sensitive prompts in memory beyond the current task.

Recommended Agent Operating Model

The model defines these roles and decision boundaries for document collaboration:

  • Planner/Orchestrator: high-level strategy, task sequencing, and handoff triggers; accepts escalation when risk is high.
  • Implementer: creates draft content with formatting aligned to the project template; ensures citations and style compliance.
  • Researcher: validates facts, retrieves sources, and flags uncertain statements.
  • Domain Specialist: ensures terminology and domain constraints are accurate; flags domain risks.
  • Reviewer: ensures quality, coherence, and policy alignment; approves or sends back for revision.
  • Tester: runs end-to-end checks for completeness and integration with tools.
  • Security Officer: enforces security controls, secrets management, and production safety checks.

Recommended Project Structure

docs/
├── drafts/
├── reviews/
├── templates/
├── prompts/
├── memories/
├── orchestrator/
├── agents/
└── integrations/

Core Operating Principles

  • Single source of truth for documents and decisions.
  • Clear memory boundaries and auditable prompts.
  • Idempotent, deterministic actions where possible.
  • Explicit escalation paths and human-in-the-loop when needed.
  • Least-privilege tool access and secure secrets handling.

Agent Handoff and Collaboration Rules

  • Planner assigns tasks with explicit inputs/outputs and required artifacts.
  • Implementer passes draft plus sources to Reviewer; any changes require traceable diffs.
  • Researcher provides sources to Domain Specialist; all evidence is stored in memory.
  • Domain Specialist validates domain accuracy before reviewer sign-off.
  • Tester runs end-to-end checks and reports results to Planner.

Tool Governance and Permission Rules

  • Commands are executed with role-based permissions; no hard-coded secrets in prompts.
  • Edits to production content require approval from the Planner and Reviewer.
  • API calls to external services require logging and traceability.
  • All actions are auditable with task IDs and timestamps.

Code Construction Rules

  • Prompts and templates must be versioned and referenced by task IDs.
  • Code blocks in AGENTS.md must not contain sensitive information.
  • Outputs must be testable, with explicit acceptance criteria.

Security and Production Rules

  • Secrets are stored in a vault and never in prompts or logs.
  • Changes to production content pass an approval gate and are reversible.
  • All tool access is monitored and rate-limited.

Testing Checklist

  • Unit tests for prompts and formatting rules.
  • Integration tests for end-to-end drafting, review, and publishing.
  • Deployment tests and rollback verification.

Common Mistakes to Avoid

  • Skipping memory scoping and context propagation between agents.
  • Allowing unsupervised edits to production content.
  • Overly broad tool permissions or secret leakage.

Related implementation resources: AI Use Case for Content Marketers Using Wordpress To Auto-Translate Blog Posts Into Multiple Languages and AI Use Case for Technical Writers Using Github To Maintain and Auto-Check Documentation Links for Broken Urls.

FAQ

What is the purpose of this AGENTS.md Template for Document Collaboration Architecture?

It codifies roles, handoffs, governance, memory, and escalation for AI agents coordinating a document workflow from drafting to publishing.

How many agents are defined and what are their responsibilities?

The roster includes Planner/Orchestrator, Implementer, Researcher, Domain Specialist, Reviewer, Tester, and Security Officer, each with defined responsibilities and decision boundaries.

What are the rules for context, memory, and source-of-truth?

Central repository is the source of truth; memory scope is limited to the active session; context includes task IDs, intent, and sources.

How is handoff and escalation handled between agents?

Handoffs are triggered by task completion, include artifacts, are logged by task ID, and escalate to human review when risk exceeds threshold.

What security and production rules govern tool usage?

Access is least-privilege, secrets are vault-managed, and production changes require approval and audit trails.