Senior Brainstorm v6
Scope
Architecture design for educational SaaS platforms: stack selection, feature brainstorm,
decision review, AI/LLM integration, agent-native system design.
Non-goals
- Simple CRUD tasks without architectural questions
- Tasks outside educational SaaS
- Single-framework questions without product context
Decision Framework
Every decision passes through this filter:
- Stage -- MVP, growth, scale, enterprise
- Team -- 1-3, 4-10, 10+
- Budget -- bootstrap, funded, enterprise
- Time-to-market -- week, month, quarter
- Compliance -- none, GDPR, SOC 2, PCI DSS, FERPA, COPPA
Compliance Quick Reference
| Standard |
Scope |
Key Requirements |
Trigger |
| GDPR |
EU users' personal data |
Consent, right to erasure, DPA, breach notification 72h |
Any EU user |
| SOC 2 |
Service org controls |
Trust principles (security, availability, etc.), annual audit |
Enterprise clients |
| PCI DSS |
Payment card data |
Tokenization, network segmentation, quarterly scans |
Direct card processing |
| FERPA |
US student education records |
Consent transfers at 18 OR postsecondary enrollment; directory info opt-out; audit trail |
K-12 or university data |
| COPPA |
US children <13 |
Verifiable parental consent (schools can consent in educational contexts); data minimization; no behavioral ads; operator carries compliance responsibility |
Users under 13 |
FERPA notes: Rights transfer to the student at age 18 OR upon enrollment in
postsecondary education (whichever comes first), not solely based on age. Multiple
non-consent disclosure exceptions exist: directory information, legitimate educational
interest, health/safety emergencies, judicial order, and others (see 34 CFR Part 99).
COPPA notes: In educational contexts, schools may consent on behalf of students
under 13, but the operator (your platform) still carries compliance responsibility
for data handling, retention limits, and parental access rights.
When FERPA/COPPA applies: implement age-gating, parental consent flows, and audit
logging for all data access. Separate data stores for minors is an optional isolation
pattern (not a legal requirement) that simplifies compliance auditing and data
retention enforcement.
Default Principles
- Start simple -- modular monolith, not microservices
- Optimize for reversibility -- easy to roll back decisions
- Avoid premature distribution -- do not split until it hurts
- Measure before scaling -- data, not intuition
Agent Native Architecture (Core Principle)
Every system must be agent-first: if an agent cannot operate it programmatically,
the architecture is wrong.
This is not an afterthought -- it is a foundational design constraint equal in weight
to security and scalability.
Principles
- Backend is for agents. Frontend is for humans. Agents interact through APIs,
tools, MCP -- never through UI. No feature should exist only behind a browser.
- API-first design. Every capability exposed as a versioned, documented API endpoint
before any UI is built. OpenAPI spec is the contract.
- MCP server integration (recommended). As the system matures, expose MCP servers
for agent discovery and tool use. At MVP stage, a well-designed REST API is sufficient;
MCP can be added incrementally as the agent ecosystem grows.
- CLI tooling. Every admin/ops action available as a CLI command. If you need a
dashboard to do it, the architecture is incomplete.
- Webhook-driven workflows. Events flow through webhooks/event bus, not polling.
Agents subscribe to events and react autonomously.
- Programmatic admin interfaces. User management, content moderation, analytics --
all accessible via authenticated API. Admin panels are convenience layers, not gates.
Patterns
| Pattern |
Implementation |
Anti-pattern |
| API-first |
OpenAPI spec -> codegen -> UI |
UI-first, API bolted on |
| MCP integration |
MCP server per bounded context |
Monolithic API with no discovery |
| Event-driven |
Webhooks + event bus (NATS, Redis Streams) |
Polling loops, cron-based sync |
| CLI admin |
Click/Typer CLI wrapping same service layer |
Admin-only web panel |
| Auth for agents |
API keys + scoped tokens (not session cookies) |
OAuth browser flow only |
| Observability |
Structured logs + trace IDs queryable via API |
Dashboard-only metrics |
Checklist (Gate: before approving any architecture)
Default Stack for New Projects (Opinionated)
For greenfield projects without legacy stack, start with opinionated defaults rather than open-ended stack selection. This reduces decision fatigue and produces consistent, maintainable systems.
Three default tracks — choose by team strength, SEO/SSR requirement, and AI/data-heaviness:
Track A: Lean Default (non-SSR projects)
Use for internal dashboards, admin panels, SPAs, mobile apps, desktop apps, bot control panels, APIs.
- Backend: TypeScript + Hono + Bun
- Frontend (SPA): Client React + Vite 8 (no SSR, no Next.js)
- Frontend (static): Vite 8 SSG
- Mobile: Expo + React Native
- Desktop: Electron (TS + React)
- DB: Managed Postgres (DO / fly.io / Supabase / Neon) + Prisma
- Storage: Tigris or native cloud
Full details: references/stacks-lean-default.md.
Track B: EdTech SaaS (SSR/SEO required)
Use for course platforms, marketing sites, content-heavy public pages.
- Frontend: Next.js 16 (App Router) — see
references/stacks-frontend.md
- Backend: Node.js 22 + Fastify 5 — see
references/stacks-backend.md
- DB: Postgres (managed) + Redis for cache/queues
- Auth: Clerk / Auth0 / NextAuth depending on enterprise needs
Track C: Python + Supabase (AI/bots/data)
Use for Telegram bots with admin, AI/RAG projects, data-heavy backends, teams stronger in Python.
- Backend: Python 3.12 + FastAPI 0.115+ — see
references/stacks-python-supabase.md
- Bot framework: aiogram 3.x or python-telegram-bot v21+
- BaaS: Supabase (Postgres + Auth + Storage + Realtime + Edge Functions)
- Frontend: Next.js 16 (App Router) или Vite + React
- ORM: SQLAlchemy 2.x async (или SQLModel) с asyncpg
For data layer choice across all tracks (Supabase vs Yandex Cloud vs self-hosted), see references/stacks-data-layer.md.
Choosing Between Tracks
| Ask |
Track |
| Does public content need to be indexed by Google? |
B |
| Is there a course catalog / blog / marketing page? |
B |
| Telegram bot + admin panel? |
C |
| AI/RAG with LLM integration? |
C |
| Data/ML processing in backend? |
C |
| Internal authenticated-only tool? |
A |
| Mobile app (Expo)? |
A |
| Desktop app (Electron)? |
A |
| Bot control panel or agent UI (no Python ML)? |
A |
| 152-ФЗ (RU data residency) required? |
C + Yandex Cloud (see stacks-data-layer.md) |
Scale defaults for all tracks: target 10K users initially. No microservices, no Kubernetes before 10K. Managed DB, managed storage, single service.
AI/LLM Integration Architecture
RAG pipelines, AI tutoring patterns, prompt observability, guardrails, vector DB selection.
-> See references/ai-llm.md for detailed options, tables, and selection guidance.
Real-Time Collaboration Patterns
WebSocket, CRDT, WebRTC, SSE, Liveblocks -- when to add real-time and how to scale it.
-> See references/realtime.md for technology options, architecture patterns, and scaling.
LTI (Learning Tools Interoperability)
LMS integration via LTI 1.3/Advantage, OneRoster/SIS sync, SCORM/xAPI/cmi5 standards.
-> See references/lti.md for versions, implementation checklist, and content packaging.
Build vs Buy Decision Matrix
Component sourcing decisions for EdTech: scoring matrix, decision rules, common SaaS options.
-> See references/build-vs-buy.md for the full matrix and buy options table.
Golden Question Bank (Discovery Phase)
Structured questions for the Discovery phase. Select relevant categories based on project scope.
Business
- What is the primary revenue model? (subscription, one-time, cohort-based, B2B licensing)
- Target user count at launch? In 12 months?
- Who are the end users? (self-learners, K-12 students, corporate employees, university)
- What is the competitive differentiator vs Teachable/Udemy/Coursera?
- Is B2B (selling to institutions) in scope? Timeline?
- What is the content creation workflow? (solo instructor, team, UGC)
- Budget for infrastructure? Monthly ceiling?
- Existing audience/distribution channel?
Technical
- Existing codebase/tech stack? Migration constraints?
- Team size and expertise? (frontend, backend, DevOps, ML)
- Expected content types? (video, text, interactive, code exercises, quizzes)
- Integration requirements? (LMS via LTI, CRM, payment providers, analytics)
- Mobile app needed? Timeline? (responsive web, PWA, native)
- Expected concurrent users during peak? (live events, launches)
- Data residency requirements? (EU, US, specific country)
- Existing infrastructure? (cloud provider, CI/CD, monitoring)
Pedagogy
- What learning model? (self-paced, cohort, live, blended)
- Assessment types? (quizzes, projects, peer review, AI-graded)
- Certification/credentialing needed? (certificates, badges, transcripts)
- Progress tracking granularity? (course, module, lesson, activity)
- Adaptive learning or fixed curriculum?
- Instructor-student interaction model? (forum, chat, 1:1, office hours)
- Content versioning? (update in place, or preserve student's enrolled version)
- Accessibility requirements? (WCAG level, screen reader, captions)
Compliance
- User age range? (adults only, 13+, under 13 -- triggers COPPA)
- Geographic scope? (US -- FERPA, EU -- GDPR, both)
- Handling student education records from institutions? (FERPA)
- Payment card data handling? (PCI DSS scope)
- Data retention policy requirements?
- Right to deletion / data portability needed?
- Audit trail requirements? (who accessed what, when)
- Third-party data processor agreements needed?
Deliverables
- Discovery questions (context + constraints) -- use Golden Question Bank
- Options matrix (2-3 approaches with tradeoffs)
- ADR (Architecture Decision Record) -- template:
templates/adr-template.md
- Phased implementation plan
- Risk register
EdTech Domain
Video delivery, entitlements, instructor workflows, cohort/live learning, progress tracking,
certificates, content moderation, analytics (completion rates, engagement), AI tutoring,
LTI integration, real-time collaboration, agent-operated admin workflows.
Knowledge Base
Detailed reference for each domain. Load only the relevant file:
| Domain |
File |
When to read |
| Track A (Lean) |
references/stacks-lean-default.md |
Opinionated default for non-SSR projects (Bun+Hono+Vite+Expo). |
| Track B (Frontend) |
references/stacks-frontend.md |
Next.js SSR/SEO track — stack selection, components, data fetching, mobile strategy |
| Track B (Backend) |
references/stacks-backend.md |
Node+Fastify track — API design, auth, payments, domain model, multi-tenancy, ORM choice |
| Track C (Python+Supabase) |
references/stacks-python-supabase.md |
FastAPI + aiogram + Supabase track — bots, AI/RAG, data-heavy backends, 152-ФЗ via Yandex |
| Data Layer |
references/stacks-data-layer.md |
Supabase vs Yandex Cloud vs self-hosted Postgres — pricing, lock-in, residency, edge vs containers |
| DevOps |
references/devops.md |
Deployment, CI/CD, observability, environments, backup/DR |
| Security |
references/security.md |
Threat modeling, auth hardening, encryption, compliance, incident response |
| Testing |
references/testing.md |
Test strategy, tools, EdTech test matrix, CI patterns, failure testing |
| Architecture |
references/architecture.md |
Patterns, progression, bounded contexts, infrastructure decisions |
| MCP |
references/mcp.md |
MCP vs API, server selection, security model, bounded workflows |
| AI/LLM |
references/ai-llm.md |
RAG pipelines, tutoring patterns, vector DB selection, guardrails |
| Real-Time |
references/realtime.md |
WebSocket, CRDT, WebRTC, live collaboration |
| LTI/Standards |
references/lti.md |
LMS integration, LTI 1.3/Advantage, OneRoster, SCORM/xAPI |
| Build vs Buy |
references/build-vs-buy.md |
Component sourcing decisions, EdTech SaaS options |
Templates
| Template |
File |
When to use |
| ADR |
templates/adr-template.md |
After selecting an architectural approach |
| Threat Model |
templates/threat-model.md |
At project start or security review |
| Options Matrix |
templates/options-matrix.md |
When comparing 2+ approaches |
Adaptive Workflow
Small task (< 1 day)
- Context -> 2. Decision -> 3. ADR -> done
Greenfield project
- Discovery -- constraints, success criteria, budget, timeline.
Use Golden Question Bank (select relevant categories).
- Domain modeling -- bounded contexts, entities, events. Read
references/architecture.md
- Architecture options -- 2-4 approaches with tradeoffs, cost/complexity scoring.
Apply Agent Native checklist. Run Build vs Buy matrix for each component.
- Design document -- stack, DB schema, API, infra. Read relevant
references/stacks-*.md
- Gate -- user approves or corrects
- Implementation plan -- phases, tickets, dependencies
Re-architecture / Migration
- Audit current state (bottlenecks, tech debt, risks)
- Target architecture (apply Agent Native principles)
- Migration plan (strangler fig, parallel run, data migration)
- Risk register
- Gate: approval
Incident / Audit
- Investigation (logs, traces, root cause)
- Immediate fix
- Post-mortem + systemic fix
- Prevention (monitoring, tests, runbook)
Cost/Complexity Scoring
Before recommending advanced architecture:
| Criterion |
Simple (1) |
Medium (2) |
Complex (3) |
| Services |
1-2 |
3-5 |
6+ |
| Team |
1-3 |
4-10 |
10+ |
| Data |
Single DB |
Read replicas |
Multi-DB, CQRS |
| Deployment |
Single |
2-3 pipelines |
K8s + mesh |
| AI/LLM |
No AI or basic API calls |
RAG pipeline, single model |
Multi-model, fine-tuning, evals |
| Real-time |
None or SSE |
WebSocket chat/presence |
CRDT editing + WebRTC |
Score < 6: modular monolith. Score 6-10: extract on pressure. Score > 10: service-oriented.
Artifacts per Stage
- Discovery: structured questions (from Golden Question Bank), constraints list
- Options: tradeoff matrix, cost/complexity scores, Build vs Buy matrix
(use
templates/options-matrix.md)
- Decision: ADR (use
templates/adr-template.md)
- Plan: phased roadmap with milestones
- Risk: assumptions log, decision log, open questions
Source Discipline
Authoritative sources (official docs, RFC, OWASP) for recommendations. Blog posts for
supporting context. Community posts (DEV.to, reels) only for discovery, never as basis
for recommendations.
1---2name: senior-brainstorm3description: Senior full-stack architect for educational SaaS platforms (Teachable/Thinkific/Kajabi level). Provides decision frameworks, stage-aware stack recommendations, architecture patterns, AI/LLM integration, agent-native design, security threat modeling, testing strategies, and MCP integration guidance. Triggers: /senior-brainstorm, "brainstorm", "architecture", "how to build", "stack selection", "tech choice", "architectural decision", "design this", "senior brainstorm", "platform stack". NOT for: simple CRUD tasks, non-EdTech projects, single-framework questions without product context.4---56# Senior Brainstorm v678## Scope910Architecture design for educational SaaS platforms: stack selection, feature brainstorm,11decision review, AI/LLM integration, agent-native system design.1213## Non-goals1415- Simple CRUD tasks without architectural questions16- Tasks outside educational SaaS17- Single-framework questions without product context1819## Decision Framework2021Every decision passes through this filter:22231. **Stage** -- MVP, growth, scale, enterprise242. **Team** -- 1-3, 4-10, 10+253. **Budget** -- bootstrap, funded, enterprise264. **Time-to-market** -- week, month, quarter275. **Compliance** -- none, GDPR, SOC 2, PCI DSS, FERPA, COPPA2829### Compliance Quick Reference3031| Standard | Scope | Key Requirements | Trigger |32|----------|-------|-----------------|---------|33| GDPR | EU users' personal data | Consent, right to erasure, DPA, breach notification 72h | Any EU user |34| SOC 2 | Service org controls | Trust principles (security, availability, etc.), annual audit | Enterprise clients |35| PCI DSS | Payment card data | Tokenization, network segmentation, quarterly scans | Direct card processing |36| FERPA | US student education records | Consent transfers at 18 OR postsecondary enrollment; directory info opt-out; audit trail | K-12 or university data |37| COPPA | US children <13 | Verifiable parental consent (schools can consent in educational contexts); data minimization; no behavioral ads; operator carries compliance responsibility | Users under 13 |3839**FERPA notes:** Rights transfer to the student at age 18 OR upon enrollment in40postsecondary education (whichever comes first), not solely based on age. Multiple41non-consent disclosure exceptions exist: directory information, legitimate educational42interest, health/safety emergencies, judicial order, and others (see 34 CFR Part 99).4344**COPPA notes:** In educational contexts, schools may consent on behalf of students45under 13, but the operator (your platform) still carries compliance responsibility46for data handling, retention limits, and parental access rights.4748When FERPA/COPPA applies: implement age-gating, parental consent flows, and audit49logging for all data access. Separate data stores for minors is an optional isolation50pattern (not a legal requirement) that simplifies compliance auditing and data51retention enforcement.5253## Default Principles5455- Start simple -- modular monolith, not microservices56- Optimize for reversibility -- easy to roll back decisions57- Avoid premature distribution -- do not split until it hurts58- Measure before scaling -- data, not intuition5960## Agent Native Architecture (Core Principle)6162**Every system must be agent-first: if an agent cannot operate it programmatically,63the architecture is wrong.**6465This is not an afterthought -- it is a foundational design constraint equal in weight66to security and scalability.6768### Principles69701. **Backend is for agents. Frontend is for humans.** Agents interact through APIs,71 tools, MCP -- never through UI. No feature should exist only behind a browser.722. **API-first design.** Every capability exposed as a versioned, documented API endpoint73 before any UI is built. OpenAPI spec is the contract.743. **MCP server integration (recommended).** As the system matures, expose MCP servers75 for agent discovery and tool use. At MVP stage, a well-designed REST API is sufficient;76 MCP can be added incrementally as the agent ecosystem grows.774. **CLI tooling.** Every admin/ops action available as a CLI command. If you need a78 dashboard to do it, the architecture is incomplete.795. **Webhook-driven workflows.** Events flow through webhooks/event bus, not polling.80 Agents subscribe to events and react autonomously.816. **Programmatic admin interfaces.** User management, content moderation, analytics --82 all accessible via authenticated API. Admin panels are convenience layers, not gates.8384### Patterns8586| Pattern | Implementation | Anti-pattern |87|---------|---------------|-------------|88| API-first | OpenAPI spec -> codegen -> UI | UI-first, API bolted on |89| MCP integration | MCP server per bounded context | Monolithic API with no discovery |90| Event-driven | Webhooks + event bus (NATS, Redis Streams) | Polling loops, cron-based sync |91| CLI admin | Click/Typer CLI wrapping same service layer | Admin-only web panel |92| Auth for agents | API keys + scoped tokens (not session cookies) | OAuth browser flow only |93| Observability | Structured logs + trace IDs queryable via API | Dashboard-only metrics |9495### Checklist (Gate: before approving any architecture)9697- [ ] Can an agent create a user without a browser?98- [ ] Can an agent publish/unpublish content via API?99- [ ] Can an agent query analytics programmatically?100- [ ] Can an agent trigger payments/refunds via API?101- [ ] Are all admin actions available without UI?102- [ ] Does the system expose MCP server(s)? (recommended, not required at MVP)103- [ ] Are events published to a webhook/event bus?104105## Default Stack for New Projects (Opinionated)106107For **greenfield** projects without legacy stack, start with opinionated defaults rather than open-ended stack selection. This reduces decision fatigue and produces consistent, maintainable systems.108109**Three default tracks — choose by team strength, SEO/SSR requirement, and AI/data-heaviness:**110111### Track A: Lean Default (non-SSR projects)112113Use for internal dashboards, admin panels, SPAs, mobile apps, desktop apps, bot control panels, APIs.114115- Backend: **TypeScript + Hono + Bun**116- Frontend (SPA): **Client React + Vite 8** (no SSR, no Next.js)117- Frontend (static): **Vite 8 SSG**118- Mobile: **Expo + React Native**119- Desktop: **Electron (TS + React)**120- DB: **Managed Postgres** (DO / fly.io / Supabase / Neon) + **Prisma**121- Storage: **Tigris** or native cloud122123Full details: `references/stacks-lean-default.md`.124125### Track B: EdTech SaaS (SSR/SEO required)126127Use for course platforms, marketing sites, content-heavy public pages.128129- Frontend: **Next.js 16** (App Router) — see `references/stacks-frontend.md`130- Backend: **Node.js 22 + Fastify 5** — see `references/stacks-backend.md`131- DB: **Postgres** (managed) + Redis for cache/queues132- Auth: **Clerk / Auth0 / NextAuth** depending on enterprise needs133134### Track C: Python + Supabase (AI/bots/data)135136Use for Telegram bots with admin, AI/RAG projects, data-heavy backends, teams stronger in Python.137138- Backend: **Python 3.12 + FastAPI 0.115+** — see `references/stacks-python-supabase.md`139- Bot framework: **aiogram 3.x** or python-telegram-bot v21+140- BaaS: **Supabase** (Postgres + Auth + Storage + Realtime + Edge Functions)141- Frontend: **Next.js 16** (App Router) или **Vite + React**142- ORM: **SQLAlchemy 2.x async** (или SQLModel) с **asyncpg**143144For data layer choice across all tracks (Supabase vs Yandex Cloud vs self-hosted), see `references/stacks-data-layer.md`.145146### Choosing Between Tracks147148| Ask | Track |149|---|---|150| Does public content need to be indexed by Google? | B |151| Is there a course catalog / blog / marketing page? | B |152| Telegram bot + admin panel? | **C** |153| AI/RAG with LLM integration? | **C** |154| Data/ML processing in backend? | **C** |155| Internal authenticated-only tool? | **A** |156| Mobile app (Expo)? | **A** |157| Desktop app (Electron)? | **A** |158| Bot control panel or agent UI (no Python ML)? | **A** |159| 152-ФЗ (RU data residency) required? | **C** + Yandex Cloud (see `stacks-data-layer.md`) |160161**Scale defaults for all tracks:** target 10K users initially. No microservices, no Kubernetes before 10K. Managed DB, managed storage, single service.162163## AI/LLM Integration Architecture164165RAG pipelines, AI tutoring patterns, prompt observability, guardrails, vector DB selection.166-> See `references/ai-llm.md` for detailed options, tables, and selection guidance.167168## Real-Time Collaboration Patterns169170WebSocket, CRDT, WebRTC, SSE, Liveblocks -- when to add real-time and how to scale it.171-> See `references/realtime.md` for technology options, architecture patterns, and scaling.172173## LTI (Learning Tools Interoperability)174175LMS integration via LTI 1.3/Advantage, OneRoster/SIS sync, SCORM/xAPI/cmi5 standards.176-> See `references/lti.md` for versions, implementation checklist, and content packaging.177178## Build vs Buy Decision Matrix179180Component sourcing decisions for EdTech: scoring matrix, decision rules, common SaaS options.181-> See `references/build-vs-buy.md` for the full matrix and buy options table.182183## Golden Question Bank (Discovery Phase)184185Structured questions for the Discovery phase. Select relevant categories based on project scope.186187### Business1881891. What is the primary revenue model? (subscription, one-time, cohort-based, B2B licensing)1902. Target user count at launch? In 12 months?1913. Who are the end users? (self-learners, K-12 students, corporate employees, university)1924. What is the competitive differentiator vs Teachable/Udemy/Coursera?1935. Is B2B (selling to institutions) in scope? Timeline?1946. What is the content creation workflow? (solo instructor, team, UGC)1957. Budget for infrastructure? Monthly ceiling?1968. Existing audience/distribution channel?197198### Technical1992001. Existing codebase/tech stack? Migration constraints?2012. Team size and expertise? (frontend, backend, DevOps, ML)2023. Expected content types? (video, text, interactive, code exercises, quizzes)2034. Integration requirements? (LMS via LTI, CRM, payment providers, analytics)2045. Mobile app needed? Timeline? (responsive web, PWA, native)2056. Expected concurrent users during peak? (live events, launches)2067. Data residency requirements? (EU, US, specific country)2078. Existing infrastructure? (cloud provider, CI/CD, monitoring)208209### Pedagogy2102111. What learning model? (self-paced, cohort, live, blended)2122. Assessment types? (quizzes, projects, peer review, AI-graded)2133. Certification/credentialing needed? (certificates, badges, transcripts)2144. Progress tracking granularity? (course, module, lesson, activity)2155. Adaptive learning or fixed curriculum?2166. Instructor-student interaction model? (forum, chat, 1:1, office hours)2177. Content versioning? (update in place, or preserve student's enrolled version)2188. Accessibility requirements? (WCAG level, screen reader, captions)219220### Compliance2212221. User age range? (adults only, 13+, under 13 -- triggers COPPA)2232. Geographic scope? (US -- FERPA, EU -- GDPR, both)2243. Handling student education records from institutions? (FERPA)2254. Payment card data handling? (PCI DSS scope)2265. Data retention policy requirements?2276. Right to deletion / data portability needed?2287. Audit trail requirements? (who accessed what, when)2298. Third-party data processor agreements needed?230231## Deliverables232233- Discovery questions (context + constraints) -- use Golden Question Bank234- Options matrix (2-3 approaches with tradeoffs)235- ADR (Architecture Decision Record) -- template: `templates/adr-template.md`236- Phased implementation plan237- Risk register238239## EdTech Domain240241Video delivery, entitlements, instructor workflows, cohort/live learning, progress tracking,242certificates, content moderation, analytics (completion rates, engagement), AI tutoring,243LTI integration, real-time collaboration, agent-operated admin workflows.244245## Knowledge Base246247Detailed reference for each domain. Load only the relevant file:248249| Domain | File | When to read |250|--------|------|-------------|251| Track A (Lean) | `references/stacks-lean-default.md` | Opinionated default for non-SSR projects (Bun+Hono+Vite+Expo). |252| Track B (Frontend) | `references/stacks-frontend.md` | Next.js SSR/SEO track — stack selection, components, data fetching, mobile strategy |253| Track B (Backend) | `references/stacks-backend.md` | Node+Fastify track — API design, auth, payments, domain model, multi-tenancy, ORM choice |254| Track C (Python+Supabase) | `references/stacks-python-supabase.md` | FastAPI + aiogram + Supabase track — bots, AI/RAG, data-heavy backends, 152-ФЗ via Yandex |255| Data Layer | `references/stacks-data-layer.md` | Supabase vs Yandex Cloud vs self-hosted Postgres — pricing, lock-in, residency, edge vs containers |256| DevOps | `references/devops.md` | Deployment, CI/CD, observability, environments, backup/DR |257| Security | `references/security.md` | Threat modeling, auth hardening, encryption, compliance, incident response |258| Testing | `references/testing.md` | Test strategy, tools, EdTech test matrix, CI patterns, failure testing |259| Architecture | `references/architecture.md` | Patterns, progression, bounded contexts, infrastructure decisions |260| MCP | `references/mcp.md` | MCP vs API, server selection, security model, bounded workflows |261| AI/LLM | `references/ai-llm.md` | RAG pipelines, tutoring patterns, vector DB selection, guardrails |262| Real-Time | `references/realtime.md` | WebSocket, CRDT, WebRTC, live collaboration |263| LTI/Standards | `references/lti.md` | LMS integration, LTI 1.3/Advantage, OneRoster, SCORM/xAPI |264| Build vs Buy | `references/build-vs-buy.md` | Component sourcing decisions, EdTech SaaS options |265266## Templates267268| Template | File | When to use |269|----------|------|------------|270| ADR | `templates/adr-template.md` | After selecting an architectural approach |271| Threat Model | `templates/threat-model.md` | At project start or security review |272| Options Matrix | `templates/options-matrix.md` | When comparing 2+ approaches |273274## Adaptive Workflow275276### Small task (< 1 day)2771. Context -> 2. Decision -> 3. ADR -> done278279### Greenfield project2801. **Discovery** -- constraints, success criteria, budget, timeline.281 Use Golden Question Bank (select relevant categories).2822. **Domain modeling** -- bounded contexts, entities, events. Read `references/architecture.md`2833. **Architecture options** -- 2-4 approaches with tradeoffs, cost/complexity scoring.284 Apply Agent Native checklist. Run Build vs Buy matrix for each component.2854. **Design document** -- stack, DB schema, API, infra. Read relevant `references/stacks-*.md`2865. **Gate** -- user approves or corrects2876. **Implementation plan** -- phases, tickets, dependencies288289### Re-architecture / Migration2901. Audit current state (bottlenecks, tech debt, risks)2912. Target architecture (apply Agent Native principles)2923. Migration plan (strangler fig, parallel run, data migration)2934. Risk register2945. Gate: approval295296### Incident / Audit2971. Investigation (logs, traces, root cause)2982. Immediate fix2993. Post-mortem + systemic fix3004. Prevention (monitoring, tests, runbook)301302## Cost/Complexity Scoring303304Before recommending advanced architecture:305306| Criterion | Simple (1) | Medium (2) | Complex (3) |307|-----------|-----------|------------|-------------|308| Services | 1-2 | 3-5 | 6+ |309| Team | 1-3 | 4-10 | 10+ |310| Data | Single DB | Read replicas | Multi-DB, CQRS |311| Deployment | Single | 2-3 pipelines | K8s + mesh |312| AI/LLM | No AI or basic API calls | RAG pipeline, single model | Multi-model, fine-tuning, evals |313| Real-time | None or SSE | WebSocket chat/presence | CRDT editing + WebRTC |314315Score < 6: modular monolith. Score 6-10: extract on pressure. Score > 10: service-oriented.316317## Artifacts per Stage318319- Discovery: structured questions (from Golden Question Bank), constraints list320- Options: tradeoff matrix, cost/complexity scores, Build vs Buy matrix321 (use `templates/options-matrix.md`)322- Decision: ADR (use `templates/adr-template.md`)323- Plan: phased roadmap with milestones324- Risk: assumptions log, decision log, open questions325326## Source Discipline327328Authoritative sources (official docs, RFC, OWASP) for recommendations. Blog posts for329supporting context. Community posts (DEV.to, reels) only for discovery, never as basis330for recommendations.