Imported from CGProductionHouse/CG-Dynamics (
AGENTS.md). Install upstream withnpx skills add CGProductionHouse/CG-Dynamics. Copyright stays with the author.
AGENTS.md — CG Dynamics agent instructions
Shared operating instructions for Codex, Claude Code, OpenCode and any other coding agent working in this repo. Read this before making changes.
Mandatory continuity reads
Before planning or editing code, read:
docs/ops/CG-DYNAMICS-OPS-HANDOVER.md— canonical fresh-chat operational handover: Supervisor #381, Google Control Centre, ownership/capacity rules, model routing, protected gates and current ops snapshot.docs/ai-workforce/MASTER-AI-TOOLS-AND-WORKFLOW.md— cross-project AI tools, agent allocation, new-chat grounding, OpenCode state and reusable website workflow.docs/ai-workforce/AUTONOMOUS-CODING-ORCHESTRATION.md— canonical wake/supervise workflow, GitHub-as-control-plane rules, agent lanes, model fallback and CA-removal-from-dispatch strategy.docs/ai-workforce/CA-CODING-PROMPT-CONTRACT.md— mandatory short-prompt contract for any coding-agent prompt CA manually copies/runs.CONTINUE-HERE.mddocs/vision/PROJECT-CONTINUITY-HANDOFF-2026-08-13.mddocs/cg-dynamics-page-vision-and-milestones.mddocs/current-product-game-plan.mddocs/vision/CURRENT-MILESTONE.mddocs/ai-workforce/AI-TOOLING-MODEL-ROUTING.mdwhen changing detailed provider/model configuration- the latest relevant open PRs/issues on GitHub
The ops handover is the first-stop authority for recovering current CG Dynamics coordination state in a fresh chat. The master AI/tools file is cross-project authority for shared capability/process. The autonomous orchestration file is the current authority for how coding workers are woken, supervised, handed off and prevented from duplicating one another. The CA coding-prompt contract is mandatory whenever ChatGPT or another coordinator prepares a prompt CA will manually send to a coding agent. Project-specific continuity files remain authority for CG Dynamics product decisions. The 2026-08-13 handoff is current. Older handoffs are historical only. Page contracts override generic product ideas.
Continuity write-back obligation
Any coordinator or coding supervisor that materially changes CG Dynamics operating state must maintain docs/ops/CG-DYNAMICS-OPS-HANDOVER.md as part of the same handoff.
Do not treat the handover as read-only documentation. When ownership, lane status, production state, protected gates, model routing, or durable operating rules materially change:
- update the owning issue/PR;
- update #381 when cross-lane state changed;
- update the Google Control Centre;
- update the ops handover if its current snapshot/rules changed.
Before a chat/session is handed off or becomes context-heavy, reconcile the handover against current GitHub + #381 + tracker so the next chat can continue without CA repeating history.
Product direction
CG Dynamics is CG Production House's internal operating system. Three product areas:
- Client Intelligence — Clients, Performance, reports, integrations and client-safe projections.
- Operations Hub — Hub, Work, Planner, Client Schedule, CG Calendar and team workflow.
- AI Workforce — CG Assistant, Marketing/Knowledge and specialist agents grounded in reviewed evidence.
Source of truth
- GitHub
mainis the committed source of truth. - Open PR state is source of truth for in-flight work. Continue an existing PR when it owns the requested area.
monthly_deliverablesis Client Schedule truth;/admin/client-scheduleis its editing surface.- Planner/Work (
planner_tasks) is separate operational task truth. - One Content Run has one canonical Content Guideline.
Non-regression rules
Do not redo solved architecture:
- #176 completed-task authority: PR #188.
- #177 Outlook duplicate architecture: PR #189; remaining work is rollout/acceptance.
- Client Portal explicit visibility: PR #192; no unsafe fallbacks.
- #181/#182 responsive/layout/navigation architecture: PR #194; no second shell/IA system.
- #183/#184 Marketing/Knowledge: active PR #195; no parallel Library rewrite.
- staff invitation lifecycle: draft PR #175; avoid overlapping auth/invite/user files.
CALENDAR LOCK
CG Calendar and Client Schedule are intentionally separate.
CG Calendar (/admin/cg-calendar) = operational company calendar for meetings, shoots, content runs, client events, deadlines, internal events and intentionally enabled dated Planner tasks.
Client Schedule (/admin/client-schedule) = DP/F/Video/Reel/package/posting work from monthly_deliverables.
Do NOT:
- inject
monthly_deliverablesinto CG Calendar; - turn CG Calendar into the posting schedule;
- merge CG Calendar and Client Schedule;
- treat missing scheduled posts in CG Calendar as a defect;
- deduplicate Outlook/native events by title alone;
- destructively delete audit/history rows to hide duplicates;
- write back to Outlook/Microsoft;
- redesign Calendar because another mission touches UX, responsive layout, Marketing, AI or navigation.
Workflow rules
- run
git statusfirst; - pull latest
main; - inspect open PRs before creating a branch;
- keep one coherent branch/PR per substantial mission;
- do not duplicate schedule, task, Marketing Library or Calendar authorities;
- preserve safe legacy deep links when consolidating navigation;
- no new production dependencies without approval;
- keep changes shippable and verifiable.
Agent allocation
CA's preferred workflow is defined cross-project in docs/ai-workforce/MASTER-AI-TOOLS-AND-WORKFLOW.md; autonomous dispatch/supervision is defined in docs/ai-workforce/AUTONOMOUS-CODING-ORCHESTRATION.md; prompts CA manually sends must follow docs/ai-workforce/CA-CODING-PROMPT-CONTRACT.md.
In short:
- Claude Code handles large architecture/substantial implementation; do not micromanage it file-by-file.
- OpenCode handles bounded isolated fixes and now also has GitHub-scheduled/on-demand autonomous worker lanes; it is provider/model-routed, not permanently tied to one model.
- ChatGPT coordinates product direction, GitHub continuity, worker dispatch/supervision, prompts and review.
- Codex is used for focused coding/review when useful and available; use thread wake/automation where available rather than relying on CA to type
continue. - Crestodian remains an orchestration/watchdog lane and must not duplicate already-owned broad missions.
- Cline/Roo Code are fallback execution paths, not separate product brains.
- Do not launch overlapping broad missions.
- Review actual GitHub output before merge advice.
- Prefer GitHub-first handoffs so a new chat/agent can continue without private conversational history.
- If repository authority already contains the context, do not repeat it in a CA manual prompt. Normal CA manual prompts should be tiny and point the agent to GitHub authority.
External coding-agent/model routing is not the same thing as CG Dynamics runtime AI. Never redesign product AI because a desktop coding model is capped, retired or unavailable.
Data and production safety
- Never mutate live Supabase or run production SQL without explicit CA approval.
- A migration file on
maindoes not prove production application. - Never expose/commit privileged secrets.
- Never guess a
client_idUUID. - Microsoft/Outlook is read-only upstream except for the narrow #325 coexistence exception: the exact operational task/meeting a staff member explicitly asked the Staff Assistant to create/update/reschedule/complete/cancel, plus its exact linked counterpart, matched by durable IDs. Nothing else. Do not build a broad write-back engine.
- During coexistence (#325) CG Dynamics is not a fallback-only source. Every normal
Staff Assistant daily update cross-references BOTH live Microsoft and CG Dynamics.
Teams/Planner and Outlook are the freshness authority for Microsoft-backed records;
Dynamics-only work is legitimate and must still appear. The canonical runtime policy is
returned by
get_my_assistant_bootstrap(seesupabase/functions/cg-dynamics-mcp/coexistencePolicy.ts) and overrides stale ChatGPT Project Instruction wording.
Pending production migration order:
20260809120000_calendar_outlook_identity.sql20260809130000_client_portal_visibility_contract.sql
Do not apply either without approval. Do not replay obsolete client-portal phase scripts afterward.
Build and security
npm run build=tsc -b && vite build.- Commit/push only if build passes.
- Vite stays 7.x unless the production bundle is explicitly proven after any future change.
- Vercel preview success is not authenticated product acceptance or production DB rollout.
- Before new tables/RPCs/routes/Edge Functions/Storage, read the security architecture/access-control docs, enforce least privilege/RLS and test horizontal isolation.
Marketing / Knowledge safety
- source material is not automatically company knowledge;
- AI output is not automatically trusted knowledge;
- draft/stale/retired knowledge must not ground production answers;
- client knowledge remains isolated and client-ID linked;
- goldmine/source-pack markdown files are containers; distinct cited sources retain provenance;
- no copyrighted full-text ingestion without explicit rights.
AI tooling / provider continuity
- Cross-project master authority:
docs/ai-workforce/MASTER-AI-TOOLS-AND-WORKFLOW.md. - Autonomous dispatch/supervision authority:
docs/ai-workforce/AUTONOMOUS-CODING-ORCHESTRATION.md. - CA manual prompt authority:
docs/ai-workforce/CA-CODING-PROMPT-CONTRACT.md. - Detailed provider/model appendix:
docs/ai-workforce/AI-TOOLING-MODEL-ROUTING.md. - Do not use a global OpenCode provider allowlist that accidentally hides connected providers without first verifying the intended effect.
- Keep CA's proven working models available; distinguish a dead provider endpoint from a similarly named working Zen model.
- Never commit OpenRouter, Google, OpenAI, Anthropic or OpenCode auth secrets.
- If the external agent/provider/model stack materially changes, update the master/orchestration files in the same work.
Client research
Read docs/ai-workforce/client-intelligence/CLIENT-RESEARCH-PROGRESS.md first.
Complete through HMH Attorneys. Exact next client: Human Auto. Do not begin automatically; ask CA Human Auto — skip or go? and proceed only on go.
Reporting
Report files touched, tests/build, production migration/data impact, security/role checks, browser/device verification actually performed, remaining risks/unverified work, overlap with open PRs and exact next step.