Monodoc

From monoes/monomind · View interactive version

Monodoc is an AI agent skill from the GitHub repository monoes/monomind. Full technical writing workbench — writes, reviews, fixes, scaffolds, and audits project docs per Google Developer Documentation Style Guide + industry best practices. Autodiscovers doc tasks. Enforces tone, formatting, accessibility, inclusive language, readability, terminology consistency, Diátaxi

How to use this skill

Skill file

Monodoc — Technical Writing Workbench

Invoke via /monodoc or auto-routed from mastermind when the task is documentation.


Style profiles

Monodoc ships a Google profile (default) and supports overrides from other guides. Set via /monodoc --profile <name> or per-project in .monodoc.json.

| Profile | Base | Key differences from Google |

|---|---|---|

| google (default) | Google DDSG | Serial comma always; sentence case headings; "see" for cross-refs |

| microsoft | Microsoft Writing Style Guide | Contractions encouraged; deeper bias-free chapter; global-ready sentence caps |

| stripe | Stripe-inspired API docs | Prose-left/code-right layout; inline first-use definitions; error docs must state what/why/fix |

| digitalocean | DigitalOcean tutorial format | Rigid "Step N — Doing X" gerund headings for tutorials; prerequisite blocks mandatory |

| minimal | Subset of Google | Only errors, no warnings — for legacy codebases being incrementally improved |

Conflict resolution: when profiles disagree (serial comma, heading case, contraction policy), the active profile wins. The google profile is the tiebreaker for any rule not explicitly overridden.

Custom profile: create .monodoc.json at the project root:

{
  "profile": "google",
  "overrides": {
    "serial_comma": true,
    "heading_case": "sentence",
    "contractions": "allowed",
    "max_sentence_words": 26,
    "readability_target": "grade-10",
    "custom_word_list": {
      "dont_use": {"leverage": "use", "utilize": "use"},
      "preferred": {"repo": "repository"}
    }
  }
}

Commands

Core writing & review

| Command | Behavior |

|---|---|

| /monodoc write <target> | Write/rewrite a doc from scratch |

| /monodoc review <file> | Audit a doc against all rules; report violations with severity |

| /monodoc fix <file> | Review + auto-fix all violations in place |

| /monodoc api <file> | Generate/audit API reference comments (TSDoc/JSDoc) |

| /monodoc readme | Generate or rewrite the project README |

| /monodoc guide <topic> | Write a how-to guide for the given topic |

| /monodoc tutorial <topic> | Write a learning-oriented tutorial (distinct from how-to) |

| (no subcommand) | Infer mode from context — review if file exists, write if not |

Scaffolding

| Command | Behavior |

|---|---|

| /monodoc scaffold <type> | Generate a doc from a template (see template catalog below) |

| /monodoc adr <title> | Scaffold an Architecture Decision Record (MADR v4 format) |

| /monodoc rfc <title> | Scaffold an RFC / design document |

| /monodoc runbook <service> | Scaffold an operational runbook |

| /monodoc migration <from> <to> | Scaffold a migration guide |

| /monodoc changelog | Generate/update CHANGELOG from conventional commits |

| /monodoc postmortem | Scaffold a blameless post-mortem / incident report |

| /monodoc glossary | Generate/update a project glossary from codebase terms |

Analysis & audit

| Command | Behavior |

|---|---|

| /monodoc coverage | Measure doc coverage — % of public API with docs, missing READMEs, undocumented exports |

| /monodoc maturity | Score project against the doc maturity model (L1–L5) |

| /monodoc readability <file> | Compute Flesch-Kincaid, Gunning Fog, and grade-level scores |

| /monodoc links <file> | Validate internal/external links, find broken anchors |

| /monodoc drift | Detect docs referencing code that no longer exists |

| /monodoc terms <file> | Check terminology consistency — flag synonyms for the same concept |

| /monodoc lint <file> | Fast pass — regex/pattern checks only (no LLM judgment), Vale-style |

