Doc coauthoring

From oimiragieo/agent-studio · View interactive version

Doc coauthoring is an AI agent skill from the GitHub repository oimiragieo/agent-studio. Collaborative document creation via a structured three-stage workflow. Use for writing specs, PRDs, design docs, proposals, RFCs, and any long-form document where quality and clarity matter. Brainstorms 5-20 options per section, builds iteratively, and tests with reader sub-agents.

How to use this skill

Skill file

Doc Co-Authoring Workflow

"Thoroughness here prevents confusion when actual stakeholders read the document."

Overview

This skill guides collaborative document creation through three structured stages: context gathering, iterative section refinement, and reader testing. The goal is to transfer the author's full intent into a document that works for readers who lack that context.

When to Invoke

Triggers for this skill:

Do not use for: short single-purpose outputs (emails, commit messages, code comments). Those are better handled inline.

Three-Stage Workflow

Stage 1: Context Gathering

Close knowledge gaps before writing anything.

Ask clarifying questions:

Accept info-dumps:

If the user provides a brain dump, meeting notes, or links to existing docs — absorb everything. Extract the key requirements, constraints, and decisions already made.

Meta-context check:

Stage 1 output: A clear scope statement: "We are writing a [type] for [audience] that enables [decision/action]. The document is [scope]."

Stage 2: Section-by-Section Refinement

Build the document iteratively, one section at a time.

Scaffold first:

Create a full document outline with placeholder sections immediately. This gives the author a map of where we're going and lets them see the overall structure before committing to any section.

# [Document Title]

## Overview
[placeholder — will cover: purpose, scope, key decisions]

## Background
[placeholder — will cover: context, motivation, prior art]

## Proposal
[placeholder — will cover: what we're building, why this approach]

## Alternatives Considered
[placeholder — will cover: what we ruled out and why]

## Implementation Plan
[placeholder — will cover: phases, timeline, dependencies]

## Open Questions
[placeholder — will cover: unresolved decisions needing input]

Per-section workflow:

  1. Brainstorm: Generate 5-20 options for how to structure/frame this section
  1. Draft: Write the selected approach fully
  1. Refine: Make targeted edits based on feedback
  1. Confirm: Get explicit "this section is done" before moving to the next

Option generation example (for an "Alternatives Considered" section):

Here are 5 options for structuring "Alternatives Considered":

1. **Elimination table** — Each alternative as a row, columns for pros/cons/why-rejected. Fast to skim.
2. **Narrative paragraphs** — One paragraph per alternative with story arc of why we considered and rejected it. Good for complex tradeoffs.
3. **Decision log format** — Date + decision + rationale per item. Good when alternatives were explored over time.
4. **Comparative matrix** — All options including chosen approach on axes like complexity/risk/value. Visual.
5. **One-liner summary** — Brief acknowledgment that we considered X, Y, Z, with a single sentence each. Good when alternatives are obvious.

Which resonates, or should I blend elements?

Stage 3: Reader Testing

Test whether the document works for readers who lack the author's context.

Why this matters: Authors know too much. Blind spots are invisible to them. A reader sub-agent with no conversation context surfaces exactly what real readers will struggle with.

Spawn a reader sub-agent with ONLY the document content (no prior conversation context):

You are reading this document for the first time with no prior context.

Read this document: [full document text]

Answer these questions:
1. What is this document trying to accomplish? (Should match author intent)
2. What questions does it leave unanswered that a reader would need answered to act?
3. Are there any sections where the reasoning is unclear or jumps without explanation?
4. What would a skeptical reader's strongest objection be?
5. Is there anything that only makes sense if you already know [the thing the author knows]?

Integrate reader feedback:

Completion criteria:

Editing Mechanics

Use `str_replace` for precision

When making edits, specify the exact text to replace:

REPLACE:
"The system will be fast."

WITH:
"The system targets p99 latency < 100ms under 1000 concurrent users."

Never reprint the entire document to show one changed sentence. This respects the author's time and makes it easy to see exactly what changed.

Preserve authorial voice

If the author writes in a particular style (casual/formal, first-person/third-person, active/passive), match it in all additions. Note their stylistic choices explicitly:

Document Type Templates

PRD (Product Requirements Document)

Sections: Executive Summary, Problem Statement, Goals & Non-Goals, User Stories, Requirements, Success Metrics, Timeline, Open Questions

Technical Design Doc

Sections: Summary, Background, Design, Implementation Details, Testing Plan, Rollout Plan, Alternatives Considered, Open Questions

RFC (Request for Comments)

Sections: Abstract, Motivation, Detailed Design, Drawbacks, Alternatives, Unresolved Questions

Project Proposal

Sections: Executive Summary, Problem, Proposed Solution, Business Case, Risks, Timeline, Resources Required, Next Steps

Memory Protocol

Before starting a co-authoring session:

cat .claude/context/memory/learnings.md | grep -i "doc\|writing\|spec\|prd"

After completing a document, record patterns that worked:

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.