Standard production layout: the OKR app (was nested under AINative_OKR_CASAN5/) is now
the repository root. No more wrapper directory.
- Promote AINative_OKR_CASAN5/* -> repo root (backend/ frontend/ packages/ apps/
.specify/ docs/ infra/ nginx/ scripts/ + configs). Merge tool dirs: .gitea (kept the
active deploy ci.yml, added harness-ci.yml + runbooks), .claude (agents/commands +
launch.json), .github moved up.
- Remove redundant: 00_SUBMISSION_PACKAGE, scattered root notes (FPT_CASAN_Full.md,
tu-tuong-casan.md, casan-tu-sinh..., casan_harness_assessment.md, source-review...,
README_CASAN5_REFINED.md), casan-next-plans/ and optimize-docs/ (competition/planning
artifacts — roadmap + design history preserved in git log / commit messages).
- Update all references to the old layout:
- .gitea/workflows/{ci,harness-ci}.yml, .github/workflows/{ci,deploy}.yml:
working-directory .; drop AINative_OKR_CASAN5/ prefix; .specify/{tests,scripts}
-> packages/casan-harness/... (.specify/logs state kept)
- .claude/launch.json, .gitea/*-runbook.md: path prefixes
- CLAUDE.md, README.md: docs/input -> apps/okr/domain/input
- policy-bundle.yaml: 8 policy paths -> packages/casan-harness/...; manifest re-signed
- secrets-scan.sh: fixture excludes -> new package/domain paths.
Full gate from the new root: PASS=64 FAIL=0 SKIP=3.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4.3 KiB
4.3 KiB
Common Delegation Block for speckit.implement
This delegation block is used by the Boss when invoking speckit.implement in Step 10.
Sub-agent already knows its own workflow — Boss only passes step-specific context.
Standard Context (always included)
feature-id: <feature-id>
module-id: <mod-id>
report-nn: <NN>
report-phase: <phase-name>
pipeline-context: docs/output/output_logs/<feature-id>/pipeline-context.yaml
mode: autonomous
language: Vietnamese
Real Execution Mandate
ALL terminal commands MUST be executed via the run tool with real output captured.
- PROHIBITED: Documenting commands without executing, mock output, skipping npm commands.
- REQUIRED: Use
get_errorsafter every code edit to verify compile/lint errors are resolved. - REQUIRED: For frontend under
frontend/, runnpm installifnode_modules/does not exist.
⛔ Portable Database Schema Rules (Post-Mortem P-02, P-05)
When generating Prisma schema:
- Do NOT use
enumin schema.prisma — SQLite does not support enums. UseStringtype with@default("VALUE")instead. - Do NOT use
@db.VarChar(),@db.Text, or any provider-specific annotations — these break when switching providers. - Create
backend/src/common/types/domain-enums.tswith TypeScriptconstarrays + derived types for all domain enumerations:export const ROLES = ['ADMIN', 'MANAGER', 'EMPLOYEE'] as const; export type Role = (typeof ROLES)[number]; - Import enums from
domain-enums.ts, NEVER from@prisma/clientenum types. - Use
provider = "sqlite"as default for local dev. Only switch to MySQL/PostgreSQL when Docker is confirmed available.
⛔ Mandatory .env File Creation (Post-Mortem P-03)
During Step 10 implementation, the agent MUST:
- Create
backend/.envwith at minimum:DATABASE_URL="file:./dev.db" JWT_SECRET=<random-generated-secret> JWT_REFRESH_SECRET=<random-generated-secret> PORT=3000 - Create
backend/.env.example(same keys, placeholder values) for documentation. - NEVER hardcode JWT secrets, database URLs, or API keys in source code. All secrets MUST be read from
process.env. - Add
.envto.gitignore(but NOT.env.example).
⛔ Security: Secrets Management (Post-Mortem P-09)
- JWT_SECRET, JWT_REFRESH_SECRET, DATABASE_URL → env-only, NEVER in source files
- Use
@nestjs/configConfigServiceorprocess.envto read secrets at runtime - If
technical_architecture.mdsays "hardcoded (workshop)" → OVERRIDE: still use env vars. Security trumps convenience.
⛔ React Frontend Quality Rules (Post-Mortem P-06, P-07)
- React Router future flags: When using React Router DOM v6, ALWAYS add future flags to
<BrowserRouter>:<BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}> - NEVER call
navigate()during render. Use<Navigate to="..." replace />component for conditional redirects in render body. - ADMIN role queries: When implementing list/dashboard endpoints, ADMIN role MUST see ALL records (not filtered by
ownerId). Add role-based query logic:const where = user.role === 'ADMIN' ? {} : { ownerId: user.id };
Step-Specific Additional Instructions
STEP 10 — Implementation + Build & Fix
Phase 1 — Implement:
Execute all tasks in specs/<feature-id>/tasks.md phase by phase.
Track every file created/modified in the report's Artifacts section.
Phase 2 — Build & Fix:
Build the application and fix all compile/runtime errors. Do NOT launch the screen.
Execute in order:
1. Fix all compile/lint errors (get_errors → fix → repeat until zero)
2. Build frontend: cd frontend && npm install && npm run build
3. Start Docker (if docker-compose.dev.yml exists): docker compose -f docker/docker-compose.dev.yml up -d
4. Build backend: cd backend && npm install && npm run build
5. Verify startup (if Docker available): cd backend && npm run start:dev
UI Layout Convention (for frontend work)
Read
docs/technical_architecture.md §IVfor all UI layout rules. Shared components:AppLayout.jsx,SystemHeader.jsx,ModuleNav.jsxunderfrontend/src/components/shared/Create if not exist, reuse if they do. Wrap ALL page components in<AppLayout>.