Imported from ecaraujo/mba-ia-greenfield-project (
AGENTS.md). Install upstream withnpx skills add ecaraujo/mba-ia-greenfield-project. Copyright stays with the author.
AGENTS.md
Project Overview
StreamTube is a YouTube-like video sharing platform. The repository is a monorepo with:
nestjs-project/: NestJS 11 backend API and background workers.next-frontend/: Next.js frontend. Video UI is outside Phase 03 scope.docs/: architecture, technical decisions, phase plans, and progress.
Read docs/project-plan.md for product scope and CLAUDE.md for the complete existing project guidance. This file is the Codex entry point and has the same authority as the root CLAUDE.md.
Architecture
- NestJS API owns business rules, authentication, database writes, upload orchestration, and queue publication.
- PostgreSQL stores users, channels, videos, tokens, and later social data.
- S3-compatible object storage stores source videos and thumbnails. Local development uses MinIO.
- A dedicated FFmpeg worker consumes video-processing jobs from the queue.
- Services running in Docker must address each other by Compose service name, never
localhostor127.0.0.1.
Required Planning Workflow
For phases, follow the repository pipeline in order:
research->docs/decisions/technical-decisions-<phase>.mdplan-context->context.mdplan-validate->validation.mdplan-resolve-> resolved decisions/context pluslibrary-refs.md- Repeat validate/resolve until validation status is
clean. plan-build-> executable plan with SIs, Technical Specifications, dependency map, and deliverables.implement-> code andprogress.md, one SI at a time.
Codex-compatible wrappers for the canonical repository skills live in .agents/skills/. The original .claude/skills/ files remain the single source of workflow instructions. Do not implement a phase before its validation.md is clean.
Working Principles
- Preserve clear module and service responsibilities. Extract ownership into the proper domain immediately.
- Use strict TypeScript and explicit contracts at external boundaries.
- Follow repository patterns in
auth/,users/, andchannels/rather than rewriting established infrastructure. - Use migrations; never enable TypeORM
synchronizefor application schema changes. - Keep documentation traceable to a requirement, decision, plan SI, or implemented behavior.
- Before using a new or uncertain library API, inspect the installed version and consult Context7 or official primary documentation for that version.
Definition of Done
A change is complete only when all of these pass in the relevant project container:
- Relevant unit, integration, and e2e tests.
- Full test suite.
npx tsc --noEmitwith exit code 0.npm run lint.
Git Flow
- Never commit directly to
main. - Feature branches originate from
devand merge back todev. - Use short, descriptive commits focused on why the change exists.
- Preserve unrelated user changes and avoid destructive Git commands.
Testing Conventions
*.spec.ts: unit tests; no real database or external I/O.*.integration-spec.ts: real database, repository, queue, or storage contracts.*.e2e-spec.ts: full HTTP contract through Supertest undernestjs-project/test/.- Run database-sharing suites serially with
--runInBand.
Codex Foundation
- Project instructions:
AGENTS.mdand nestedAGENTS.mdfiles. - Skills:
.agents/skills/wrappers pointing to canonical.claude/skills/instructions. - Read-only workflow agents:
.codex/agents/wrappers pointing to canonical.claude/agents/instructions. - MCP:
.codex/config.tomlconfigures Context7 and PostgreSQL for trusted local Codex sessions.