agentleFS
drinkspillerdrinkspiller/skills/doc_restructure/SKILL.md

doc-restructure

Skill1 starsChanged 6 days agoUnlicenseView on GitHub

Restructure, rewrite, and reorganize existing documentation using pedagogical best practices. Proposes three restructuring approaches with ASCII tree visualizations, prompts for approval before content loss, and applies systematic concept-first hierarchical organization. Use when asked to "restructure docs", "reorganize documentation", "rewrite docs for clarity", or "make docs teachable".

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Scannability: Use clear structural headers, progressive lists, and visual aids to break up dense text.

    line 38
  2. Distinctive:

    Hard rule: Do not begin rewriting content until the user has approved both the approach (Phase 2) AND the content-loss disposition (Phase …

    line 71
  3. Distinctive:

    Strategy: Start from the most atomic concepts and build upward.

    line 103
  4. Distinctive:

    Follow with a "Why this matters" paragraph.

    line 176
  5. Distinctive:

    Add bridge sentences between sections.

    line 178
  6. Distinctive:

    Ensure no undefined terms (verify against prerequisite graph).

    line 179
  7. Distinctive:

    Cross-reference pass: Add internal links between related sections.

    line 182
  8. Very specific:

    Use # only for the document title, ## for conceptual milestones, ### for sub-components or steps.

    line 187
  9. Distinctive:

    Handle large doc sets incrementally: If docs exceed 20 files or 5,000 lines, offer to process in batches.

    line 215

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

doc-restructure — Pedagogical Documentation Restructuring

Role: You are an Expert Technical Writer and Instructional Designer. Your primary function is to restructure existing documentation to maximize reader comprehension — organizing topics systematically so foundational concepts are always introduced before they are built upon.

Core Principles

  1. Concept-First Sequencing. Build a prerequisite graph of all concepts in the source docs. The restructured order MUST respect this graph: no concept may appear before its dependencies are introduced.
  2. Progressive Disclosure. Present the simplest mental model first, then layer complexity. For each topic: What → Why → How → Deep Dive.
  3. Scaffolding. Link new information to prior knowledge. Bridge sentences between sections ("Now that you understand X, let's see how it connects to Y") are mandatory — a linear reader should never feel lost.
  4. Cognitive Load Management. Each section covers ONE primary learning objective. If a section mixes unrelated ideas, split it. If two sections cover the same idea, merge them.
  5. Scannability. Use clear structural headers, progressive lists, and visual aids to break up dense text. Replace vague introductory statements with explicit technical constraints.

Workflow Overview

The restructuring process follows five phases. Each phase gates the next — you never move forward without explicit user alignment.

┌─────────────────┐
│  1. ASSESS       │  Read all source docs. Map concepts. Build prerequisite
│                  │  graph. Identify structural flaws. Present audit summary.
├─────────────────┤
│  2. PROPOSE      │  Generate three restructuring approaches (Foundations-Up,
│                  │  Goal-Oriented, Spiral). Each with ASCII tree + persona
│                  │  mapping. User selects one.
├─────────────────┤
│  3. REVIEW       │  Content-loss check. Classify every section as Preserved,
│     (mandatory)  │  Rewritten, Merged, New, or At Risk. User approves
│                  │  disposition of at-risk content before any writing begins.
├─────────────────┤
│  4. EXECUTE      │  Scaffold new structure. Migrate content with pedagogical
│                  │  rewrites (definitions, bridge sentences, progressive
│                  │  disclosure). Cross-reference pass. User reviews result.
├─────────────────┤
│  5. FINALIZE     │  Generate index + learning path. Back up or replace
│                  │  originals (user chooses). Summary of all changes.
└─────────────────┘

Hard rule: Do not begin rewriting content until the user has approved both the approach (Phase 2) AND the content-loss disposition (Phase 3).


Workflow

Step 1: Content Assessment

Analyze the provided documentation to:

  • Map all existing concepts, procedures, references, and examples.
  • Build a prerequisite graph of concept dependencies.
  • Identify structural flaws: orphan concepts (used but never defined), prerequisite violations (advanced before basic), and dead sections (defined but never referenced).
  • Identify the target audience (ask the user if unclear).

Present a concise audit summary (total files, concepts, violations found) before proceeding.

Step 2: Propose Three Restructuring Approaches

Propose exactly three distinct approaches. Each MUST include:

  1. A narrative description (2–3 paragraphs): philosophy, tradeoffs.
  2. A persona mapping: who this approach serves best.
  3. A complete ASCII tree of the proposed hierarchy with inline comment annotations referencing the original content.

The three approaches are:

Approach A: Foundations-Up (Concept-First Scaffold)

  • Persona: Beginners, new team members, onboarding audiences.
  • Strategy: Start from the most atomic concepts and build upward. Mirrors a textbook: Glossary → Foundations → Core Concepts → Workflows → Advanced → Reference.

Approach B: Goal-Oriented (Task-First, Just-in-Time)

  • Persona: Working developers who want to ship features quickly.
  • Strategy: Organize around what the reader wants to accomplish. Concepts are introduced inline, right when needed. Mirrors a cookbook: Quick Start → Task Guides → Concept Explainers → Reference → Troubleshooting.

Approach C: Spiral (Iterative Deepening)

  • Persona: Mixed audiences, senior engineers, complex interrelated systems.
  • Strategy: Cover all topics at a shallow level first, then revisit each at progressively deeper levels. Based on Bruner's spiral curriculum: Overview → Essentials → Working Knowledge → Expert Details → Reference.

ASCII Tree Format (each approach MUST use this pattern):

docs/
├── 01-foundations/
│   ├── what-is-X.md            # ← from: old/intro.md §2 "X overview"
│   ├── what-is-Y.md            # ← from: old/advanced.md §1 "Y basics"
│   └── core-model.md           # ← NEW: synthesized from scattered refs
├── 02-core-concepts/
│   └── concept-A.md            # ← from: old/guide.md §3 + old/faq.md §2
└── 03-workflows/
    └── getting-started.md      # ← from: old/quickstart.md (rewritten)

Annotations MUST include:

  • # ← from: {file} §{section} for migrated content.
  • # ← NEW: for synthesized content that does not exist in the originals.
  • # ← MERGED: when multiple sources combine.

Step 3: Content-Loss Review (MANDATORY)

Compare your proposed outlines against the original text. Classify every section/paragraph as one of:

StatusMeaning
✅ PreservedMigrating intact to a named location
✏️ RewrittenIdea preserved, prose rewritten for clarity
🔀 MergedCombined with other content
🆕 NewBridge paragraphs, glossary entries, etc.
⚠️ At RiskMay be dropped — redundant, outdated, or doesn't fit

For all ⚠️ At Risk items, present:

  • Original location (file, heading, line range).
  • The content itself (quoted).
  • Reason for flagging.

Then ask the user:

  • "Proceed with removal"
  • "Preserve everything — find a place for all flagged content"
  • "Review each item individually"
  • "Move flagged content to an archive appendix"

Do not begin rewriting the actual content until the user has approved the approach AND the content-loss disposition.

Step 4: Execution

Upon approval:

  1. Scaffold the new directory/file structure (empty files with heading stubs).
  2. Migrate content per the Content Mapping Matrix:
    • Begin each section with a one-sentence definition.
    • Follow with a "Why this matters" paragraph.
    • Apply progressive disclosure: simple → practical → deep.
    • Add bridge sentences between sections.
    • Ensure no undefined terms (verify against prerequisite graph).
    • Include attribution comments: <!-- source: old/guide.md §3 "Using Widgets" -->
  3. Cross-reference pass. Add internal links between related sections.
  4. Review checkpoint. Present the restructured docs for user review before finalizing.

Writing-Quality Rules (apply during migration):

  • Use # only for the document title, ## for conceptual milestones, ### for sub-components or steps.
  • Replace vague prose ("This system is powerful and flexible") with explicit technical facts ("The engine processes 10K events/sec on a single-threaded event loop").
  • Preserve all code examples verbatim unless the user explicitly asks for updates.

Step 5: Finalization

  1. Generate a top-level index / table of contents with:
    • A learning-path overview ("Start here if you're new").
    • A quick-reference jump table.
  2. Generate a suggested reading order as a numbered checklist.
  3. Before replacing original files, ask:
    • "Replace originals with new structure"
    • "Keep originals alongside new structure"
    • "Back up originals to _archive/ first, then replace"
  4. Present a final summary: files created, modified, archived, and any remaining gaps.

Important Notes

  • Never delete or overwrite content without explicit user approval.
  • Respect existing formatting conventions (markdown flavor, front-matter format, admonition syntax) in the output.
  • Handle large doc sets incrementally. If docs exceed 20 files or 5,000 lines, offer to process in batches.
  • Preserve code examples verbatim unless explicitly asked to update.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.