Badges
adrkit ships no badge service and no adr badge command. Both badges below are a
recipe over JSON adrkit already emits, rendered by shields.io and served from
your repository (ADR-0025).
Corpus size badge
Section titled “Corpus size badge”How many decisions are on record. This is the adoption signal with evidence behind it: a reader can click through and count them.
Publish adr lint --json (see Publish the reports
below — the same workflow emits both files), then:
[](./docs/adr)$.checked is every record the corpus contains, whatever its status — a
superseded decision is still a decision that was recorded.
Corpus status badge
Section titled “Corpus status badge”The honest status badge already exists: run adr check in a workflow and use
GitHub’s own badge for it.
[](https://github.com/OWNER/REPO/actions/workflows/adr.yml)Its claim is past-tense and attributable — the last run of this workflow concluded X — with the run, its date, and its logs one click away. That is the property to look for in any status badge, including the one below.
ARB queue depth badge
Section titled “ARB queue depth badge”How many decisions are awaiting review. This is the number no other tool can
produce for you, and it comes straight from adr queue.
The workflow below publishes the JSON read by this badge:
[](./docs/adr)Replace OWNER/REPO, plus the branch and path if you changed them.
Publish the reports
Section titled “Publish the reports”Add a workflow that regenerates both reports whenever the corpus changes. Each file is the command’s verbatim JSON — adrkit defines no badge format:
name: ADR queue badge
on: push: branches: [main] paths: - 'docs/adr/**' # deliberately NOT .adrkit/**, or this re-triggers itself workflow_dispatch:
permissions: contents: read
jobs: regenerate: runs-on: ubuntu-latest permissions: contents: write steps: # Pin actions by commit SHA, not by tag: a tag can be moved, and this job # holds a token that can write to your default branch. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Pin the CLI version too. `npx @adrkit/cli` without a version resolves at # run time, which puts whatever npm serves that day inside a write-capable job. # Nothing will tell you when this pin ages — Dependabot does not read inline # `npx` versions — so bump it when you upgrade. This page always shows the # current release. - run: | mkdir -p .adrkit npx @adrkit/cli@0.13.0 queue --format json > .adrkit/queue.json.tmp npx @adrkit/cli@0.13.0 lint --json > .adrkit/lint.json.tmp
# A truncated or malformed write renders as `no result` on the badge, which # reads as a bug in your tooling. Fail here instead of committing it. - name: Validate before publishing run: | # `type(x) is int`, not isinstance: bool subclasses int in Python, so # isinstance would accept `{"totalItems": true}` as valid. python3 -c "import json,sys; d=json.load(open('.adrkit/queue.json.tmp')); sys.exit(0 if type(d.get('totalItems')) is int else 'totalItems missing')" python3 -c "import json,sys; d=json.load(open('.adrkit/lint.json.tmp')); sys.exit(0 if type(d.get('checked')) is int else 'checked missing')" mv .adrkit/queue.json.tmp .adrkit/queue.json mv .adrkit/lint.json.tmp .adrkit/lint.json
- name: Commit when the report changed run: | # `git diff` alone cannot see an untracked file, so on the very first # run it would report "no change" and never publish anything. Compare # against HEAD, and stage the path explicitly — `commit -am` does not # stage a new file, and would sweep in unrelated tracked edits. git add .adrkit/queue.json .adrkit/lint.json if git diff --cached --quiet -- .adrkit; then echo "Reports unchanged; nothing to commit." exit 0 fi git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git commit -m 'chore(adr): refresh corpus reports [skip ci]' git pushAfter the workflow runs, a wrong URL
renders resource not found and a wrong query renders no result, so a mistake
is visible rather than silently wrong — but note that a correct URL renders
resource not found too when the workflow has not published the file yet. Check
the workflow before you suspect the URL.
Why depth, and not deadlines
Section titled “Why depth, and not deadlines”Queue depth depends only on the corpus: adr queue selects items whose
status is proposed. SLA state depends on the calendar — an item crosses its
deadline with no commit at all. A badge over deadlines would therefore need a
scheduled rebuild, producing a bot commit every day whether or not anything
happened, and would quietly go wrong between rebuilds. Depth costs one workflow
run per corpus change and stays true between them.
If you want deadline pressure surfaced, use the queue Action instead — it maintains a GitHub issue that people actually receive notifications about.
What adrkit will not do
Section titled “What adrkit will not do”- No hosted badge endpoint. It would add an uptime dependency to your README, put a computed surface on the origin that serves the canonical schema, and make badge renders a de-facto record of who uses adrkit.
- No
adr badgecommand.adr queue --format jsonalready emitstotalItems; a command that reformatted it would be public API to maintain forever for no added truth.