Skip to content

feat: restructure to Python monorepo with /init customization skill#9

Merged
amiller68 merged 25 commits intomainfrom
alex/python-updates
Feb 13, 2026
Merged

feat: restructure to Python monorepo with /init customization skill#9
amiller68 merged 25 commits intomainfrom
alex/python-updates

Conversation

@amiller68
Copy link
Owner

Summary

  • Restructure Python codebase to monorepo with py-core library and py-app application
  • Add comprehensive AI/ML chat engine with async tool execution
  • Add background job system with TaskIQ and Redis
  • Add /init skill for interactive template customization
  • Add admin dashboard with user management, widget CRUD, and chat interface

Key Changes

Monorepo Structure

  • py/packages/py-core/ - Shared library (database, AI/ML, events)
  • py/apps/py-app/ - FastAPI application

New Features

  • AI chat engine with pydantic-ai integration
  • Async tool execution for long-running operations
  • Background jobs with distributed cron locking
  • Admin dashboard with real-time updates
  • Widget management system with processing pipeline
  • Event publishing system

Developer Experience

  • /init skill for guided template customization
  • docs/CUSTOMIZING.md for manual customization reference
  • Seed data system for local development

Test plan

  • Run make check in py/ directory
  • Test local development with make dev
  • Verify database migrations work
  • Test /init skill flow

🤖 Generated with Claude Code

amiller68 and others added 23 commits February 12, 2026 14:35
Major restructuring of Python codebase:

**Architecture:**
- Split into py-core (shared library) and py-app (FastAPI application)
- Added turbo for intra-project orchestration
- SQLAlchemy 2.0 with PgEnum for type-safe enums
- uuid7 for time-sortable IDs

**Chat System:**
- Admin-only AI chat with streaming SSE
- Redis-based cancellation signaling
- Completion lifecycle tracking (pending -> processing -> completed/cancelled/failed)
- Tool call support with async execution tracking

**Type Safety:**
- All enums use PgEnum directly (no .value conversions)
- Proper SQLAlchemy column type casts
- Full type checker compliance (ty)

**Documentation:**
- Added MULTI_TENANCY.md guide for future tenant isolation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update Python homepage to reflect completed features (AI chat, TaskIQ, turbo)
- Update static homepage Python description
- Add ANTHROPIC_API_KEY to deploy secrets for chat feature

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add interactive `/init` command that guides users through customizing
the template for their project. Asks about stack selection (Python,
TypeScript, or hybrid), features (database, background jobs, auth),
and deployment targets, then enters plan mode to design the transformation.

- Create .claude/commands/init.md skill definition
- Create docs/CUSTOMIZING.md manual customization guide
- Update CLAUDE.md with /init command and customization section
- Update README.md with getting started section

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address code review feedback:
- Add StringEnum utility for type-safe enum storage as VARCHAR
- Add uuid7_str utility for time-sortable IDs
- Update User, Widget, CronJobRun, AsyncToolExecution models to use
  Mapped/mapped_column syntax with StringEnum and uuid7_str
- Fix timestamp type annotations (datetime instead of TIMESTAMP)
- Update cron decorator to use enums directly (no .value needed)
- Create fresh migration dated 2026-02-12 with all tables
- Add database tests for utils and models (40 tests passing)
- Update CLAUDE.md to reference StringEnum

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix docstring in utils.py to reference StringEnum instead of PgEnum
- Add conftest.py with documented fixture examples for future DB tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move customization documentation from flat docs/CUSTOMIZING.md to
structured docs/customizing/ folder with specialized guides for
project setup, TypeScript/Python packages, hybrid stack, and
multi-tenancy patterns.

Philosophy: keep features, don't remove them - easier to ignore than add back.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Emphasize interview-style conversation over checklist questions
- Align with "keep features, don't remove" philosophy
- Remove deployment as a choice - describe what's needed instead
- Focus on identity config and cleaning up template docs
- Remove git history preservation emphasis

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the convention for keeping server-rendered routes alongside
the SPA: /_status/* for health checks and /_admin/* for admin pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace separate py/ and ts/ directories with single unified workspace
where turbo orchestrates both Python and TypeScript packages.

Single `pnpm dev` runs everything - API, workers, and frontend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-core

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All tenant members should see events, not just the user who made the change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
One command, one terminal, all services. No tmux needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
asyncpg can't insert timezone-aware datetimes into timezone-naive columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All datetimes are now naive UTC, no need for _ensure_tz_aware.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Parse JSON string in ToolResultPart.result to extract ref_id for async tool lookup
- Add session factory (get_session) to AgentDeps for isolated DB sessions in parallel tool calls
- Use naive UTC datetimes for TIMESTAMP WITHOUT TIME ZONE columns
- Update StringEnum docs to clarify ORM vs Core usage
- Add async tools polling endpoint for completed tool refresh
- Update landing page with async tools feature badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covered by customization docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Kamal handles registry setup during deployment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These were hallucinated and don't reflect reality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@amiller68 amiller68 marked this pull request as ready for review February 13, 2026 02:59
amiller68 and others added 2 commits February 12, 2026 22:00
The py/Makefile install target requires pnpm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@amiller68 amiller68 merged commit 83ef1c8 into main Feb 13, 2026
12 checks passed
@amiller68 amiller68 deleted the alex/python-updates branch February 13, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant