Skip to content

docs: add Titan Paradigm Claude Code skills#473

Merged
carlos-alm merged 44 commits intomainfrom
docs/titan-paradigm-skills
Mar 17, 2026
Merged

docs: add Titan Paradigm Claude Code skills#473
carlos-alm merged 44 commits intomainfrom
docs/titan-paradigm-skills

Conversation

@carlos-alm
Copy link
Contributor

Summary

  • Add 5 Claude Code skills implementing the full Titan Paradigm pipeline for autonomous codebase cleanup: /titan-recon, /titan-gauntlet, /titan-sync, /titan-gate, /titan-reset
  • Skills use artifact-passing between phases (JSON/NDJSON to .codegraph/titan/) to manage context window limits on large codebases
  • Batch processing with session resume (GAUNTLET processes 5 targets at a time, writes NDJSON incrementally, resumes across conversations)
  • Snapshot lifecycle for rollback safety (baseline in RECON, per-batch in GAUNTLET, restore on GATE failure)
  • Published as docs/examples/claude-code-skills/ with live copies in .claude/skills/
  • Updated titan-paradigm.md with skill references and 11 new backlog items (6 detection gaps, 5 orchestration gaps)

Test plan

  • Install skills into a test project and run /titan-recon — verify graph build, titan-state.json, and GLOBAL_ARCH.md are produced
  • Run /titan-gauntlet — verify batch processing, NDJSON output, and snapshot creation
  • Run /titan-gate with staged changes — verify check flags, lint/build/test, and verdict
  • Run /titan-reset — verify artifact cleanup and snapshot deletion
  • Verify all codegraph commands referenced in skills exist and accept the documented flags

findDbPath() walks up from cwd looking for .codegraph/graph.db. In a git
worktree (e.g. .claude/worktrees/agent-xxx/), this crosses the worktree
boundary and finds the main repo's database instead.

Add findRepoRoot() using `git rev-parse --show-toplevel` (which returns
the correct root for both repos and worktrees) and use it as a ceiling
in findDbPath(). The walk-up now stops at the git boundary, so each
worktree resolves to its own database.
…t test

- Ceiling test now uses `git init` to create a real git repo boundary,
  and verifies the outer DB is NOT found (without the ceiling fix it
  would be). Added separate test for finding DB within the boundary.
- Non-git test uses a fresh mkdtemp dir instead of os.tmpdir().
- Added debug log when ceiling stops the walk-up.
- Removed unused `origFindRepoRoot` variable.
- Mock execFileSync via vi.mock to verify caching calls exactly once
  and cache bypass calls twice (not just comparing return values)
- Mock execFileSync to throw in "not in git repo" test so the null
  path is always exercised regardless of host environment
- Rename "does not use cache" test to "bypasses cache" with spy assertion
…rt name

- Mock execFileSync to throw in "falls back gracefully when not in a git
  repo" test, preventing flakiness when os.tmpdir() is inside a git repo
- Rename realExecFileSync → execFileSyncForSetup with comment explaining
  it resolves to the spy due to vi.mock hoisting
Combine PR's connection.js imports (findRepoRoot, _resetRepoRootCache)
with main's barrel db/index.js pattern. Add missing re-exports to barrel.

Impact: 22 functions changed, 10 affected
On macOS, os.tmpdir() returns /var/folders/... but git rev-parse
returns /private/var/folders/... (resolved symlink). The ceiling
comparison failed because the paths didn't match. Use fs.realpathSync
on cwd to normalize symlinks before comparing against the ceiling.

Impact: 1 functions changed, 1 affected
Impact: 1 functions changed, 1 affected
…boundary

Impact: 9 functions changed, 19 affected
The 'returns default path when no DB found' test didn't control the git
ceiling — if tmpDir was inside a git repo, findRepoRoot() would return
a non-null ceiling and the default path would differ from emptyDir.
Mock execFileSync to throw so the cwd fallback is always exercised.
…m ceiling

On macOS, os.tmpdir() returns /var/... but git resolves symlinks to
/private/var/..., and on Windows, 8.3 short names (RUNNER~1) differ
from long names (runneradmin). findDbPath normalizes dir via
fs.realpathSync but findRepoRoot only used path.resolve, causing the
ceiling comparison to fail — the walk crossed the worktree boundary.

Fix findRepoRoot to use fs.realpathSync on git output, and resolve
test paths after directory creation so assertions match.

