This file provides guidance to Claude Code when working with this repository.
AutoModeler — an AI-powered, conversational data modeling platform. Users upload data, explore it through chat, build ML models with AI guidance, and deploy predictions as APIs and dashboards. No code required.
Built on the code-evolve framework: a self-evolving project builder that reads
vision.md and spec.md, then autonomously implements features session after session.
scripts/evolve.shorchestrates each evolution session- It reads
vision.md,spec.md, current project state, and GitHub issues - Claude Code implements the next highest-priority work from the spec
- Build verification runs (auto-detected from project stack)
- Journal entry is written, issue responses posted
- Changes are committed, tagged, and pushed
auto-modeler-evolve/
├── vision.md # Project vision — the "why" (DO NOT lose sight of this)
├── spec.md # Technical spec with feature checklist
├── IDENTITY.md # Agent constitution (DO NOT MODIFY)
├── JOURNAL.md # Evolution log (append at top, never delete)
├── LEARNINGS.md # Cached knowledge from research
├── DAY_COUNT # Current evolution day
├── scripts/
│ ├── evolve.sh # Master orchestrator (DO NOT MODIFY)
│ ├── format_issues.py # Issue sanitization (DO NOT MODIFY)
│ └── detect_stack.sh # Stack detection for build verification
├── skills/ # Agent behavior definitions
│ ├── evolve/ # Build features from spec
│ ├── self-assess/ # Gap analysis: spec vs implementation
│ ├── communicate/ # Journal and issue responses
│ ├── research/ # Web research
│ └── plan/ # Planning from vision/spec
├── .github/workflows/
│ ├── evolve.yml # Cron trigger (every 4h)
│ └── ci.yml # Build verification on push/PR
└── src/ # THE APPLICATION
├── backend/ # FastAPI (Python, uv)
└── frontend/ # Next.js (TypeScript, npm)
- Language: Python 3.12+
- Framework: FastAPI
- Package Manager: uv (
uv venv,uv sync,uv run pytest) - Database: SQLite via SQLModel
- ML: scikit-learn, pandas, numpy, joblib
- LLM: Anthropic SDK (Claude) for chat orchestration
- Testing: pytest + pytest-bdd (no mocking — real services)
- Linting: ruff + black
- Framework: Next.js 15 (App Router)
- UI Kit: Shadcn/UI (Nova template, gray color scheme)
- Icons: Hugeicons (@hugeicons/react) — NOT lucide-react
- Font: Nunito Sans
- Charts: Recharts
- State: Zustand
- Testing: Jest (unit) + Playwright (E2E)
Every conversational feature follows this exact pipeline. Do not deviate:
-
Regex constant at module level in
src/backend/api/chat.py:_FOO_PATTERNS = re.compile(r"(?i)\b(phrase one|phrase two|...)\b", re.IGNORECASE)
- Do NOT add a trailing
\bafter alternation groups ending in\w— it causes false negatives - Include 6–9 natural-language variants covering how business analysts actually speak
- Do NOT add a trailing
-
Handler block inside
send_message(), guarded by_FOO_PATTERNS.search(body.message):foo_event: dict | None = None if _FOO_PATTERNS.search(body.message) and ctx["dataset"]: try: # ... compute result ... foo_event = {...} system_prompt += "\n\n## <Context for LLM narration>" except Exception: # noqa: BLE001 pass # Nice-to-have; never crash chat
The
except Exception: passis intentional — rich cards are enhancement, not core. -
SSE emit in the generator's yield section, after LLM streaming:
if foo_event: yield f"data: {json.dumps({'type': 'foo_result', 'foo_result': foo_event})}\n\n"
-
Frontend card component at
src/frontend/components/<domain>/<feature>-card.tsx- TypeScript types in
src/frontend/lib/types.ts - API method in
src/frontend/lib/api.ts - Zustand action in
src/frontend/lib/store.ts(attachFooToLastMessage) - Unit tests in
src/frontend/__tests__/<feature>-card.test.tsx
- TypeScript types in
Always call _load_working_df with positional args in this exact order:
_df = _load_working_df(file_path, _active_filter_conditions)NOT _load_working_df(dataset, session) — that is a recurring bug pattern.
Analytics functions (e.g., compute_segment_performance()) must:
- Accept plain Python arrays/lists, not ORM objects
- Have no database dependencies
- Be fully testable in isolation without a running server
When accepting a column as a grouping/segmenting parameter:
- Reject if
n_unique > 50(absolute high-cardinality) - Reject if
n_unique >= n_rows * 0.8(relative near-unique — catches continuous numeric columns) - Return HTTP 400 with a plain-English explanation
This is built for business analysts, not data scientists. Every interaction should feel like chatting with a smart colleague. Key principles:
- Chat is the primary interface — everything can be done through conversation
- No jargon without explanation — always include plain-English equivalents
- Show, don't tell — every insight gets a visualization
- Progressive disclosure — start simple, reveal complexity on demand
- Fail gracefully — no stack traces, always suggest next steps
# Full evolution cycle (uses OAuth from `claude auth login` or env var)
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... ./scripts/evolve.sh
# With specific model
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... MODEL=claude-opus-4-6 ./scripts/evolve.sh
# Force run (bypass schedule gate)
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... FORCE_RUN=true ./scripts/evolve.shThese files are protected and must never be modified by the agent:
IDENTITY.md— agent constitutionscripts/evolve.sh— orchestratorscripts/format_issues.py— input sanitization.github/workflows/— CI/CD safety net
| File | Purpose | Mutability |
|---|---|---|
| vision.md | North star | Human-edited |
| spec.md | Blueprint with checklist (Phase 8+ items are perpetual) | Human + agent (checkboxes) |
| JOURNAL.md | Session log | Append-only (top) |
| LEARNINGS.md | Cached knowledge | Append (new sections) |
| BACKLOG.md | Evolution coordination + ideation board | Agent-managed (read before, update after) |
| DAY_COUNT | Evolution day | Written each run |