Skip to content
zadykianPublic

About

Claude Code skills and hooks for work in a GitHub repository, and GitHub Actions that check each pull request against the same rules, released at one version.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

toolkit

Claude Code skills and hooks for work in a GitHub repository, and GitHub Actions that check each pull request against the same rules. The skills plan a change as an issue, commit it in small steps, and land the stack by GitHub's merge. They keep prose short, and the hooks lint each file as Claude edits it. The skills and hooks are a plugin marketplace, zadykian, of five bundles. They and the actions release at one version.

The bundles

Bundle Skill Run as What it does
flow atomic-commits by Claude as it commits Small commits, stacks of small PRs
flow issue /flow:issue [topic] Plans a change, then files the issue
flow ci by Claude as it edits a workflow Short and long jobs, stacks in turn
flow land /flow:land PR... [vX.Y.Z], by hand Lands a stack by merge, tags releases
flow repo-settings /flow:repo-settings, by hand Checks the settings stacks land by
docs writing by Claude as it edits a file The policy for comments and docs
docs trim /docs:trim FILE... Trims comments and docs to the policy
lint split-file /lint:split-file FILE Splits a file over the line cap
lint banned-terms by Claude as it writes code or prose Keeps vague names and fillers out
lint its hooks after each edit, and as Claude stops Run the repository's own lint gates
lean cost /lean:cost [SESSION...], by hand Reports what sessions cost, and why
lean delegate by Claude as it spawns a subagent When to hand off, to whom, the brief
lean fan-out by Claude as it writes a workflow Sizes review by risk, tiers agents
lean its hook before the Workflow tool Denies an agent with no tier
lean context by Claude in a long session Reads by range, checkpoints, compacts
lean wait by Claude as it waits on work Backgrounds work, bounds a wait
lean its hook before the Bash tool Denies an unbounded foreground poll
design grill-me /design:grill-me, or by Claude Interviews you on a plan, in rounds
design grill-with-docs /design:grill-with-docs, by hand Grills, and keeps glossary and ADRs
design domain-modeling by Claude as it names terms Sharpens terms, glossary and ADRs
design codebase-design by Claude as it designs a module Deep-module terms, and seam rules
design tdd by Claude, test-first Red-green slices at agreed seams
design improve-codebase-architecture /design:improve-codebase-architecture, by hand Scans for deepening, then grills

Claude Code names a bundle's skill after the bundle, as /flow:land. Claude also uses a skill unasked where its description fits the task, unless it runs by hand only. flow, docs, lint, lean and design say how each runs, and what a repository adds.

Install

Each bundle, for yourself, from a shell with claude, jq and git:

curl -fsSL https://raw.githubusercontent.com/zadykian/toolkit/main/tools/install | sh

tools/install installs each bundle that the marketplace lists and you lack, and adds the marketplace at its last release where Claude Code lacks it. Run it again for a bundle that a release adds. sh -s -- --scope project in place of sh installs them for the repository of the current directory alone. In a session, one bundle, on Claude Code 2.1.275 or later: /plugin install flow --marketplace zadykian/toolkit.

For everyone who works in a repository, in its .claude/settings.json. Claude Code reads it once the folder is trusted, and fetches the marketplace. It installs no bundle: each person runs tools/install once, as above, and the bundles enabled there load:

{
  "extraKnownMarketplaces": {
    "zadykian": {
      "source": { "source": "github", "repo": "zadykian/toolkit", "ref": "vX.Y.Z" },
      "autoUpdate": true
    }
  },
  "enabledPlugins": {
    "flow@zadykian": true,
    "docs@zadykian": true,
    "lint@zadykian": true,
    "lean@zadykian": true,
    "design@zadykian": true
  }
}

Claude Code updates a third party's marketplace only where autoUpdate is on, or when asked: /plugin marketplace update zadykian. The "ref" holds it at a release, as main may hold changes not yet released: name that release's tag in place of vX.Y.Z.

One skill alone, with gh 2.90 or later, copied into the repository's .claude/skills, where it runs as /land:

gh skill install zadykian/toolkit land --agent claude-code --scope project

gh installs the latest release, or the one a land@v1.0.0 names, and pins it with --pin. It copies no hooks: the lint bundle's come with the plugin alone.

The actions

Action Skill What it does
atomic-commits atomic-commits Warns on a PR's commits, size, stack or title
pr-description atomic-commits Warns on a description off title, Problem, Changes
issue issue Warns on an issue's title or body off its form
banned-terms banned-terms Warns on vague names and fillers that a PR adds

The checks warn and never block. Each annotates its run, writes a job summary and keeps one comment of its own up to date, and its job passes. A check reads the pull request or the issue through GitHub's API alone and checks out nothing, so it runs none of a pull request's code. No input changes a rule: each check holds its skill's own, and links each finding to the rule.

The checks of a pull request run in one workflow, .github/workflows/rules.yml, a step each:

