claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
Configures pre-commit hooks for linting, type checking, formatting, and testing. Use when setting up a new project or adding quality gates to an existing one.
$ npx -y skills add athola/claude-night-market --skill precommit-setup --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/precommit-setupContext preview
The summary Claude sees to decide when to auto-load this skill.
Configures pre-commit hooks for linting, type checking, formatting, and testing. Use when setting up a new project or adding quality gates to an existing one.
name: precommit-setup description: Configures pre-commit hooks for linting, type checking, formatting, and testing. Use when setting up a new project or adding quality gates to an existing one. globs: "**/.pre-commit-config.yaml" alwaysApply: false # Custom metadata (not used by Claude for matching): model: sonnet tools: - Read - Write - Bash category: infrastructure tags: - pre-commit - quality-gates - linting - type-checking - testing complexity: intermediate model_hint: standard estimated_tokens: 1800 progressive_loading: true modules: - modules/standard-hooks.md - modules/component-level-hooks.md - modules/validation-hooks.md - modules/ci-integration.md - modules/troubleshooting.md
Configure a three-layer pre-commit quality system that enforces linting, type checking, and testing before every commit.
per-component quality checks
The system is organised in three layers, each with a different cost / coverage tradeoff:
(50-200ms total). Lints and type-checks every staged file.
lint, typecheck, and test (10-30s total). Only the components touched by the staged files are run.
structure and pattern checks (varies). Catches violations that generic linters miss.
This layering keeps the fast feedback loop fast while still catching the slow / project-specific bugs before they land.
The detailed configuration patterns are in modules; load only the ones you need:
Python, Rust, and TypeScript (load when configuring base linters).
scripts and pre-commit wiring (load when project has multiple components / plugins).
and SKIP patterns (load when enforcing project conventions beyond linting).
plus a complete `.pre-commit-config.yaml` example (load when wiring CI to mirror local checks).
clearing, hook-failure recovery (load when hooks are slow or failing).
\`\`\`bash
python3 plugins/attune/scripts/attune_init.py \\ --lang python \\ --name my-project \\ --path .
mkdir -p scripts chmod +x scripts/run-component-*.sh \`\`\`
Create `pyproject.toml` with strict type checking:
\`\`\`toml [tool.mypy] python_version = "3.12" warn_return_any = true warn_unused_configs = true disallow_untyped_defs = true strict = true
[[tool.mypy.overrides]] module = "plugins.*" strict = true \`\`\`
\`\`\`toml [tool.pytest.ini_options] testpaths = ["tests"] pythonpath = ["src"] addopts = [ "-v", # Verbose output "--strict-markers", # Strict marker enforcement "--cov=src", # Coverage for src/ "--cov-report=term", # Terminal coverage report ]
markers = [ "slow: marks tests as slow (deselect with '-m \\"not slow\\"')", "integration: marks tests as integration tests", ] \`\`\`
\`\`\`bash
uv sync --extra dev
uv run pre-commit install
uv run pre-commit run --all-files
git add . git commit -m "feat: add feature"
\`\`\`
For full quality checks (CI/CD, monthly audits):
\`\`\`bash #!/bin/bash
set -e
echo "=== Running Full Quality Checks ==="
./scripts/run-component-lint.sh --all ./scripts/run-component-typecheck.sh --all ./scripts/run-component-tests.sh --all
echo "=== All Quality Checks Passed ===" \`\`\`
Pre-commit hooks run in this fixed order; all must pass for the commit to succeed:
1. File validation (whitespace, EOF, YAML/TOML/JSON syntax) 2. Security scanning (bandit) 3. Global linting (ruff, all files) 4. Global type checking (mypy, all files) 5. Component linting (changed components only) 6. Component type checking (changed components only) 7. Component tests (changed components only) 8. Custom validation (structure, patterns, etc.)
Start with strict settings from the beginning: they are easier to maintain over time. Configure type checking with `strict = true` in `pyproject.toml`, set up testing early (include pytest in pre-commit), and document the reason whenever you must skip a hook.
Use a gradual adoption strategy. Start with global checks (Layer 1), then add component-specific checks (Layer 2) once legacy issues are resolved. Use `--no-verify` only for true emergencies and document why.
Standardize per-component Makefiles for `lint`, `typecheck`, and `test` targets. Centralize common settings in a root `pyproject.toml` while allowing per-component overrides. Automate change detection so commits stay fast, and use progressive disclosure (summary first, detail on failure).
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily commands; use night-market-operations.
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use night-market-debugging-playbook.
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use night-market-validation-and-qa.