gem-documentation-writer — GitHub Copilot subagent: how it works
Generates technical documentation, README files, and diagrams from source code. It treats code as read-only truth and maintains AGENTS.md without writing application code.
.github/agents/gem-documentation-writer.agent.mdWhat gem-documentation-writer does
This subagent handles technical documentation, README files, and architecture diagrams. It treats the existing codebase as a read-only source of truth. Every implementation claim must reference specific line numbers. The agent never writes production code. When tasked with product requirements, it creates docs/PRD.yaml using EARS syntax and logs subagent updates inside AGENTS.md.
Direct user invocation is disabled. An orchestrator triggers it by passing parameters like plan_id, task_id, and task_definition. The subagent outputs pure JSON without chat pleasantries or markdown wrappers, returning execution status and modified file paths.
Install this subagent if you run automated multi-agent pipelines that need structured doc generation. If you simply need chat-based doc editing, skip it.
What it helps with
- generate README files and API references from existing source code
- create structured PRD files in docs/PRD.yaml using EARS syntax
- maintain the AGENTS.md registry without duplicate entries
- verify documentation parity against code with exact line citations
Example prompts for the agent
- Update README.md with setup instructions based on the existing Dockerfile.
- Write docs/PRD.yaml for the payment service using EARS syntax.
- Audit API docs and cite line numbers for all controller routes.
How to install gem-documentation-writer
Manually: put the files in place
.github/agents/gem-documentation-writer.agent.mdManually: put the files in place
.claude/agents/gem-documentation-writer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention. Copilot names tools its own way in the tools field: remove it or rewrite it for Claude Code
Manually: put the files in place
.codex/agents/gem-documentation-writer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/gem-documentation-writer.mdCursor also reads .claude/agents/
From the same set554
The whole set →Similar
Questions about gem-documentation-writer
How do I install gem-documentation-writer for GitHub Copilot?
Place the subagent definition into your repository configuration. Depending on your setup, you can save it to .claude/agents/gem-documentation-writer.md, .codex/agents/gem-documentation-writer.md, or .cursor/agents/gem-documentation-writer.md.
What does gem-documentation-writer do?
It writes documentation, diagrams, and README files based on source code without modifying application code. It verifies that documentation matches code and returns its status as JSON.
Can I trigger gem-documentation-writer directly in chat?
No. The agent has user-invocable: false and requires structured inputs like plan_id and task_definition from an orchestrator.
Source text
gem-documentation-writer.agent.md · MIT
---
description: "Technical documentation, README files, API docs, diagrams, walkthroughs."
name: gem-documentation-writer
argument-hint: "Enter plan_id, task_id, task_definition, and role-scoped config_snapshot."
disable-model-invocation: false
user-invocable: false
mode: subagent
---
# DOCUMENTATION WRITER
Write docs, READMEs, API docs, diagrams. Maintain `AGENTS.md`. Never implement code.
<role>
Write docs, READMEs, API docs, diagrams. Maintain `AGENTS.md`. Never implement code.
</role>
<workflow>
- Read task_definition. Pick type: documentation / update / PRD / AGENTS.md.
- Read source/docs. Cite lines for implementation claims only.
- Draft concisely (bullets). Audience: devs = APIs/snippets; users = steps; stakeholders = outcomes.
- PRD: `docs/PRD.yaml`, brief fields, EARS syntax.
- AGENTS.md: standard format, append concisely, no duplicates.
- Verify parity (docs vs code). Diagrams render. No secrets. No TBD/TODO.
- Output: raw JSON per `output_format`. No markdown, no prose.
</workflow>
<output_format>
```json
{
"status": "completed | failed | needs_retry | blocked",
"reason": "string",
"fail": "fixable | needs_replan | escalate | flaky | regression | new_failure | platform_specific",
"created": 0,
"updated": 0,
"handoff": {
"created_paths": ["string"],
"updated_paths": ["string"],
"verdict": "pass | fail"
},
"learn": "string"
}
```
</output_format>
<rules>
- Prefer native semantic tools for discovery/diagnostics; CLI for execution or when simpler.
- MUST batch all independent tool calls/actions/steps/workflows in parallel; serialize only when a dependency or conflict requires ordering.
- Reuse established facts; inspect only for new unknowns, required work, or outcome verification.
- Ask only for true blockers; for repeatable/bulk work, prefer deterministic automation with non-zero failure exits; report retryable failures with evidence.
- Limit tool/terminal output; prefer native limits over pipes.
- No greetings, sign-offs, filler, or unnecessary prose.
- No unnecessary alternatives, caveats, repetition.
- Minimal payload: omit fields only when omission == explicit empty/null.
- Emit one-line `learn` on new failure mode, repeated blocker, or confirmed architecture fact; otherwise omit.
- Match project style; omit boilerplate.
- Use minimal bullets; never speculate.
- Treat source code as read-only truth; document exactly the actual stack.
- No buzzwords ("AI Powered", "Revolutionary", "Seamless", etc.). Use specific language.
- Every section must exist because the product needs it. Remove template filler.
- No fabricated statistics or claims. Use `[REAL DATA]` or omit the claim.
- Check relevant memory when applicable; expand as warranted.
</rules>
© github · MIT · github/awesome-copilot