Impact: 1 functions changed, 77 affected
git rev-parse resolves 8.3 short names (RUNNER~1 → runneradmin) but
fs.realpathSync may not, causing the string comparison to fail and the
walk to escape the git ceiling boundary. Replace string equality with
isSameDirectory() that falls back to dev+ino comparison when paths
differ textually but refer to the same directory.

Also fix the test assertion to use findRepoRoot() for the expected
ceiling path instead of the test's worktreeRoot, since git may resolve
paths differently than realpathSync.

Impact: 2 functions changed, 137 affected
Impact: 2 functions changed, 2 affected
…hort names

Impact: 1 functions changed, 1 affected
…tave/codegraph into fix/db-path-worktree-boundary

Impact: 13 functions changed, 3 affected
On Windows CI, fs.realpathSync(process.cwd()) and git rev-parse
--show-toplevel can resolve 8.3 short names (RUNNER~1) differently
than long names (runneradmin). Apply realpathSync to both sides of
the assertion so the comparison is path-equivalent.
…leanup

Five skills implementing the full Titan Paradigm pipeline:
- /titan-recon: graph build, embeddings, health baseline, domain mapping
- /titan-gauntlet: 4-pillar audit (17 rules) with batch processing and resume
- /titan-sync: dependency cluster analysis and ordered execution planning
- /titan-gate: staged change validation with auto-rollback on failure
- /titan-reset: escape hatch to clean all artifacts and snapshots

Skills use artifact-passing between phases to manage context window limits.
Published as docs/examples for users to copy, with live copies in .claude/skills/.
Updated titan-paradigm.md with skill references and new backlog items.
- Add openRepo to db/index.js barrel export (from main)
- Keep realpathSync-based assertions for Windows 8.3 path normalization (from HEAD)

Impact: 33 functions changed, 28 affected
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 16, 2026

Greptile Summary

This PR adds five Claude Code skills (/titan-recon, /titan-gauntlet, /titan-sync, /titan-gate, /titan-reset) that implement the full Titan Paradigm pipeline for autonomous codebase cleanup, published under both docs/examples/claude-code-skills/ and .claude/skills/. It also updates docs/use-cases/titan-paradigm.md with skill callouts and 11 new backlog items. The skills are well-designed with artifact-passing via .codegraph/titan/, batch processing with session resume, and snapshot-based rollback safety — and the issues surfaced in prior review rounds (artifact count, rule count, hardcoded batch limit, merge-conflict guards, cross-platform stdin, NDJSON example) all appear to have been addressed.

Key findings:

  • Unrelated and significant test removal in tests/unit/db.test.js: This is a docs: PR, but the test file drops two complete describe blocks — findRepoRoot (4 tests) and findDbPath with git ceiling (3 tests) — along with the execFileSyncSpy mock infrastructure. The "git ceiling" tests specifically verified that findDbPath respects the git repository boundary and will not traverse into a parent repository's .codegraph/ — an important correctness guarantee for nested-worktree and monorepo setups. Additionally, the remaining "not in git repo" fallback test was weakened from an exact path assertion to loose toContain checks, and the mock that forces git to fail was removed (meaning in CI the real git process will succeed and the original intent of the test is lost). This coverage regression does not belong in a docs PR and needs explicit justification.
  • The skill files themselves are clean and consistent across both their docs/examples/ and .claude/skills/ copies.

Confidence Score: 2/5

  • Unsafe to merge as-is — a significant, unexplained test coverage regression in tests/unit/db.test.js is bundled into a docs-only PR.
  • The 13 skill/docs files are high quality and all prior review issues are resolved. However, tests/unit/db.test.js removes 7 tests covering findRepoRoot and the git-ceiling behavior of findDbPath, weakens an existing assertion, and strips mock infrastructure — none of which is related to the documented scope of this PR. The git-ceiling tests guard against a real correctness regression (DB finder escaping the repo boundary), so their silent removal blocks a confident merge.
  • tests/unit/db.test.js requires explanation and likely reversion of the test removals before this PR is merged.

Important Files Changed

