SIN counterpart to Anthropic's
doc-coauthoringskill. Collaborative document creation (READMEs, ADRs, specs, design docs, RFCs, API docs, changelogs) via MCP and CLI.
This skill provides a structured workflow for coauthoring documents with the user — gathering context, proposing outlines, drafting sections interactively, reviewing, and exporting to final destinations. It is complementary to sin-codocs (which handles .doc.md companion files for code), sin-codocs-bundle, and sin-image-generation.
git clone https://github.com/OpenSIN-Code/SIN-Code-Doc-Coauthoring-Skill.git
cd SIN-Code-Doc-Coauthoring-Skill
pip install -e ".[dev]"
pytestINIT → GATHERING → OUTLINING → DRAFTING → REVIEWING → RENDERING → EXPORTED
| State | Tool | Description |
|---|---|---|
| INIT | doc_start |
Start a session, choose doc type |
| GATHERING | doc_context_gather |
Read existing code, find related files |
| OUTLINING | doc_outline_propose |
Propose outline from template + context |
| DRAFTING | doc_section_draft |
Draft one section at a time, ask clarifying Qs |
| REVIEWING | doc_review |
Check completeness, accuracy, clarity |
| RENDERING | doc_format_render |
Render to Markdown, HTML, or PDF |
| EXPORTED | doc_export |
Commit, write file, or share link |
| Tool | Description |
|---|---|
doc_start |
Start a new coauthoring session (type: README, ADR, SPEC, DESIGN, RFC, API, CHANGELOG) |
doc_context_gather |
Gather context from existing code, related files, user goals |
doc_outline_propose |
Propose document outline (sections, hierarchy) |
doc_section_draft |
Draft a section with clarifying questions |
doc_review |
Review for completeness, accuracy, clarity |
doc_format_render |
Render to final format (Markdown, HTML, PDF) |
doc_diff_show |
Show changes from previous version |
doc_export |
Export to destination (git commit, file path, share link) |
| Type | Template | Use Case |
|---|---|---|
README |
templates/readme.md |
Project overview, install, quickstart |
ADR |
templates/adr.md |
Architecture Decision Record (Michael Nygard) |
SPEC |
templates/spec.md |
Technical specification |
DESIGN |
templates/design.md |
Design document |
RFC |
templates/rfc.md |
Request for Comments |
API |
templates/api.md |
API documentation |
CHANGELOG |
templates/changelog.md |
Changelog entry (Keep a Changelog) |
# Start a new session
sin-doc start --type README --title "My Project"
# Gather context
sin-doc gather --session <id> --path ./my-project
# Propose outline
sin-doc outline --session <id>
# Draft a section
sin-doc draft --session <id> --section "Installation"
# Review
sin-doc review --session <id>
# Render to HTML
sin-doc render --session <id> --format html
# Export
sin-doc export --session <id> --destination ./README.mdOr via bash wrappers:
~/.local/bin/doc-start.sh README "My Project"
~/.local/bin/doc-outline.sh <session-id>
~/.local/bin/doc-draft.sh <session-id> "Installation"
~/.local/bin/doc-review.sh <session-id>
~/.local/bin/doc-render.sh <session-id> html
~/.local/bin/doc-export.sh <session-id> ./README.mdMCP Client / CLI
↓ JSON-RPC / argparse
FastMCP Server (mcp_server.py)
↓
CoauthoringSession (state machine)
├→ ContextGatherer (reads codebase)
├→ OutlineProposer (template engine)
├→ SectionDrafter (interactive Q&A)
├→ DocReviewer (completeness/accuracy/clarity)
├→ MultiFormatRenderer (md → html/pdf)
└→ Exporter (git / file / link)
Sessions are stored in ~/.config/sin-doc-coauthoring/sessions/<id>/ as JSON + Markdown. Each session has:
meta.json— session metadata (type, title, state, timestamps)outline.md— current outlinesections/— drafted sectionsdraft.md— assembled draftreview.md— review notesrendered/— rendered output (md, html, pdf)export.log— export history
- 7 doc types with curated templates
- State machine (INIT → EXPORTED) with validation
- Interactive drafting — asks clarifying questions, suggests content
- Multi-format rendering — Markdown, HTML (inline), PDF (weasyprint, optional)
- Diff support — compare versions
- Export to git/file/link — commit, write, or share
- 100% CoDocs — every code file has a
.doc.mdcompanion - 40+ tests — full coverage of session, context, outline, drafter, reviewer, renderer, exporter, MCP
// ~/.config/opencode/opencode.json
{
"mcp": {
"sin-doc-coauthoring": {
"type": "stdio",
"command": "python3",
"args": ["-m", "sin_doc_coauthoring.mcp_server"]
}
}
}pip install -e ".[dev]"
pytest # all tests + coverage
pytest --no-cov # faster, no coverage
pytest tests/test_session.py # one moduleMIT
sin-codocs—.doc.mdcompanion files for code (Layer 1 docs)sin-codocs-bundle— bundle packaging- Anthropic's
doc-coauthoring— original inspiration