Codecraft

software = science + art + people

AGENTS.md — Project context for AI collaborators

AGENTS.md — Project context for AI collaborators

This file is the single source of truth for working in this repository. CLAUDE.md, GEMINI.md, etc. are thin redirects here. Read this first. The live, tickable task list lives in ROADMAP.md. The exact metadata schema and ID convention live in docs/conventions.md.

What this repository is

A collection of ~124 essays written years ago by Daniel Hardman about software architecture and the craft of programming. They were authored on WordPress, exported, and converted to Markdown. They are published as a Jekyll site on GitHub Pages at codecraft.co (CC BY 4.0).

The repo is mid-transformation: from a date-ordered WordPress blog export into a curated, professional anthology of essays. A sister repo, ../papers, already exhibits the target patterns (categorized index, stable per-item IDs, per-document PDFs, a tested Python toolkit, requirements-checking CI). Much of the work here is porting and adapting that proven system.

The vision (what “done” means)

  1. Reads as a curated anthology, not a blog — categorized table of contents, stable per-essay IDs, no date-driven navigation.
  2. Owns 100% of its images: yours, or AI-generated with full rights. Zero external image dependencies.
  3. No broken links (internal or external), enforced in CI.
  4. Complete, accurate, schema-valid metadata on every essay.
  5. Strong Google indexing posture (structured data, sitemap, canonical URLs, social cards, preserved legacy redirects).
  6. Robust cross-references between sibling essays and robust citation of external sources.
  7. A PDF of every published essay; eventually a curated subset published as a book on Amazon KDP.
  8. A tested Python toolkit (scripts/) + pytest suite (tests/) that proves every goal above. pytest green == publication-ready.

Guiding principles

Decisions already made (do not relitigate without the author)

Open questions (decide when relevant, don’t assume)

Repository layout

*.md                 essays (one file per essay; slug == filename)
index.md / README.md  table of contents (README currently a flat list; to be replaced)
assets/              owned images (target: ALL images live here)
_layouts/            Jekyll layouts (default.html renders essays + comments)
_includes/           Jekyll partials
_config.yml          Jekyll config (minimal remote theme, plugins)
scripts/             durable maintenance/polish toolkit (Python) — see scripts/README.md
tests/               pytest suite that proves the goals — see tests/README.md
docs/                conventions (frontmatter schema, item-id convention)
tools/               LEGACY one-shot migration scripts (1convert.py…). Do not
                     extend; new tooling goes in scripts/.
.github/workflows/   CI (link-check today; requirements-check to be added)
ROADMAP.md           the tickable project plan

Frontmatter schema (summary)

Canonical definition in docs/conventions.md. In brief, each essay’s YAML frontmatter should carry: title, date (original publication), slug, item_id (CC-YYMMOO), tags (1+ from the controlled vocabulary), redirect_from, keywords, abstract, version, revision_date, status (published | retired), optional book: true, optional series, and the existing comments list. Essays are classified by multi-valued tags, not a single mutually-exclusive category — see docs/conventions.md.

Image workflow (case-by-case)

  1. scripts/inventory_images.py → writes assets/image-triage.yml: one row per external <img> (essay, line, URL, host, alt-text, alive/dead, blank disposition).
  2. A human or AI fills disposition per image: own (download & localize), generate (AI replacement + prompt seed), redraw (→ owned diagram), or drop (remove tag, reflow prose).
  3. scripts/apply_image_triage.py executes the manifest.
  4. assets/CREDITS.yml records provenance/rights for every final image (origin, license, and generation model+prompt if AI-made).
  5. Generated art follows the house style guide so the anthology stays cohesive.

How to add or edit an essay

  1. Make only mechanical/structural/metadata changes (see principles).
  2. Keep frontmatter schema-valid (scripts/validate_frontmatter.py).
  3. Never introduce external image URLs; route images through the workflow above.
  4. Run pytest before committing; CI is the backstop.

Conventions for AI collaborators