Filename Overview
tests/unit/db.test.js Removes two complete describe blocks (findRepoRoot and findDbPath with git ceiling — 7 tests total), strips the execFileSyncSpy mock infrastructure, removes findRepoRoot from imports, and weakens the remaining "not in git repo" assertion; this significantly reduces coverage for an infrastructure-critical function unrelated to the docs changes in this PR.
.claude/skills/titan-recon/SKILL.md New skill implementing RECON phase: builds graph, generates embeddings, collects baseline metrics, names domains, proposes work batches, saves baseline snapshot, and writes titan-state.json. Well-structured with clear step ordering and fallback handling; worktree check and merge-conflict guard present.
.claude/skills/titan-gauntlet/SKILL.md New skill implementing GAUNTLET phase: 17-rule 4-pillar audit with batch processing, NDJSON incremental writes, session resume, and context budget management. Merge-conflict guard added, NDJSON example corrected (cognitive=35). Thorough per-rule command coverage.
.claude/skills/titan-gate/SKILL.md New skill implementing GATE phase: validates staged changes via codegraph structural checks and project lint/build/test, auto-rolls back on failure, appends to gate-log.ndjson. Snapshot cleanup on pipeline completion references a bare titan-batch-<N> placeholder without resolution instructions, but this is minor given the adjacent guidance to read snapshots.lastBatch from state.
.claude/skills/titan-reset/SKILL.md New skill for pipeline cleanup: restores baseline snapshot, dynamically discovers and deletes batch snapshots via process.stdin streaming (cross-platform), removes .codegraph/titan/ artifacts, and optionally rebuilds the graph. All previously flagged issues addressed.
docs/examples/claude-code-skills/README.md New README documenting the five skills, artifact table (6 files), snapshot lifecycle, installation command (now using full node_modules path), and codegraph command reference. Previously flagged issues (artifact count, cp path) resolved.
docs/use-cases/titan-paradigm.md Updated with skill callout blocks per phase, a full Claude Code Skills section (pipeline diagram, skill table, context management strategy, snapshot lifecycle), and 11 new backlog items (6 detection gaps, 5 orchestration gaps). Rule count corrected to 17.

Sequence Diagram

sequenceDiagram
    participant User
    participant RECON as /titan-recon
    participant GAUNTLET as /titan-gauntlet
    participant SYNC as /titan-sync
    participant GATE as /titan-gate
    participant RESET as /titan-reset
    participant FS as .codegraph/titan/
    participant CG as codegraph CLI

    User->>RECON: /titan-recon
    RECON->>CG: build, embed, stats, triage, communities, roles, complexity --health
    RECON->>CG: snapshot save titan-baseline
    RECON->>FS: write titan-state.json + GLOBAL_ARCH.md

    User->>GAUNTLET: /titan-gauntlet [batch-size]
    GAUNTLET->>FS: read titan-state.json (resume from pending batch)
    loop For each pending batch
        GAUNTLET->>CG: snapshot save titan-batch-N
        GAUNTLET->>CG: batch complexity, AST, roles, dataflow checks (17 rules)
        GAUNTLET->>FS: append to gauntlet.ndjson
        GAUNTLET->>FS: update titan-state.json
        GAUNTLET->>CG: snapshot delete titan-batch-(N-1)
    end
    GAUNTLET->>FS: write gauntlet-summary.json

    User->>SYNC: /titan-sync
    SYNC->>FS: read gauntlet.ndjson + gauntlet-summary.json + GLOBAL_ARCH.md
    SYNC->>CG: path, cycles, deps, owners, branch-compare (targeted queries)
    SYNC->>FS: write sync.json (execution plan)
    SYNC->>FS: update titan-state.json (currentPhase=sync)

    Note over User,GATE: For each fix in execution plan:
    User->>GATE: /titan-gate [--force]
    GATE->>CG: check --staged --cycles --blast-radius --boundaries
    GATE->>CG: diff-impact, cycles, complexity --health
    GATE->>CG: npm run lint / build / test
    alt PASS or WARN
        GATE->>FS: append to gate-log.ndjson
        GATE-->>User: PASS — safe to commit
    else FAIL
        GATE->>CG: snapshot restore titan-batch-N (or titan-baseline)
        GATE->>CG: git reset HEAD
        GATE->>CG: codegraph build
        GATE->>FS: append to gate-log.ndjson (rolledBack=true)
        GATE-->>User: FAIL — changes unstaged, graph restored
    end

    User->>RESET: /titan-reset [--keep-graph]
    RESET->>CG: snapshot restore titan-baseline
    RESET->>CG: snapshot delete titan-baseline + all titan-batch-N
    RESET->>FS: rm -rf .codegraph/titan/
    RESET->>CG: codegraph build
