Initial commit: VoIdeaAI - voice-first AI idea assistant

This commit is contained in:
2026-05-13 12:51:42 +03:00
commit 688d043dad
421 changed files with 47915 additions and 0 deletions
+191
View File
@@ -0,0 +1,191 @@
# System Prompt for AI (OpenCode) - VoIdea
**Role:** Senior Software Architect and Product Analyst
**Project:** VoIdea - Voice Ideas Application
---
## 1. Primary Rule
**00-rules.md is PRIORITY.** If something is not described in a specific block - check 00-rules.md first. Only then ask user.
---
## 2. Project Overview
VoIdea is a hybrid app (mobile + web) for capturing and developing ideas using group AI analysis.
### Key Features
- Voice input
- 11 AI agents for idea analysis
- Cross-device sync
- AES-256 encryption
- Offline support (PWA)
### Tech Stack
- Backend: Python FastAPI, Port 8020
- Database: PostgreSQL
- Cache: Redis + Celery
- Frontend: React + TypeScript + Tailwind CSS
---
## 3. Working with AI Agents
### AI Agents (11 roles for idea analysis)
1. Coordinator
2. Task Organizer
3. Business Analyst
4. Lawyer
5. Financial Advisor
6. Solution Architect
7. Tester
8. UI Designer
9. SMM Specialist
10. Life Coach
11. Accessibility Expert
Prompts stored in: docs/agent_prompts.yaml (TDC)
### System Agents (11 agents for automation)
1. DocAgent - Documentation
2. AuditAgent - Rules compliance
3. SecurityAgent - Security
4. SpecAgent - Specifications, versioning
5. ObserverAgent - User behavior
6. QATesterAgent - Functional testing
7. FixAgent - Bug fixes
8. UITestAgent - Visual testing
9. RolloutAgent - Gradual deployment
10. EvolutionAgent - Self-improvement
11. BacklogAgent - Task management
---
## 4. Architecture
Layers (dependencies only inward):
`
API -> Services -> Integrations -> Data Layer -> Core
`
SOLID principles apply.
Module public API in __init__.py only.
---
## 5. Code Style
- UTF-8, 4 spaces, 88 char line length
- snake_case for vars/functions
- PascalCase for classes
- UPPER_SNAKE_CASE for constants
- Type annotations required
- Imports: stdlib -> third-party -> local
---
## 6. Documentation
- Google-style docstrings
- README.md in each app/* folder
- Update docs on changes
- TODO with task number
---
## 7. Testing
- Unit tests: tests/unit/
- Integration tests: tests/integration/
- Minimum 1 smoke test per endpoint
- pytest with asyncio_mode=auto
---
## 8. Versioning
Format: MAJOR.MINOR.PATCH
CHANGELOG: CHANGELOG/vX.Y.md (new file on X or Y change)
Conventional Commits: feat, fix, docs, refactor, test, chore
---
## 9. Security
- .env never in git
- JWT: HS256, 60min access, 30 days refresh
- Passwords: bcrypt
- Pydantic validation on all inputs
- RBAC: user, admin, owner
---
## 10. Design System
Source of truth: docs/design-system/tokens.json
Includes: colors, typography, spacing, shadows
Themes: system (auto), dark, light
---
## 11. Error Handling
| Layer | Action |
|-------|--------|
| API | HTTPException with detail and status_code |
| Services | Business exceptions, no HTTP |
| Integrations | try/except with fallback |
| DB | Errors don't bubble up |
---
## 12. Logging
Format: [ISO8601] [LEVEL] [component] message key=val
No f-strings in logger (lazy evaluation).
Never log: passwords, JWT, API keys, raw email.
---
## 13. Rollout Process
Gradual deployment: 3 users -> 1% -> 5% -> 15% -> 100%
Controlled by RolloutAgent.
Manual trigger via admin panel.
---
## 14. Project Structure
`
voidea/
├── app/
│ ├── agents/ # System agents (11)
│ ├── core/ # Config, base, security
│ ├── models/ # Database models
│ ├── api/ # API endpoints
│ ├── services/ # Business logic
│ └── integrations/ # External services
├── docs/
│ ├── blocks/ # Project blocks
│ ├── design-system/ # Design tokens
│ ├── instructions/ # For AI and humans
│ ├── specs/ # Specifications
│ └── ...
├── tests/
└── CHANGELOG/
`
---
## 15. Before Starting Work
1. Read docs/blocks/00-rules.md
2. Check docs/blocks/PLAN.md for current phase
3. Check docs/instructions/ for relevant instructions
4. Update TODO list if needed
---
*Updated: 2026-05-10*
+105
View File
@@ -0,0 +1,105 @@
# Developer Instructions - VoIdea
**Date:** 2026-05-10
---
## Prerequisites
1. Python 3.12+
2. PostgreSQL (local)
3. Redis (optional for local dev)
---
## Setup
`ash
# 1. Clone repository
git clone <repo>
cd voidea
# 2. Create venv
python -m venv venv
source venv/Scripts/activate # Windows
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment
cp .env.example .env
# Edit .env with your values
# 5. Database setup
alembic upgrade head
# 6. Run application
uvicorn app.main:app --reload --port 8020
`
---
## Key Commands
`ash
# Lint
ruff check .
# Format
ruff format .
# Type check
mypy .
# Tests
pytest
# With coverage
pytest --cov=app tests/
# Run specific test
pytest tests/unit/test_core.py -v
`
---
## Project Structure
- pp/ - Application code
- docs/ - Documentation
- ests/ - Tests
---
## Naming Conventions
- Variables/Functions: snake_case
- Classes: PascalCase
- Constants: UPPER_SNAKE_CASE
- Files: snake_case.py
---
## Adding New Feature
1. Create feature branch: git checkout -b feature/description
2. Implement code
3. Write tests
4. Update documentation
5. Create PR
6. After approval: merge to develop, then main
---
## Rules
1. Always read 00-rules.md first
2. Follow code style (ruff, mypy)
3. Write docstrings
4. Update docs on changes
5. Tests required
6. No secrets in code
---
*Updated: 2026-05-10*
+91
View File
@@ -0,0 +1,91 @@
# Tester Instructions - VoIdea
**Date:** 2026-05-10
---
## Testing Overview
### Test Types
1. **Unit Tests** - tests/unit/
- Test individual functions/methods
- Mock external dependencies
2. **Integration Tests** - tests/integration/
- Test API endpoints
- Test database operations
- Test with real services
3. **E2E Tests** - docs/specs/e2e/
- User scenarios
- Cross-module behavior
---
## Running Tests
`ash
# All tests
pytest
# Specific file
pytest tests/unit/test_services.py -v
# With coverage
pytest --cov=app --cov-report=html
# Watch mode
pytest --watch
`
---
## Writing Tests
`python
async def test_create_idea():
# Arrange
user = await create_test_user()
# Act
result = await idea_service.create(
user_id=user.id,
title="Test Idea"
)
# Assert
assert result.title == "Test Idea"
assert result.user_id == user.id
`
---
## Test Coverage Goals
- Minimum: 1 smoke test per endpoint
- Target: 80% coverage
- Critical paths: 100%
---
## Bug Reporting
Report format:
1. Description
2. Steps to reproduce
3. Expected vs actual
4. Logs/screenshots
5. Environment
---
## QA Agents
- QATesterAgent: Functional testing, temp users
- FixAgent: Bug fixes
- UITestAgent: Visual testing
---
*Updated: 2026-05-10*
+63
View File
@@ -0,0 +1,63 @@
# Admin Instructions - VoIdea
**Date:** 2026-05-10
---
## Admin Panel
Access: /admin
### Features
1. **Logs Viewer**
- Filter by type, date, severity
- Color-coded severity: red (critical), orange (warning)
- Export logs
2. **Agent Control**
- View agent status
- Start/stop agents manually
- View agent reports
3. **User Management**
- View users
- Manage roles
- Disable accounts
4. **System Health**
- Database status
- Redis status
- Server uptime
---
## Logs
Location: PostgreSQL (system_logs table) + files (logs/)
Severity levels:
- ERROR: Red + email notification
- WARNING: Orange
- INFO: No highlight
---
## Agent Commands
- "Run Test" button -> starts QATesterAgent
- "View Report" -> shows last agent report
- "Stop Task" -> cancels running agent
---
## Monitoring
Key metrics:
- API response time: < 500ms
- Database queries: < 100ms
- Uptime: > 99.9%
---
*Updated: 2026-05-10*