Infrastructure and template sync
This page is for maintainers of a package that uses the kit. It explains which files the kit owns and how it keeps them current. scaffold writes the standard infrastructure once, and update keeps it current on a schedule. For what the infrastructure contains, see test infrastructure, benchmarking and AD tooling.
Managed and package-owned files
Every file the kit writes is one of two kinds.
Managed files are rewritten from the templates on every sync. They carry a
MANAGED by EpiAwarePackageTools.scaffoldheader. Do not edit them by hand.Package-owned files are written once and never overwritten. They are yours to edit.
A few files are a hybrid. The kit manages a block between markers, and keeps anything you write outside them.
Which files are which
Managed: the CI caller workflows, the docs build (docs/make.jl, docs/pages.jl, and the VitePress theme, config and components), the formatter and pre-commit config, and the coverage config.
Package-owned: the unit tests, the QA config values, docs/docs_config.jl (see Documentation layout), the README body, LICENSE, CITATION.cff, and the docs source pages.
Hybrid (managed between markers): the README badge block, the README standard sections (Contributing, How to cite, Code of conduct), the .gitignore standard rules, and the docs pointers in AGENTS.md and CLAUDE.md. The managed "How to cite" section points at your CITATION.cff, so GitHub shows a "Cite this repository" widget.
Comments in Project.toml
Project.toml is package-owned, but a sync warns if it carries a comment. Pkg drops comments the next time it rewrites the file (Pkg.add, Pkg.compat!, a dependency bump).
Agent files
AGENTS.md links the docs an agent should read: Package standards, Test infrastructure, this page, and the package's own docs. CLAUDE.md points at AGENTS.md. Neither restates a standard, so neither drifts from it.
Both carry a managed block between <!-- epiaware-standards:start MANAGED by EpiAwarePackageTools.scaffold --> and <!-- epiaware-standards:end -->. Put your own notes after the end marker. Change the block itself in the kit's templates/AGENTS.md and templates/CLAUDE.md.
Marker matching
The start marker is matched on its prefix. A package carrying an older, longer form is rewritten to the current one on the next sync.
Overriding a managed file
To keep your own version of a managed file, put EPIAWARE_MANAGED_OVERRIDE in a comment anywhere in it. update then leaves the file alone and lists it under preserved in the manifest.
# EPIAWARE_MANAGED_OVERRIDE: this package needs its own test matrix.The marker is case-sensitive. Remove it to hand the file back to the kit. An overridden file no longer receives kit fixes, so prefer the supported hooks where they cover the need: package-owned config values, the marker-delimited regions, and the ad, benchmarks, downgrade_compat and unregistered_sources flags.
What the marker does not cover
scaffoldwithforce = trueignores the marker, so a new package always starts fully managed.Marker-delimited regions in package-owned files are refreshed on every sync regardless: the README badge block, the README standard sections, the
.gitignoremanaged block, theCLAUDE.mdstandards block, and the[workspace]stanza inProject.toml. Edit outside their markers instead. There is no region-level opt-out.A retired path is deleted on sync even if it carries the marker.
The managed JSON files (
docs/package.jsonand.secrets.baseline) cannot hold a comment, so they cannot be overridden.A mis-cased marker does nothing and the file is resynced.
The two common overrides
test/ad/setup.jl: a package whose ADFixtures registry predates the ADRegistry contract keeps a hand-written driver while it migrates. This file also honours the older marker EPIAWARE_AD_SETUP_OWNED. It is the one file where update warns before overwriting a diverged, unmarked version, because a clobber breaks every AD CI job. Other managed files get no divergence warning, since an adopter on an older kit version always diverges. Mark the files you own instead.
docs/make.jl: the managed version is a thin build_docs entry point that regenerates docs/src/index.md from the README and reads docs/docs_config.jl. A package that keeps a direct DocumenterVitepress build with a hand-written home page marks its make.jl, and update stops migrating it.
What the kit preserves without a marker
Some values in managed files are your configuration. The kit reads them back from the committed repository on every sync, so you do not re-pass them to update.
The reviewer handle, the docs-hosting choice, the benchmark and downgrade-compat opt-ins, Dependabot's action and reusable-workflow pins, and any
with:input you add to a managed CI caller.The Zenodo DOI badge and the licence badge in the README.
The
downstreamslist in.github/workflows/downstream.yaml.
Edge cases
A comment between uses: and with: is kept as the rationale for your own input while the block carries one, and re-rendered from the template otherwise.
The licence badge is rendered from the license field in Project.toml. Pass license explicitly only to change it. A license value outside the supported set stops the sync. A badge label naming an unsupported licence is warned about and rewritten.
Staying in sync
Two workflows keep a package aligned with the kit. A fix made once in the kit reaches every package on its next sync.
Template sync (
.github/workflows/template-sync.yaml) runsupdateon a schedule and on Dependabot updates, and opens or refreshes a pull request when infrastructure has drifted. It runs the latest registered kit release, not the kit'smain.Dependabot (
.github/dependabot.yml) keeps pinned workflow and action references current, daily, with one pull request per ecosystem. Set thejuliaecosystem toweeklyin your copy to slow it down.
A failed sync opens a single template-sync issue, closed by the next clean run. Fix it by re-applying the standard locally, or ask the kit for more flexibility. Hand-editing the managed file does not work, because the next sync reverts it.
A sync with warnings opens a single sync-warnings issue, closed by the next run without any. To silence a warning you have decided not to act on, add an entry to the package-owned .github/sync-warnings-ignore.toml.
[[ignore]]
match = "reversediff_compiled"
reason = "this package does not support compiled ReverseDiff"match is a substring of the warning text. An entry without a reason fails the sync. The kit never writes this file.
Reusable-workflow pins
Scheduled runs set freshen_reusable_refs = true. Each managed caller moves its pin forward to the newest commit that touched the shared workflow it wraps. It skips a pin it cannot resolve or one that floats on a branch or tag. This is the only part of update that needs the network, so it is off by default.
When a kit release passes a new input to a shared workflow, a caller pinned before that input existed fails until the next scheduled sync. Run the template-sync workflow by hand to fix it sooner.
The template-sync caller wraps the shared EpiAware/.github template-sync workflow. While a sync-warnings issue is open it also lists suppressed warnings, collapsed, with their reasons.
After a sync, read your own docs
<!– EPIAWARE_PROSE_OK: this section names a retired tool to explain the scan, which is the one thing the scan itself cannot tell apart from drift. –>
A sync only changes managed files. Your README and pages under docs/src/ can still describe an older standard, such as telling readers to run JuliaFormatter after the move to Runic.
update scans that prose for retired names (the entries in RETIRED_PATHS, plus tools the standard has moved away from) and lists each in warnings, printed in the sync job log. It never rewrites your text. It cannot catch stale counts, examples or descriptions, so read the pages that cover what the sync changed.
Skipping the scan
Put EPIAWARE_PROSE_OK in an HTML comment in a page that names a retired tool on purpose, and the scan skips that file. Changelogs are never scanned: NEWS.md, CHANGELOG.md and the generated docs/src/release-notes.md.
Registration safety
The managed registrability.yaml caller runs two read-only checks when Project.toml changes, on main, and on demand.
Registrability checks that every non-stdlib
[deps]entry is in General with a version that satisfies your[compat]. A dependency pinned by git in[sources]fails it.The reverse-dependency scan reports which org packages depend on yours and whether their
[compat]admits the new version. It warns by default. Setfail_on_revdep_break: trueon the caller job to make it fail.
Unregistered [sources] pins and the Julia floor
[sources] needs Julia 1.11. Earlier versions ignore it without error.
If your package pins a dependency by git [sources], the kit holds it to Julia 1.11. It detects the pin from the committed environments, or you pass unregistered_sources = true to scaffold or update. It then warns about any [compat] bound or CI leg below 1.11. Other packages can reach Julia 1.10, and their tests.yml matrix includes an lts leg.
Every [compat] bound in test/Project.toml must resolve on every matrix leg. JET has nothing past 0.9.18 for Julia 1.10, so its seeded bound reaches back to 0.9. The kit supports Julia 1.10 from 0.4.0. Versions 0.2.0 and 0.3.0 need 1.11. Widen an older EpiAwarePackageTools = "0.3" bound, or drop lts from julia_versions, before adding the leg.
Why the lts leg still works with path pins
The kit itself is registered, so no managed environment pins it by git. The lts leg runs Pkg.test, which develops the package under test itself, so an ignored [sources] path pin in test/Project.toml does no harm. Jobs that run a managed environment directly (the test/jet and test/ad runners, the docs build and the benchmark suite) need their path pins honoured. They are separate jobs on the current release, not legs of the test matrix.
Release documentation
Versioned docs (stable and vX.Y) are built only when TagBot pushes a release tag with a DOCUMENTER_KEY deploy key. Without the key a package publishes dev docs only.
Why the key is needed
Only a push event at a release tag starts a versioned build. Without the key TagBot tags with the Actions app token, which raises no event. That fallback is refused outright when the tagged commit touches a workflow file. TagBot reads the secret as ssh: to push the tag, and Documenter reads it as DOCUMENTER_KEY to push to gh-pages. Only the tag push needs it, since deploydocs also works with GITHUB_TOKEN.
Adding the deploy key
Do this once per package. It needs repository admin, so scaffold cannot do it.
repo=EpiAware/YourPackage.jl
ssh-keygen -t rsa -b 4096 -m PEM -N "" -C documenter -f /tmp/dk
gh repo deploy-key add /tmp/dk.pub --repo "$repo" \
--title documenter --allow-write
gh secret set DOCUMENTER_KEY --repo "$repo" --body "$(base64 -w0 < /tmp/dk)"
shred -u /tmp/dk /tmp/dk.pubEach of these breaks the deploy silently if wrong.
The deploy key has write access.
The secret holds the private half, base64-encoded on one line.
Each repository has its own keypair. GitHub refuses to reuse a deploy key.
The key is RSA in PEM form.
DocumenterTools.genkeys prints the same two halves to paste by hand.
Release nudges
The managed release-nudge.yaml caller runs weekly and on demand. When main has unreleased commits, it opens a single issue with the next steps. Comment /version patch, /version minor or /version major on a pull request to bump, then comment /register or run the Register workflow. Write the release notes on the GitHub release once it exists (see the release notes convention).
What the nudge issue contains
The caller wraps the shared EpiAware/.github release-nudge workflow. It compares the Project.toml version, the commits on main since the latest release or tag, and, best-effort, the version registered in General. The issue reports the released and Project.toml versions, the number of unreleased commits with a compare link and recent commits, and whether a bump or only registration is outstanding. When nothing is unreleased it closes any open nudge issue.
The issue is never edited in place. A run that finds the state changed, or the issue open too long, closes it with a comment and opens a fresh one. The body never contains a literal @, so it never pings anyone.
Authorship labels
The kit seeds issue forms and a pull request template that ask how each was written. The managed authorship-labels.yaml workflow then labels each issue and pull request bot, ai-supported or human. The forms and template are package-owned, so edit them as you like. A repo that already has its own issue or pull request templates keeps them, and gets only the workflow. Pass authorship_labels = false to scaffold or update to turn the feature off. The choice is recorded in template-sync.yaml, so later syncs keep it.
How each label is chosen
Exactly one label applies, and an edit moves it.
botwhen the author's account type isBot, the login ends in[bot]or-bot, or the body contains "This was opened by a bot".ai-supportedwhen the issue form answer to "How was this issue written?" is "By me, with AI support (I have read and understood it)", or the pull request's "AI tools were used" box is ticked.humanotherwise.
The workflow runs on pull_request_target, so pull requests from forks are labelled too. It never checks out or runs the pull request's code. It reads the event payload and calls the labels API, with only issues: write and pull-requests: write. A missing label is created on first use.
How the kit applies this to itself
The kit manages its own repository like an adopter's, with ad = false because it is a tooling package. A self-drift CI check runs update("."; ad = false) and asserts zero drift. This docs site is therefore a live example of what scaffold writes (see the getting-started note).
Running a sync by hand
using EpiAwarePackageTools
# `update` is public but not exported, so call it qualified.
EpiAwarePackageTools.update(pkgdir(MyPackage))update rewrites only managed files. It returns a manifest of what was created, updated or preserved.