Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dagster-io avatar

Learned Docs

  • 75 installs
  • Updated January 1, 1970
  • dagster-io/erk

Maintain agent-focused documentation with YAML frontmatter for routing and discovery, hierarchical categories, and an auto-generated doc registry.

About

learned-docs provides agent-focused documentation infrastructure: markdown docs with YAML frontmatter for routing and discovery, hierarchical categories with index files, and an auto-generated registry. A solo builder reaches for it to give coding agents a structured, discoverable knowledge base instead of scattered notes, so agents can route to the right reference automatically.

  • Agent-focused docs with YAML frontmatter routing
  • Hierarchical category organization
  • Auto-generated registry in docs/learned/index.md
  • Routing tables in AGENTS.md

Learned Docs by the numbers

  • 75 all-time installs (skills.sh)
  • Ranked #709 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dagster-io/erk --skill learned-docs

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs75
Last updatedJanuary 1, 1970
Repositorydagster-io/erk

What it does

Maintain agent-focused documentation with YAML frontmatter for routing and discovery, hierarchical categories, and an auto-generated doc registry.

Who is it for?

Teams giving agents a routed, discoverable doc set.

Files

SKILL.mdMarkdownGitHub ↗

Learned Documentation Guide

Overview: docs/learned/ contains agent-focused documentation with:

  • YAML frontmatter for routing and discovery
  • Hierarchical category organization (categories listed in index below)
  • Index files for category navigation
  • Routing tables in AGENTS.md

Core Knowledge (ALWAYS Loaded)

@learned-docs-core.md

Document Registry (Auto-Generated)

@docs/learned/index.md

Frontmatter Requirements

Every markdown file (except index.md) MUST have:

---
title: Document Title
read_when:
  - "first condition"
  - "second condition"
---

Required Fields

FieldTypePurpose
titlestringHuman-readable title for index tables
read_whenlist[string]Conditions when agent should read this doc

Writing Effective read_when Values

  • Use gerund phrases: "creating a plan", "styling CLI output"
  • Be specific: "fixing merge conflicts in tests" not "tests"
  • Include 2-4 conditions covering primary use cases
  • Think: "An agent should read this when they are..."

Good:

read_when:
  - "creating or closing plans"
  - "understanding plan states"
  - "working with .erk/impl-context/ directories"

Bad:

read_when:
  - "plans" # Too vague
  - "the user asks" # Not descriptive

Documentation Structure

Read the master index for current categories and documents:

docs/learned/index.md

The index contains:

  • All category paths and descriptions
  • Root-level documents
  • Document listings with "Read when..." conditions

Category Placement Guidelines

1. Match by topic - Does the doc clearly fit one category? (see index above for categories) 2. Match by related docs - Are similar docs already in a category? 3. When unclear - Place at root level; categorize later when patterns emerge 4. Create new category - When 3+ related docs exist at root level

Distinguishing cli/ vs architecture/

This is the most common confusion:

  • cli/: Patterns for building CLI commands - how users interact with the tool
  • Fast-path patterns (skipping expensive ops)
  • Output formatting and styling
  • Script mode behavior
  • Command organization
  • architecture/: Internal implementation patterns - how the code works
  • Gateway ABCs and dependency injection
  • Dry-run via wrapper classes
  • Shell integration constraints
  • Protocol vs ABC decisions

Document Structure Template

---
title: [Clear Document Title]
read_when:
  - "[first condition]"
  - "[second condition]"
---

# [Title Matching Frontmatter]

[1-2 sentence overview]

## [Main Content Sections]

[Organized content with clear headers]

## Related Topics

- [Link to related docs](../category/doc.md) - Brief description

Index File Template

Each category has an index.md following this pattern:

---
title: [Category] Documentation
read_when:
  - "[when to browse this category]"
---

# [Category] Documentation

[Brief category description]

## Quick Navigation

| When you need to... | Read this        |
| ------------------- | ---------------- |
| [specific task]     | [doc.md](doc.md) |

## Documents in This Category

### [Document Title]

**File:** [doc.md](doc.md)

[1-2 sentence description]

## Related Topics

- [Other Category](../other/) - Brief relevance

Reorganizing Documentation

When moving files between categories:

Step 1: Move Files with git mv

cd docs/learned
git mv old-location/doc.md new-category/doc.md

Step 2: Update Cross-References

Find all references to moved files:

grep -r "old-filename.md" docs/learned/

Update relative links:

  • Same category: [doc.md](doc.md)
  • Different category: [doc.md](../category/doc.md)
  • To category index: [Category](../category/)

Step 3: Update Index Files

Update Quick Navigation tables in affected index files.

Step 4: Update AGENTS.md

If the doc was in the routing table, update the path.

Step 5: Validate

Run make fast-ci to catch broken links and formatting issues.

Updating Routing Tables

AGENTS.md contains the Quick Routing Table for agent navigation.

When to Add Entries

  • New category additions
  • High-frequency tasks
  • Tasks where wrong approach is common

Entry Format

| [Task description] | → [Link or skill] |

Examples:

  • | Understand project architecture | → [Architecture](docs/learned/architecture/) |
  • | Write Python code | → Load \dignified-python\ skill FIRST |

Validation

Run before committing:

make fast-ci

This validates:

  • YAML frontmatter syntax
  • Required fields present
  • Markdown formatting (prettier)

⚠️ Generated Files - Do Not Edit Directly

The following files are auto-generated from frontmatter metadata:

FileSource
docs/learned/index.mdFrontmatter from all docs
docs/learned/<category>/index.mdFrontmatter from category
docs/learned/<category>/tripwires.mdtripwires: field in category docs
docs/learned/tripwires-index.mdCategory tripwires with routing hints

Never edit these files directly. Changes will be overwritten.

Workflow for Changes

1. Edit the source frontmatter in the relevant documentation file(s) 2. Run sync: erk docs sync 3. Verify changes in the generated files 4. Commit both the source and generated files

Adding a New Tripwire

To add a tripwire rule:

1. Add to the tripwires: field in the relevant doc's frontmatter:

   tripwires:
     - action: "doing something dangerous"
       warning: "Do this instead."

2. Run erk docs sync to regenerate tripwires.md

Quick Reference

  • Full navigation: docs/learned/guide.md
  • Category index: docs/learned/index.md
  • Regenerate indexes: erk docs sync
  • Run validation: make fast-ci

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.