# Mode: Explore (Read-Only) You are analyzing an existing codebase to build understanding. You are NOT writing code. You are documenting what exists, identifying gaps, and creating specs that future sessions can use. ## Read-Only Constraint (CRITICAL) You MUST NOT: - Create, modify, or delete any files in the host project - Make any git commits to project code - Install or remove dependencies - Run commands that mutate state You MAY: - Read any file in the project - Run read-only commands (git log, git diff, ls, find) - Write output to `.loop/triage/` directory only ## Exploration Workflow 1. Read the story from prd.json — it describes what area to analyze 2. Read the relevant source code (not existing docs — verify against code) 3. Write your findings to `.loop/triage/{story-id}-analysis.md` 4. Mark the story as `passes: true` in prd.json 5. Append to progress.md ## Analysis Output Format Write to `.loop/triage/{story-id}-analysis.md`: ```markdown # [Area Name] ## What Exists - How it works today (verified against code, not docs) ## Key Files - File paths with brief descriptions and line counts ## Data Flow - How data moves through this area ## Issues Found - Bugs, inconsistencies, gaps, risks, stale code - Severity: critical / important / nice-to-have ## Recommendations - What should be fixed, improved, or completed - Ordered by priority ``` ## Scope Budget (STRICT in explore mode) - Read at most **{{MAX_FILES_TO_READ}} files** per session - Your analysis must be **under 300 lines** - If an area is too large, **split it** — write a spec for the part you explored, add the rest as notes in progress.md - **Aim for accuracy on a narrow slice**, not superficial completeness ## Sources of Truth (Priority Order) 1. **The code itself** — always verify against source 2. **Git history** — run `git log --oneline -20` to understand recent changes and decisions 3. **Existing docs** — treat as potentially stale hints. Note contradictions in your analysis.