Documentation
¶
Overview ¶
Package claudeassets embeds this repository's own canonical .claude/ package — the Claude Code skill, hooks fragment, and SessionStart nudge script authored and dogfooded in Phase 6 — so the running codegraph binary can install a byte-identical copy into any user's Claude Code read locations (Phase 7, AGENT-01).
This file MUST live at the repository root, not under internal/. Go's //go:embed patterns may not contain ".." path elements (golang/go#46056) and are resolved only relative to, or below, the directory containing the source file that carries the directive. .claude/ and internal/ are sibling directories at the repository root, so no file under internal/agents/ (or any other package directory) can embed anything under .claude/ — the repository root is the only directory that is an ancestor of both. A later refactor that tries to relocate this file into internal/ will fail to compile, which is the intended guardrail (07-RESEARCH.md Critical Finding 2, empirically verified this repo's own session).
Because the declared package name ("claudeassets") does not match the module path's last element ("codegraph-go"), every importer must use a named import: claudeassets "github.com/seanb4t/codegraph-go".
Index ¶
Constants ¶
const ( // SkillMarkdownPath is FS's path to the Claude Code skill's SKILL.md. SkillMarkdownPath = ".claude/skills/codegraph/SKILL.md" // HooksFragmentPath is FS's path to the versioned go:embed source for // the SessionStart hooks fragment (Phase 7 D-04) — not itself read by // Claude Code in this repository (internal/agents/hookpackage_test.go); // internal/agents derives the install-time hooks.SessionStart blocks // from it. HooksFragmentPath = ".claude/hooks/hooks.json" // SessionNudgeScriptPath is FS's path to the SessionStart nudge script. SessionNudgeScriptPath = ".claude/hooks/session-nudge.sh" )
Variables ¶
var FS embed.FS
FS embeds exactly three files, named explicitly rather than as a directory pattern over .claude/skills/codegraph/ — embed's default dot/underscore filtering does not exclude .claude/skills/codegraph/verification/, so a directory pattern would also ship Phase 6's rehearsal-transcript evidence to every install target (07-RESEARCH.md Pitfall 2).
Functions ¶
func HooksFragment ¶
HooksFragment returns the embedded hooks.json fragment content.
func SessionNudgeScript ¶
SessionNudgeScript returns the embedded session-nudge.sh content.
func SkillMarkdown ¶
SkillMarkdown returns the embedded SKILL.md content.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
codegraph
command
Command codegraph is the codegraph CLI binary entrypoint.
|
Command codegraph is the codegraph CLI binary entrypoint. |
|
internal
|
|
|
agents
Package agents (this file): the sidecar manifest written next to SKILL.md at install time (D-03, D-04).
|
Package agents (this file): the sidecar manifest written next to SKILL.md at install time (D-03, D-04). |
|
bench
Package bench holds the pure-logic measurement core for the codegraph benchmark harness (PERF-01, INDX-06).
|
Package bench holds the pure-logic measurement core for the codegraph benchmark harness (PERF-01, INDX-06). |
|
cli
Package cli implements the codegraph command-line interface: the Cobra root command "codegraph" and its init/index/uninit subcommands, wired directly to the internal/indexer pipeline (D-01).
|
Package cli implements the codegraph command-line interface: the Cobra root command "codegraph" and its init/index/uninit subcommands, wired directly to the internal/indexer pipeline (D-01). |
|
cli/present
Package present is the sole home for charm.land/lipgloss/v2 styling (D-01).
|
Package present is the sole home for charm.land/lipgloss/v2 styling (D-01). |
|
cli/tui
Package tui hosts the ONLY code in this module that imports charm.land/bubbletea/v2 and charm.land/bubbles/v2 (D-09/D-11).
|
Package tui hosts the ONLY code in this module that imports charm.land/bubbletea/v2 and charm.land/bubbles/v2 (D-09/D-11). |
|
daemon
Package daemon implements SYNC-04/SYNC-05/D-05: the long-lived local process (or in-process fallback) that owns a repo's watcher plus the single GraphStore.Writer so multiple agent sessions share one indexer.
|
Package daemon implements SYNC-04/SYNC-05/D-05: the long-lived local process (or in-process fallback) that owns a repo's watcher plus the single GraphStore.Writer so multiple agent sessions share one indexer. |
|
fsatomic
Package fsatomic provides a single crash-safe file-write primitive shared by internal/agents (external agent configs) and internal/githooks (git hook scripts).
|
Package fsatomic provides a single crash-safe file-write primitive shared by internal/agents (external agent configs) and internal/githooks (git hook scripts). |
|
githooks
Package githooks manages CodeGraph's marker-fenced git sync hooks (post-commit/post-merge/post-checkout) — a verbatim port of TS sync/git-hooks.js (D-01/D-02).
|
Package githooks manages CodeGraph's marker-fenced git sync hooks (post-commit/post-merge/post-checkout) — a verbatim port of TS sync/git-hooks.js (D-01/D-02). |
|
gitmeta
Package gitmeta is the stdlib-only, best-effort git introspection layer that detects when a resolved CodeGraph index belongs to a different git working tree than the caller (WORK-01/02/03).
|
Package gitmeta is the stdlib-only, best-effort git introspection layer that detects when a resolved CodeGraph index belongs to a different git working tree than the caller (WORK-01/02/03). |
|
graphstore
Package graphstore is the sole legal caller of the embedded key-value storage engine; all graph reads and writes flow through the boundary this package defines.
|
Package graphstore is the sole legal caller of the embedded key-value storage engine; all graph reads and writes flow through the boundary this package defines. |
|
indexer
Package indexer implements the two-pass Go indexing pipeline: Pass 0 (deterministic file discovery, this file's neighbor discover.go), Pass 1 (parallel per-file extraction), and Pass 2 (sequential cross-file resolution), writing through internal/graphstore.
|
Package indexer implements the two-pass Go indexing pipeline: Pass 0 (deterministic file discovery, this file's neighbor discover.go), Pass 1 (parallel per-file extraction), and Pass 2 (sequential cross-file resolution), writing through internal/graphstore. |
|
indexer/capability
Package capability is the D-11 language capability descriptor: the machine-readable half of the "language capability matrix" (the other half is the human-readable docs/LANGUAGE-CAPABILITY-MATRIX.md, which this package's own consistency test — matrix_test.go — keeps mirrored to this file exactly, coverage value for coverage value, gap for gap).
|
Package capability is the D-11 language capability descriptor: the machine-readable half of the "language capability matrix" (the other half is the human-readable docs/LANGUAGE-CAPABILITY-MATRIX.md, which this package's own consistency test — matrix_test.go — keeps mirrored to this file exactly, coverage value for coverage value, gap for gap). |
|
indexer/csharpextract
Package csharpextract walks a C# file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/javaextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package csharpextract walks a C# file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/javaextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/dispatch
Package dispatch synthesizes Go's implicit structural interface satisfaction into explicit "implements" edges (RES-02, Phase 5 Pattern 3): a struct whose method set (by name+arity, D-06's bounded-matching discipline) is a superset of an interface's own method-spec set is synthesized as implementing that interface.
|
Package dispatch synthesizes Go's implicit structural interface satisfaction into explicit "implements" edges (RES-02, Phase 5 Pattern 3): a struct whose method set (by name+arity, D-06's bounded-matching discipline) is a superset of an interface's own method-spec set is synthesized as implementing that interface. |
|
indexer/goextract
Package goextract implements Pass 1's Go-specific tree-walk (LANG-01): mapping a parsed Go file's tree-sitter concrete syntax tree onto the codegraph node/edge vocabulary (D-06) — function/method/struct/ interface/type_alias/constant/variable nodes, intra-file contains edges, and unresolved cross-file references (calls, imports, struct/ interface embedding) for Pass 2 (resolve, a later plan) to settle.
|
Package goextract implements Pass 1's Go-specific tree-walk (LANG-01): mapping a parsed Go file's tree-sitter concrete syntax tree onto the codegraph node/edge vocabulary (D-06) — function/method/struct/ interface/type_alias/constant/variable nodes, intra-file contains edges, and unresolved cross-file references (calls, imports, struct/ interface embedding) for Pass 2 (resolve, a later plan) to settle. |
|
indexer/javaextract
Package javaextract walks a Java file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package javaextract walks a Java file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/mainstream/cextract
Package cextract walks a C or C++ file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package cextract walks a C or C++ file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/mainstream/kotlinextract
Package kotlinextract walks a Kotlin file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/ IntraEdge/UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package kotlinextract walks a Kotlin file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/ IntraEdge/UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/mainstream/phpextract
Package phpextract walks a PHP file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package phpextract walks a PHP file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/mainstream/rubyextract
Package rubyextract walks a Ruby file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package rubyextract walks a Ruby file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/mainstream/rustextract
Package rustextract walks a Rust file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package rustextract walks a Rust file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/mainstream/swiftextract
Package swiftextract walks a Swift file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary.
|
Package swiftextract walks a Swift file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary. |
|
indexer/nodeid
Package nodeid computes the deterministic content-hashed identifier assigned to every extracted symbol (D-02/D-02a).
|
Package nodeid computes the deterministic content-hashed identifier assigned to every extracted symbol (D-02/D-02a). |
|
indexer/pyextract
Package pyextract walks a Python file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary — the same discipline javaextract/csharpextract already follow.
|
Package pyextract walks a Python file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/ UnresolvedRef, goextract.Kind*/RefKind*), mirroring internal/indexer/goextract's shape (D-01) rather than redefining its own copy of that vocabulary — the same discipline javaextract/csharpextract already follow. |
|
indexer/routes
Package routes implements LANG-07's per-framework route-detector registry (D-08): a small, opt-in-per-detected-dependency (D-09) set of AST-based detectors — Gin (Go), Spring (Java), ASP.NET (C#), Django/Flask/FastAPI (Python), Express/NestJS (TypeScript/JavaScript) — each scanning one already-parsed file's syntax tree for that framework's route-declaration shape and resolving the route's handler to an already-known function/method node id.
|
Package routes implements LANG-07's per-framework route-detector registry (D-08): a small, opt-in-per-detected-dependency (D-09) set of AST-based detectors — Gin (Go), Spring (Java), ASP.NET (C#), Django/Flask/FastAPI (Python), Express/NestJS (TypeScript/JavaScript) — each scanning one already-parsed file's syntax tree for that framework's route-declaration shape and resolving the route's handler to an already-known function/method node id. |
|
indexer/tsextract
Package tsextract walks a TypeScript, TSX, or JavaScript file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/UnresolvedRef, goextract.Kind*/RefKind*) — ONE extractor serving all three grammars registered by languages_typescript.go ("typescript" .ts, "tsx" .tsx, "javascript" .js/.jsx/.mjs/.cjs), mirroring javaextract's/csharpextract's/ pyextract's shape (D-01) rather than defining three near-duplicate packages.
|
Package tsextract walks a TypeScript, TSX, or JavaScript file's tree-sitter syntax tree into the shared codegraph vocabulary (goextract.FileResult/ExtractedNode/IntraEdge/UnresolvedRef, goextract.Kind*/RefKind*) — ONE extractor serving all three grammars registered by languages_typescript.go ("typescript" .ts, "tsx" .tsx, "javascript" .js/.jsx/.mjs/.cjs), mirroring javaextract's/csharpextract's/ pyextract's shape (D-01) rather than defining three near-duplicate packages. |
|
mcp
Package mcp implements the codegraph stdio MCP server (D-08): a startup-time conditional tool registration surface.
|
Package mcp implements the codegraph stdio MCP server (D-08): a startup-time conditional tool registration surface. |
|
migrate
Package migrate — this file is the orchestration capstone (MIGR-01/ MIGR-02): Run wires the read-only reader (reader.go/translate.go), the resumable progress cursor (progress.go), the D-09 invariant pass (validate.go), and the atomic directory swap (swap.go) into one call that converts a TS CodeGraph SQLite index into a healthy new-format store.
|
Package migrate — this file is the orchestration capstone (MIGR-01/ MIGR-02): Run wires the read-only reader (reader.go/translate.go), the resumable progress cursor (progress.go), the D-09 invariant pass (validate.go), and the atomic directory swap (swap.go) into one call that converts a TS CodeGraph SQLite index into a healthy new-format store. |
|
migrate/migratetest
Package migratetest provides an in-Go SQLite fixture-reconstruction harness for internal/migrate tests.
|
Package migratetest provides an in-Go SQLite fixture-reconstruction harness for internal/migrate tests. |
|
parser
Package parser defines a narrow, backend-swappable boundary for turning source bytes into a syntax tree, independent of storage concerns.
|
Package parser defines a narrow, backend-swappable boundary for turning source bytes into a syntax tree, independent of storage concerns. |
|
parser/cgo
Package cgo implements the production CGo tree-sitter backend (Option A) for the parser.Parser interface, covering the two spike-partner languages (D-05): Go (LANG-01) and Python (carries a real external C scanner).
|
Package cgo implements the production CGo tree-sitter backend (Option A) for the parser.Parser interface, covering the two spike-partner languages (D-05): Go (LANG-01) and Python (carries a real external C scanner). |
|
query
Package query — internal/query/expand.go ports TS CodeGraph 1.3.1's subgraph-construction heuristics H10-H12 (RESEARCH §C.2, D-10): the DoS-bounding stage (T-01-18) that turns explore's gathered candidate set (H3-H6, gather.go) into the bounded subgraph computeGraphRelevance (rwr.go) later ranks over.
|
Package query — internal/query/expand.go ports TS CodeGraph 1.3.1's subgraph-construction heuristics H10-H12 (RESEARCH §C.2, D-10): the DoS-bounding stage (T-01-18) that turns explore's gathered candidate set (H3-H6, gather.go) into the bounded subgraph computeGraphRelevance (rwr.go) later ranks over. |
|
schema
Package schema owns the record serialization layer and its schema-versioned message definitions used by the graph store.
|
Package schema owns the record serialization layer and its schema-versioned message definitions used by the graph store. |
|
upgrade
Package upgrade implements `codegraph upgrade` (CLI-02, D-11..D-14): resolve the target release version from GitHub Releases, download and verify its sigstore-go signature bundle IN-PROCESS (D-12 — never shell out to a cosign CLI), and only on successful verification atomically replace the running binary (D-13).
|
Package upgrade implements `codegraph upgrade` (CLI-02, D-11..D-14): resolve the target release version from GitHub Releases, download and verify its sigstore-go signature bundle IN-PROCESS (D-12 — never shell out to a cosign CLI), and only on successful verification atomically replace the running binary (D-13). |
|
version
Package version holds the codegraph binary's build-identity metadata (D-09).
|
Package version holds the codegraph binary's build-identity metadata (D-09). |
|
watch
Package watch implements SYNC-01: a native, debounced filesystem watcher built on github.com/fsnotify/fsnotify (D-04) — the mandated cross-platform primitive; no polling default.
|
Package watch implements SYNC-01: a native, debounced filesystem watcher built on github.com/fsnotify/fsnotify (D-04) — the mandated cross-platform primitive; no polling default. |
|
test
|
|
|
wireoracle
Package wireoracle is the phase's wire-level regression oracle (D-01, VRFY-01): it spawns the REAL codegraph binary via os/exec, drives a scripted JSON-RPC session over real stdio, and returns the raw captured bytes.
|
Package wireoracle is the phase's wire-level regression oracle (D-01, VRFY-01): it spawns the REAL codegraph binary via os/exec, drives a scripted JSON-RPC session over real stdio, and returns the raw captured bytes. |
|
wireoracle/cmd/wireoracle
command
Command wireoracle is the human-redirect capture entrypoint (D-03): it spawns one scenario against a caller-supplied binary and fixture, prints ONLY the normalized transcript to stdout, and prints the per-rule hit ledger to stderr.
|
Command wireoracle is the human-redirect capture entrypoint (D-03): it spawns one scenario against a caller-supplied binary and fixture, prints ONLY the normalized transcript to stdout, and prints the per-rule hit ledger to stderr. |
|
tools
|
|
|
bench/cpudiag
command
Command cpudiag is a one-shot CPU-topology diagnostic (10-04-PLAN, Rule 2 deviation): it prints what a Go process on this host believes about its own parallelism, for comparison against the host's REAL CPU allotment.
|
Command cpudiag is a one-shot CPU-topology diagnostic (10-04-PLAN, Rule 2 deviation): it prints what a Go process on this host believes about its own parallelism, for comparison against the host's REAL CPU allotment. |
|
bench/gencorpus
command
Command gencorpus generates a deterministic, network-free synthetic source-code corpus for the PERF-02 CI regression gate and the INDX-06 bounded-memory / peak-RSS assertion (see 08-RESEARCH.md Pattern 2).
|
Command gencorpus generates a deterministic, network-free synthetic source-code corpus for the PERF-02 CI regression gate and the INDX-06 bounded-memory / peak-RSS assertion (see 08-RESEARCH.md Pattern 2). |
|
bench/realcorpus
Package realcorpus is the pinned real-repo manifest for the PERF-01 head-to-head benchmark: the freshly-built Go `codegraph` binary vs the installed TS `codegraph@1.3.1`, run over real, publicly available source trees rather than the synthetic PERF-02/INDX-06 corpus (tools/bench/gencorpus).
|
Package realcorpus is the pinned real-repo manifest for the PERF-01 head-to-head benchmark: the freshly-built Go `codegraph` binary vs the installed TS `codegraph@1.3.1`, run over real, publicly available source trees rather than the synthetic PERF-02/INDX-06 corpus (tools/bench/gencorpus). |
|
bench/runner
command
Command runner is the codegraph benchmark harness: it drives the freshly-built Go `codegraph` binary — and, in headtohead mode, the installed TS `codegraph@1.3.1` binary too — through a shared, external measurement path and reports internal/bench.Metrics.
|
Command runner is the codegraph benchmark harness: it drives the freshly-built Go `codegraph` binary — and, in headtohead mode, the installed TS `codegraph@1.3.1` binary too — through a shared, external measurement path and reports internal/bench.Metrics. |
|
mcpaudit
command
Command mcpaudit is the entrypoint for the VRFY-05 proxying MCP capture shim.
|
Command mcpaudit is the entrypoint for the VRFY-05 proxying MCP capture shim. |
|
transcriptfreeze
command
Command transcriptfreeze implements CONTEXT.md D-03's anti-regeneration cross-change rule as a CI-invokable guard: a pull request must never both change a frozen wire-oracle transcript AND change something that could have caused the diff (internal/mcp/*.go, or the MCP dependency line in go.mod).
|
Command transcriptfreeze implements CONTEXT.md D-03's anti-regeneration cross-change rule as a CI-invokable guard: a pull request must never both change a frozen wire-oracle transcript AND change something that could have caused the diff (internal/mcp/*.go, or the MCP dependency line in go.mod). |