chore: rewrite project Claude config for FiscalFlow
- Rewrite .claude/CLAUDE.md with project-specific context: tech stack (.NET 10, React 18), solution structure, build commands, architecture decisions (DDD, CQRS, Provider pattern), domain concepts - Rewrite AGENTS.md with layer-specific agent routing mapped to FiscalFlow architecture layers - Remove invoice-master-poc-v2 reference from settings.json - Clean settings.local.json: remove 100+ irrelevant entries from another project and hardcoded database password - Remove everything-claude-code framework files (commands, hooks, skills) now managed at user level
This commit is contained in:
@@ -1,93 +1,55 @@
|
||||
# Invoice Master POC v2
|
||||
# FiscalFlow - Multi-Accounting System Invoice Processing Platform
|
||||
|
||||
Swedish Invoice Field Extraction System - YOLOv11 + PaddleOCR 从瑞典 PDF 发票中提取结构化数据。
|
||||
Invoice OCR platform integrating with accounting systems (Fortnox, Visma, Hogia). Scans invoices, matches suppliers, generates vouchers, and imports into connected accounting software.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| Component | Technology |
|
||||
|-----------|------------|
|
||||
| Object Detection | YOLOv11 (Ultralytics) |
|
||||
| OCR Engine | PaddleOCR v5 (PP-OCRv5) |
|
||||
| PDF Processing | PyMuPDF (fitz) |
|
||||
| Database | PostgreSQL + psycopg2 |
|
||||
| Web Framework | FastAPI + Uvicorn |
|
||||
| Deep Learning | PyTorch + CUDA 12.x |
|
||||
- **Backend**: .NET 10 (C# 14), ASP.NET Core Web API, EF Core, PostgreSQL, Redis
|
||||
- **Frontend**: React 18 + TypeScript + Vite + TailwindCSS + Zustand
|
||||
- **Patterns**: DDD Lite, CQRS (MediatR), Repository + Unit of Work, Domain Events
|
||||
- **Libraries**: FluentValidation, AutoMapper, Serilog, Polly, JWT Bearer
|
||||
|
||||
## WSL Environment (REQUIRED)
|
||||
## Solution Structure
|
||||
|
||||
**Prefix ALL commands with:**
|
||||
|
||||
```bash
|
||||
wsl bash -c "source ~/miniconda3/etc/profile.d/conda.sh && conda activate invoice-py311 && <command>"
|
||||
```
|
||||
backend/FiscalFlow.sln
|
||||
src/FiscalFlow.Api/ -- Controllers, middleware, Swagger
|
||||
src/FiscalFlow.Application/ -- CQRS commands/queries, DTOs, validators
|
||||
src/FiscalFlow.Core/ -- Domain entities, value objects, events, interfaces
|
||||
src/FiscalFlow.Infrastructure/ -- EF Core repos, event store, blob storage, OCR client
|
||||
src/FiscalFlow.Integrations/ -- IAccountingSystem providers (Fortnox, Visma...)
|
||||
tests/FiscalFlow.UnitTests/ -- xUnit + Moq + FluentAssertions
|
||||
tests/FiscalFlow.IntegrationTests/
|
||||
frontend/ -- React SPA (Vite dev server :5173)
|
||||
docs/ -- Architecture, API, DB schema docs (Chinese)
|
||||
```
|
||||
|
||||
**NEVER run Python commands directly in Windows PowerShell/CMD.**
|
||||
|
||||
## Project-Specific Rules
|
||||
|
||||
- Python 3.11+ with type hints
|
||||
- No print() in production - use logging
|
||||
- Run tests: `pytest --cov=src`
|
||||
|
||||
## Critical Rules
|
||||
|
||||
### Code Organization
|
||||
|
||||
- Many small files over few large files
|
||||
- High cohesion, low coupling
|
||||
- 200-400 lines typical, 800 max per file
|
||||
- Organize by feature/domain, not by type
|
||||
|
||||
### Code Style
|
||||
|
||||
- No emojis in code, comments, or documentation
|
||||
- Immutability always - never mutate objects or arrays
|
||||
- No console.log in production code
|
||||
- Proper error handling with try/catch
|
||||
- Input validation with Zod or similar
|
||||
|
||||
### Testing
|
||||
|
||||
- TDD: Write tests first
|
||||
- 80% minimum coverage
|
||||
- Unit tests for utilities
|
||||
- Integration tests for APIs
|
||||
- E2E tests for critical flows
|
||||
|
||||
### Security
|
||||
|
||||
- No hardcoded secrets
|
||||
- Environment variables for sensitive data
|
||||
- Validate all user inputs
|
||||
- Parameterized queries only
|
||||
- CSRF protection enabled
|
||||
|
||||
## Environment Variables
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
# Required
|
||||
DB_PASSWORD=
|
||||
# Backend
|
||||
cd backend && dotnet restore && dotnet build
|
||||
dotnet run --project src/FiscalFlow.Api
|
||||
dotnet test
|
||||
dotnet test tests/FiscalFlow.UnitTests
|
||||
|
||||
# Optional (with defaults)
|
||||
DB_HOST=192.168.68.31
|
||||
DB_PORT=5432
|
||||
DB_NAME=docmaster
|
||||
DB_USER=docmaster
|
||||
MODEL_PATH=runs/train/invoice_fields/weights/best.pt
|
||||
CONFIDENCE_THRESHOLD=0.5
|
||||
SERVER_HOST=0.0.0.0
|
||||
SERVER_PORT=8000
|
||||
# Frontend
|
||||
cd frontend && npm install
|
||||
npm run dev
|
||||
npm run build
|
||||
npm run lint
|
||||
```
|
||||
## Available Commands
|
||||
|
||||
- `/tdd` - Test-driven development workflow
|
||||
- `/plan` - Create implementation plan
|
||||
- `/code-review` - Review code quality
|
||||
- `/build-fix` - Fix build errors
|
||||
## Architecture
|
||||
|
||||
## Git Workflow
|
||||
- **Provider Pattern**: `IAccountingSystem` interface in `FiscalFlow.Integrations/Accounting/`. New providers implement this interface and register via DI. Factory: `IAccountingSystemFactory.Create("fortnox")`
|
||||
- **CQRS**: Commands/queries dispatched by MediatR with pipeline behaviors for validation and logging
|
||||
- **Domain Events**: Raised by aggregates, dispatched by EF Core interceptor, stored in `DomainEvents` table (JSONB payload) for audit trail
|
||||
- **Invoice Lifecycle**: Upload -> OCR -> SupplierMatch -> VoucherGenerate -> Import
|
||||
|
||||
- Conventional commits: `feat:`, `fix:`, `refactor:`, `docs:`, `test:`
|
||||
- Never commit to main directly
|
||||
- PRs require review
|
||||
- All tests must pass before merge
|
||||
## dotnet-skills Routing
|
||||
|
||||
- Code quality: modern-csharp-coding-standards, api-design, type-design-performance
|
||||
- Data access: efcore-patterns, database-performance
|
||||
- DI / config: dependency-injection-patterns, microsoft-extensions-configuration
|
||||
- Quality gates: dotnet-slopwatch (after new/refactored code), crap-analysis (after test changes)
|
||||
|
||||
Reference in New Issue
Block a user