TASK: Full-Repo Deep Dive + AI-Chats v3.1 Compliance + Orchestrated Handoffs
CONTEXT / GOAL
You are Traycer running inside VS Code at the workspace root. Perform a comprehensive repository analysis (all code, docs, configs, tests, infra), then deliver a senior-staff-level engineering review with a phased execution plan and feature ideation. While analyzing, you MUST read and comply with the AI-Chats protocol in ai-chats/README.md and document this session accordingly. When you invoke any other AI coding assistants, you MUST instruct them to follow the same protocol and write their own model-specific files inside the same session folder.
AI-CHATS PROTOCOL (MANDATORY)
1. Read ai-chats/README.md and enforce v3.1 rules exactly.
2. Session folder:
- Detect or create today’s session folder: ai-chats/YYYY-MM-DD-XX-topic/
- Use fuzzy matching to avoid duplicates; otherwise create next XX (01, 02, 03…).
3. Model files (NO SPACES; DOUBLE DASH BEFORE SEQUENCE):
- Use `[Model-Name-Version]--NN.md` (e.g., Opus-4.1--00.md, Gemini-Pro-2.5--01.md).
- `--00` = the model’s main doc (summary/tech/lessons/next steps/index).
- `--01+` = verbatim exchanges, one per file, strictly no summarization.
4. Allowed writes:
- You MAY write/update files only under ai-chats/\*\* for protocol compliance.
- Do NOT modify source code or configs elsewhere; propose diffs/snippets instead.
5. Recordkeeping for this task:
- Create/update your own `[Model-Name-Version]--00.md` with: Session Header, Conversation Summary, Technical Details, Lessons Learned, Next Steps, and Exchange Index.
- Save the exact user request and your full response as `[Model-Name-Version]--01.md` (verbatim).
- If you later invoke other assistants, each must create/update their own `--00.md` and `--NN.md` in the SAME session folder.
PROPAGATION TO OTHER AI ASSISTANTS (REQUIRED)
When you invoke Claude Code, Gemini CLI, Qwen CLI, Kilo Code, Codex, or others, prepend this handoff preamble to their task:
---BEGIN AI-CHATS HANDOFF---
Read and follow ai-chats/README.md (protocol v3.1). Use or create today’s session folder:
{SESSION_FOLDER_PATH}
Use your exact model name and version with NO SPACES and DOUBLE DASH before sequence, e.g.:
[Model-Name-Version]--00.md (main doc), then --01, --02… for verbatim exchanges.
Write ONLY inside {SESSION_FOLDER_PATH}. Do NOT modify source code; propose diffs/snippets.
At session end, update your --00.md with a summary and an index of your exchanges.
---END AI-CHATS HANDOFF---
OPERATING PRINCIPLES
- Plan-first, code-second: do not change source files. Produce precise, multi-phase plans and file-anchored diffs.
- Read broadly, then zoom in: start with README/docs/manifests; map the architecture; inspect hot paths and representative files per component.
- Be explicit about assumptions/unknowns; propose defaults and justify trade-offs.
- Prefer deterministic steps (lint rules, tests, CI checks) over vague advice.
- Security and secrets matter: flag risky patterns or ambiguous configs.
SCOPE OF WORK
1. Inventory & Index
- Walk the tree (exclude node_modules, .venv, build/dist, .git, caches).
- Emit a manifest: languages/frameworks, package managers, build tools, notable folders, entry points, env/config files, DB schemas/migrations, Docker/K8s/Compose, CI configs.
- Surface all TODO/FIXME/NOTE with file:line references.
2. Architecture Map
- Infer the domain problem from docs/code.
- Provide an ASCII architecture diagram (UI, API, services, workers, DB, queues, external APIs).
- Summarize data model (schemas/ORM entities/migrations).
- List public surfaces: HTTP routes, GraphQL, RPC/CLI, events/queues, SDK entry points.
3. Quality, Security, and Risk Review
- Code quality: style coherency, complexity hot spots, duplication, layering violations, dead code, missing types.
- Security: secret leakage, unsafe defaults, authN/authZ gaps, input validation, dependency vulns, supply-chain hygiene, CORS/CSRF, OWASP-style risks.
- Reliability/Perf/O11y: error handling, retries/timeouts, N+1 queries, caching, structured logging, metrics/tracing readiness.
- DevEx: setup friction, .env.example completeness, script ergonomics, editorconfig/formatters, pre-commit hooks.
4. Tests & Delivery
- Current posture: frameworks detected, coverage estimate by surface area, gaps (unit/integration/e2e/contract/property-based).
- Propose a practical test strategy per layer with example test lists for critical modules.
- CI/CD: propose a minimal yet solid pipeline (lint, typecheck, test, build, package, SCA/SAST). Provide exact GitHub Actions (or equivalent) YAML with caching.
5. Concrete Top-10 Recommendations
- Ten leveraged, file-anchored fixes. For each: problem → why it matters → exact files/lines → proposed change → validation method (test/lint/metric).
6. Execution Plan (Phased)
- Phase 0: Repo hygiene (non-breaking quick wins, 0.5–1 day).
- Phase 1: Foundations (1–3 days): types/configs/CI/env/logging/test scaffolds.
- Phase 2+: Feature/architecture improvements (each with acceptance criteria).
- For each phase: task list with file-by-file diffs, commands, tests, and objective “done” checks.
7. Feature Ideation (Value-Aligned)
- 8–12 ideas that fit this repo’s domain/stack.
- For each: user value, rough implementation sketch (data/APIs), risks/deps, T-shirt size, impact/effort score.
8. Deliverables (Markdown + Snippets Only)
- Create/Update (in ai-chats session folder):
• Your `[Model-Name-Version]--00.md` with: Session Header, Conversation Summary, Technical Details, Lessons Learned, Next Steps, Exchange Index.
• Your `[Model-Name-Version]--01.md` containing this task request and your full response VERBATIM.
- Produce these paste-ready artifacts (in output, not written to source):
• ANALYSIS.md with TOC: Executive Summary; Repo Inventory & Architecture Map (ASCII); Quality/Security/Perf Review with evidence; Test & CI/CD Strategy (YAML snippets); Top-10 Recommendations; Phased Roadmap; Feature Catalog; Open Questions & Assumptions.
• Snippets for `.github/workflows/ci.yml`, `.pre-commit-config.yaml`, `.editorconfig`, lint/format configs, improved README outline, and `.env.example` (keys, meanings; no secrets).
- Tailor configs/examples to detected stack (Node/TS, Python, Go, Rust, .NET, etc.).
CONSTRAINTS & SAFETY
- Do NOT modify source files outside ai-chats/\*\*. Propose diffs/snippets only.
- If repo is large, analyze high-impact directories first; note sampling and where to dive deeper.
- When uncertain, list options with pros/cons and a recommendation.
- Enforce AI-Chats filename rules: NO SPACES and ALWAYS `--` before sequence.
OUTPUT STYLE
- Be precise and concise. Use bullets, code blocks, and small tables where helpful.
- Cite evidence by relative path and line ranges (e.g., src/server/app.ts:120–164).
- Begin your output by echoing the chosen {SESSION_FOLDER_PATH} and the files you created/updated under it.
- End with a “Next 3 Actions” list I can run immediately.
CHECKLIST (must confirm each)
- [ ] Read ai-chats/README.md and enforced v3.1 rules.
- [ ] Created/used session folder: ai-chats/YYYY-MM-DD-XX-topic/
- [ ] Wrote/updated `[Model-Name-Version]--00.md` and `--01.md` (verbatim).
- [ ] Propagated AI-Chats handoff to every assistant you invoked.
- [ ] Produced ANALYSIS.md + CI/test/config snippets without changing source files.