Codegraph worktree startup
Skill selamy-labs/agent-skills/skills/codegraph-worktree-startup
Reusable public SKILL.md workflows for AI agents
npx -y skills add selamy-labs/agent-skills --skill codegraph-worktree-startupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when starting or resuming code work in a repository worktree. Initialize or sync CodeGraph, keep its cache uncommitted, and prefer CodeGraph for code navigation before grep or broad file reads.
SKILL.md
2.5 KB, 520 tokens by cl100k_base, as published. Nobody here has run it
CodeGraph Worktree Startup
Use CodeGraph as repository startup hygiene for coding tasks. The goal is faster, more accurate code navigation without committing .codegraph/ cache artifacts.
Startup
- Confirm the tool and repository root:
command -v codegraph
git rev-parse --show-toplevel
If codegraph is unavailable, say so briefly and use normal repo exploration.
- If an index exists, sync it:
codegraph sync "$(git rev-parse --show-toplevel)"
codegraph status "$(git rev-parse --show-toplevel)"
- If no index exists, initialize one before code exploration unless disk, memory, or repo size makes that unreasonable:
/usr/bin/time -f 'elapsed=%E cpu=%P maxrss_kb=%M' codegraph init "$(git rev-parse --show-toplevel)"
codegraph status "$(git rev-parse --show-toplevel)"
Local calibration has shown small and medium repositories can index in seconds, so prefer measuring once over assuming indexing is expensive.
- Keep CodeGraph out of source control:
printf '\n.codegraph/\n' >> "$(git rev-parse --git-path info/exclude)"
git status --short --branch
Use local git excludes instead of editing .gitignore unless the repository explicitly wants a shared ignore rule. git rev-parse --git-path info/exclude works in linked worktrees because it resolves the real git metadata path.
Usage
Use CodeGraph before grep or broad file reads when locating code, call paths, blast radius, or likely tests:
codegraph explore "<symbol, file, behavior, or bug area>"
codegraph node "<symbol-or-file>"
codegraph affected <changed-files>
Prefer:
codegraph explorefor relevant symbols, line-numbered source, call paths, and blast radius.codegraph nodefor one exact file or symbol.codegraph affectedafter edits when choosing focused tests.rgafter CodeGraph for text outside the code index, such as docs, YAML literals, shell snippets, issue numbers, or generated config.
Run codegraph sync after meaningful edits before relying on impact or affected-test output.
Reporting
When timing a new repository class, record wall time, indexed files, DB size, memory, and whether the first query was useful. If indexing is slow or low-value for that class, document the exception instead of making the startup step performative.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.