Thanks for working on SPEAR. This repo follows its own methodology — contributions go through the spec → prove → engine → arch → refine cycle driven by /spear:<name> slash commands once the plugin is installed.
- OS: Linux, macOS, or Windows (Git Bash). CI runs on Ubuntu; Windows is smoke-tested for the
run-hook.cmdpolyglot wrapper. - Node.js: 20 LTS (for lint + state-machine tests).
- Bats-core: 1.10+ (for hook integration tests). Install locally at
~/.local/bin/batsor via package manager. - jq: 1.6+ (for state-file I/O inside bash helpers).
Tests:
PATH="$HOME/.local/bin:$HOME/bin:$PATH" \
bats tests/hooks/ \
&& node --test tests/state/*.test.mjs \
&& node --test tests/skills/*.test.mjs
Skill lint (REQ-100):
node tests/skills/lint.mjs .
See docs/implementation.md §1. Briefly:
.claude-plugin/marketplace.json # marketplace manifest
plugins/spear/
.claude-plugin/plugin.json # plugin manifest
skills/<name>/SKILL.md # the seven SPEAR skills
hooks/run-hook.cmd, session-start, lib/*.sh
templates/*.md, LayerRulesTest.kt # emitted by /spear:init
tests/hooks/ # Bats
tests/skills/ # Node lint + unit tests
tests/state/ # Node state-machine tests
docs/ # the four SPEAR docs + design refs
- Open an issue describing the change. If it adds or revises behaviour, state which REQ-ID it maps to (or propose a new one).
- Fork + branch. Use a short descriptive branch name.
- Run the methodology on yourself. Every non-trivial change is a SPEAR task:
- Add or revise a REQ in
docs/requirements.md(EARS format — use/spear:spec). - Add a task in
docs/tasks.mdtaggedTDD,DOC, orINFRA, withReferences:and an emptyEvidence:block. - For TDD tasks: write a failing test first (
/spear:prove), then minimum implementation (/spear:engine), then/spear:arch, then/spear:refine.
- Add or revise a REQ in
- Keep tests green. Do not raise the skill lint ceiling (4096 bytes/body) to fit a larger skill — trim the skill instead. The ceiling is load-bearing for the session-start payload.
- Commit convention.
docs(spear):,test(spear):,feat(spear):,fix(spear):,chore(spear):. Include aCo-Authored-By:trailer when AI assisted. - Pull request. Reference the REQ-IDs and tasks covered. The PR template will ask for evidence sources consulted.
- YAML frontmatter with non-empty
name:anddescription:. - Body ≤ 4096 bytes (UTF-8). Enforced by
tests/skills/lint.mjs. - No broken internal markdown links. External and anchor-only links are allowed.
- Paths to files inside the repo should be plain backticked text, not markdown link syntax — otherwise the lint resolves them on disk and fails if the target doesn't exist yet.
Templates under plugins/spear/templates/ use {{PLACEHOLDER}} tokens that /spear:init substitutes from language/framework detection. The Konsist template uses __BASE_PACKAGE__ for the consumer's detected top-level package.
This repo uses git worktrees heavily for parallel Claude sessions. Before any commit, verify:
git -C <worktree> branch --show-current
matches the expected branch. A prior session lost a commit by running git commit in the wrong worktree. Prefer absolute paths and git -C <worktree> over relying on shell cwd.
Semver. Bump plugin.json:version and tag. Run the manual E2E checklist in TESTING.md before each release.