improve-doc
Analyze and improve existing documentation using Diataxis principles
What this skill does
# Improve Doc
Analyze an existing markdown document, classify sections by Diataxis type, identify issues, and interactively refine each section.
## Arguments
- **Path:** Path to the markdown document to improve (required)
## Workflow Overview
Invoke the **improve-doc** skill with a document path, e.g. `improve-doc docs/guides/getting-started.md`.
The skill runs in two phases:
1. **Analysis Phase:** Parse document, classify sections, identify issues
2. **Refinement Phase:** Interactive loop to improve each section
## Gates
Hard sequencing — advance only when the **pass condition** is met (artifact or explicit user input, not assumed).
**Before Phase 2 (refinement):**
1. **Read** — Full contents of the file at **Path** are loaded.
- **Pass:** Enumerated sections (from `#` / `##` / `###` headings) cover every heading in the file; titles match the source.
2. **Core skill** — [docs-style](../docs-style/SKILL.md) is loaded (or its path read) before classification.
- **Pass:** Analysis output reflects at least one concrete principle from that skill (name it or quote briefly).
3. **Handoff** — User saw an analysis summary (template in Step 5 or equivalent) and entered **`start`** to begin refinement, or **`abort`** to exit.
- **Pass:** If `abort`, no writes to **Path**. If `start`, proceed to Phase 2.
**Before overwriting the file (Phase 2, Step 4):**
1. **Choices** — Every section with open issues has a terminal outcome: applied **`yes`**, unchanged **`skip`**, or **`modify`** loop finished with **`yes`** or **`skip`**.
- **Pass:** No section left in a pending `modify` state unless the user aborted the whole session (then do not write).
2. **Skips** — Content for every **`skip`** matches the original section text (copy preserved, not paraphrased).
- **Pass:** Full block equality check against the initial read (line-for-line, including whitespace).
3. **Write** — Only after the above.
- **Pass:** Single save to **Path**; completion report notes backup or major restructure if applicable (Rules).
**Ambiguous Diataxis type** — If classification is uncertain, do not edit that section until the user answers the clarifying fork (Step 2b) or explicitly confirms your stated default.
## Phase 1: Analysis
### Step 1: Read Document
Read the target markdown file and parse into sections based on headings:
- Each `#`, `##`, `###` heading starts a new section
- Capture heading level, title, and content
- Preserve hierarchy for context
### Step 2: Load Core Skill
Load [docs-style](../docs-style/SKILL.md) for core writing principles that apply to all documentation types.
### Step 3: Classify Each Section
For each section, determine the Diataxis type using these indicators:
| Type | Indicators |
|------|------------|
| **Tutorial** | "Let's", "we will", step-by-step learning, builds toward a project, minimal explanation of why |
| **How-To** | "How to" title, task-focused steps, assumes prior knowledge, goal-oriented |
| **Reference** | Parameter tables, type signatures, API specs, factual descriptions, no narrative |
| **Explanation** | "Why", "because", history, trade-offs, alternatives, conceptual discussion |
**Classification rules:**
1. Check title first - "How to X" is always How-To, "Why X" is always Explanation
2. Look for structural patterns - tables with parameters/types suggest Reference
3. Analyze language - learning-oriented ("Let's learn") vs task-oriented ("To accomplish X")
4. Consider context - what comes before/after this section
5. Mark as "Mixed" if section blends types (this is an issue to fix)
### Step 4: Identify Issues
For each section, check for issues based on its detected type:
**Tutorial issues:**
- Explains "why" instead of just guiding the learner
- Skips steps assuming prior knowledge
- No clear learning outcome
- Missing "you will build/learn" framing
**How-To issues:**
- Includes explanatory tangents
- Missing prerequisites
- Steps not atomic (multiple actions per step)
- No verification that goal was achieved
**Reference issues:**
- Missing parameter types or return values
- Narrative text instead of factual description
- Incomplete coverage of options/parameters
- No code examples
**Explanation issues:**
- Includes procedural steps
- Missing context for "why"
- No trade-offs or alternatives discussed
- Reads like reference material
**Cross-type issues (any section):**
- Mixed Diataxis types in single section
- Unclear who the audience is
- Missing or vague heading
- Wall of text without structure
### Step 5: Present Analysis
Display analysis summary to user:
```markdown
## Document Analysis
**File:** `docs/guides/getting-started.md`
**Sections found:** 8
**Estimated time:** ~15 minutes to refine
### Type Breakdown
| Type | Sections | Health |
|------|----------|--------|
| Tutorial | 2 | 1 issue |
| How-To | 3 | 4 issues |
| Reference | 1 | Clean |
| Explanation | 1 | 2 issues |
| Mixed | 1 | Needs split |
### Top Issues
1. **Section "Setting Up"** (How-To): Contains explanatory tangent about architecture
2. **Section "Configuration Options"** (Mixed): Blends reference table with tutorial steps
3. **Section "Authentication"** (How-To): Missing prerequisites, steps not atomic
4. **Section "Why We Built This"** (Explanation): Includes procedural steps
### Ready to Refine?
I'll go through each section with issues. For each one, you can:
- **yes** - Accept the proposed improvement
- **skip** - Keep original, move to next section
- **modify** - Tell me what to change about the proposal
Type "start" to begin refinement, or "abort" to exit without changes.
```
## Phase 2: Interactive Refinement
### Step 1: Load Type-Specific Skills
As you encounter each section type, load the relevant skill if not already loaded:
- Tutorial sections: [tutorial-docs](../tutorial-docs/SKILL.md)
- How-To sections: [howto-docs](../howto-docs/SKILL.md)
- Reference sections: [reference-docs](../reference-docs/SKILL.md)
- Explanation sections: [explanation-docs](../explanation-docs/SKILL.md)
### Step 2: Refinement Loop
For each section with issues, in document order:
#### 2a: Show Current State
```markdown
---
## Section 3 of 5: "Setting Up" (How-To)
### Current Content
> ## Setting Up
>
> Before we begin, it's important to understand why the architecture
> works this way. The system uses a microservices pattern because...
> [explanatory content]
>
> To set up the project:
> 1. Clone the repo and install dependencies
> 2. Configure the environment variables
> 3. Start the server
### Issues Found
1. **Explanatory tangent** (lines 1-3): How-To should assume reader knows why; move explanation to dedicated Explanation section
2. **Non-atomic steps** (step 1): "Clone and install" is two actions; split into separate steps
3. **Missing verification**: No way to confirm setup succeeded
```
#### 2b: Ask Clarifying Question (if needed)
If the type classification is uncertain:
```markdown
### Quick Question
This section has characteristics of both How-To (task steps) and Explanation (why content). How would you like to handle it?
1. **Split** - Create separate How-To and Explanation sections
2. **How-To** - Remove explanation, keep as pure How-To
3. **Explanation** - Remove steps, keep as pure Explanation
```
#### 2c: Propose Improvement
```markdown
### Proposed Improvement
> ## Setting Up
>
> **Prerequisites:** Familiarity with microservices architecture
>
> ### Steps
>
> 1. Clone the repository
> ```bash
> git clone https://github.com/example/project.git
> ```
>
> 2. Install dependencies
> ```bash
> cd project && npm install
> ```
>
> 3. Configure environment variables
> ```bash
> cp .env.example .env
> ```
>
> 4. Start the server
> ```bash
> npm start
> ```
>
> ### Verify
>
> Open http://localhost:3000 - you should see the welcome page.
**Changes made:**
- Removed explanatory content (suggest creating "Architecture Overview" section)
- Split "clone and instalRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.