chore(skill): add codegraph install step to titan-run pre-flight#857
chore(skill): add codegraph install step to titan-run pre-flight#857carlos-alm wants to merge 7 commits intomainfrom
Conversation
Analyze Claude Code v2.1.88 architecture (all 17 episodes from claude-reviews-claude) to extract 22 transferable patterns for codegraph. Separate report identifies 11 concrete MCP integration hacks from source analysis — alwaysLoad, searchHint, readOnlyHint annotations — to make codegraph a first-class tool inside Claude Code.
…consolidated output path - Add uncompromising architect persona that holds an enterprise-grade bar regardless of project stage - Add dual-lens scoring: Current State vs State of the Art side by side, with gap analysis - Move audit output from docs/architecture/ to generated/architecture/ (single location) - Remove old audit file from docs/architecture/ (already exists in generated/)
Greptile SummaryThis PR adds a single, narrowly scoped change to Key observations:
Confidence Score: 5/5Safe to merge — all prior review concerns resolved, no remaining issues Both P1 findings from previous review rounds have been addressed: No files require special attention Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
S1["Step 1: Worktree check\ngit worktree list"] --> S2
S2["Step 2: Parse arguments\ntargetPath · startPhase · gauntletBatchSize"] --> S3
S3["Step 3: Check existing state\nRead titan-state.json"] --> S4
S4["Step 4 ✨ NEW: Install latest codegraph\nnpm install -g @optave/codegraph@latest"] --> CHK{Install OK?}
CHK -- Yes --> LOG["codegraph --version\nLog version for traceability"]
CHK -- No --> WARN["Warn user\ncontinue — project-local may still work"]
LOG --> S5
WARN --> S5
S5["Step 5: Sync with main\ngit fetch origin main && git merge"] --> MC{Merge conflict?}
MC -- Yes --> STOP(["STOP: Resolve conflicts\nre-run /titan-run"])
MC -- No --> S6["Step 6: Print plan\nBegin pipeline"]
Reviews (3): Last reviewed commit: "Merge main into docs/claude-code-archite..." | Re-trigger Greptile |
.claude/skills/architect/SKILL.md
Outdated
| 3. Check `docs/architecture/` for previous audit files | ||
| 4. **Read all ADRs in `docs/architecture/decisions/`.** These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase *against* these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale? | ||
| 3. Check `generated/architecture/` for previous audit files | ||
| 4. **Read all ADRs in `generated/architecture/decisions/`.** These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase *against* these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale? |
There was a problem hiding this comment.
ADR path points to a non-existent directory
Phase 1 Step 4 now reads ADRs from generated/architecture/decisions/, but that directory does not exist. The only ADR in the repo is docs/architecture/decisions/001-dual-engine-architecture.md, which lives at the old path. Running /architect after this change will silently find no ADRs, causing the audit to skip the entire ADR compliance section.
The same stale path is also referenced in Phase 3 → F. ADR Compliance (line ~105), which evaluates compliance against generated/architecture/decisions/.
Either migrate the ADR to generated/architecture/decisions/ or revert the path to docs/architecture/decisions/.
| 4. **Read all ADRs in `generated/architecture/decisions/`.** These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase *against* these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale? | |
| 4. **Read all ADRs in `docs/architecture/decisions/`.** These are |
There was a problem hiding this comment.
Fixed. The merge conflict resolution (a62a5c1) reverted all three ADR path references back to docs/architecture/decisions/ — the Step 4 reference that was in conflict, plus two additional occurrences in Phase 3 F. ADR Compliance (line ~105) and the deliverable section (line ~174) that git auto-merged with the stale generated/ path. All references now point to the correct directory where the ADR actually lives.
.claude/skills/titan-run/SKILL.md
Outdated
| 4. **Install latest codegraph** (once, before any sub-agent runs): | ||
| ```bash | ||
| npm install -g @optave/codegraph@latest | ||
| ``` | ||
| Log the installed version: | ||
| ```bash | ||
| codegraph --version | ||
| ``` | ||
| If the install fails, warn the user but continue with whichever version is currently available. |
There was a problem hiding this comment.
codegraph --version runs unconditionally after a potentially failed install
The instructions say "if the install fails, warn the user but continue with whichever version is currently available." However, codegraph --version is written as a separate unconditional command block. If npm install -g fails and no previous codegraph binary exists on PATH (e.g., a brand-new CI runner), the version-logging command will also error out with command not found, leaving the AI agent without clear guidance for a second consecutive failure.
Consider making the intent explicit:
| 4. **Install latest codegraph** (once, before any sub-agent runs): | |
| ```bash | |
| npm install -g @optave/codegraph@latest | |
| ``` | |
| Log the installed version: | |
| ```bash | |
| codegraph --version | |
| ``` | |
| If the install fails, warn the user but continue with whichever version is currently available. | |
| 4. **Install latest codegraph** (once, before any sub-agent runs): | |
| ```bash | |
| npm install -g @optave/codegraph@latest |
Log the installed version (skip if codegraph is not available):
codegraph --version || trueIf the install fails or codegraph is not found, warn the user but continue — the sub-agents may still work if a project-local version is available.
There was a problem hiding this comment.
Fixed in c5a7760. Applied the suggested change: codegraph --version || true to prevent a second error when the binary is absent, and updated the guidance text to mention project-local fallback.
Conflicts in 3 files resolved by keeping main's changes: - architect/SKILL.md: ADR path updated from generated/ to docs/ - claude-code-architecture-lessons.md: added missing priority rows - codegraph-mcp-optimization-hacks.md: added verification notice and security caveat
Add `|| true` to prevent error when codegraph is not on PATH after a failed install. Update guidance to mention project-local fallback.
|
The remaining ADR path references on lines 105 and 174 of Regarding CI:
|
Summary
/titan-runthat installs the latest@optave/codegraphglobally before the pipeline beginsTest plan
/titan-runand verify it installs the latest codegraph before proceedingnpm install -gfails (e.g., no network)