POC: agentic documentation automation (jaiph) - #2
Open
Efeguclu1 wants to merge 1 commit into
Open
Conversation
Proof-of-concept using jaiph + the documentation-writer skill + Claude to (A) detect/fix doc drift and (B) generate docs from the codebase. Includes a drift detector with mocked tests, a multi-subject generator, three sample generated pages, and a full writeup in POC-RESULTS.md. Not wired into CI yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POC: Agentic documentation automation for Fablo
Question this POC set out to answer: can we keep Fablo's documentation
correct and up to date automatically, using AI agents driven by
jaiph workflows in CI?
Answer: yes. Both halves of the problem were built and verified against the
real repository — detecting/fixing doc drift, and authoring new docs from the
codebase. Details and evidence below.
1. How it works — three layers
.jhfiles) that orchestrates coding agents. v0.10.0.documentation-writerskill (Diátaxis framework), embedded verbatim into the agent prompt.agent.backend = "claude").jaiph runs the agent, the skill directs the agent, the agent writes the doc.
GitHub Pages is not part of generation — it is only the hosting layer for the
final site, and Fablo already has it wired (
docs/CNAME→fablo.io).2. Two tracks, both proven
Track A — Drift sync (keep existing docs current)
Goal: when code changes, catch docs that have gone stale, and fix them.
docs-drift.jh— report-only detector. Gathers agit diffof the source surface (
src/,fablo.sh,docs/schema.json) since a basecommit, feeds it plus
SUPPORTED_FEATURES.mdto the agent, and returns astructured verdict:
{ needs_update: boolean, stale_rows, summary }.docs-drift.test.jh— deterministic unit tests that mockthe scripts and the agent, so the workflow logic is verified in CI with no
LLM call and no cost.
check → if drift, agent rewrites the doc → write to disk; idempotent — a second run makes no change). Kept out of therepo since it edits files; it folds into the CI fix step.
Evidence (live runs against this repo):
HEAD~10..HEAD)needs_update = false— correctly saw the recentmysqlCA-DB change is already covered; did not false-alarm on version bumps / path fixesneeds_update = true, pinpointed exactlyCA DB - MySQL(✕→✓, v2 & v3), citing the type-union diff as evidencejaiph test(mocked)The detector discriminates real drift from noise, and the boolean is reliable
enough to gate a CI job.
Track B — Generation (author new docs from the codebase)
Goal: produce real documentation pages, not just detect drift — the basis for
a proper docs site.
generate.jh— a reusable enginegenerate_page(out_path, brief, source)that applies the
documentation-writerskill to any source + brief;default()wires three real Fablo subjects to it. Add a subject = one gatherer script +
three lines. Output →
out/(touches no real docs).skills/documentation-writer.md— the skill,fetched verbatim from
github/awesome-copilot.Evidence: live runs produced three real pages spanning different repo
areas and two Diátaxis types — each fact-checked against its source:
out/configuration.mddocs/schema.json+sample.jsonsolo/raft/BFT, logleveldebug/info/warn); caught theccaasconditional; honest thathooksis out of scope. No hallucinated fields.out/cli-commands.mdfablo.shusage +src/commands/fablo.sh(init,generate,up,down/start/stop,reset,prune,recreate,chaincode(s) …,channel,snapshot,restore). No invented commands.out/getting-started.mdfablo.sh+initcommandEach page is a single agent call (~30–65 s).
3. Honest limitations / open questions
validated and accurate. Tutorial and Explanation — longer, more prose, less
fact-anchored — have not been exercised; that is where the remaining quality
risk sits, so those pages will need closer human review.
propose outline → await approval → write." For an unattended pipeline we
pinned type/audience/goal/scope up front and told it to proceed in one pass.
A real deployment should keep a human-review gate — which the PR-based CI
flow provides naturally.
jaiph runexecutes in Docker and auto-detectsthe workspace as the
.jh's folder, which excludes the repo root /.git.POC runs used
--unsafe --workspace ... CI must either run unsafe in therunner or mount the repo root.
claudebackend needs credentials + a writableCLAUDE_CONFIG_DIR; local runs use the developer's authenticated CLI. CI needsan API key wired as a secret.
codexis an alternative backend.(~15–65 s, a few cents). The
needs_updateboolean gate means the expensivefix/generation step only runs when there is actually drift.
4. Recommended path to production
docs-driftonpush/PR (or nightly); when
needs_update = true, it runs the fix stage andopens a pull request with the doc change. Ship it opt-in / non-blocking
until trusted. The mocked tests run on every PR for free.
generate.jhwith more subjects toauthor the full set of pages (a Reference set first, then Tutorials/How-to),
review the output by hand, then point the existing
fablo.ioPages setup atthe generated content (optionally via a static-site generator for polish).
Track 1 delivers value immediately with the least risk; Track 2 is the bigger
"real docs site" investment and can follow once Track 1 is trusted.
5. Reproduce it
Requirements:
jaiphv0.10.0+ on PATH, an authenticatedclaudeCLI, run frominside the Fablo git repo.
6. File inventory
docs-drift.jhdocs-drift.test.jhgenerate.jhskills/documentation-writer.mdout/.jaiph/SKILL.md= language reference;runs/are gitignored)