Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .claude/hooks/pre-write-doc-file-warning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# • README.md — allowed anywhere
# • CLAUDE.md — allowed anywhere
# • docs/**/ — any depth under any docs/ directory
# • .claude/**/ — skills, rules, commands, hooks docs
#
# All other .md files → BLOCKED. Recreate them under docs/.
#
Expand Down Expand Up @@ -56,6 +57,12 @@ if echo "$FILE_PATH" | grep -qE '(^|/)tasks_summary/'; then
exit 0
fi

# Files under .claude/ are allowed (skills, rules, commands, hooks docs)
if echo "$FILE_PATH" | grep -qE '(^|/)\.claude/'; then
echo "$INPUT"
exit 0
fi

# ── Violation — block the write ───────────────────────────────────────────────
echo "┌─ BLOCKED: Markdown placement violation" >&2
echo "│" >&2
Expand Down
71 changes: 30 additions & 41 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"Bash(git commit:*)",
"Bash(git checkout:*)",
"Bash(git branch:*)",
"Bash(rm -rf /tmp/test-output*)",
"Bash(python3:*)",
"Bash(bash .claude/hooks/*)"
],
Expand Down Expand Up @@ -69,74 +68,74 @@
"description": "Pre-commit: scan staged .py files for secrets/debug markers before git commit"
},
{
"matcher": "Bash",
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-bash-coverage-gate.sh"
"command": "bash .claude/hooks/pre-config-protection.sh"
}
],
"description": "Coverage gate: warn before git commit if test coverage is below 85%"
"description": "Block weakening edits to ruff/basedpyright config in pyproject.toml"
},
{
"matcher": "Write|Edit|MultiEdit",
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-config-protection.sh"
"command": "bash .claude/hooks/pre-protect-uv-lock.sh"
}
],
"description": "Block weakening edits to ruff/basedpyright config in pyproject.toml and .pre-commit-config.yaml"
"description": "Block direct edits to uv.lock — must be regenerated via uv lock or just update"
},
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-protect-uv-lock.sh"
"command": "bash .claude/hooks/pre-write-src-require-test.sh"
}
],
"description": "Block direct edits to uv.lock — must be regenerated via uv lock or just update"
"description": "TDD enforcement: block writing src/<pkg>/<module>.py if test file does not exist (use pre-write-src-test-reminder.sh instead for warn-only — do not register both)"
},
{
"matcher": "Write|Edit|MultiEdit",
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-protect-readonly-files.sh"
"command": "bash .claude/hooks/pre-bash-coverage-gate.sh"
}
],
"description": "Block direct edits to protected root-level config files: env.example, justfile, LICENSE, pyproject.toml, uv.lock, copier.yml, .gitignore, .gitmessage, .pre-commit-config.yaml, .secrets.baseline"
"description": "Coverage gate: warn before git commit if test coverage is below 85%"
},
{
"matcher": "Write|Edit",
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-write-src-require-test.sh"
"command": "bash .claude/hooks/pre-delete-protection.sh"
}
],
"description": "TDD enforcement: block writing src/<pkg>/<module>.py if test file does not exist (use pre-write-src-test-reminder.sh instead for warn-only — do not register both)"
"description": "Block rm of critical files: pyproject.toml, justfile, CLAUDE.md, .pre-commit-config.yaml, .copier-answers.yml, uv.lock, .claude/settings.json"
},
{
"matcher": "Write",
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-write-doc-file-warning.sh"
"command": "bash .claude/hooks/pre-bash-branch-protection.sh"
}
],
"description": "Block writing .md files outside docs/ (pre-flightprevents the wrong location)"
"description": "Block git push to main/master branchesuse feature branches and PRs"
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/pre-write-jinja-syntax.sh"
"command": "bash .claude/hooks/pre-write-doc-file-warning.sh"
}
],
"description": "Validate Jinja2 syntax before writing new/overwritten .jinja template files"
"description": "Block writing .md files outside docs/ (pre-flight — prevents the wrong location)"
},
{
"matcher": "Edit|Write",
Expand All @@ -161,54 +160,44 @@
"description": "Run ruff check + basedpyright after every .py edit for immediate feedback"
},
{
"matcher": "Edit|Write",
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/post-edit-refactor-test-guard.sh"
"command": "bash .claude/hooks/post-edit-markdown.sh"
}
],
"description": "TDD refactor guard: remind to run tests after multiple src/ or scripts/ edits"
"description": "Post-edit fallback: warn if an existing .md file is edited outside docs/"
},
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/post-edit-jinja.sh"
}
],
"description": "Validate Jinja2 syntax after every .jinja template edit (post-edit secondary layer)"
},
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/post-edit-markdown.sh"
"command": "bash .claude/hooks/post-edit-refactor-test-guard.sh"
}
],
"description": "Post-edit fallback: warn if an existing .md file is edited outside docs/"
"description": "TDD refactor guard: remind to run tests after multiple src/ edits"
},
{
"matcher": "Edit|Write",
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/post-edit-copier-migration.sh"
"command": "bash .claude/hooks/post-bash-test-coverage-reminder.sh"
}
],
"description": "Remind about _migrations, _skip_if_exists, and tests after copier.yml edits"
"description": "After pytest/just test runs, surface modules below 85% coverage"
},
{
"matcher": "Edit|Write",
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/post-edit-template-mirror.sh"
"command": "bash .claude/hooks/post-write-test-structure.sh"
}
],
"description": "Remind to mirror template/.claude/ changes to root .claude/ (and vice versa)"
"description": "After creating test files, check for test_ functions, no unittest.TestCase, and proper pytest markers"
},
{
"matcher": "Bash",
Expand Down
17 changes: 17 additions & 0 deletions .claude/skills/bash-guide/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,23 @@ done

For the full pattern library, see [references/patterns.md](references/patterns.md).

## When to load references

| If the task involves… | Load |
|---------------------------------------------|---------------------------------|
| Script headers, `main()` layout, comments | `references/structure.md` |
| Dual-mode logging, JSON log output | `references/logging.md` |
| Arg parsing, traps, arrays, retries | `references/patterns.md` |
| Starting a new script from scratch | `templates/script-skeleton.sh` |
| Simple script edit or small function | No reference needed — use inline |

## Efficiency: batch edits and parallel calls

- **Batch edits:** When adding multiple functions to a script, write them all in
a single Edit call rather than one function at a time.
- **Read before edit:** Read the full script first to understand its structure,
existing style, and variable names before making any changes.

## Quick reference: where to go deeper

| Topic | Reference file |
Expand Down
7 changes: 7 additions & 0 deletions .claude/skills/config-management/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ Run all hooks manually: `just precommit`
4. Keep `justfile` recipes simple — one concern per recipe.
5. Pin all dependency versions in `pyproject.toml`.

## Efficiency: batch edits and parallel calls

- **Batch edits:** When modifying pyproject.toml (e.g., adding dependencies and
updating tool config), combine all changes into a single Edit call.
- **Read before edit:** Read the full config file first. Plan all sections that
need changes, then apply in one Edit call.

## Quick reference: where to go deeper

| Topic | Reference file |
Expand Down
7 changes: 7 additions & 0 deletions .claude/skills/cron-scheduling/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ description: >-

# Cron Scheduling Skill

## Efficiency: batch edits and parallel calls

- **Batch edits:** When setting up multiple cron jobs, write all entries in a
single `crontab -e` session or Edit call rather than one job at a time.
- **Read before edit:** Read the current crontab first (`crontab -l`) to
understand existing jobs before adding or modifying entries.

## Quick reference: where to go deeper

| Topic | Reference file |
Expand Down
17 changes: 17 additions & 0 deletions .claude/skills/css-guide/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,23 @@ Recommended stylelint rules: `color-named: "never"`, `color-no-invalid-hex`,
`declaration-no-important`, a BEM-compatible `selector-class-pattern`, and
`no-duplicate-selectors`.

## When to load references

| If the task involves… | Load |
|------------------------------------------|-------------------------------------|
| ITCSS layers, CSS architecture design | `references/css-architecture.md` |
| ARIA, focus styles, a11y compliance | `references/accessibility.md` |
| Grid, flexbox, responsive breakpoints | `references/layout-responsive.md` |
| Starting a new project from scratch | `templates/css-tokens.css` + `templates/css-reset.css` |
| Simple CSS edits (default) | No reference needed — use inline |

## Efficiency: batch edits and parallel calls

- **Batch edits:** When adding multiple CSS rules or updating a stylesheet,
combine all changes into a single Edit call per file.
- **Read before edit:** Read the full stylesheet first to understand existing
patterns, tokens, and class naming before modifying.

## Quick reference: where to go deeper

| Topic | Reference file |
Expand Down
17 changes: 17 additions & 0 deletions .claude/skills/html-guide/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,23 @@ Recommended `.htmlhintrc`:
}
```

## When to load references

| If the task involves… | Load |
|---------------------------------------------|------------------------------------|
| Choosing semantic elements (article, nav) | `references/semantic-elements.md` |
| WCAG compliance, ARIA, focus management | `references/accessibility.md` |
| Starting a new HTML page | `templates/html-template.html` |
| Simple HTML edits (default) | No reference needed — use inline |

## Efficiency: batch edits and parallel calls

- **Batch edits:** When restructuring an HTML file (fixing semantics, adding
ARIA attributes, updating structure), plan all changes first and apply in
a single Edit call.
- **Read before edit:** Read the full HTML file first to understand existing
structure and patterns.

## Quick reference: where to go deeper

| Topic | Reference file |
Expand Down
17 changes: 17 additions & 0 deletions .claude/skills/jinja-guide/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,23 @@ conventions on top of Jinja. Auto-escape defaults differ (Flask: on for
structure, and security defaults, see
[references/best-practices.md](references/best-practices.md).

## When to load references

| If the task involves… | Load |
|-------------------------------------------------|-----------------------------------|
| Operator syntax, literals, global functions | `references/syntax.md` |
| Filter usage beyond basics (A-Z list) | `references/filters-reference.md` |
| Template inheritance, include, import, macros | `references/inheritance.md` |
| Performance, security, testing best practices | `references/best-practices.md` |
| Simple template edits (default) | No reference needed — use inline |

## Efficiency: batch edits and parallel calls

- **Batch edits:** When modifying multiple template files, read all target
templates first, then edit each in a single Edit call per file.
- **Read before edit:** Read the base template and child templates to understand
the inheritance chain before making block changes.

## Quick reference: where to go deeper

| Topic | Reference file |
Expand Down
Loading
Loading