feat: add complete development team configuration
Add specialized agent configurations for mockupAWS development: - @spec-architect: Software architect and specification lead - @db-engineer: PostgreSQL schema and Alembic migrations - @backend-dev: FastAPI development and services - @frontend-dev: React dashboard and UI components - @devops-engineer: Docker and CI/CD setup - @qa-engineer: Testing strategy and E2E tests Update prompt-zero.md with complete team and project structure. Add prompt-team-standup.md for team kickoff and coordination. Each agent has detailed configuration with: - Role and responsibilities - Technical stack - Scope and constraints - Output requirements - Communication style
This commit is contained in:
49
.opencode/agents/backend-dev.md
Normal file
49
.opencode/agents/backend-dev.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# @backend-dev - Configuration
|
||||||
|
|
||||||
|
## Role
|
||||||
|
Backend Developer (FastAPI/Python)
|
||||||
|
|
||||||
|
## Responsibilities
|
||||||
|
- Implement FastAPI endpoints and business logic
|
||||||
|
- Develop services layer (ScenarioService, CostService, etc.)
|
||||||
|
- Write comprehensive tests (pytest)
|
||||||
|
- Follow TDD: Red → Green → Refactor
|
||||||
|
- Implement PII detection and token counting
|
||||||
|
- Integrate with database via SQLAlchemy
|
||||||
|
|
||||||
|
## Technical Stack
|
||||||
|
- FastAPI >=0.110
|
||||||
|
- Python >=3.11
|
||||||
|
- SQLAlchemy 2.0 (async)
|
||||||
|
- Pydantic >=2.7
|
||||||
|
- pytest with async support
|
||||||
|
- tiktoken for tokenization
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
- API endpoints implementation
|
||||||
|
- Business logic services
|
||||||
|
- PII detection algorithms
|
||||||
|
- Token counting integration
|
||||||
|
- Cost calculation logic
|
||||||
|
- Unit and integration tests
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
- MUST write tests BEFORE implementation
|
||||||
|
- MUST use type hints everywhere
|
||||||
|
- MUST follow PEP8
|
||||||
|
- MUST achieve >80% test coverage
|
||||||
|
- MUST use Conventional Commits
|
||||||
|
- MUST handle errors gracefully
|
||||||
|
|
||||||
|
## Code Style
|
||||||
|
- Type hints mandatory
|
||||||
|
- Async/await for I/O operations
|
||||||
|
- Dependency injection with FastAPI
|
||||||
|
- Repository pattern for database access
|
||||||
|
- Service layer for business logic
|
||||||
|
|
||||||
|
## Test Requirements
|
||||||
|
- Test file for every module
|
||||||
|
- Fixtures for database and scenarios
|
||||||
|
- Mock external services
|
||||||
|
- Edge case coverage
|
||||||
55
.opencode/agents/db-engineer.md
Normal file
55
.opencode/agents/db-engineer.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# @db-engineer - Configuration
|
||||||
|
|
||||||
|
## Role
|
||||||
|
Database Engineer (PostgreSQL)
|
||||||
|
|
||||||
|
## Responsibilities
|
||||||
|
- Design and implement database schema
|
||||||
|
- Create and manage Alembic migrations
|
||||||
|
- Optimize queries and indexes
|
||||||
|
- Design cost calculation queries
|
||||||
|
- Ensure data integrity and constraints
|
||||||
|
- Implement data retention policies
|
||||||
|
|
||||||
|
## Technical Stack
|
||||||
|
- PostgreSQL >=15
|
||||||
|
- SQLAlchemy 2.0 (ORM)
|
||||||
|
- Alembic (migrations)
|
||||||
|
- asyncpg (async driver)
|
||||||
|
- PgAdmin/DBeaver for management
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
- Database schema design
|
||||||
|
- Alembic migrations (upgrade/downgrade)
|
||||||
|
- Indexes and query optimization
|
||||||
|
- Views for reporting
|
||||||
|
- Data seeding (AWS pricing data)
|
||||||
|
- Backup and recovery scripts
|
||||||
|
|
||||||
|
## Tables to Implement
|
||||||
|
1. **scenarios** - Scenario metadata and state
|
||||||
|
2. **scenario_logs** - Received logs with hash
|
||||||
|
3. **scenario_metrics** - Aggregated metrics over time
|
||||||
|
4. **aws_pricing** - AWS service pricing by region
|
||||||
|
5. **reports** - Generated reports metadata
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
- MUST use UUID primary keys
|
||||||
|
- MUST include created_at/updated_at timestamps
|
||||||
|
- MUST define proper foreign key constraints
|
||||||
|
- MUST create indexes on query columns
|
||||||
|
- MUST use transactions for data consistency
|
||||||
|
- MUST document all migrations
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
- Normalization (3NF)
|
||||||
|
- JSONB for flexible metadata
|
||||||
|
- Partitioning for large tables (logs)
|
||||||
|
- Soft deletes where appropriate
|
||||||
|
- Connection pooling
|
||||||
|
|
||||||
|
## Migration Rules
|
||||||
|
- One logical change = one migration
|
||||||
|
- Never modify existing migrations after push
|
||||||
|
- Include both upgrade() and downgrade()
|
||||||
|
- Test migrations on sample data
|
||||||
67
.opencode/agents/devops-engineer.md
Normal file
67
.opencode/agents/devops-engineer.md
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# @devops-engineer - Configuration
|
||||||
|
|
||||||
|
## Role
|
||||||
|
DevOps Engineer (Docker/CI/CD)
|
||||||
|
|
||||||
|
## Responsibilities
|
||||||
|
- Create Docker and Docker Compose configuration
|
||||||
|
- Set up development environment
|
||||||
|
- Configure reverse proxy (Nginx)
|
||||||
|
- Implement health checks
|
||||||
|
- Set up CI/CD pipeline (GitHub Actions)
|
||||||
|
- Manage environment variables
|
||||||
|
- Configure logging and monitoring
|
||||||
|
|
||||||
|
## Technical Stack
|
||||||
|
- Docker & Docker Compose
|
||||||
|
- Nginx (reverse proxy)
|
||||||
|
- GitHub Actions / CI
|
||||||
|
- PostgreSQL (containerized)
|
||||||
|
- Watchtower (optional, auto-updates)
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
- Dockerfile for backend (Python)
|
||||||
|
- Dockerfile for frontend (Node/Nginx)
|
||||||
|
- docker-compose.yml for full stack
|
||||||
|
- Nginx configuration
|
||||||
|
- Environment configuration (.env templates)
|
||||||
|
- Health check endpoints
|
||||||
|
- CI/CD pipeline
|
||||||
|
- Backup scripts
|
||||||
|
|
||||||
|
## Containers to Create
|
||||||
|
1. **postgres** - PostgreSQL 15 with volumes
|
||||||
|
2. **backend** - FastAPI application
|
||||||
|
3. **frontend** - React app served by Nginx
|
||||||
|
4. **nginx** - Reverse proxy (optional, can be combined)
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
- MUST use multi-stage builds
|
||||||
|
- MUST not run containers as root
|
||||||
|
- MUST use health checks
|
||||||
|
- MUST persist data with volumes
|
||||||
|
- MUST separate environments (dev/prod)
|
||||||
|
- MUST document all environment variables
|
||||||
|
|
||||||
|
## Docker Best Practices
|
||||||
|
- Layer caching optimization
|
||||||
|
- Minimal base images (python:3.11-slim, node:20-alpine)
|
||||||
|
- .dockerignore for each service
|
||||||
|
- Named volumes for persistence
|
||||||
|
- Network isolation
|
||||||
|
- Resource limits (memory/CPU)
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
- Database connection strings
|
||||||
|
- API keys and secrets
|
||||||
|
- Feature flags
|
||||||
|
- Logging levels
|
||||||
|
- CORS origins
|
||||||
|
|
||||||
|
## CI/CD Pipeline
|
||||||
|
- Lint checks (ruff, eslint)
|
||||||
|
- Type checking (mypy, tsc)
|
||||||
|
- Test execution
|
||||||
|
- Security scanning
|
||||||
|
- Docker image building
|
||||||
|
- Deployment automation
|
||||||
66
.opencode/agents/frontend-dev.md
Normal file
66
.opencode/agents/frontend-dev.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# @frontend-dev - Configuration
|
||||||
|
|
||||||
|
## Role
|
||||||
|
Frontend Developer (React/TypeScript)
|
||||||
|
|
||||||
|
## Responsibilities
|
||||||
|
- Build React components for dashboard
|
||||||
|
- Implement scenario management UI
|
||||||
|
- Create data visualization (charts)
|
||||||
|
- Implement dark/light mode
|
||||||
|
- Build forms with validation
|
||||||
|
- Integrate with backend API
|
||||||
|
|
||||||
|
## Technical Stack
|
||||||
|
- React >=18
|
||||||
|
- TypeScript (strict mode)
|
||||||
|
- Vite (build tool)
|
||||||
|
- Tailwind CSS >=3.4
|
||||||
|
- shadcn/ui components
|
||||||
|
- Recharts (data visualization)
|
||||||
|
- React Query (server state)
|
||||||
|
- Axios (HTTP client)
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
- Dashboard page with scenarios list
|
||||||
|
- Scenario creation wizard (3 steps)
|
||||||
|
- Scenario detail view (tabs)
|
||||||
|
- Scenario comparison page
|
||||||
|
- Report generation UI
|
||||||
|
- Settings page
|
||||||
|
- Responsive design (mobile-first)
|
||||||
|
|
||||||
|
## Pages to Implement
|
||||||
|
1. **Dashboard** - Scenarios overview, filters, charts
|
||||||
|
2. **Scenario Create** - Step-by-step wizard form
|
||||||
|
3. **Scenario Detail** - Tabs: Overview, Costs, Logs, PII, Reports
|
||||||
|
4. **Compare** - Side-by-side scenario comparison
|
||||||
|
5. **Settings** - Pricing, Theme, API keys
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
- MUST use TypeScript with strict types
|
||||||
|
- MUST be responsive (mobile, tablet, desktop)
|
||||||
|
- MUST implement error boundaries
|
||||||
|
- MUST use React Query for server state
|
||||||
|
- MUST implement loading states
|
||||||
|
- MUST follow component composition pattern
|
||||||
|
|
||||||
|
## Design System
|
||||||
|
- shadcn/ui base components
|
||||||
|
- Tailwind for styling
|
||||||
|
- Lucide icons
|
||||||
|
- Inter or System font
|
||||||
|
- Color palette: Slate primary, accents for states
|
||||||
|
|
||||||
|
## Accessibility
|
||||||
|
- WCAG 2.1 AA compliance
|
||||||
|
- Keyboard navigation
|
||||||
|
- Screen reader support
|
||||||
|
- Focus management
|
||||||
|
- Color contrast >= 4.5:1
|
||||||
|
|
||||||
|
## State Management
|
||||||
|
- React Query for server state
|
||||||
|
- React useState/useReducer for local state
|
||||||
|
- URL state for filters/pagination
|
||||||
|
- Context only for theme/auth
|
||||||
48
.opencode/agents/qa-engineer.md
Normal file
48
.opencode/agents/qa-engineer.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# @qa-engineer - Configuration
|
||||||
|
|
||||||
|
## Role
|
||||||
|
QA Engineer & Testing Lead
|
||||||
|
|
||||||
|
## Responsibilities
|
||||||
|
- Define testing strategy
|
||||||
|
- Write integration and E2E tests
|
||||||
|
- Perform manual testing
|
||||||
|
- Validate requirements compliance
|
||||||
|
- Report bugs with detailed reproduction steps
|
||||||
|
- Verify fixes and regressions
|
||||||
|
|
||||||
|
## Testing Types
|
||||||
|
- **Unit Tests** - pytest for backend, Jest for frontend
|
||||||
|
- **Integration Tests** - API testing with TestClient
|
||||||
|
- **E2E Tests** - Playwright or Cypress
|
||||||
|
- **Load Tests** - Locust or k6
|
||||||
|
- **Manual Testing** - Exploratory testing
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
- Test plans for each feature
|
||||||
|
- Automated test suites
|
||||||
|
- Performance benchmarks
|
||||||
|
- Security testing
|
||||||
|
- Accessibility testing (axe-core)
|
||||||
|
|
||||||
|
## Tools
|
||||||
|
- pytest (backend)
|
||||||
|
- Jest + React Testing Library (frontend)
|
||||||
|
- Playwright (E2E)
|
||||||
|
- Locust (load testing)
|
||||||
|
- Postman/Insomnia (API testing)
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
- MUST write test cases before implementation (TDD support)
|
||||||
|
- MUST achieve >80% code coverage
|
||||||
|
- MUST test edge cases and error scenarios
|
||||||
|
- MUST document test cases
|
||||||
|
- MUST maintain test data fixtures
|
||||||
|
|
||||||
|
## Bug Reporting
|
||||||
|
- Title and description
|
||||||
|
- Steps to reproduce
|
||||||
|
- Expected vs actual behavior
|
||||||
|
- Environment details
|
||||||
|
- Screenshots/logs
|
||||||
|
- Severity and priority
|
||||||
39
.opencode/agents/spec-architect.md
Normal file
39
.opencode/agents/spec-architect.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# @spec-architect - Configuration
|
||||||
|
|
||||||
|
## Role
|
||||||
|
Software Architect & Specification Lead
|
||||||
|
|
||||||
|
## Responsibilities
|
||||||
|
- Analyze PRD and create detailed technical specifications
|
||||||
|
- Design system architecture and database schema
|
||||||
|
- Define API contracts and interfaces
|
||||||
|
- Create and maintain kanban.md and progress.md
|
||||||
|
- Coordinate between backend, frontend and database teams
|
||||||
|
- Ensure technical decisions align with business requirements
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
- Architecture design (export/architecture.md)
|
||||||
|
- Database schema design (DDL)
|
||||||
|
- API specifications (OpenAPI)
|
||||||
|
- Task breakdown (export/kanban.md)
|
||||||
|
- Progress tracking (export/progress.md)
|
||||||
|
- Technology stack decisions
|
||||||
|
- Security architecture
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
- MUST NOT write implementation code
|
||||||
|
- MUST create specifications before development starts
|
||||||
|
- MUST use "Little Often" principle for task breakdown
|
||||||
|
- MUST document all architectural decisions (ADRs)
|
||||||
|
|
||||||
|
## Output Files
|
||||||
|
- export/architecture.md - System architecture
|
||||||
|
- export/kanban.md - Task breakdown
|
||||||
|
- export/progress.md - Progress tracking
|
||||||
|
- docs/architecture.md - Architecture decision records
|
||||||
|
|
||||||
|
## Communication Style
|
||||||
|
- Technical but clear
|
||||||
|
- Diagrams (ASCII or Mermaid) preferred
|
||||||
|
- Explicit acceptance criteria
|
||||||
|
- Clear dependency chains
|
||||||
421
prompt/prompt-team-standup.md
Normal file
421
prompt/prompt-team-standup.md
Normal file
@@ -0,0 +1,421 @@
|
|||||||
|
# Prompt: Team Standup - mockupAWS Development Kickoff
|
||||||
|
|
||||||
|
## 🎯 Obiettivo
|
||||||
|
|
||||||
|
Ingaggiare il team di sviluppo per verificare lo stato attuale e procedere con l'implementazione della Fase 1 (Database + Backend API) del progetto mockupAWS.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Stato Progetto
|
||||||
|
|
||||||
|
**Progetto:** mockupAWS - Backend Profiler & Cost Estimator
|
||||||
|
**Versione Target:** v0.2.0
|
||||||
|
**Data:** 2026-04-07
|
||||||
|
**Stato:** 🔴 Pianificazione / Architettura iniziale
|
||||||
|
|
||||||
|
### Cosa è stato completato ✅
|
||||||
|
|
||||||
|
1. **Documentazione:**
|
||||||
|
- ✅ PRD completo (v0.2.0) in `export/prd.md`
|
||||||
|
- ✅ README aggiornato con architettura e istruzioni
|
||||||
|
- ✅ Team configurato in `.opencode/agents/`
|
||||||
|
|
||||||
|
2. **Codice Base Iniziale:**
|
||||||
|
- ✅ FastAPI base con endpoint `/ingest`, `/metrics`, `/reset`, `/flush`
|
||||||
|
- ✅ Calcolo metriche: SQS blocks, token count (tiktoken), PII detection
|
||||||
|
- ✅ Test suite pytest con 5 test passanti
|
||||||
|
- ✅ Struttura progetto e configurazione uv/pyproject.toml
|
||||||
|
|
||||||
|
3. **Configurazione:**
|
||||||
|
- ✅ Configurazione OpenCode (`.opencode/`)
|
||||||
|
- ✅ Git repository con commit iniziale
|
||||||
|
|
||||||
|
### Cosa deve essere fatto 🔴
|
||||||
|
|
||||||
|
#### Priorità Alta (Fase 1 - v0.2.0)
|
||||||
|
|
||||||
|
- [ ] **Database PostgreSQL:**
|
||||||
|
- Schema completo (scenarios, scenario_logs, scenario_metrics, aws_pricing, reports)
|
||||||
|
- Alembic migrations setup
|
||||||
|
- Migrazioni per tutte le tabelle
|
||||||
|
- Seed dati prezzi AWS
|
||||||
|
|
||||||
|
- [ ] **Backend API:**
|
||||||
|
- Integrazione SQLAlchemy 2.0 async
|
||||||
|
- Model SQLAlchemy per tutte le tabelle
|
||||||
|
- API CRUD scenari (/api/v1/scenarios/*)
|
||||||
|
- Gestione stati scenario (draft→running→completed→archived)
|
||||||
|
- Calcolo costi usando prezzi da database
|
||||||
|
- Persistenza log e metriche
|
||||||
|
|
||||||
|
- [ ] **Testing:**
|
||||||
|
- Integration tests per API scenari
|
||||||
|
- Test coverage > 80%
|
||||||
|
|
||||||
|
#### Priorità Media (Fase 2 - v0.3.0)
|
||||||
|
|
||||||
|
- [ ] Frontend React con dashboard
|
||||||
|
- [ ] Docker Compose setup
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 👥 Team Assegnato
|
||||||
|
|
||||||
|
| Agente | Ruolo | Priorità Task |
|
||||||
|
|--------|-------|---------------|
|
||||||
|
| `@spec-architect` | Software Architect | Completare architecture.md, kanban.md, coordinamento |
|
||||||
|
| `@db-engineer` | Database Engineer | Schema DB, Alembic migrations, seed dati |
|
||||||
|
| `@backend-dev` | Backend Developer | API CRUD, integrazione DB, services |
|
||||||
|
| `@frontend-dev` | Frontend Developer | In attesa Fase 2 (preparare mock data) |
|
||||||
|
| `@devops-engineer` | DevOps Engineer | In attesa (preparare Docker base) |
|
||||||
|
| `@qa-engineer` | QA Engineer | Review requisiti, preparare test plan |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎬 Azioni Immediate
|
||||||
|
|
||||||
|
### Per @spec-architect
|
||||||
|
|
||||||
|
**Task:** Completare specifiche tecniche
|
||||||
|
|
||||||
|
1. **Leggere attentamente:**
|
||||||
|
- `/home/google/Sources/LucaSacchiNet/mockupAWS/export/prd.md` (tutto)
|
||||||
|
- `/home/google/Sources/LucaSacchiNet/mockupAWS/src/main.py` (codice esistente)
|
||||||
|
- `/home/google/Sources/LucaSacchiNet/mockupAWS/src/profiler.py`
|
||||||
|
|
||||||
|
2. **Aggiornare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/architecture.md`:
|
||||||
|
```markdown
|
||||||
|
# Da aggiungere:
|
||||||
|
- Sezione Database: schema dettagliato con tipi SQL
|
||||||
|
- Sezione API: endpoint completi con request/response
|
||||||
|
- Sezione Sicurezza: JWT, API keys, rate limiting
|
||||||
|
- Sezione Deployment: Docker strategy
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Creare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/kanban.md`:
|
||||||
|
```markdown
|
||||||
|
# Struttura richiesta:
|
||||||
|
## 🔴 TODO (Fase 1 - Database & Backend)
|
||||||
|
### DB-001: Setup Alembic
|
||||||
|
- [ ] Configurazione async
|
||||||
|
- [ ] Test connessione
|
||||||
|
|
||||||
|
### DB-002: Migrazione Scenarios
|
||||||
|
- [ ] Tabella scenarios
|
||||||
|
- [ ] Indici
|
||||||
|
|
||||||
|
### API-001: CRUD Scenari
|
||||||
|
- [ ] POST /api/v1/scenarios
|
||||||
|
- [ ] GET /api/v1/scenarios
|
||||||
|
- ...
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Aggiornare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/progress.md`:
|
||||||
|
- Stato attuale: "🔴 Fase 1 - Database setup"
|
||||||
|
- Percentuale: 10%
|
||||||
|
- Task in corso: Architettura
|
||||||
|
|
||||||
|
### Per @db-engineer
|
||||||
|
|
||||||
|
**Task:** Progettare e implementare database
|
||||||
|
|
||||||
|
1. **Progettare schema completo**:
|
||||||
|
```sql
|
||||||
|
-- scenarios
|
||||||
|
id: UUID PK
|
||||||
|
name: VARCHAR(255)
|
||||||
|
description: TEXT
|
||||||
|
tags: JSONB
|
||||||
|
status: ENUM('draft', 'running', 'completed', 'archived')
|
||||||
|
region: VARCHAR(50)
|
||||||
|
created_at: TIMESTAMP
|
||||||
|
updated_at: TIMESTAMP
|
||||||
|
total_cost_estimate: DECIMAL(10,4)
|
||||||
|
|
||||||
|
-- scenario_logs
|
||||||
|
id: UUID PK
|
||||||
|
scenario_id: UUID FK
|
||||||
|
received_at: TIMESTAMP
|
||||||
|
message_hash: VARCHAR(64) -- SHA256
|
||||||
|
message_preview: VARCHAR(500)
|
||||||
|
source: VARCHAR(100)
|
||||||
|
size_bytes: INTEGER
|
||||||
|
has_pii: BOOLEAN
|
||||||
|
token_count: INTEGER
|
||||||
|
sqs_blocks: INTEGER
|
||||||
|
|
||||||
|
-- scenario_metrics
|
||||||
|
id: UUID PK
|
||||||
|
scenario_id: UUID FK
|
||||||
|
timestamp: TIMESTAMP
|
||||||
|
metric_type: VARCHAR(50)
|
||||||
|
metric_name: VARCHAR(100)
|
||||||
|
value: DECIMAL(15,4)
|
||||||
|
unit: VARCHAR(20)
|
||||||
|
metadata: JSONB
|
||||||
|
|
||||||
|
-- aws_pricing
|
||||||
|
id: UUID PK
|
||||||
|
service: VARCHAR(50)
|
||||||
|
region: VARCHAR(50)
|
||||||
|
tier: VARCHAR(50)
|
||||||
|
price_per_unit: DECIMAL(10,8)
|
||||||
|
unit: VARCHAR(20)
|
||||||
|
effective_from: DATE
|
||||||
|
effective_to: DATE
|
||||||
|
is_active: BOOLEAN
|
||||||
|
|
||||||
|
-- reports
|
||||||
|
id: UUID PK
|
||||||
|
scenario_id: UUID FK
|
||||||
|
format: ENUM('pdf', 'csv')
|
||||||
|
file_path: VARCHAR(500)
|
||||||
|
generated_at: TIMESTAMP
|
||||||
|
metadata: JSONB
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Setup Alembic**:
|
||||||
|
```bash
|
||||||
|
cd /home/google/Sources/LucaSacchiNet/mockupAWS
|
||||||
|
uv add alembic asyncpg
|
||||||
|
uv run alembic init alembic
|
||||||
|
# Configurare per async
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Creare migrazioni**:
|
||||||
|
- `alembic/versions/001_create_scenarios_table.py`
|
||||||
|
- `alembic/versions/002_create_scenario_logs_table.py`
|
||||||
|
- `alembic/versions/003_create_scenario_metrics_table.py`
|
||||||
|
- `alembic/versions/004_create_aws_pricing_table.py`
|
||||||
|
- `alembic/versions/005_create_reports_table.py`
|
||||||
|
- `alembic/versions/006_seed_aws_pricing_data.py`
|
||||||
|
|
||||||
|
4. **Documentare** in `docs/database_schema.md`:
|
||||||
|
- Schema ER
|
||||||
|
- Indici
|
||||||
|
- Query principali
|
||||||
|
|
||||||
|
### Per @backend-dev
|
||||||
|
|
||||||
|
**Task:** Preparare integrazione database
|
||||||
|
|
||||||
|
1. **Analizzare** codice esistente:
|
||||||
|
- Come funziona `/ingest` attualmente (in-memory)
|
||||||
|
- Come adattarlo per usare database
|
||||||
|
|
||||||
|
2. **Preparare** struttura nuova:
|
||||||
|
```
|
||||||
|
backend/src/
|
||||||
|
├── models/
|
||||||
|
│ ├── __init__.py
|
||||||
|
│ ├── scenario.py # SQLAlchemy model
|
||||||
|
│ ├── scenario_log.py
|
||||||
|
│ ├── scenario_metric.py
|
||||||
|
│ └── aws_pricing.py
|
||||||
|
├── schemas/
|
||||||
|
│ ├── __init__.py
|
||||||
|
│ ├── scenario.py # Pydantic schemas
|
||||||
|
│ └── ...
|
||||||
|
├── api/
|
||||||
|
│ ├── __init__.py
|
||||||
|
│ ├── v1/
|
||||||
|
│ │ ├── __init__.py
|
||||||
|
│ │ ├── scenarios.py # CRUD endpoints
|
||||||
|
│ │ ├── ingest.py # Updated /ingest
|
||||||
|
│ │ └── pricing.py
|
||||||
|
│ └── deps.py # Dependencies (DB session)
|
||||||
|
├── services/
|
||||||
|
│ ├── __init__.py
|
||||||
|
│ ├── scenario_service.py
|
||||||
|
│ ├── cost_calculator.py
|
||||||
|
│ └── ingest_processor.py
|
||||||
|
└── core/
|
||||||
|
├── config.py # Settings (DB URL, etc.)
|
||||||
|
└── database.py # DB connection/session
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Aspettare** completamento schema DB prima di iniziare implementazione
|
||||||
|
|
||||||
|
### Per @qa-engineer
|
||||||
|
|
||||||
|
**Task:** Preparare test strategy
|
||||||
|
|
||||||
|
1. **Creare** `docs/test_plan.md`:
|
||||||
|
```markdown
|
||||||
|
# Test Plan mockupAWS v0.2.0
|
||||||
|
|
||||||
|
## Unit Tests
|
||||||
|
- [ ] ScenarioService.create()
|
||||||
|
- [ ] ScenarioService.update_status()
|
||||||
|
- [ ] CostCalculator.calculate_sqs_cost()
|
||||||
|
- [ ] CostCalculator.calculate_lambda_cost()
|
||||||
|
- [ ] IngestProcessor.process_log()
|
||||||
|
|
||||||
|
## Integration Tests
|
||||||
|
- [ ] POST /api/v1/scenarios - Crea scenario
|
||||||
|
- [ ] GET /api/v1/scenarios - Lista scenari
|
||||||
|
- [ ] POST /ingest with X-Scenario-ID - Ingest log
|
||||||
|
- [ ] GET /api/v1/scenarios/{id}/metrics - Get metrics
|
||||||
|
- [ ] State transitions: draft→running→completed
|
||||||
|
|
||||||
|
## E2E Tests (preparazione)
|
||||||
|
- [ ] Flow completo: Crea → Ingest 10 log → Verifica metriche
|
||||||
|
- [ ] Confronto costi: scenario A vs scenario B
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Review** requisiti PRD per completezza test coverage
|
||||||
|
|
||||||
|
### Per @frontend-dev (preparazione)
|
||||||
|
|
||||||
|
**Task:** Preparare ambiente e mock data
|
||||||
|
|
||||||
|
1. **Setup** struttura frontend:
|
||||||
|
```bash
|
||||||
|
mkdir -p /home/google/Sources/LucaSacchiNet/mockupAWS/frontend
|
||||||
|
cd /home/google/Sources/LucaSacchiNet/mockupAWS/frontend
|
||||||
|
npm create vite@latest . -- --template react-ts
|
||||||
|
npm install
|
||||||
|
npm install tailwindcss postcss autoprefixer
|
||||||
|
npx tailwindcss init -p
|
||||||
|
npm install @tanstack/react-query axios recharts lucide-react
|
||||||
|
npm install -D @types/node
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Preparare** mock data per sviluppo UI:
|
||||||
|
```typescript
|
||||||
|
// mock/scenarios.ts
|
||||||
|
export const mockScenarios = [
|
||||||
|
{
|
||||||
|
id: "uuid-1",
|
||||||
|
name: "Produzione Q2",
|
||||||
|
status: "running",
|
||||||
|
total_cost_estimate: 125.50,
|
||||||
|
total_requests: 15000,
|
||||||
|
created_at: "2026-04-01T10:00:00Z"
|
||||||
|
},
|
||||||
|
// ...
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Attendere** completamento API backend
|
||||||
|
|
||||||
|
### Per @devops-engineer (preparazione)
|
||||||
|
|
||||||
|
**Task:** Preparare Docker base
|
||||||
|
|
||||||
|
1. **Creare** `docker-compose.yml` base:
|
||||||
|
```yaml
|
||||||
|
version: '3.8'
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:15-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: mockupaws
|
||||||
|
POSTGRES_USER: app
|
||||||
|
POSTGRES_PASSWORD: changeme
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
|
||||||
|
# backend e frontend da aggiungere dopo
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Preparare** `backend/Dockerfile`:
|
||||||
|
```dockerfile
|
||||||
|
FROM python:3.11-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY pyproject.toml .
|
||||||
|
RUN pip install uv && uv pip install -r pyproject.toml
|
||||||
|
COPY . .
|
||||||
|
CMD ["uv", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Checklist Team
|
||||||
|
|
||||||
|
### @spec-architect
|
||||||
|
- [ ] Leggere PRD completo
|
||||||
|
- [ ] Aggiornare architecture.md con dettagli DB e API
|
||||||
|
- [ ] Creare kanban.md con task Fase 1
|
||||||
|
- [ ] Aggiornare progress.md
|
||||||
|
|
||||||
|
### @db-engineer
|
||||||
|
- [ ] Progettare schema completo
|
||||||
|
- [ ] Setup Alembic
|
||||||
|
- [ ] Creare migrazioni
|
||||||
|
- [ ] Documentare schema
|
||||||
|
|
||||||
|
### @backend-dev
|
||||||
|
- [ ] Analizzare codice esistente
|
||||||
|
- [ ] Preparare struttura nuova
|
||||||
|
- [ ] In attesa schema DB
|
||||||
|
|
||||||
|
### @qa-engineer
|
||||||
|
- [ ] Creare test_plan.md
|
||||||
|
- [ ] Review requisiti
|
||||||
|
|
||||||
|
### @frontend-dev
|
||||||
|
- [ ] Setup ambiente React
|
||||||
|
- [ ] Preparare mock data
|
||||||
|
|
||||||
|
### @devops-engineer
|
||||||
|
- [ ] Creare docker-compose.yml base
|
||||||
|
- [ ] Preparare Dockerfile backend
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 Success Criteria
|
||||||
|
|
||||||
|
La Fase 1 è completata quando:
|
||||||
|
|
||||||
|
- [ ] Database PostgreSQL funzionante con tutte le tabelle
|
||||||
|
- [ ] Migrazioni Alembic funzionanti (upgrade/downgrade)
|
||||||
|
- [ ] API CRUD scenari complete e testate
|
||||||
|
- [ ] Endpoint `/ingest` aggiornato per persistere log
|
||||||
|
- [ ] Calcolo costi usando prezzi da database
|
||||||
|
- [ ] Test coverage > 80%
|
||||||
|
- [ ] Documentazione tecnica aggiornata
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⏰ Timeline Suggerita
|
||||||
|
|
||||||
|
| Settimana | Focus | Deliverable |
|
||||||
|
|-----------|-------|-------------|
|
||||||
|
| Week 1 | Architettura + DB | Schema DB, migrazioni, architettura approvata |
|
||||||
|
| Week 2 | Backend API | CRUD scenari, persistenza, calcolo costi |
|
||||||
|
| Week 3 | Testing + Refinement | Test >80%, bug fixing, ottimizzazioni |
|
||||||
|
| Week 4 | Frontend base | Dashboard lista scenari, form creazione |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📞 Comunicazione
|
||||||
|
|
||||||
|
- **Daily standup:** Aggiornare `export/progress.md`
|
||||||
|
- **Domande tecniche:** Documentare in `docs/architecture.md`
|
||||||
|
- **Blocchi:** Aggiungere a `export/kanban.md` colonna BLOCKED
|
||||||
|
- **Decisioni:** Sempre in Conventional Commits
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Prompt creato:** 2026-04-07
|
||||||
|
**Team Lead:** @spec-architect
|
||||||
|
**Stato:** Pronto per esecuzione
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Prossima Azione Concreta
|
||||||
|
|
||||||
|
**Tutti gli agenti coinvolti:** Leggete questo prompt e la vostra configurazione in `.opencode/agents/`, poi procedete con i task assegnati.
|
||||||
|
|
||||||
|
**Priorità immediata:**
|
||||||
|
1. @spec-architect completa architecture.md
|
||||||
|
2. @db-engineer inizia schema DB
|
||||||
|
3. @backend-dev prepara struttura
|
||||||
|
|
||||||
|
Iniziate ora! 💪
|
||||||
@@ -1,141 +1,216 @@
|
|||||||
# Prompt Zero: [NOME_PROGETTO] - Project Kickoff
|
# Prompt Zero: mockupAWS - Project Kickoff
|
||||||
|
|
||||||
## 🎯 Missione
|
## 🎯 Missione
|
||||||
|
|
||||||
Sviluppare **[NOME_PROGETTO]**, [descrizione breve del progetto - da personalizzare].
|
Sviluppare **mockupAWS**, un ambiente di simulazione locale per profilare traffico log e calcolare i driver di costo AWS (SQS, Lambda, Bedrock/LLM) prima del deploy in produzione.
|
||||||
|
|
||||||
**Repository:** `[ROOT_PROGETTO]`
|
**Repository:** `/home/google/Sources/LucaSacchiNet/mockupAWS`
|
||||||
**PRD:** `[ROOT_PROGETTO]/export/prd.md`
|
**PRD:** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/prd.md`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📊 Stato Attuale
|
## 📊 Stato Attuale
|
||||||
|
|
||||||
- ✅ **PRD Completo**: Requisiti funzionali e non funzionali definiti
|
- ✅ **PRD Completo**: Requisiti funzionali e non funzionali definiti (v0.2.0)
|
||||||
- ✅ **Team Configurato**: Agenti specializzati pronti
|
- ✅ **Team Configurato**: 6 agenti specializzati pronti
|
||||||
- ❌ **Nessun Codice**: Progetto da zero
|
- ⚠️ **Codice Base Parziale**: API base implementata (v0.1), manca database e persistenza
|
||||||
- ❌ **Nessuna Specifica Tecnica**: Da creare
|
- ❌ **Database**: Schema da creare (PostgreSQL)
|
||||||
|
- ❌ **Frontend**: Dashboard React da implementare
|
||||||
|
- ❌ **Docker**: Configurazione da creare
|
||||||
|
|
||||||
|
### Cosa è già fatto:
|
||||||
|
- FastAPI base con endpoint `/ingest`, `/metrics`, `/reset`, `/flush`
|
||||||
|
- Calcolo metriche: SQS blocks, token count (tiktoken), PII detection
|
||||||
|
- Test suite pytest (5 test passanti)
|
||||||
|
- Documentazione: README, PRD, architettura
|
||||||
|
- Struttura progetto e configurazione uv
|
||||||
|
|
||||||
|
### Cosa manca (Priorità):
|
||||||
|
1. Database PostgreSQL con tabelle scenarios, logs, metrics, pricing
|
||||||
|
2. Alembic migrations
|
||||||
|
3. API CRUD scenari complete
|
||||||
|
4. Calcolo costi con prezzi AWS reali
|
||||||
|
5. Frontend React con dashboard
|
||||||
|
6. Docker Compose setup
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 👥 Team di Sviluppo
|
## 👥 Team di Sviluppo
|
||||||
|
|
||||||
| Agente | Ruolo | File Config |
|
| Agente | Ruolo | Config | Responsabilità |
|
||||||
|--------|-------|-------------|
|
|--------|-------|--------|----------------|
|
||||||
| `@spec-architect` | Definisce specifiche e architettura | `.opencode/agents/spec-architect.md` |
|
| `@spec-architect` | Software Architect | `.opencode/agents/spec-architect.md` | Specifiche tecniche, architettura, coordinamento |
|
||||||
| `@tdd-developer` | Implementazione TDD | `.opencode/agents/tdd-developer.md` |
|
| `@db-engineer` | Database Engineer | `.opencode/agents/db-engineer.md` | Schema DB, Alembic migrations, queries |
|
||||||
| `@git-manager` | Gestione commit Git | `.opencode/agents/git-manager.md` |
|
| `@backend-dev` | Backend Developer | `.opencode/agents/backend-dev.md` | FastAPI endpoints, services, tests |
|
||||||
|
| `@frontend-dev` | Frontend Developer | `.opencode/agents/frontend-dev.md` | React dashboard, UI components |
|
||||||
|
| `@devops-engineer` | DevOps Engineer | `.opencode/agents/devops-engineer.md` | Docker, CI/CD, deployment |
|
||||||
|
| `@qa-engineer` | QA Engineer | `.opencode/agents/qa-engineer.md` | Testing strategy, E2E tests |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔄 Workflow Obbligatorio
|
## 🔄 Workflow Obbligatorio
|
||||||
|
|
||||||
```
|
```
|
||||||
┌─────────────────────────────────────────────────────────────┐
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
│ FASE 1: SPECIFICA │
|
│ FASE 1: ARCHITETTURA & DATABASE │
|
||||||
│ @spec-architect │
|
│ @spec-architect + @db-engineer │
|
||||||
│ └── Legge PRD → Crea architecture.md, kanban.md │
|
│ └── Finalizza architecture.md + Crea schema DB + Migrations │
|
||||||
│ │
|
│ │
|
||||||
│ ↓ │
|
│ ↓ │
|
||||||
│ │
|
│ │
|
||||||
│ FASE 2: IMPLEMENTAZIONE │
|
│ FASE 2: BACKEND API │
|
||||||
│ @tdd-developer │
|
│ @backend-dev + @db-engineer │
|
||||||
│ └── RED → GREEN → REFACTOR per ogni task │
|
│ └── Implementa API CRUD scenari + Persistenza metriche │
|
||||||
│ │
|
│ │
|
||||||
│ ↓ │
|
│ ↓ │
|
||||||
│ │
|
│ │
|
||||||
│ FASE 3: COMMIT │
|
│ FASE 3: FRONTEND │
|
||||||
│ @git-manager │
|
│ @frontend-dev │
|
||||||
│ └── Commit atomico + Conventional Commits │
|
│ └── Dashboard React + Forms + Visualizzazione dati │
|
||||||
└─────────────────────────────────────────────────────────────┘
|
│ │
|
||||||
|
│ ↓ │
|
||||||
|
│ │
|
||||||
|
│ FASE 4: DEVOPS & QA │
|
||||||
|
│ @devops-engineer + @qa-engineer │
|
||||||
|
│ └── Docker Compose + CI/CD + Testing E2E │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🚀 Task Iniziale: Fase 1 - Specifica
|
## 🚀 Task Iniziale: Fase 1 - Architettura e Database
|
||||||
|
|
||||||
**AGENTE:** `@spec-architect`
|
**AGENTE:** `@spec-architect` + `@db-engineer`
|
||||||
|
|
||||||
**OBIETTIVO:** Analizzare il PRD e creare le specifiche tecniche dettagliate.
|
**OBIETTIVO:** Completare le specifiche tecniche e creare il database schema.
|
||||||
|
|
||||||
### Azioni Richieste
|
### Azioni Richieste
|
||||||
|
|
||||||
1. **Leggere** `[ROOT_PROGETTO]/export/prd.md`
|
#### 1. @spec-architect - Analisi e Specifiche
|
||||||
|
|
||||||
2. **Creare** la struttura di output:
|
1. **Leggere** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/prd.md`
|
||||||
```
|
|
||||||
[ROOT_PROGETTO]/export/
|
|
||||||
├── prd.md # Requisiti prodotti (estratto/dettaglio)
|
|
||||||
├── architecture.md # Architettura sistema
|
|
||||||
├── kanban.md # Task breakdown
|
|
||||||
└── progress.md # Tracciamento progresso
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Produrre** `architecture.md` con:
|
2. **Analizzare** il codice esistente in `/home/google/Sources/LucaSacchiNet/mockupAWS/src/`
|
||||||
- Stack tecnologico dettagliato
|
|
||||||
- Struttura cartelle progetto
|
|
||||||
- Diagrammi flusso dati
|
|
||||||
- Schema database completo (DDL)
|
|
||||||
- Interfacce API (OpenAPI specs)
|
|
||||||
- Sicurezza (cifratura, autenticazione)
|
|
||||||
|
|
||||||
4. **Produrre** `kanban.md` con:
|
3. **Aggiornare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/architecture.md` con:
|
||||||
- Task breakdown per Fase 1 (MVP)
|
- Stack tecnologico dettagliato (conferma FastAPI + PostgreSQL + React)
|
||||||
- Stima complessità
|
- Struttura cartelle progetto finale
|
||||||
|
- Diagrammi flusso dati (Mermaid o ASCII)
|
||||||
|
- API specifications complete (OpenAPI specs)
|
||||||
|
- Piano di sicurezza (JWT, API keys)
|
||||||
|
|
||||||
|
4. **Creare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/kanban.md` con:
|
||||||
|
- Task breakdown per Fase 1 (Database + Backend API)
|
||||||
|
- Task breakdown per Fase 2 (Frontend)
|
||||||
|
- Stima complessità (XS/S/M/L)
|
||||||
- Dipendenze tra task
|
- Dipendenze tra task
|
||||||
- Regola "little often": task < 2 ore
|
- Regola "little often": task < 2 ore
|
||||||
|
|
||||||
5. **Inizializzare** `progress.md` con:
|
5. **Inizializzare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/progress.md` con:
|
||||||
- Feature corrente: "Fase 1 - MVP"
|
- Feature corrente: "Fase 1 - Database e Backend API"
|
||||||
- Stato: "🔴 Pianificazione"
|
- Stato: "🔴 Pianificazione"
|
||||||
- Percentuale: 0%
|
- Percentuale: 10%
|
||||||
|
|
||||||
### Criteri di Accettazione
|
#### 2. @db-engineer - Schema Database
|
||||||
|
|
||||||
- [ ] Architecture.md completo con tutte le sezioni
|
1. **Progettare** schema PostgreSQL completo:
|
||||||
- [ ] Kanban.md con task pronti per @tdd-developer
|
```sql
|
||||||
- [ ] Progress.md inizializzato
|
-- Tabelle richieste:
|
||||||
- [ ] Tutti i path usano `[ROOT_PROGETTO]/`
|
- scenarios (metadata scenario)
|
||||||
|
- scenario_logs (log ricevuti con hash)
|
||||||
|
- scenario_metrics (metriche aggregate)
|
||||||
|
- aws_pricing (prezzi AWS per regione)
|
||||||
|
- reports (report generati)
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Creare** Alembic setup:
|
||||||
|
- `alembic init alembic`
|
||||||
|
- Configurare `alembic.ini`
|
||||||
|
- Creare `migrations/env.py` con async support
|
||||||
|
|
||||||
|
3. **Creare** migrazioni iniziali:
|
||||||
|
- `001_create_scenarios_table.py`
|
||||||
|
- `002_create_scenario_logs_table.py`
|
||||||
|
- `003_create_scenario_metrics_table.py`
|
||||||
|
- `004_create_aws_pricing_table.py`
|
||||||
|
- `005_create_reports_table.py`
|
||||||
|
- `006_seed_aws_pricing_data.py`
|
||||||
|
|
||||||
|
4. **Documentare** in `docs/database_schema.md`:
|
||||||
|
- Schema ER completo
|
||||||
|
- Indici creati
|
||||||
|
- Constraints e foreign keys
|
||||||
|
|
||||||
|
### Criteri di Accettazione Fase 1
|
||||||
|
|
||||||
|
- [ ] `architecture.md` completo con tutte le sezioni
|
||||||
|
- [ ] `kanban.md` con task pronti per sviluppo
|
||||||
|
- [ ] `progress.md` inizializzato con stato attuale
|
||||||
|
- [ ] Schema database progettato e documentato
|
||||||
|
- [ ] Migrazioni Alembic create e testate
|
||||||
|
- [ ] Tabelle create correttamente in PostgreSQL
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📋 Requisiti Chiave (Dal PRD)
|
## 📋 Requisiti Chiave (Dal PRD)
|
||||||
|
|
||||||
### Funzionalità MVP (Fase 1)
|
### Priorità Alta (MVP v0.2.0)
|
||||||
|
|
||||||
[DA PERSONALIZZARE - Inserire le funzionalità principali del progetto]
|
1. **Database & Persistenza**
|
||||||
|
- PostgreSQL con tabelle scenarios, logs, metrics, pricing
|
||||||
|
- Alembic migrations
|
||||||
|
- Seed dati prezzi AWS reali
|
||||||
|
|
||||||
1. **[Feature 1]**
|
2. **API Scenari**
|
||||||
- [Dettaglio 1]
|
- CRUD completo: GET/POST/PUT/DELETE /api/v1/scenarios
|
||||||
- [Dettaglio 2]
|
- Gestione stati: draft → running → completed → archived
|
||||||
|
- Associazione log a scenario via X-Scenario-ID header
|
||||||
|
|
||||||
2. **[Feature 2]**
|
3. **Calcolo Costi**
|
||||||
- [Dettaglio 1]
|
- Formula SQS: blocks × price_per_million / 1000000
|
||||||
- [Dettaglio 2]
|
- Formula Lambda: invocations × price + gb_seconds × price
|
||||||
|
- Formula Bedrock: tokens × price_per_1k / 1000
|
||||||
|
- Prezzi per regione (us-east-1, eu-west-1)
|
||||||
|
|
||||||
### Stack Tecnologico (Esempio)
|
4. **Testing**
|
||||||
|
- Test coverage > 80%
|
||||||
|
- Unit tests per services
|
||||||
|
- Integration tests per API
|
||||||
|
|
||||||
- **Backend:** [Linguaggio/Framework]
|
### Priorità Media (v0.3.0)
|
||||||
- **Database:** [Tipo database]
|
|
||||||
- **Frontend:** [Tecnologia frontend]
|
5. **Dashboard Web**
|
||||||
- **Auth:** [Metodo autenticazione]
|
- React + TypeScript + Tailwind
|
||||||
- **Task Background:** [Scheduler]
|
- Lista scenari con filtri
|
||||||
|
- Form creazione scenario
|
||||||
|
- Vista dettaglio con metriche
|
||||||
|
|
||||||
|
6. **Report**
|
||||||
|
- Export CSV
|
||||||
|
- Visualizzazione grafici
|
||||||
|
|
||||||
|
### Priorità Bassa (v0.4.0)
|
||||||
|
|
||||||
|
7. **Report PDF**
|
||||||
|
8. **Confronto scenari**
|
||||||
|
9. **Autenticazione**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🛡️ Vincoli e Best Practices
|
## 🛡️ Vincoli e Best Practices
|
||||||
|
|
||||||
### Sicurezza (Critico)
|
### Sicurezza (Critico)
|
||||||
- [Requisito sicurezza 1]
|
- SQL injection prevention (SQLAlchemy ORM)
|
||||||
- [Requisito sicurezza 2]
|
- XSS prevention (React escaping)
|
||||||
- SQL injection prevention
|
|
||||||
- XSS prevention
|
|
||||||
- CSRF protection
|
- CSRF protection
|
||||||
- Rate limiting
|
- Rate limiting (slowapi)
|
||||||
|
- Hashing messaggi per privacy
|
||||||
|
- No PII in logs persistenti
|
||||||
|
|
||||||
### Qualità
|
### Qualità
|
||||||
- Test coverage ≥ 90%
|
- Test coverage ≥ 80%
|
||||||
- TDD obbligatorio
|
- TDD obbligatorio per backend
|
||||||
|
- Type hints obbligatori (Python + TypeScript)
|
||||||
- Conventional commits
|
- Conventional commits
|
||||||
- Commit atomici
|
- Commit atomici
|
||||||
|
|
||||||
@@ -143,38 +218,62 @@ Sviluppare **[NOME_PROGETTO]**, [descrizione breve del progetto - da personalizz
|
|||||||
- Task "little often" (< 2 ore)
|
- Task "little often" (< 2 ore)
|
||||||
- Documentazione in `/export/`
|
- Documentazione in `/export/`
|
||||||
- Bug complessi in `/docs/bug_ledger.md`
|
- Bug complessi in `/docs/bug_ledger.md`
|
||||||
|
- PR con code review
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📁 Struttura Progetto Attesa
|
## 📁 Struttura Progetto Finale
|
||||||
|
|
||||||
```
|
```
|
||||||
[ROOT_PROGETTO]/
|
/home/google/Sources/LucaSacchiNet/mockupAWS/
|
||||||
├── prd.md # Product Requirements
|
├── export/ # Output spec-driven
|
||||||
|
│ ├── prd.md # Product Requirements
|
||||||
|
│ ├── architecture.md # Architettura sistema
|
||||||
|
│ ├── kanban.md # Task breakdown
|
||||||
|
│ └── progress.md # Tracciamento progresso
|
||||||
|
├── docs/
|
||||||
|
│ ├── architecture.md # ADR (Architecture Decision Records)
|
||||||
|
│ ├── bug_ledger.md # Bug tracking
|
||||||
|
│ └── database_schema.md # Schema DB documentazione
|
||||||
├── prompt/
|
├── prompt/
|
||||||
│ └── prompt-zero.md # Questo file
|
│ └── prompt-zero.md # Questo file
|
||||||
├── .opencode/
|
├── .opencode/
|
||||||
│ ├── agents/ # Configurazioni agenti
|
│ └── agents/ # Configurazioni agenti
|
||||||
│ └── skills/ # Skill condivise
|
│ ├── spec-architect.md
|
||||||
├── export/ # Output spec-driven (da creare)
|
│ ├── backend-dev.md
|
||||||
│ ├── prd.md
|
│ ├── db-engineer.md
|
||||||
│ ├── architecture.md
|
│ ├── frontend-dev.md
|
||||||
│ ├── kanban.md
|
│ ├── devops-engineer.md
|
||||||
│ └── progress.md
|
│ └── qa-engineer.md
|
||||||
├── docs/ # Documentazione (da creare)
|
├── backend/ # FastAPI application
|
||||||
│ ├── bug_ledger.md
|
│ ├── src/
|
||||||
│ └── architecture.md
|
│ │ ├── __init__.py
|
||||||
├── src/ # Codice sorgente (da creare)
|
│ │ ├── main.py # Entry point
|
||||||
│ └── [nome_package]/
|
│ │ ├── config.py # Configuration
|
||||||
│ ├── __init__.py
|
│ │ ├── models/ # SQLAlchemy models
|
||||||
│ ├── main.py
|
│ │ ├── schemas/ # Pydantic schemas
|
||||||
│ ├── config.py
|
│ │ ├── api/ # API endpoints
|
||||||
│ └── ...
|
│ │ ├── services/ # Business logic
|
||||||
├── tests/ # Test suite (da creare)
|
│ │ └── core/ # Utils, auth, etc.
|
||||||
│ ├── unit/
|
│ ├── tests/
|
||||||
│ ├── integration/
|
│ │ ├── unit/
|
||||||
│ └── conftest.py
|
│ │ ├── integration/
|
||||||
├── requirements.txt / package.json
|
│ │ └── conftest.py
|
||||||
|
│ ├── alembic/ # Database migrations
|
||||||
|
│ ├── Dockerfile
|
||||||
|
│ └── pyproject.toml
|
||||||
|
├── frontend/ # React application
|
||||||
|
│ ├── src/
|
||||||
|
│ │ ├── components/ # React components
|
||||||
|
│ │ ├── pages/ # Page components
|
||||||
|
│ │ ├── hooks/ # Custom hooks
|
||||||
|
│ │ ├── services/ # API clients
|
||||||
|
│ │ └── types/ # TypeScript types
|
||||||
|
│ ├── public/
|
||||||
|
│ ├── Dockerfile
|
||||||
|
│ └── package.json
|
||||||
|
├── docker-compose.yml # Full stack orchestration
|
||||||
|
├── nginx.conf # Reverse proxy config
|
||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -182,43 +281,55 @@ Sviluppare **[NOME_PROGETTO]**, [descrizione breve del progetto - da personalizz
|
|||||||
|
|
||||||
## ✅ Checklist Pre-Sviluppo
|
## ✅ Checklist Pre-Sviluppo
|
||||||
|
|
||||||
- [ ] @spec-architect ha letto questo prompt
|
- [ ] @spec-architect ha letto questo prompt e il PRD
|
||||||
- [ ] Cartella `export/` creata
|
- [ ] @db-engineer ha revisionato il PRD sezione database
|
||||||
- [ ] `architecture.md` creato con schema DB
|
- [ ] Team allineato sulle priorita (MVP v0.2.0)
|
||||||
- [ ] `kanban.md` creato con task Fase 1
|
- [ ] Architettura approvata
|
||||||
- [ ] `progress.md` inizializzato
|
- [ ] Schema database pronto
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🎬 Prossima Azione
|
## 🎬 Prossima Azione
|
||||||
|
|
||||||
**@spec-architect**: Inizia analizzando il PRD in `export/prd.md` e crea le specifiche tecniche in `export/`.
|
**@spec-architect**: Inizia analizzando il PRD e il codice esistente, poi aggiorna `architecture.md` e `kanban.md`.
|
||||||
|
|
||||||
**NON iniziare l'implementazione** finché le specifiche non sono approvate.
|
**@db-engineer**: Inizia progettando lo schema database e le migrazioni Alembic.
|
||||||
|
|
||||||
|
**NON iniziare l'implementazione del codice di business logic** finché architettura e schema DB non sono completati e revisionati.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📞 Note per il Team
|
## 📞 Note per il Team
|
||||||
|
|
||||||
- **Domande sul PRD?** Leggi prima `export/prd.md` completamente
|
- **Domande sul PRD?** Leggi prima `export/prd.md` completamente
|
||||||
|
- **Codice esistente?** Esamina `/home/google/Sources/LucaSacchiNet/mockupAWS/src/` prima di iniziare
|
||||||
- **Ambiguità?** Chiedi prima di procedere
|
- **Ambiguità?** Chiedi prima di procedere
|
||||||
- **Vincoli tecnici?** Documentali in `architecture.md`
|
- **Vincoli tecnici?** Documentali in `architecture.md`
|
||||||
- **Task troppo grandi?** Spezza in task più piccoli
|
- **Task troppo grandi?** Spezza in task più piccoli seguendo "little often"
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Data Creazione:** YYYY-MM-DD
|
**Data Creazione:** 2026-04-07
|
||||||
**Versione:** 1.0
|
**Versione:** 2.0
|
||||||
**Stato:** Pronto per kickoff
|
**Stato:** Pronto per kickoff - Fase 1: Architettura e Database
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📝 Note per l'Utente
|
## 📝 Note sullo Stato Attuale
|
||||||
|
|
||||||
Questo è un template. Per usarlo:
|
Il progetto ha già una base solida con:
|
||||||
|
- API FastAPI funzionante con metriche base
|
||||||
|
- Test suite completa (pytest)
|
||||||
|
- Documentazione PRD dettagliata
|
||||||
|
|
||||||
1. **Sostituisci** `[NOME_PROGETTO]` con il nome reale
|
Il team deve ora:
|
||||||
2. **Descrivi** il progetto nella sezione Missione
|
1. Completare l'architettura tecnica
|
||||||
3. **Personalizza** la sezione "Requisiti Chiave" con i tuoi requisiti
|
2. Implementare il database layer
|
||||||
4. **Aggiorna** lo stack tecnologico
|
3. Evolvere l'API esistente per supportare scenari
|
||||||
5. **Definisci** gli scope dei commit pertinenti al tuo progetto
|
4. Costruire il frontend
|
||||||
|
5. Containerizzare tutto
|
||||||
|
|
||||||
|
Il lavoro può procedere in parallelo dopo la fase di architettura:
|
||||||
|
- Backend e DB possono procedere insieme
|
||||||
|
- Frontend può iniziare con mock data
|
||||||
|
- DevOps può preparare l'infrastruttura
|
||||||
|
|||||||
Reference in New Issue
Block a user