Skip to content

Commit 94c5b30

Browse files
committed
Merge remote-tracking branch 'origin/main' into han-communication
2 parents 21d72b9 + 7dcba3b commit 94c5b30

9 files changed

Lines changed: 575 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: 2
2+
3+
# One monthly pull request bundles updates across all three ecosystems (npm,
4+
# GitHub Actions, pre-commit) via a multi-ecosystem group. Each ecosystem holds
5+
# a newly published version for 30 days before proposing it (cooldown), to lower
6+
# supply-chain risk from fresh or compromised releases. Cooldown does not apply
7+
# to security updates, so enabling Dependabot security updates in the repository
8+
# settings still lands those immediately.
9+
multi-ecosystem-groups:
10+
dev-tooling:
11+
schedule:
12+
interval: monthly
13+
14+
updates:
15+
# npm devDependencies: prek, Prettier, Bats.
16+
- package-ecosystem: npm
17+
directory: "/"
18+
multi-ecosystem-group: dev-tooling
19+
cooldown:
20+
default-days: 30
21+
22+
# GitHub Actions used by the CI workflows.
23+
- package-ecosystem: github-actions
24+
directory: "/"
25+
multi-ecosystem-group: dev-tooling
26+
cooldown:
27+
default-days: 30
28+
29+
# pre-commit hook revisions in .pre-commit-config.yaml (shellcheck-py,
30+
# pre-commit-hooks). prek reads the same config format Dependabot updates.
31+
- package-ecosystem: pre-commit
32+
directory: "/"
33+
multi-ecosystem-group: dev-tooling
34+
cooldown:
35+
default-days: 30

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
# Lint and test the repo with the same npm-pinned tools contributors run
4+
# locally (prek + Prettier + ShellCheck for lint, Bats for tests). Everything is
5+
# installed by `npm ci` from the committed package-lock.json, so CI and local
6+
# use identical versions.
7+
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ci-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
lint:
22+
name: lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: lts/*
29+
cache: npm
30+
- name: Cache prek hook environments
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cache/prek
34+
key: prek-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
35+
restore-keys: |
36+
prek-${{ runner.os }}-
37+
- run: npm ci
38+
- run: npm run lint
39+
40+
test:
41+
name: test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: lts/*
48+
cache: npm
49+
- run: npm ci
50+
- run: npm test

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Pre-commit hooks for the han plugin suite, run with prek.
2+
#
3+
# Run every hook manually with `npm run lint` (prek run --all-files).
4+
5+
# Files no hook ever touches: static archives and vendored assets.
6+
exclude: "^(docs/plans/|docs/research/|han-reporting/skills/html-summary/assets/)"
7+
8+
repos:
9+
# Prettier owns formatting for Markdown, JSON, YAML, and JS: 120-column prose,
10+
# ordered-list numbering, and unwrapped .github templates (.prettierrc.json),
11+
# with ignore rules in .prettierignore. Running the local devDependency keeps
12+
# Prettier's version in package.json only, not duplicated in a hook mirror.
13+
# It runs first so the hygiene fixers below never fight it.
14+
- repo: local
15+
hooks:
16+
- id: prettier
17+
name: prettier
18+
entry: npx prettier --write --ignore-unknown
19+
language: system
20+
types_or: [markdown, json, yaml, javascript]
21+
22+
# Lint shell scripts. prek builds the environment; no Docker, no global install.
23+
- repo: https://github.com/shellcheck-py/shellcheck-py
24+
rev: v0.10.0.1
25+
hooks:
26+
- id: shellcheck
27+
28+
# Hygiene checks. The whitespace/EOL fixers exclude the file types Prettier
29+
# already normalizes (Markdown, JSON, YAML, JS), so Prettier owns those and
30+
# these cover the rest (shell scripts, dotfiles, LICENSE) with no overlap.
31+
# check-yaml and check-json are intentionally omitted: Prettier parses and so
32+
# validates those types already.
33+
- repo: https://github.com/pre-commit/pre-commit-hooks
34+
rev: v6.0.0
35+
hooks:
36+
- id: trailing-whitespace
37+
exclude: '\.(md|markdown|json|ya?ml|jsx?|mjs|cjs)$'
38+
- id: end-of-file-fixer
39+
exclude: '\.(md|markdown|json|ya?ml|jsx?|mjs|cjs)$'
40+
- id: fix-byte-order-marker
41+
exclude: '\.(md|markdown|json|ya?ml|jsx?|mjs|cjs)$'
42+
- id: mixed-line-ending
43+
args: [--fix=lf]
44+
exclude: '\.(md|markdown|json|ya?ml|jsx?|mjs|cjs)$'
45+
- id: check-added-large-files
46+
- id: check-merge-conflict
47+
- id: check-shebang-scripts-are-executable
48+
- id: check-executables-have-shebangs
49+
- id: check-symlinks
50+
- id: destroyed-symlinks
51+
- id: check-vcs-permalinks

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Static historical artifacts: left as written.
2+
docs/plans/
3+
docs/research/
4+
5+
# Vendored third-party assets: checked in verbatim, never reformat.
6+
han-reporting/skills/html-summary/assets/
7+
8+
# Dependencies and generated files.
9+
node_modules/
10+
package-lock.json

.prettierrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 120,
3+
"proseWrap": "always",
4+
"overrides": [
5+
{
6+
"files": ".github/**/*.md",
7+
"options": {
8+
"proseWrap": "never"
9+
}
10+
}
11+
]
12+
}

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This page is for contributors: anyone adding, editing, or restructuring skills,
1111
- **Every skill and every agent gets a long-form doc.** No exceptions. See the [coverage rule](./docs/templates/coverage-rule.md).
1212
- Use the [long-form skill template](./docs/templates/skill-long-form-template.md) or the [agent template](./docs/templates/agent-long-form-template.md).
1313
- The root [CLAUDE.md](./CLAUDE.md) carries the at-a-glance project map for assistants and contributors.
14+
- Before your first commit, run `npm install`. It installs the pinned dev tools and wires up the git hook. See [Setting up your environment](#setting-up-your-environment).
1415

1516
## Before you start
1617

@@ -21,6 +22,32 @@ Read these once:
2122
- **[`han-plugin-builder/skills/guidance/references/agent-building-guidelines/`](./han-plugin-builder/skills/guidance/references/agent-building-guidelines/).** The agent-authoring rules: external files, model selection, domain focus, graceful degradation, multi-agent economics.
2223
- **[Root `CLAUDE.md`](./CLAUDE.md).** Repo conventions, doc map, and where each kind of file lives.
2324

25+
## Setting up your environment
26+
27+
Han's dev tooling is managed as npm devDependencies, so a single `npm install` sets everything up at pinned versions with nothing installed globally. It installs [prek](https://github.com/j178/prek) (the git-hook runner), [Prettier](https://prettier.io) (formatting), and [Bats](https://github.com/bats-core/bats-core) (shell tests).
28+
29+
One-time setup, from the repo root:
30+
31+
1. Install [Node.js](https://nodejs.org/) (the current LTS is fine).
32+
2. Run `npm install`. It installs the pinned tools into `node_modules/`. Nothing lands on your global PATH, so tool versions never clash with your other projects.
33+
3. If you want pre-commit hooks, run `npx prek install`.
34+
35+
Everyday use:
36+
37+
- `npm run lint` runs every hook over the whole repo (`prek run --all-files`).
38+
- `npm test` runs the shell tests (`bats --recursive test/`).
39+
- If installed, every commit runs the lint hooks (Prettier, ShellCheck, and file hygiene) on your staged files.
40+
41+
CI runs the same lint hooks and the tests on every pull request.
42+
43+
How Prettier treats your files:
44+
45+
- It formats Markdown, JSON, YAML, and JavaScript. Prose reflows to 120 columns and ordered lists keep their `1.`, `2.`, `3.` numbering (configured in `.prettierrc.json`).
46+
- PR and issue templates under `.github/` are unwrapped rather than wrapped, because GitHub renders every newline in a PR or issue body as a line break.
47+
- The static archives under `docs/plans/` and `docs/research/`, and the vendored assets under `han-reporting/skills/html-summary/assets/`, are left untouched (`.prettierignore`).
48+
49+
Shell scripts are linted with ShellCheck. Tests live in `test/` as `*.bats` files and run in CI rather than on commit; run them locally with `npm test`.
50+
2451
## Which plugin does the change belong in?
2552

2653
Han ships as a family of plugins. Most carry components; the `han` meta-plugin bundles the others. Decide where your change goes before you scaffold anything. (For the user-facing version of this map, see [Choosing a Han plugin](./docs/choosing-a-han-plugin.md).)
@@ -112,6 +139,8 @@ Before opening the PR, run through this checklist:
112139
- [ ] Internal links resolve.
113140
- [ ] No em-dashes anywhere in the doc.
114141
- [ ] No *"actually," "just," "leverage," "utilize," "showcase," "robust" (vague), "It's worth noting," "Importantly,"* or other voice violations.
142+
- [ ] `npm run lint` passes.
143+
- [ ] `npm run test` passes.
115144

116145
## Related Documentation
117146

0 commit comments

Comments
 (0)