codeflash/.claude/rules/code-style.md
Kevin Turcios e4b1fb854b chore: rebuild .claude config from scratch
Delete all existing .claude/ tracked files and recreate from scratch,
adapting patterns from codeflash-agent.

Hooks (6, up from 1):
- bash-guard: blocks grep/find/cat in Bash, redirects to dedicated tools
- require-read + track-read: enforces Read-before-Write/Edit
- post-compact: injects git state + project conventions into compaction
- post-edit-lint: runs prek on edited Python files (kept)
- status-line: shows user, area, branch, dirty state

Rules (10, up from 8):
- New: sessions, debugging, github (from codeflash-agent)
- Rewrote: code-style (absorbed source-code), git (added sizing/hygiene)
- Removed: source-code (folded into code-style)

Settings: permissions allowlist, attribution, includeCoAuthoredBy, full
hook wiring, status line, enableAllProjectMcpServers.

.gitignore: whitelist .claude/skills/ for tracking.
2026-04-23 04:31:04 -05:00

14 lines
887 B
Markdown

# Code Style
- **Line length**: 120 characters
- **Python**: 3.9+ syntax
- **Package management**: Always use `uv`, never `pip`
- **Tooling**: Ruff for linting/formatting, mypy strict mode, prek for pre-commit checks
- **Comments**: Minimal — only explain "why", not "what"
- **Docstrings**: Do not add docstrings unless the user explicitly asks
- **Types**: Match the type annotation style of surrounding code
- **Naming**: No leading underscores (`_function_name`) — Python has no true private functions
- **Paths**: Always use absolute paths
- **Encoding**: Always pass `encoding="utf-8"` to `open()`, `read_text()`, `write_text()` in new or changed code
- **Verification**: Use `uv run prek` — it handles ruff, ty, mypy in one pass. Don't run them separately
- **Code transforms**: Use `libcst` for code modification/transformation. `ast` is acceptable for read-only analysis