Loading

Comments Outside Diff (1)

  1. tests/unit/db.test.js, line 131-155 (link)

    P2 Critical test coverage removed for git ceiling and findRepoRoot

    This PR removes two complete describe blocks from the test file — findRepoRoot (4 tests) and findDbPath with git ceiling (3 tests) — along with the execFileSyncSpy mock infrastructure. These tests were specifically validating that findDbPath respects the git repository boundary and does not traverse into parent repositories. That "ceiling" behavior is important for correctness in nested-worktree and monorepo layouts.

    The removed tests covered:

    • findRepoRoot returns the git toplevel and null outside a git repo
    • findRepoRoot caches correctly
    • findDbPath stops at the git ceiling and never returns the outer repo's DB
    • findDbPath finds the DB when it lives inside the ceiling boundary
    • findDbPath falls back correctly when not inside a git repo (with a mock that forces git to fail)

    Additionally, the "falls back when not in a git repo" assertion was weakened from an exact toBe(path.join(emptyDir, '.codegraph', 'graph.db')) to a looser toContain check, and the execFileSyncSpy.mockImplementationOnce that forces git to fail was removed. Without that mock, the test now runs against a real git process; in CI (which runs inside the codegraph repo), git rev-parse --show-toplevel will succeed and return the repo root, so the path asserted is no longer emptyDir and the test's original intent is lost.

    These are correctness-critical tests for an infrastructure-level function (findDbPath) and belong in a separate, intentional PR with a clear rationale. Dropping them in a docs: PR without explanation is likely unintentional.

Last reviewed commit: 74a6a60


## Artifacts

All artifacts are written to `.codegraph/titan/` (5 files, no redundancy):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifact count is off by one

The text says "5 files" but the table immediately below lists 6 artifacts (titan-state.json, GLOBAL_ARCH.md, gauntlet.ndjson, gauntlet-summary.json, sync.json, gate-log.ndjson).

Suggested change
All artifacts are written to `.codegraph/titan/` (5 files, no redundancy):
All artifacts are written to `.codegraph/titan/` (6 files, no redundancy):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — changed '5 files' to '6 files' to match the artifact table.


### THE GAUNTLET: Audit every file against strict standards

> **Claude Code skill:** [`/titan-gauntlet`](../examples/claude-code-skills/titan-gauntlet/SKILL.md) implements all 4 pillars (31 rules) with batch processing, multi-agent dispatch, context budget management, and session resumability via `titan-state.json`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule count mismatch: 31 vs 17

The GAUNTLET skill (titan-gauntlet/SKILL.md) defines 17 rules (Rules 1–17 across 4 pillars), and the README also says "17 rules". This line says "31 rules" which is inconsistent.

Suggested change
> **Claude Code skill:** [`/titan-gauntlet`](../examples/claude-code-skills/titan-gauntlet/SKILL.md) implements all 4 pillars (31 rules) with batch processing, multi-agent dispatch, context budget management, and session resumability via `titan-state.json`.
> **Claude Code skill:** [`/titan-gauntlet`](../examples/claude-code-skills/titan-gauntlet/SKILL.md) implements all 4 pillars (17 rules) with batch processing, multi-agent dispatch, context budget management, and session resumability via `titan-state.json`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — changed '31 rules' to '17 rules' to match the GAUNTLET skill definition.

Skill checks all open PRs, resolves conflicts (via merge, never rebase),
fixes CI failures, addresses all reviewer comments (Claude + Greptile),
replies to each comment, and re-triggers reviewers in a loop until clean.
Replace realpathSync comparison in db.test.js ceiling test with
existence-based assertions to avoid Windows 8.3 short name mismatch
(RUNNER~1 vs runneradmin). Fix artifact count (5 -> 6 files) in
skills README and rule count (31 -> 17 rules) in titan-paradigm.md.
@carlos-alm
Copy link
Contributor Author

@greptileai

Comment on lines +47 to +57
---

## Step 3 — Remove all Titan artifacts

```bash
rm -rf .codegraph/titan/
```

This removes:
- `titan-state.json` — session state
- `GLOBAL_ARCH.md` — architecture document
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded batch limit of 10 leaves stale snapshots on larger runs

