Clara and GitHub
On this page
Clara keeps the board in the repository, so most of what it does with GitHub is git: commits and branches link to tickets, and a merged commit can close one. On top of that, Clara writes GitHub Actions workflows that check pull requests, keep the board in step with the base branch, work agents' tickets, publish the board and post a digest.
Clara needs no GitHub account for any of this on your machine. The hosted board, which lets a team sign in with GitHub and edit the board on the web, has a page of its own: HOSTED.md.
Linking and closing: clara sync
clara sync # pull, link, close, commit the board
clara sync --dry-run # say what it would record, change nothing
clara sync --push # push the branch after committing
clara sync:
- Pulls, when the branch tracks a remote one, only ever by fast-forward. Your own work is never stashed.
- Links each commit and branch that names a ticket, such as a branch
web-12-sign-in-linksor a commitWEB-12: send the link, to that ticket. - Moves a ticket to
donewhen a commit whose message sayscloses WEB-12,fixes WEB-12orresolves WEB-12is on the base branch. It is credited to whoever merged it. - Commits the changes in
.clara, and only those.
Each commit is recorded once, so sync can run any number of times. A ticket reopened by hand is not closed again by the same commit, and a revert closes nothing.
Git hooks
clara hooks install
clara hooks remove
Installs post-commit and post-merge hooks that run clara sync --no-pull --no-commit --quiet, so the board links your commits as you make them. The hooks never stop git.
The badge and the static board
clara badge --out docs/badge.svg # a sprint's progress, or the open tickets, as an SVG
clara export --static --out site # the board as a read-only website
The static board is Clara's web app with a snapshot of the board in its page: the board,
backlog, sprint, graph, activity, docs and insights, with filters and the replay. Nothing on
it can be changed, it makes no network requests, and any static host can serve the folder. It
holds only what the repository holds, never runs, plans or undo history from .clara/.local.
The workflows: clara github setup
clara github setup # validate and sync
clara github setup publish digest # the ones you name
clara github setup all # all six
This writes workflows into .github/workflows/clara-<name>.yml. It commits nothing: read them,
then commit and push them. It never writes over a workflow you changed, unless --force.
Each workflow runs clara github action <mode> from npm at the exact version of Clara that
wrote it, so a workflow written by a build that was never published cannot start. Every
action is pinned to a commit, every job has a timeout and only the permissions it needs, and no
two runs of one workflow race. A workflow that needs a secret or a setting the repository lacks
says so in its log and passes.
There are six:
| Workflow | When it runs | What it does | Permissions |
|---|---|---|---|
validate |
Each pull request | Runs clara doctor on the pull request's board and keeps one comment saying what it finds and which tickets merging it closes. Fails only on a doctor error. |
contents: read, pull-requests: write |
sync |
Each push to the base branch, or by hand | Applies the merge rules as clara sync does, commits the board as github-actions[bot] and pushes it. Its own commit never starts another run. |
contents: write |
routines |
Each day at 05:17 UTC, or by hand | Makes the tickets the board's routines are due and commits them. | contents: write |
work |
Every hour, or by hand | Works the tickets of agents whose profile says runtime: actions, then pushes each branch and opens its pull request. |
See Work. |
publish |
When the board changes on the base branch, after each sync, or by hand | Builds the static board with its badge and deploys it to GitHub Pages. | build: contents: read, pages: read; deploy: pages: write, id-token: write |
digest |
Each weekday at 09:00 UTC, or by hand | Posts the standup to a webhook; started by hand, it can post the sprint's summary. | contents: read |
What each needs from you
| Workflow | Needs |
|---|---|
validate |
Nothing. A pull request from a fork gets the job's summary only, as its token cannot comment. |
sync, routines |
A protected base branch must let GitHub Actions push. |
work |
A repository secret with an agent key: ANTHROPIC_API_KEY (Claude Code), OPENAI_API_KEY (Codex) or GEMINI_API_KEY (Gemini CLI). Settings > Actions > General must allow GitHub Actions to create pull requests. |
publish |
Settings > Pages, with GitHub Actions as the source. Until then the site is built, not deployed. |
digest |
A CLARA_WEBHOOK_URL secret: an https address for Slack, Discord or any service that takes { "text" }. |
The token every workflow uses is the workflow's own GITHUB_TOKEN. You do not create it.
Work
Agents on GitHub Actions run in two jobs, so no agent can reach a token that writes to the repository:
- work has
contents: readand no token in its environment. It installs the agent CLIs whose keys are set, works the ready tickets asclara work --oncedoes, trusting the commands the base branch holds, and keeps what they did as an artifact for one day. - land runs no agent and has
contents: writeandpull-requests: write. It checks the artifact as it would a stranger's: the board's commit may change only the board's records, and each branch must be the one Clara names for its ticket. Then it pushes each branch, opens a pull request whose title says(closes WEB-12), and pushes the board.
It works only what the base branch holds, never a pull request's code. Agent runs are billed by
their vendor. A pull request opened with the workflow's token starts no other workflow; to have
your CI run on it, pass a GitHub App's token as GITHUB_TOKEN in the land job.
Claude Code's adapter has run against the real Claude Code; the others are written from each agent's documentation and not yet run against the real program (CONDUCTOR.md).
The Action
The workflows run Clara from npm. You can also use Clara's composite action directly:
- uses: sherwinvishesh/clara/action@v1 # or a commit, to pin one version
with:
mode: sync
mode is one of validate, sync, routines, work, publish or digest. The action
runs clara github action <mode>, the same command the workflows run, so what it does on
GitHub is what you can run and test on your machine. token defaults to github.token.
action/action.yml lists every input and output.
clara github action refuses to run outside GitHub Actions.
Status
Linking, closing, the hooks, the badge, the static board, the Action's modes and the workflow files are built and tested on this machine. Clara's own repository has workflows that validate pull requests, sync by hand and publish its board with the Action built from its checkout; they have not yet run on GitHub, as the repository is private for now. See STATUS.md.