Integration

| Command | Behavior |

|---|---|

| /monodoc review-integration | Run monodoc review as part of a mastermind:review pipeline |

| /monodoc ci | Output violations in machine-parseable format (JSON/SARIF) for CI pipelines |


Autodiscovery

Monodoc activates automatically when it detects documentation work. Activation signals (combined, not any-one-alone):

Strong signals (activate immediately):

Medium signals (suggest activation):

Weak signals (log, don't interrupt):


Step 1 — Classify with Diátaxis

Before writing or reviewing, classify the document using the Diátaxis framework. This determines structure, tone weight, and which rules apply most strictly.

| Quadrant | Orientation | Reader need | Structure | Tone weight |

|---|---|---|---|---|

| Tutorial | Learning | "Teach me" | Guided steps, guaranteed success, no side-explanations | Warmest, most encouraging |

| How-to guide | Task | "Help me do X" | Goal → prerequisites → steps → result | Direct, assumes competence |

| Reference | Information | "Tell me about X" | Mirrors code structure, dry, scannable | Most neutral, most precise |

| Explanation | Understanding | "Help me understand why" | Discusses alternatives, context, tradeoffs | Conversational, discursive |

Classification rules:

Common mistakes to avoid:


Step 2 — Style rules

Every doc produced or reviewed by monodoc MUST comply with ALL sections below. Violations are bugs.


2.1 Voice and tone

Tone calibration:

| Too casual | Correct | Too formal |

|---|---|---|

| "Boom — just call the API and you're golden" | "To retrieve data, call the getData method" | "The data may be retrieved via invocation of the getData method" |


2.2 Inclusive language

These are mandatory, not suggestions:

| Don't use | Use instead |

|---|---|

| blacklist / whitelist | denylist / allowlist |

| master / slave | primary / replica, leader / follower |

| sanity check | quick check, confidence check, coherence check |

| crazy, insane, bonkers | unexpected, surprising, complex |

| cripple, lame | impair, hinder, slow |

| blind (metaphorical) | unaware, ignore |

| guys | everyone, folks, people |

| he/him/his (generic) | they/them/their |

| man-in-the-middle | on-path attack, person-in-the-middle |

| native (for people) | built-in, integrated (for features) |

| abort | stop, cancel, end |

| kill | stop, end, terminate |

| hang | stop responding, freeze |

| dummy | placeholder, sample |

| mankind | humanity, people |

| manpower | workforce, staffing |

| grandfathered | legacy, exempt |

| handicapped | person with a disability (identity-first only if the community prefers it) |

| normal / abnormal (for people) | typical / atypical, expected / unexpected |

| first-class citizen | first-class support, built-in |

| ninja / rockstar / guru | expert, specialist |

Example names: use diverse, non-stereotypical placeholder names across gender, ethnicity, and culture. Rotate: Alex Chen, Priya Sharma, Jordan Williams, Fatima Al-Rashid, Sam Rivera.


2.3 Headings and titles


2.4 Lists


2.5 Procedures


2.6 Code in text


2.7 Code samples


2.8 API reference comments


2.9 Accessibility

Every doc must be accessible. These are not optional:

Structure:

Images:

Links:

Content:

Tables:

Forms:


2.10 Formatting and organization

Capitalization:

Numbers:

Dates and times:

UI elements:

Notes/warnings:

Paragraphs:


2.11 Word list (key entries)

Apply these on every pass. When in doubt, consult the full word list.

| Term | Rule |

|---|---|

| abort | Don't use. Use stop, cancel, end |

| access (verb) | Use see, edit, find, use, view |

| allows you to | Use "lets you" |

| app vs application | "app" for end-user; "application" for enterprise |

| can / may / might / must | "can" = ability; "may" = policy permission; "might" = possibility; "must" = requirement |

| CLI | Don't use generically; name the specific tool |

| comprise | Use "consists of", "contains", "includes" |

| config | Spell out "configuration" in prose |

| currently | Omit — docs should be timeless |

| data | Singular — "the data is" |

| deselect | Use "clear" (for checkboxes) |

| deprecate | Means "recommend against"; not "removed" |

| dialog | UI element; "dialogue" for human conversation |

| display (verb) | Requires a direct object |

| earlier / later | For versions — not "above/below" or "higher/lower" |

| email | Not "e-mail"; don't use as verb |

| enable | For features; use "lets you" for capability |

| enter | For text input into fields |

| etc. | Don't use. List explicitly or phrase intro with "such as" |

| fill in / fill out | "fill in" for fields; "fill out" for forms |

| frontend / backend | One word, no hyphen |

| he/him/his | Use singular "they" |

| just | Usually filler — delete it |

| on-premises | Hyphenated; never "on-prem" or "on-premise" |

| please | Only for requesting forgiveness/permission; never in instructions |

| plugin / plug-in / plug in | Noun / adjective / verb |

| & | Use "and" in text; & only in code/UI |


2.12 Linking and cross-references


2.13 Filenames and naming


2.14 Command-line syntax


2.15 Error messages and troubleshooting docs

When documenting error messages or writing troubleshooting content:


2.16 Readability

Target readability scores by doc type:

| Doc type | Flesch-Kincaid target | Gunning Fog target |

|---|---|---|

| Tutorial | Grade 6–8 | ≤10 |

| How-to guide | Grade 8–10 | ≤12 |

| Conceptual / explanation | Grade 8–10 | ≤12 |

| API reference | Grade 10–14 (acceptable) | ≤14 |

| README | Grade 8–10 | ≤12 |

Rules:


2.17 Terminology consistency


2.18 Global audience (i18n readiness)


Step 3 — Templates catalog

When scaffolding (/monodoc scaffold <type>), use these structures. Pre-fill from code analysis (package.json, exported symbols, git history) where possible; use TODO: markers for facts that require human input.

README

# Project name
One-sentence description.
## Prerequisites
## Install
## Quick start
## Usage
## Configuration
## API (if applicable)
## Contributing
## License

How-to guide

# [Task verb] [object]
One-sentence overview.
## Before you begin
Prerequisites list.
## [Step sections — numbered within each]
## What's next

Tutorial

# [Task verb] [object]: a tutorial
## Objectives
What you'll learn (bulleted).
## Before you begin
Prerequisites + costs.
## Step 1 — [Verb] [object]
...
## Step N — [Verb] [object]
## Clean up
## What's next

API reference

# [Module/class name]
One-paragraph description + 5–20 line code sample.
## Members
### [Property name]
## Methods
### [method_name]
Description. Parameters table. Returns. Throws. Example.

ADR (MADR v4)

# [ADR-NNNN] [Title]
- Status: [proposed | accepted | deprecated | superseded by ADR-NNNN]
- Date: YYYY-MM-DD
## Context and problem statement
## Decision drivers
## Considered options
1. [Option A]
2. [Option B]
## Decision outcome
Chosen option: "[Option]", because [justification].
### Consequences
- Good, because ...
- Bad, because ...
## Pros and cons of the options
### [Option A]
### [Option B]
## More information

RFC / design document

# RFC: [Title]
- Author: [name]
- Status: [draft | review | accepted | rejected | withdrawn]
- Date: YYYY-MM-DD
## Summary
## Motivation
## Goals and non-goals
## Proposed design
## Alternatives considered
## Risks and tradeoffs
## Rollout plan
## Open questions

Runbook

# Runbook: [Service/system name]
## Service overview
## Alert conditions
## Severity classification
## Diagnosis steps
## Mitigation / remediation
## Escalation path
## Rollback procedure
## Post-incident actions

Migration guide

# Migrate from [X] to [Y]
## Overview
## Breaking changes
## Prerequisites
## Step-by-step migration
## Before/after examples
## Rollback procedure
## Deprecation timeline
## FAQ

Changelog (Keep a Changelog)

# Changelog
All notable changes to this project are documented in this file.
Format: [Keep a Changelog](https://keepachangelog.com/).
Versioning: [Semantic Versioning](https://semver.org/).
## [Unreleased]
## [X.Y.Z] - YYYY-MM-DD
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security

Post-mortem / incident report

# Incident report: [Title]
- Date: YYYY-MM-DD
- Severity: [P0–P4]
- Duration: [start–end]
- Author: [name]
## Summary
## Impact and blast radius
## Timeline
## Root cause
## Detection
## Resolution
## Action items
| Action | Owner | Deadline | Status |
## Lessons learned

Contributing guide

# Contribute to [project]
## Code of conduct
## Development setup
## Branch and PR workflow
## Coding standards
## Testing requirements
## Commit conventions
## Review process

Security policy (SECURITY.md)

# Security policy
## Supported versions
| Version | Supported |
## Report a vulnerability
## Response SLA
## Disclosure policy

Troubleshooting guide

# Troubleshoot [topic]
## [Symptom]
**Cause:** ...
**Fix:** ...
## Diagnostic commands
## Known issues
## Get help

FAQ

# Frequently asked questions
## [Topic group]
### [Question in sentence case?]
Answer.

Glossary

# Glossary
| Term | Definition |

Onboarding guide

# Get started with [project/team]
## Access and accounts
## Local environment setup
## Architecture overview
## Your first task
## Team norms
## Key contacts

Step 3b — Monograph integration

When available, use monograph tools to power doc analysis instead of manual grep. This makes coverage, drift, and term analysis graph-aware.

| Task | Tool | How |

|---|---|---|

| Coverage | mcp__monomind__monograph_dead_code | Find exported functions with no doc comments; cross-reference against docs/ entries |

| Drift | mcp__monomind__monograph_query | For each backticked symbol in a doc file, verify it still exists in the graph |

| Impact | mcp__monomind__monograph_impact | Before documenting a change, find all affected files/consumers |

| API surface | mcp__monomind__monograph_god_nodes | Find high-centrality files that deserve dedicated doc pages |

| Neighbors | mcp__monomind__monograph_neighbors | When writing a module doc, discover related modules for "See also" links |

| Route map | mcp__monomind__monograph_route_map | Auto-generate API endpoint reference from route definitions |

| Suggest | mcp__monomind__monograph_suggest | When starting doc work on 3+ files, get ranked relevance list |

Fallback: if monograph is not built or returns 0 results, fall back to grep/find via Bash.


Step 3c — Lint patterns (fast pass)

The /monodoc lint command runs regex/pattern checks without LLM judgment. These are the highest-signal patterns, derived from Vale, alex.js, write-good, and proselint:

Filler & weasel words (flag for removal):

Ease words (flag as condescending):

Passive voice (flag for rewrite):

Inclusive language (flag as error):

Google word list violations (flag with replacement):

"There is/are" constructions:

Sentence length (flag if >26 words):

Heading case (flag title case in headings):

Click here (flag as accessibility error):

These patterns catch ~60% of style violations without any LLM cost. The full /monodoc review uses LLM judgment for the remaining 40% (tone calibration, content accuracy, Diátaxis classification, semantic completeness).


Step 4 — Doc coverage and maturity

Coverage analysis (`/monodoc coverage`)

Measure and report:

  1. API coverage — % of public exported functions/classes/types with doc comments (use monograph or TSDoc extraction)
  2. README coverage — which packages/directories lack a README
  3. Guide coverage — which major features lack a how-to guide
  4. Changelog freshness — is CHANGELOG current with latest version?
  5. Link health — count of broken internal/external links

Output format:

DOC COVERAGE REPORT
━━━━━━━━━━━━━━━━━━
API docs:    72% (43/60 exports documented)
READMEs:     5/8 packages have README  ⚠ missing: @monoes/routing, monofence-ai, @monoes/memory
Guides:      3 features undocumented
Changelog:   ✓ current (v2.5.5)
Links:       2 broken (list follows)

Doc maturity model (`/monodoc maturity`)

| Level | Name | Criteria |

|---|---|---|

| L1 | Exists | README present, may be informal or stale |

| L2 | Referenced | Generated API reference from code (TSDoc/JSDoc), basic README |

| L3 | Guided | Task-oriented how-to guides per major feature |

| L4 | Taught | Tutorials + versioned docs synced to releases |

| L5 | Measured | Analytics, freshness SLAs, i18n, readability-scored |

Score the project and report the current level with specific gaps to reach the next level.


Step 5 — Doc drift detection (`/monodoc drift`)

Detect documentation that references code artifacts that no longer exist:

  1. Extract code references from docs (function names, class names, file paths, CLI commands in backticks)
  2. Cross-reference against monograph or codebase grep
  3. Report stale references with the doc file, line number, and the missing artifact
  4. Suggest: remove, update, or mark as deprecated

Step 6 — Write or review

Writing mode (`write`, `readme`, `guide`, `tutorial`, `api`, `scaffold`)

  1. Classify with Diátaxis (Step 1)
  2. Select the template from the catalog (Step 3) or outline from scratch
  3. Pre-fill from code analysis where possible (package.json, exported symbols, monograph, git log)
  4. Draft following ALL rules from Step 2
  5. Compute readability score — rewrite if above target for the doc type
  6. Self-review against the checklist (Step 7)
  7. Fix all violations before presenting the draft

Review mode (`review`)

  1. Read the entire file
  2. Classify the doc type (Diátaxis)
  3. Run every rule from Step 2 against it systematically
  4. Compute readability scores
  5. Check terminology consistency across the doc
  6. Validate links (internal anchors, external URLs if accessible)
  7. Report violations grouped by section (2.1–2.18), with:
  1. Severity: Error (violates a MUST rule), Warning (violates a SHOULD), Info (style improvement)

Fix mode (`fix`)

  1. Run review mode
  2. Apply all Error and Warning fixes in place
  3. Report summary: violations found, fixed, remaining (Info-level left for human decision)

Step 7 — Self-review checklist

Before presenting ANY doc, verify EVERY item. Each unchecked item must be fixed.

Voice and tone

Inclusive language

Structure and formatting

Code and technical

Procedures

Accessibility

Readability

Terminology

Command-line syntax

Error and troubleshooting docs

Word list and grammar

Links

Global readiness


Step 8 — Output

After completing the write/review/fix:

| Mode | Output |

|---|---|

| write | Finished doc with readability score and Diátaxis classification |

| review | Violation report: line numbers, rule IDs (2.1–2.18), severity, suggested fixes, readability scores |

| fix | Applied edits summary with before/after readability comparison |

| lint | Fast pattern-match results — no LLM judgment, machine-parseable |

| coverage | Coverage report: API %, README %, guide gaps, changelog freshness, link health |

| maturity | L1–L5 assessment with gap analysis to next level |

| drift | Stale references with doc file, line number, missing artifact, suggested action |

| terms | Terminology consistency report: synonym clusters, suggested canonical terms |

| ci | JSON or SARIF output for CI pipeline integration |

| scaffold | Generated doc with TODO: markers for human-supplied facts |

Always state what was checked and any items that couldn't be automatically verified (for example, alt text accuracy requires human judgment on whether the description matches the image's intent).


Quick reference

When invoked without a subcommand, monodoc infers the mode:

  1. If the argument is an existing .md file → review mode
  2. If the argument is a non-existent file path → write mode (infer type from filename)
  3. If no argument → coverage mode (audit the whole project)
  4. If the prompt describes a doc goal → write mode with Diátaxis classification

Shorthand examples:

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.