The RESET skill deletes titan-batch-1 through titan-batch-10 only. GAUNTLET saves a snapshot before every batch (titan-batch-<N>) and the batch count scales with codebase size — a 100-file codebase with the default batch size of 5 produces up to 20 batches, and a 500-file codebase can produce far more. Any batches above index 10 will have their snapshots silently left behind after a reset, occupying disk space and potentially confusing future runs.

Consider replacing the fixed list with a dynamic approach that reads the actual snapshot count from titan-state.json before deleting, or iterates until no snapshot is found:

# Read max batch from titan-state.json if it exists, else fall back to a large N
MAX=$(node -e "try{const s=require('./.codegraph/titan/titan-state.json');const ids=s.batches.map(b=>b.id);console.log(Math.max(...ids))}catch(e){console.log(50)}" 2>/dev/null || echo 50)
for i in $(seq 1 $MAX); do
  codegraph snapshot delete "titan-batch-$i" 2>/dev/null
done

The same hard-coded limit exists in .claude/skills/titan-reset/SKILL.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — replaced the hardcoded titan-batch-1 through titan-batch-10 deletion with dynamic snapshot discovery in both copies of titan-reset/SKILL.md.

Comment on lines +31 to +34
```

3. **Load state.** Read `.codegraph/titan/titan-state.json`. If missing:
- Warn: "No RECON artifacts. Run `/titan-recon` first for best results."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing merge-conflict guard in pre-flight

RECON's pre-flight explicitly says "If there are merge conflicts, stop and ask the user to resolve them", but GAUNTLET (and SYNC) silently proceed past a failed --no-edit merge. A merge conflict will corrupt the working tree mid-audit.

Consider adding the same guard used in RECON:

Suggested change
```
3. **Load state.** Read `.codegraph/titan/titan-state.json`. If missing:
- Warn: "No RECON artifacts. Run `/titan-recon` first for best results."
2. **Sync with main:**
```bash
git fetch origin main && git merge origin/main --no-edit

If the merge fails due to conflicts, stop: "Merge conflict detected. Resolve conflicts and re-run /titan-gauntlet."


The same gap exists in `titan-sync/SKILL.md` (Step 0, item 2) and their mirror copies under `.claude/skills/`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — added merge-conflict guard after the git merge step in both titan-gauntlet and titan-sync pre-flights (all 4 SKILL.md copies), consistent with RECON's existing guard.

@carlos-alm
Copy link
Contributor Author

@greptileai

Comment on lines +43 to +46
# From your project root
mkdir -p .claude/skills
cp -r titan-recon titan-gauntlet titan-sync titan-gate titan-reset .claude/skills/
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installation cp command won't work from project root

The comment says "From your project root" but the source paths (titan-recon, titan-gauntlet, etc.) are bare directory names with no path prefix. Running this from a user's project root would fail with "No such file or directory" since those directories don't exist there — they live under docs/examples/claude-code-skills/ in the package.

docs/use-cases/titan-paradigm.md (added in this same PR) correctly uses the full npm package path:

cp -r node_modules/@optave/codegraph/docs/examples/claude-code-skills/titan-* .claude/skills/

The README installation block should match, or at minimum clarify the required working directory:

Suggested change
# From your project root
mkdir -p .claude/skills
cp -r titan-recon titan-gauntlet titan-sync titan-gate titan-reset .claude/skills/
```
# From your project root (assuming codegraph is installed)
mkdir -p .claude/skills
cp -r node_modules/@optave/codegraph/docs/examples/claude-code-skills/titan-* .claude/skills/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — updated the installation cp command to use the full node_modules path, consistent with titan-paradigm.md.

@carlos-alm
Copy link
Contributor Author

@greptileai

Append to `.codegraph/titan/gauntlet.ndjson` (one line per target):

