How the Generation Pipeline Works
An engineering breakdown of the SupportPages pipeline: project detection, section suggestion, article recommendation, generation and staleness checks.
The first version of this pipeline shipped on 2025-12-10: seventy-three lines of shell wrapped around a single claude -p call. It did not write help articles at all. Pointed at a repository, it produced a description of what the project was - a short overview, some metadata, nothing a reader would ever see. Article generation was bolted onto the end of that two days later. A summariser has no concept of a set, and neither did the thing that grew out of one.
The fix was not a better prompt. It was admitting that "write documentation for this repository" is four different jobs that have to happen in order.
The stages, in order
Detection runs once per project. It works out what the codebase is - framework, routing conventions, where views live, what the design tokens are, which fonts, what the brand colours are - and caches the result. Everything downstream reads from that cache rather than rediscovering it, which is why the second article costs a fraction of the first.
Section suggestion proposes the help centre's shape before any article exists. This is the stage the naive version skipped and the reason it failed. Deciding "these are the six areas this product needs documented" is a different kind of judgement from writing a page, and doing it first means every subsequent article knows where it belongs and what its neighbours cover.
Recommendation proposes specific article topics within that structure, with coverage accounting - it knows what has already been recommended and what already exists, so it fills gaps rather than duplicating. This is the stage that stops a help centre acquiring three separate explanations of the same thing.
Generation writes an approved topic into an actual article: prose plus deliberately-chosen mockups, in one pass. Choosing which steps benefit from a screenshot happens here rather than as a separate pass, because that decision depends on what the prose ended up saying.
Update checking runs continuously afterwards, comparing merged pull requests against published articles and queueing anything that looks contradicted.
The bit that makes it maintainable
Every one of those stages is a skill - a self-contained instruction set with its own scripts, invoked headlessly inside the analyzer container. Rails does not talk to a model at any point. It writes context into /input, starts a container, and parses what comes back out of /output:
# the shape every job shares
docker run --rm \
-v "$repo:/repo" -v "$input:/input" -v "$output:/output" \
rtfm/claude-analyzer:<skills-ref>-<digest> \
generate_article_skill.sh
Adding a capability means writing a new skill and a thin wrapper, not a new integration. That has turned out to matter more than any other architectural decision here - the walkthrough pipeline exists because it could reuse the mockup machinery from article generation rather than needing its own.
The skills themselves are vendored from a separate repository at a pinned tag, and image tags encode that tag plus a digest of the build context. So a project can pin an older skills version and keep getting identical behaviour while everyone else moves forward, which sounds like an edge case and turns out to be the thing that makes upgrades survivable.
The stages are partly an accident
Splitting into stages was right. Splitting into exactly these stages was partly an accident of the order we discovered the problems in.
Detection does too much. Branding, structure and prose-style analysis are three unrelated jobs that happen to run in the same container invocation because it was cheaper that way, and the coupling means re-running one re-runs all three. Refreshing brand colours should not re-derive the routing map.
Section suggestion and recommendation are also more tightly bound than they look. Recommendations are generated per section, which is correct, but it means a genuinely cross-cutting article - one that spans four sections - has no natural home and tends not to get proposed at all. That gap is real and I do not have a clean answer for it yet.
The bigger regret is that the pipeline is one-directional. Nothing downstream feeds back up. Articles that turned out to be useless, recommendations that were rejected, questions readers asked that nothing answered - all of that is recorded, and none of it currently influences the next recommendation run. Closing that loop is the most valuable unbuilt thing on the list.
The general shape
If you are building something similar, the transferable lesson is the one that cost us the most to learn.
Structure before content. Any system that generates a set of things needs a stage whose only job is deciding what the set should contain, and that stage must run before anything is written.
About the Author
Simon Moxon has been building SaaS companies since 2009. He's scaled teams to 20+ people, hit £2m ARR, and learned most of the lessons the hard way. Now he's building SupportPages.io - help docs that write themselves when you ship code. He writes about what's changed in SaaS and what hasn't.