codeflash-internal/.claude/rules/python-patterns.md
Kevin Turcios 4c3deeb7b8
Restructure CLAUDE.md files and add path-scoped rules for monorepo (#2417)
## Summary

- Restructure CLAUDE.md hierarchy so Claude Code auto-discovers
project-specific instructions
- Delete dead `AGENTS.md` files (referenced non-existent
`.tessl/RULES.md`)
- Rename `django/aiservice/AGENTS.md` → `CLAUDE.md` for auto-discovery
- Create `js/CLAUDE.md` with package commands and gotchas
- Move PR review guidelines to `.claude/rules/pr-review.md` (auto-loaded
rule)
- Move prek workflow to `.claude/skills/fix-prek.md` (on-demand skill)
- Add path-scoped rules for Python and Next.js patterns
- Add domain glossary, service architecture diagram, and per-package
gotchas

## Test plan

- Verify `CLAUDE.md` files exist at root, `django/aiservice/`, and `js/`
- Verify no remaining references to `AGENTS.md` or `.tessl/`
- Verify `.claude/rules/` and `.claude/skills/` files are committed
2026-02-14 17:13:09 -05:00

547 B

paths
django/**/*.py

Python Patterns (aiservice)

  • Always use libcst for code transformation, never ast (preserves formatting and comments)
  • All endpoints are async — use async def and asyncio.TaskGroup for concurrency
  • Use Pydantic BaseModel or ninja.Schema for all request/response types
  • Use call_llm() from aiservice/llm.py for all LLM calls — never call OpenAI/Anthropic APIs directly
  • Django-Ninja has no built-in exception handling — use get_object_or_404 and custom error responses explicitly