name: rules

on:
  pull_request:
    types: [opened, edited, reopened, synchronize, ready_for_review]

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
  cancel-in-progress: true

permissions: {}

jobs:
  rules:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    permissions:
      checks: read
      contents: read
      pull-requests: write
    steps:
      - uses: zadykian/toolkit/actions/atomic-commits@SHA # vX.Y.Z
      - uses: zadykian/toolkit/actions/pr-description@SHA # vX.Y.Z
      - uses: zadykian/toolkit/actions/banned-terms@SHA # vX.Y.Z

Pin a release says which hash to pin. The edited type checks the title and the description again once they change, and ready_for_review the stack's base once a draft goes ready. pull-requests: write lets each check keep its comment. The concurrency group cancels a pull request's older run once a newer event starts one, as the two would race to create each comment. Files changed shows the warnings of every run on the head, the cancelled ones too, so checks: read lets each check leave out those another run shows.

The issue check takes a workflow of its own, on issues, as no event of a pull request names an issue. Its README shows it.

Each action's README says what it checks, and its inputs.

The templates

Template Skill Path in a repository
pull_request_template.md atomic-commits .github/pull_request_template.md
change.yml issue .github/ISSUE_TEMPLATE/change.yml
config.yml issue .github/ISSUE_TEMPLATE/config.yml

A skill writes a text in its template's form. tools/pin writes each template of the release a repository pins to its path, as Pin a release says. There GitHub offers it to whoever opens a new pull request or issue. The issue form's config.yml turns blank issues off.

The repository's rules

A skill's rules hold in every repository, and it runs as the marketplace ships it. A repository's CLAUDE.md and .claude/rules/ name its own facts, which add to a skill's steps. Such are the checks to wait for, the gates a text passes, or the paths of its generated code. No rule of a skill changes for a repository. Each bundle's page says what facts a repository names.

Versions

One version, X.Y.Z, covers every part: the skills, the hooks and the actions. The marketplace gives it, and each bundle too, as Claude Code updates a bundle only when its version changes. A change need not raise it: commits land on main unreleased, and the last pull request of a stack raises it. It raises:

  • the patch, for a fix, a clearer wording, or any other commit;
  • the minor, for a feat: a new step, argument, input, skill or action;
  • the major, for a break, such as a renamed skill or action, an argument or input changed or dropped, or a step a repository relies on, gone. So is a make target that a repository must now write. A commit marks a break by a ! in its header, or a BREAKING CHANGE: footer. Before 1.0, a break raises the minor.

The largest change since the last release sets the part it raises. Once a raise lands on main, the release workflow tags main's head vX.Y.Z and publishes a GitHub Release. Its notes list the commits since the last release, as breaking changes, features, fixes and other changes. Under a breaking change goes its BREAKING CHANGE: footer, which says what a repository must change. CLAUDE.md says how a change is made and checked.

Pin a release

A repository pins the skills, the actions and the templates to the same release, so that its checks hold the rules its skills teach:

  • the marketplace's "ref" in .claude/settings.json names the release's tag, as Install shows;
  • each action's uses: names the full hash of the tag's commit, with the tag in a comment, as zadykian/toolkit/actions/NAME@SHA # vX.Y.Z. git rev-parse vX.Y.Z^{commit} prints the hash;
  • the pull request template and the issue form in .github/ come from the same tag, and tools/pin writes them.

A released tag is never moved or deleted, and no major tag, such as v1, follows the releases.

Dependabot moves an action's hash and comment, but not the marketplace's ref, which it does not read. So a repository's github-actions update in .github/dependabot.yml ignores every action of the toolkit, ignore: [{dependency-name: "zadykian/toolkit*"}], and tools/pin moves both to a release. It writes the release's templates too. Run it in the repository's work tree, with no clone of this one:

curl -fsSL https://raw.githubusercontent.com/zadykian/toolkit/main/tools/pin | sh -s -- .

It clones the last release's tag, or the one --version vX.Y.Z names, and runs that release's own tools/pin. From a clone of this repository that has the tag, tools/pin [--version vX.Y.Z] DIR pins the repository whose work tree is DIR. Its header comment says what it changes.

With --pr, it pins the main of DIR's origin instead, on a branch chore/pin-vX.Y.Z, and opens a pull request of it into main with gh. DIR's work tree stays unchanged. So one run pins each repository whose work tree is a directory of ~/src:

pin=$(mktemp)
curl -fsSL https://raw.githubusercontent.com/zadykian/toolkit/main/tools/pin -o "$pin"
for dir in ~/src/*/; do
    sh "$pin" --pr "$dir"
done

License

MIT. The design bundle's skills are a one-time fork of the MIT-licensed mattpocock/skills at commit 4ae2317. Each of them carries a copy of its licence.

About

Claude Code skills and hooks for work in a GitHub repository, and GitHub Actions that check each pull request against the same rules, released at one version.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages