Use GitHub Issues. Include:
- Claude Code version (
claude --version) - OS and shell environment (Windows, WSL2, macOS, Linux)
- Steps to reproduce
- Expected vs actual behavior
- Create a branch from
main(git checkout -b feat/your-change) - Make your changes
- Run
/reviewin Claude Code on every file you changed - Verify hooks pass syntax check:
python -m py_compile .claude/hooks/*.py - Commit with conventional format:
feat(commands): add review command
- New slash commands (
.claude/commands/) - New skills (
.claude/skills/<name>/SKILL.md) - New agents (
.claude/agents/) - New hooks (
.claude/hooks/) - Improvements to
global/CLAUDE.mdorproject/CLAUDE.md - Documentation improvements
- Bash or DOS scripts — Python only, always
- External library dependencies in hooks without documentation
- Removing existing rules without opening an issue first
- Stack-specific opinions baked into generic components (keep it language-agnostic where possible)
- Large refactors without prior discussion
- Python strict typing for all hook scripts. NO BASH OR DOS.
- No file > 300 lines, no function > 50 lines
- Hooks use stdlib only unless dependency is clearly documented
- Run
/reviewbefore committing - Use
@path/to/filesyntax for absolute file path references in.mdfiles (e.g.@src/main.py); relative or fuzzy references (e.g.file.ext) are fine as-is - See
CLAUDE.mdfor the full standards
Commands are Markdown files with YAML frontmatter. Location depends on scope:
| Scope | Location | Invocation | Meaning |
|---|---|---|---|
project |
.claude/commands/<name>.md |
/<name> |
Installed into target projects. |
framework |
.claude/commands/kc/<name>.md |
/kc:<name> |
Framework management only. Never copied. |
Project command example:
---
name: command-name
description: One-line description of what this command does
scope: project
---
Your command prompt here. Write in imperative form — instructions Claude follows
when the user runs `/command-name`.Framework command example (inside .claude/commands/kc/):
---
name: command-name
description: One-line description of what this command does
scope: framework
---
Your command prompt here. Invoked as `/kc:command-name`.Naming: kebab-case, start with an action verb (review, commit, check-, refactor).
Description limit: Must not exceed 400 characters.
After adding: Update README.md (component listing) and this file if you introduced new conventions.
Skills live in .claude/skills/<name>/SKILL.md:
---
name: skill-name
description: What this skill does
triggers:
- keyword one
- keyword two
---
# Skill: Name
Structured template Claude follows when trigger keywords are detected in conversation.- Trigger keywords must be specific enough to avoid false activations
- Each skill gets its own subdirectory:
.claude/skills/code-review/SKILL.md - Description limit: Must not exceed 400 characters.
Agents live in .claude/agents/<name>.md. They can be organized into subfolders:
| Path | Use for |
|---|---|
.claude/agents/<name>.md |
General-purpose agents for any stack |
.claude/agents/core/<name>.md |
Cross-cutting concerns (review, testing, docs) |
.claude/agents/<stack>/<name>.md |
Tech-stack specific agents (e.g. react/, django/, rust/) |
---
name: agent-name
description: What this specialist does. Use PROACTIVELY when [condition].
tools:
- Read
- Grep
- Glob
---
# Agent: Name
You are a specialist in [domain]. Your job is to [specific goal].
[Behavioral instructions, output format, constraints]- Tool access principle: Default to minimum necessary. Reviewers get
Read/Grep/Globonly — neverWriteorBash. - Description limit: Must not exceed 400 characters.
- Proactive agents: Only add
Use PROACTIVELY when [condition]to agents that would otherwise be skipped — e.g. a reviewer that should run after every feature. Do NOT add it to agents users will always invoke explicitly (test writers, scaffolders). The condition must be specific. - Color: Keep the following convention, you may create unique shades to differenciate: green for authoring code, blue for review, research or audit, purple for testing.
Hooks live in .claude/hooks/<name>.py. Python only — no bash.
Naming conventions:
| Prefix | Behavior |
|---|---|
block- |
Blocks the operation (exit 2) |
check- |
Checks condition, warns or blocks |
lint- |
Lints after file write (PostToolUse) or at Stop |
verify- |
Verifies at turn end (Stop) |
after- |
Runs post-edit formatting (PostToolUse) |
notify- |
Sends a desktop/system notification (Notification) |
Required structure:
#!/usr/bin/env python3
"""
hook-name.py — Brief description.
Event: PreToolUse | PostToolUse | Stop | Notification
Matcher: Read|Write|Edit|Bash (PreToolUse/PostToolUse only; use * for Stop/Notification)
Exit codes:
0 — Allow / no action
1 — Warning (printed, continues)
2 — Block (printed to stderr, operation stopped)
"""
import json
import sys
def main() -> None:
try:
data = json.load(sys.stdin)
except (json.JSONDecodeError, EOFError):
sys.exit(0)
tool_input = data.get("tool_input", {})
# Your logic here.
# To block: print("BLOCKED: reason", file=sys.stderr); sys.exit(2)
if __name__ == "__main__":
main()After adding a hook:
- Wire it in
@.claude/settings.json - Document the wiring example in
@global/settings.json - Syntax-check:
python -m py_compile .claude/hooks/your-hook.py - Test with mock stdin:
echo '{"tool_name":"Write","tool_input":{"file_path":".env"}}' | python3 .claude/hooks/your-hook.py
CLAUDE.md generation templates and guides live in project/ — the master template at project/CLAUDE.md and per-stack Q&A guides in project/tech-stacks/<name>.md (e.g., unreal.md). Read project/tech-stacks/unreal.md for an example of the expected structure: detection pattern, numbered questions with CLAUDE.md section mappings, and rationale for each question. Guides are Markdown only and are used by /kc:generate-claude-md from the KahnClaude source directory; they are never copied to target projects. After adding a guide, update README.md to list it.
Starting point for a new project's CLAUDE.md. When editing:
- Keep rules numbered with clear labels
- Append new rules — never remove without discussion
- Each rule must explain why, not just what
Installed at @~/.claude/CLAUDE.md. Keep it:
- Security and cross-project standards only
- Free of project-specific rules (those belong in
project/CLAUDE.md) - Safe to merge into an existing global config without conflicts
- Component in correct location (
scope: project→.claude/commands/,scope: framework→.claude/commands/kc/, skills, agents, hooks in their respective dirs) -
README.mdupdated with description - This file updated if new conventions introduced
- If hook: syntax-checked (
python -m py_compile) - If hook: wired in
@.claude/settings.jsonand@global/settings.json - No secrets, credentials, or personal data in any file
By contributing, you agree your contributions will be licensed under the same license as this project (see LICENSE).