agentleFS
cheyuriycheyuriy/codelabgen/skills/site-assembly/SKILL.md

site-assembly

Skill1 starsChanged 24 days agoMITView on GitHub

How a codelabgen course is assembled into its readable form — generated READMEs and table of contents, run.sh, the glossary, the MkDocs site and its GitHub-compatible rendering rules, the final checks and the commit. Load for the assembly phase and /codelabgen:build.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Not allowed, because GitHub shows them as broken text: !!!

    line 41
  2. Very specific:

    Run from the main session, with --course <dir> on every command:

    line 51

≈ “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

Assembling the course

A course is read in two places: on GitHub (or in an IDE) as plain Markdown, and as an MkDocs Material website. Both must look good. Assembly generates the pages that tie the lessons together, checks everything, builds the site and commits.

What is generated (never edit by hand)

codelabgen toc writes, from the curriculum and lesson specs:

FileContent
README.mdCourse title, description, getting started (.env, ./run.sh, the site), contents with summaries, the sources the course is built on (kept or added by the user; titles and links by type)
<module>/README.md, section READMEsTitle, summary, objectives, lesson list
<lesson>/README.mdSummary, "continues lesson X" note, objectives, links to notes / read-along / code, how to run and test, previous/next
mkdocs.ymlSite config and nav (only pages that exist)
run.sh./run.sh <id>, ./run.sh test <id>, ./run.sh list, ./run.sh site serve
assets/MathJax setup, asciinema player hook and script
GLOSSARY.md, assets/glossary-abbr.mdFrom .codelabgen/glossary.yaml (codelabgen glossary build)

Labels in these files follow the course language. To change their wording, change the generator, not the files.

How Markdown features render

FeatureWritten asGitHubSite
Code shown in the notes<!-- snippet: path#region --> markers, filled by codelabgen snippets syncCode blockCode block with highlighting and a copy button
Links into the code (read-along)[name](../src/…/file.py#L12), #L12-L20 for a rangeOpens the file, highlights the lineOpens the source file
Callouts> [!NOTE], > [!TIP], > [!WARNING], > [!IMPORTANT]Native alertsAdmonitions (mkdocs-callouts)
Mermaid```mermaidNativeNative (Material)
Math$…$, $$…$$NativeMathJax (arithmatex)
Glossary termsA link on first use; definition in GLOSSARY.mdLinkLink, plus a tooltip on every use of the term or an alias
D2 / Graphviz![…](diagrams/x.svg)ImageImage
Recordings![…](generated/x.gif)Animated GIFInteractive asciinema player
Hidden answers<details><summary>…</summary>…</details>NativeNative

Not allowed, because GitHub shows them as broken text: !!! / ??? admonitions, === content tabs, (1)! code annotations, --8<-- includes. codelabgen check render finds them.

Site details:

  • use_directory_urls: false, so relative links and paths work the same as on GitHub.
  • Heading anchors use GitHub's rules, including Cyrillic text (#граф-состояний).
  • Code files are part of the site, so links to ../src/<package>/graph.py work there too.
  • strict: true: any broken link or missing page fails the build.

The assembly procedure

Run from the main session, with --course <dir> on every command:

  1. All lessons done: codelabgen state show shows every lesson done, then codelabgen state phase assembly.
  2. Generate: codelabgen glossary build, then codelabgen toc.
  3. Check: codelabgen check all. Fix every problem in the page that has it. For problems in a lesson's docs, send that lesson back (codelabgen state set <id> verified or readalong with a note) and let its writer fix it, then return here. Problems in generated files mean a generator bug: report it to the user.
  4. Build the site: codelabgen site build must succeed (strict mode).
  5. Commit: codelabgen commit -m "<message>", for example "Course: LangGraph на практике, lessons 1.1–1.3".
  6. Stop the services: codelabgen services down (data volumes stay; ./run.sh <id> starts them again).
  7. Done: codelabgen state phase done. Tell the user how to read the course: the course README.md, ./run.sh site serve, and ./run.sh <id> to run a lesson.

codelabgen site serve starts a local preview at http://127.0.0.1:8000 with live reload. It runs until stopped, so start it in the background only when the user asks for a preview.

Optional tools

codelabgen doctor lists them. Without d2 or dot, diagrams in those formats can't be rendered, so lessons should use Mermaid. Without asciinema and agg, recordings are skipped (verify logs "skipped"), and lessons must not link to recordings that don't exist.

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.