agentleFS
yumeiriowlyumeiriowl/code-learn-skill/skills/staged-learning-code/SKILL.md

staged-learning-code

Skill1 starsChanged 4 months agoMITView on GitHub

A skill that decomposes a technical concept (agent harness, RAG, compiler, network protocol, etc.) into its elements and generates learning material you can study in stages, with minimal code split per folder. Each folder runs on its own and can be verified with a single command (e.g., `python main.py`). It prioritizes in-file transparency over DRY, and copy-paste readability over abstraction. Use it for "learning code", "make teaching material", "implement it split by element", "in a form I can learn in stages", "I want to add more samples", and similar.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 14 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Start from mocks, and connect the real thing (LLM/DB/external API) at the end

    line 14
  2. Distinctive:

    If there are no arguments, ask the following:

    line 24
  3. Distinctive:

    If the user specifies a language, follow it

    line 36
  4. Distinctive:

    When adding to existing material, match the existing material's language

    line 37
  5. Distinctive:

    Do not infer the language from the repository name, directory name, or unrelated adjacent files.

    line 40
  6. Distinctive:

    If possible, check one representative OSS repository or official sample

    line 49
  7. Distinctive:

    If it differs from your understanding, reflect it in the material code

    line 50
  8. Very specific:

    Check especially: technologies not in the training data or whose last update is old, libraries after a major version upgrade, and …

    line 52
  9. Distinctive:

    Leave the sources you checked (URLs) as footnotes in the README or the integrated version.

    line 56
  10. Distinctive:

    If there is existing material, do not touch existing files

    line 64
  11. Distinctive:

    Write out the "not this time" list

    line 65
  12. Distinctive:

    If the user says "bare minimum", "minimal", "keep it simple", "just this element", etc., trim the scope accordingly.

    line 67
  13. Very specific:

    Do not create shared modules, config modules, package markers, or test files (in Python, utils.py / config.py / __init__.py).

    line 106
  14. Distinctive:

    Use real external dependencies for the first time in the integrated version

    line 112
  15. Very specific:

    If there is an execution environment and you can run the entry point directly, verify it.

    line 114
  16. Very specific:

    Run each folder's entry point (e.g., python main.py) and confirm the expected output appears

    line 118
  17. Distinctive:

    If it fails, fix it before handing it to the user

    line 119
  18. Distinctive:

    Put the run command and an actual example output (10–30 lines) in the README

    line 120
  19. Distinctive:

    Start each folder from the bundled templates (Python example.

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 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

staged-learning-code — Staged Learning Material Code Generation Skill

Decompose a technical concept (agent harness, RAG pipeline, compiler frontend, network protocol, etc.) element by element, and generate learning material that lays out minimal code per folder. Prioritize transparency over DRY, and plainness over abstraction — the reverse of normal code design, because the reader is a learner, not a maintainer.

Goals

  • Take out elements one at a time, and reduce each to minimal code that runs on its own
  • Opening each folder, a few files make that element's behavior clear
  • Start from mocks, and connect the real thing (LLM/DB/external API) at the end
  • Structure it so learners can copy-paste, run, and read along

When to use

  • "Make learning code for X"
  • "I want X split element by element into a form I can learn in stages"
  • "X as a minimal implementation, split per folder"
  • "I want to add more samples (add a new folder to existing material)"

If there are no arguments, ask the following:

  1. Target topic (what the material teaches)
  2. Scope preference (optional; e.g., "minimal configuration" or "just this element". If none, decide the number of elements according to the natural decomposition of the subject)
  3. Mock/implementation boundary (from which folder to use the real thing)
  4. Dependency packages (standard library only, or external dependencies)
  5. Adding to existing material, or a new project

Natural language of the material (README and comments)

Decide the natural language of README.md and code comments in this priority order:

  1. If the user specifies a language, follow it
  2. When adding to existing material, match the existing material's language
  3. Otherwise, write in the same language as the user's request

Do not infer the language from the repository name, directory name, or unrelated adjacent files. If none of the above settles it, ask before writing.

Process

Phase 0: Preliminary research

In environments where web search is available, before proceeding to Phase 1:

  • Open at least one official document (the latest version)
  • If possible, check one representative OSS repository or official sample
  • If it differs from your understanding, reflect it in the material code

Check especially: technologies not in the training data or whose last update is old, libraries after a major version upgrade, and models/protocols/frameworks released within the last 1–2 years.

Skip: basic language-spec-level features (for, dict, dataclass, etc.), algorithm-textbook-level subjects (sorting, searching, DP, etc.), and subjects you researched within the past year with no major version upgrade since.

Leave the sources you checked (URLs) as footnotes in the README or the integrated version.

Phase 1: Fixing the scope

Make a "won't-do list" first:

  • Decompose the subject into elements; decide which to cover and which not to. Decide the count by the subject's natural decomposition, not a fixed number
  • Number each folder sequentially from 01_ (gaps allowed)
  • If there is existing material, do not touch existing files
  • Write out the "not this time" list

If the user says "bare minimum", "minimal", "keep it simple", "just this element", etc., trim the scope accordingly.

Phase 2: Deciding the directory structure

project/
├── 01_<element_name>/            # the most basic element
│   ├── <entry point>             # ~100 lines (e.g., main.py)
│   └── README.md
├── 02_<next element>/
│   ├── <entry point>             # ~150 lines
│   └── README.md
├── 03_<the one after>/
│   └── ...
└── XX_integrated/                # the integrated version at the end
    ├── <entry point>             # ~400 lines
    ├── .env.example              # if needed
    └── README.md

Naming rules:

  • <number>_<snake_case element name>/ format
  • Assign numbers by learning order, not implementation difficulty
  • Gaps and branches are allowed (e.g., 02b_<another variant> as an alternate implementation to contrast with 02)
  • Mock folders come first; only the final integrated folder(s) use real external services (LLM / DB / external API)

Phase 3: File-composition rules

Each folder is basically 2 files:

  • Entry point — the minimal implementation of that element, with verification in the direct-execution block (e.g., Python's if __name__ == "__main__":, Node's index.js, Go's func main)
  • README.md — purpose, how to run, example output, the folder to proceed to next

Exceptions:

  • .env.example — only for folders that use real external services (LLM, DB, external API, etc.)
  • Sub-dependency files — only when bundling a separate-process server, etc.

Do not create shared modules, config modules, package markers, or test files (in Python, utils.py / config.py / __init__.py).

Phase 4: Implementation (mock → real)

  1. Build first the folder with zero external dependencies (mock LLM, DB, external API)
  2. The next folder embeds the previous folder's class while adding one new element
  3. Use real external dependencies for the first time in the integrated version

If there is an execution environment and you can run the entry point directly, verify it. If you cannot, do a syntax/import check (e.g., py_compile for Python).

Phase 5: Verification and documentation

  • Run each folder's entry point (e.g., python main.py) and confirm the expected output appears
  • If it fails, fix it before handing it to the user
  • Put the run command and an actual example output (10–30 lines) in the README
  • Guide to the next folder in a "Where to go next" section

Principles

PrincipleApplication
Give up DRYNo shared modules. The same class in two folders is fine as copy-paste — learners can place the two side by side and compare
Enforce YAGNINo abstract base classes, config layers/files, plugin mechanisms, loggers, or test frameworks. Do not write "might be needed in the future" code — add it once it is needed
Write plainlyUse even a verbose idiom (e.g., Python's for i in range(len(xs)):) if it is more readable
Minimal abstractionAn abstract base class only when multiple concrete classes share a common interface; a class with one instance is written directly
Do not add dependenciesStandard library + the bare minimum. Replace convenience libraries (e.g., jsonschema) with handwritten code
Use mocksStub the LLM, DB, and external APIs so learners run everything without external keys
Use standard outputNo logging library; visualize behavior with standard output (e.g., print("[Step N] tool=..."))
Embed verificationThe direct-execution block runs through success + failure cases lined up in a list
Return errors as stringsThe tool layer and external-call layer do not throw exceptions; they return an ERROR string
No package markersNo __init__.py etc.; each folder is a standalone script
Do not touch existing files"Add a sample" means only adding. Editing existing folders requires permission
Respect "minimal"If the user says "bare minimum", stop partway instead of building all elements

Per-folder templates

Start each folder from the bundled templates (Python example; for other languages, substitute the entry-point name, the direct-execution idiom, and standard-library naming):

  • assets/entrypoint_template.py — entry-point skeleton (docstring header, section-comment blocks, showcase in the direct-execution block)
  • assets/readme_template.md — README skeleton (What you can learn / Run / Composition / Why X is not used / Where to go next)

How to proceed with the design

  1. List the constituent elements of the target concept
  2. Choose the one element the learner touches first (the one with the fewest dependencies)
  3. Decide the goal experience the integrated version shows
  4. Decide how many folders to place in between, limiting the element that increases in each folder to one
  5. Decide the mock → real stages (only the last 1–2 folders are real)
  6. Spell out the "won't-do" items in a list
  7. Get the user's confirmation before entering implementation

Completion checklist

  • Each folder is basically 2 files: the entry point + README.md
  • No shared module (e.g., utils.py) exists
  • No package marker (e.g., __init__.py) is placed
  • The top of each entry point states "what to learn" and "the run command"
  • The showcase runs in each entry point's direct-execution block
  • The mock-only folders need no external dependencies (API keys, etc.)
  • Folders that use real external services have a .env.example
  • Each README has "run command", "actual example output", and "where to go next" sections
  • An abstract base class exists only when multiple concretes share a common interface
  • The tool layer and external-call layer do not throw exceptions and return ERROR strings
  • What is needed via a dependency-install command is stated in the README
  • When adding to existing material, not a single line of existing files was touched (except when permitted)

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.