Guidance for AI coding assistants working on this .github repository.
Centralized defaults and automation for all benhigham GitHub repositories:
- Community health files — inherited by repos without their own (CODE_OF_CONDUCT, SECURITY, SUPPORT, etc.)
- Reusable workflows — called by other repos via
workflow_call - Templates — issue and PR templates
.github/
actions/
claude-invoke/ # Composite action: wraps claude-code-action with org-standard config
setup-node-pnpm/ # Composite action: pnpm + Node.js setup with caching
setup-terraform/ # Composite action: Terraform toolchain via mise
workflows/
lint.yml # Lint and format check on PRs and pushes to main
release-changesets.yml # Reusable: versioning and npm publishing via Changesets
ISSUE_TEMPLATE/ # Issue form templates
pull_request_template.md # Default PR template
FUNDING.yml
.claude/
commands/ # Reference command files — copy to per-repo as needed
renovate-review.md # Renovate dependency PR review
test-gen.md # Generate missing tests for PR changes
security-review.md # Security-focused PR review
docs-sync.md # Keep docs in sync with code changes
respond.md # @claude mention handler
triage.md # Issue triage and labelling
release-notes.md # Generate release notes
quality-audit.md # Weekly code quality sweep
dependency-audit.md # Dependency security audit
docs-drift.md # Documentation freshness check
agents/
workflow-reviewer.md # Subagent: review workflows for pitfalls and convention adherence
skills/
workflow-scaffold/ # Skill: scaffold new workflows and composite actions
update-command-file/ # Skill: create/update .claude/commands/*.md files
settings.json # Claude Code plugins and hooks (auto-format, sensitive file protection)
.mise.toml # Tool versions + task definitions (mise)
lefthook.yml # Git hook config (pre-commit)
.yamllint.yml # yamllint rules
.markdownlint-cli2.yaml # markdownlint rules
.prettierrc.yaml # Prettier config
.prettierignore # Prettier ignore patterns
CODEOWNERS # GitHub code ownership rules
GOVERNANCE.md # Project governance policy
renovate.json # Renovate dependency update config
- YAML for workflows and configurations
- Markdown for documentation and templates
- pnpm as the package manager (not npm or yarn)
- Changesets for versioning and releases
- Conventional Commits (
feat:,fix:,chore:,docs:, etc.) - mise as the tool manager and task runner
- lefthook for git hooks (pre-commit linting and formatting)
- Renovate for automated dependency updates (requires Renovate GitHub App; configured via
renovate.jsonat repo root)
mise install # Install all tool dependencies (actionlint, jq, lefthook, prettier, yamllint, markdownlint-cli2)mise run check— run all checks (format + lint)mise run fmt— auto-format YAML and Markdownmise run lint— run all lintersmise run lint:actions— actionlint onlymise run lint:yaml— yamllint onlymise run lint:markdown— markdownlint-cli2 onlymise run lint:markdown:fix— auto-fix Markdown lint violations
Lefthook runs formatting and linting automatically on pre-commit.
Composite actions are steps, not jobs — the caller controls the job shape, permissions, and timeout.
Reference them with a pinned SHA ref: benhigham/.github/.github/actions/{name}@<sha>
SHA pinning: Always pin to a specific commit SHA rather than
@main. Exception: this repo's own workflows may reference its composite actions via@mainas a self-reference, since the SHA is not available until after merge.
Wraps anthropics/claude-code-action with org-standard config (tools, plugins, validation).
- uses: benhigham/.github/.github/actions/claude-invoke@<sha>
with:
oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
command: quality-audit # uses .claude/commands/quality-audit.md if it exists
max-turns: "30"
additional-permissions: |
actions: readBehaviour:
- Fails fast if
oauth-tokenis empty - Fails fast if neither
commandnorpromptis provided - Validates
commandname (alphanumeric, hyphens, underscores) andmax-turns(positive integer) - If
commandis set and.claude/commands/{command}.mdexists → invokes as/{command} {command-args} - If
commandis set but file is missing → falls back toprompt(fails if empty) - Otherwise → uses the
promptinput directly
Key inputs:
| Input | Default | Notes |
|---|---|---|
oauth-token |
— | Required. Forward the secret explicitly |
command |
'' |
Command name (without .md) |
prompt |
'' |
Inline prompt fallback |
command-args |
'' |
Appended after /{command} |
max-turns |
'20' |
Tune per concern (review: 20, quality: 30) |
allowed-tools |
Read,Glob,Grep,Edit,Write,Bash(pnpm:*),Bash(git:*),Bash(gh:*),WebSearch,WebFetch |
Override to change the tool allowlist |
extra-tools |
'' |
Appended to allowed-tools |
additional-permissions |
'' |
YAML string forwarded to claude-code-action |
track-progress |
'true' |
Visual progress comments |
classify-inline-comments |
'true' |
Filter test/probe inline comments |
Baked-in plugins: context7@claude-plugins-official, security-guidance@claude-plugins-official
Note: The @claude mention handler and code-review workflow call anthropics/claude-code-action
directly — the former is event-driven (no prompt needed), the latter uses different plugins.
- uses: benhigham/.github/.github/actions/setup-node-pnpm@<sha>
with:
# Zero-config: reads Node version from package.json by default
# Override with node-version for an explicit version:
# node-version: '24'
# Or point to a different file:
# node-version-file: '.nvmrc'
cache-dependency-path: "**/pnpm-lock.yaml" # optional, default '**/pnpm-lock.yaml'
install: "true" # optional, default 'true' — runs pnpm install --frozen-lockfile- uses: benhigham/.github/.github/actions/setup-terraform@<sha>
# No inputs — reads tool versions from .mise.toml in the repo.claude/commands/*.md files in this repo are reference implementations. They are not automatically
inherited — copy what you need to your repo's own .claude/commands/ directory and customise for your stack.
When claude-invoke receives command: foo:
- If
.claude/commands/foo.mdexists in the calling repo → runs/foo {args} - If not → falls back to the
promptinput
This means zero-config onboarding (use prompt: inline) with a clean migration path to command files as
repos mature.
Skills in .claude/skills/ provide guided workflows for common tasks in this repo.
Scaffolds new reusable workflows (workflow_call) and composite actions with org conventions
(concurrency groups, timeouts, permissions, SHA pinning, input validation). Includes templates
and pointers to real examples in this repo.
Creates or updates .claude/commands/*.md files. Encodes the command file structure (opening line,
context section, steps, output), naming rules (^[a-zA-Z0-9_-]+$), and conventions like $ARGUMENTS,
severity levels, and branch naming. Instructs the agent to read existing command files for style.
Subagents in .claude/agents/ are specialised reviewers that can run in parallel.
Reviews .github/workflows/ and .github/actions/ for:
- Missing
timeout-minutesor overly broad permissions - Unpinned action versions (should be full SHA, not
@v4or@main) - Injection risks —
${{ inputs }}or${{ github.event }}inrun:blocks - Missing or incorrectly namespaced concurrency groups
- Secrets handling (explicit forwarding, least-privilege
GITHUB_TOKEN)
Claude Code hooks in .claude/settings.json run automatically during sessions:
- PostToolUse (Write|Edit): Runs
prettier --writeon YAML/Markdown files andmarkdownlint-cli2 --fixon Markdown files after every edit - PreToolUse (Edit|Write): Blocks edits to
.envand.env.*files (e.g..env.local,.env.production) andsettings.local.json— these may contain secrets or local permission overrides and should be edited manually
Claude Code plugins are enabled in .claude/settings.json via enabledPlugins for local
sessions. The claude-invoke composite action has its own plugin list (see Baked-in plugins
above). All plugins are from anthropics/claude-plugins-official:
- code-review — automated code review with confidence-scored bug detection and CLAUDE.md compliance checking
- code-simplifier — identifies opportunities to simplify and refine code for clarity and maintainability
- commit-commands — conventional commit workflow (commit, push, PR creation)
- context7 — live documentation lookup for GitHub Actions, mise, Changesets, pnpm, and other tools used in this repo
- github — GitHub API access (automatic in GitHub Actions; locally, requires
export GITHUB_TOKEN=$(gh auth token)) - pr-review-toolkit — comprehensive PR review with specialised agents (code quality, test coverage, error handling, type design)
- security-guidance — security reminders for workflow editing (injection, permissions, secrets)
- Use
workflow_callfor reusable workflows - Always include
timeout-minuteson jobs - Use concurrency groups:
${{ github.workflow }}-${{ github.ref }}(or PR number for PR-triggered workflows). Reusable workflows should prefix the group (e.g.release-${{ github.workflow }}-${{ github.ref }}) to namespace separately from the caller's concurrency groups - Minimal permissions (declare only what's needed)
- kebab-case for input names
- Use environment variables (not
${{ inputs }}or${{ github.event }}) inrun:andgithub-scriptblocks to prevent injection
<type>: <description>
Types: feat, fix, docs, chore, refactor, test, ci, perf
Community health files and templates are inherited by other repositories. Edit carefully — breaking changes affect all repos without their own versions.
README.md, AGENTS.md, renovate.json, and workflow definitions. Other repos call workflows explicitly;
changes here require consumers to update their references if inputs change.