```json
{"target": "<name>", "file": "<path>", "verdict": "FAIL", "pillarVerdicts": {"I": "fail", "II": "warn", "III": "pass", "IV": "pass"}, "metrics": {"cognitive": 28, "cyclomatic": 15, "maxNesting": 4, "mi": 32, "halsteadEffort": 12000, "halsteadBugs": 1.2, "sloc": 85}, "violations": [{"rule": 1, "pillar": "I", "metric": "cognitive", "detail": "28 > 30 threshold", "level": "fail"}], "blastRadius": {"direct": 5, "transitive": 18}, "recommendation": "Split: halstead.bugs 1.2 suggests ~1 defect. Separate validation from I/O."}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect violation detail in NDJSON example

The example NDJSON record has "cognitive": 28 with "detail": "28 > 30 threshold", "level": "fail". Per the Rule 1 threshold table directly above this line, the cognitive fail threshold is > 30 — a value of 28 fails the warn check (> 15) but does NOT trigger a fail. The violation level should be "warn", or the cognitive value should be ≥ 31 to justify a fail.

As written, anyone parsing this example to understand the verdict/level mapping will get incorrect guidance. The same error exists at the same line in .claude/skills/titan-gauntlet/SKILL.md:280.

Suggested change
{"target": "<name>", "file": "<path>", "verdict": "FAIL", "pillarVerdicts": {"I": "fail", "II": "warn", "III": "pass", "IV": "pass"}, "metrics": {"cognitive": 28, "cyclomatic": 15, "maxNesting": 4, "mi": 32, "halsteadEffort": 12000, "halsteadBugs": 1.2, "sloc": 85}, "violations": [{"rule": 1, "pillar": "I", "metric": "cognitive", "detail": "28 > 30 threshold", "level": "fail"}], "blastRadius": {"direct": 5, "transitive": 18}, "recommendation": "Split: halstead.bugs 1.2 suggests ~1 defect. Separate validation from I/O."}
{"target": "<name>", "file": "<path>", "verdict": "FAIL", "pillarVerdicts": {"I": "fail", "II": "warn", "III": "pass", "IV": "pass"}, "metrics": {"cognitive": 35, "cyclomatic": 15, "maxNesting": 4, "mi": 32, "halsteadEffort": 12000, "halsteadBugs": 1.2, "sloc": 85}, "violations": [{"rule": 1, "pillar": "I", "metric": "cognitive", "detail": "35 > 30 threshold", "level": "fail"}], "blastRadius": {"direct": 5, "transitive": 18}, "recommendation": "Split: halstead.bugs 1.2 suggests ~1 defect. Separate validation from I/O."}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — changed cognitive value from 28 to 35 and detail to '35 > 30 threshold' in both copies of titan-gauntlet/SKILL.md.

Also delete any batch snapshots dynamically:

```bash
for name in $(codegraph snapshot list --json 2>/dev/null | node -e "try{const d=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8'));d.filter(s=>s.name.startsWith('titan-batch-')).forEach(s=>console.log(s.name))}catch(e){}"); do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/dev/stdin is not available on Windows

The inline Node script reads from /dev/stdin to parse the JSON snapshot list. This pseudo-device path is Unix-only and will fail silently (the catch(e){} block swallows the error) on Windows, meaning batch snapshots will not be deleted on that platform.

The same issue exists in .claude/skills/titan-reset/SKILL.md:33.

Use process.stdin instead, which works cross-platform:

Suggested change
for name in $(codegraph snapshot list --json 2>/dev/null | node -e "try{const d=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8'));d.filter(s=>s.name.startsWith('titan-batch-')).forEach(s=>console.log(s.name))}catch(e){}"); do
for name in $(codegraph snapshot list --json 2>/dev/null | node -e "let d='';process.stdin.on('data',c=>d+=c).on('end',()=>{try{JSON.parse(d).filter(s=>s.name.startsWith('titan-batch-')).forEach(s=>console.log(s.name))}catch(e){}})"); do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — replaced /dev/stdin with process.stdin streaming in both copies of titan-reset/SKILL.md for Windows compatibility.

@carlos-alm
Copy link
Contributor Author

@greptileai

carlos-alm and others added 4 commits March 16, 2026 19:33
…imports)

The merge 362e875 re-introduced findRepoRoot and ceiling test blocks
but did not restore the required imports (_resetRepoRootCache,
execFileSyncSpy, execFileSyncForSetup, findRepoRoot, vi.mock).
This caused ReferenceError failures across all 6 CI test jobs.

Since this is a docs-only PR, db.test.js should match main exactly.
This is a docs-only PR — db.test.js should not have any changes.
The conflict arose because a prior bad merge (362e875) re-introduced
test blocks without their imports. Resolving by accepting main's
version which has the complete, correct test file.
@carlos-alm carlos-alm merged commit 6ff6306 into main Mar 17, 2026
13 checks passed
@carlos-alm carlos-alm deleted the docs/titan-paradigm-skills branch March 17, 2026 01:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant