Skip to content

Latest commit

 

History

History
83 lines (66 loc) · 3.86 KB

AGENTS.md

File metadata and controls

83 lines (66 loc) · 3.86 KB

Agent instructions

Layout

  • .github/workflows/: reusable workflows (workflow_call) consumed by other repositories pinned to a commit SHA. Several also run on push and pull_request here, so this repository lints itself with them.
  • .github/actions/<name>/: actions called by those workflows. Most are Node actions (using: node24, main: dist/index.js) built from TypeScript. setup-actionlint, attest-release-assets and publish-release-assets are plain composite actions with no source in src/.
  • src/actions/<name>/: Node action source. workflow.ts exports the input Schema and run, so tests can import them. main.ts decodes inputs with ActionInputs.decodeInputs, calls run and hands the program to ActionRuntime.runAction.
  • src/action/: shared action runtime (inputs, outputs, annotations, GitHub commands). src/services/: shared services such as CommandExecutor.
  • tests/<name>.test.ts: one file per action, using helpers from tests/support.ts and fixtures in tests/fixtures/.

Workflow contracts

  • A workflow's inputs, secrets, outputs and job names are a public contract. Renaming or removing one breaks callers, and a job name change also changes their required check context (<caller job id> / <job name>). Call that out and update README.md when a contract or documented behaviour changes.
  • Reference actions in this repository with uses: $/.github/actions/<name> so they resolve from the same commit as the workflow. .github/actionlint.yaml ignores the error actionlint 1.7.12 still raises for this syntax.
  • Pin third-party actions to a full commit SHA with a # vX.Y.Z comment. Renovate (timmo001/renovate-config) updates them, and updates tool versions marked with a # renovate: comment.
  • Every job sets timeout-minutes.

Node actions

To add one:

  1. Create src/actions/<name>/workflow.ts and main.ts following an existing action, failing with Annotations.ActionFailure.
  2. Add the action to the actions list in scripts/bundle.ts.
  3. Add .github/actions/<name>/action.yml pointing at dist/index.js.
  4. Run mise run bundle and commit the generated dist/index.js.

The bundles are committed. After changing src/, package.json, bun.lock or tsconfig.json, run mise run bundle, or bundle:check fails. sync-action-bundles.yml also rebuilds them on pull requests. Upkeep runs mise run bundle itself when it pushes a dependency update to master.

Tasks

mise.toml pins Bun and Node and is the only place tasks are combined. package.json scripts each run one command; don't add aggregates there.

  • validate is the full suite CI runs in validate-actions.yml.
  • The tests need bsdtar (libarchive-tools) and Python's packaging module on the system, as CI installs them with apt.
  • To add a check, add its package.json script, a mise task that runs it, and that task to validate.

Internal workflows

Not called outside this repository:

  • validate-actions.yml: runs mise run -c validate and smoke-tests a bundled action through $/ syntax.
  • sync-action-bundles.yml: rebuilds the action bundles and commits them to the pull request.
  • renovate-automerge-any.yml: enables automerge on Renovate pull requests once validate-actions.yml passes.
  • publish-hk-base.yml: packages hk/ with mise run hk:package and attaches hk-base@<tag>.0 to each release. Keep hk/base.pkl in step with lint-general.yml, check-only, with no pre-commit hook.

Other workflows are public. Code search timmo001/workflows/.github/workflows/<name> for callers before changing or removing one, and delete what nothing calls.

Synced files

.agents/skills/ and skills-lock.json are synced from timmo001/skills and other skill sources. Don't edit them here; change the source repository. The exception is workflows-* skills, which this repository owns.