gitnexus/skills/gitnexus-plan/SKILL.md
Use when you need a deep, implementation-ready engineering plan for a code change — built from GitNexus graph intelligence, statement-level PDG analysis, and targeted source verification, compact enough that an implementation agent can start without re-investigating. Also strengthens existing plans via Deepen mode. Examples: "/gitnexus-plan Add retry support to the ingestion pipeline", "/gitnexus-plan deepen docs/plans/<plan>.md", "plan this change using the knowledge graph".
npx skillsauth add abhigyanpatwari/gitnexus gitnexus-planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce an implementation-ready plan for an engineering task. GitNexus is the
navigation layer (where to look), statement-level PDG is the constraint layer
(what gates and feeds the behavior), and your native targeted source reads are
the verification layer (what is actually true right now). The output is a plan
document plus a compact, machine-readable implementation context pack
that a follow-up implementation agent (gitnexus-work, or any executor) can
consume without repeating the investigation.
/gitnexus-plan <task description>
/gitnexus-plan impact_depth:3 depth:deep <task description> # knob overrides, see Configuration
This skill plans. It never implements. Do not modify production code,
tests, or configuration while running it. The only repository file it writes
is the plan document (a working ledger kept outside the repo is fine). The
only other permitted state change is an index refresh via
analyze --index-only, which writes only the .gitnexus index store. It
must not build analyzer dist/ output and must not mutate source, tests,
configuration, or evaluation data. Stale analyzer provenance is disclosed as
a source-weighted limitation, never repaired by a planning run.
references/context-ledger.md; this skill's own reference files are exempt
from ledger bookkeeping).references/context-ledger.md. Generate it only with the portable helper
and byte contract in scripts/evidence-provenance.mjs and
references/evidence-provenance.md; never reimplement the digest.docs/plans/YYYY-MM-DD-gitnexus-plan-<3-5-word-slug>.md path. Compose the
complete UTF-8 document in memory or in a scratchpad outside the target
repo, then pass it on stdin to the helper's write-plan command. Never
write the destination directly or fall back to an external output path when
the safe writer fails.scripts/evidence-provenance.mjs read-plan, parse the exact decoded
plan_bytes_base64 from its descriptor-anchored receipt, and retain that
receipt's canonical generated_plan_path and plan_digest as one binding.
Never parse a direct lexical-path read or apply one plan's digest to another
path.Read references/context-ledger.md and open the ledger with the task:
original request, interpreted goal, acceptance criteria. Classify the task:
| Category | Posture (depth · plan form · tool-call budget · freshness) |
| ------------------------------ | -------------------------------------------------------------------------------- |
| Bug fix (local) | Narrow, 1–2 primary symbols, impact_depth 1 · compact · ~15 · accept |
| Feature | Default knobs · compact · ~30 · accept |
| Refactor / shared API change | Impact mandatory, impact_depth 3 · full · ~45 · strict |
| Performance | Default + performance PDG mode (references/pdg-slice.md) · full · ~45 · strict |
| Security | Default + security PDG mode + explain taint findings · full · ~45 · strict |
| Dependency upgrade / migration | Impact + compatibility focus; PDG rarely needed · compact · ~20 · accept |
| Concurrency / transactional | Control-flow + state-mutation PDG focus · full · ~45 · strict |
| Test improvement / docs | Narrowest: usually no impact or PDG pass · compact · ~10 · accept |
| Architecture change / spike | Widest: clusters + processes first · full · no cap · strict |
The category posture overrides the Configuration baseline; explicit key:value
invocation knobs override both. A task matching several rows combines them:
take the widest depth, union the focus areas.
Seeded evidence. When a completed investigation already supplies
verified findings — a finished review, a triage document with path:line
anchors and named failing scenarios — open the ledger FROM it: cite the
source document as the opening ledger entries and plan directly against
them instead of re-running the graph ladder over ground it already covers.
Re-deriving what the evidence proves is budget spent against the
turn-economy rule. Phase 4 still source-verifies whatever Proposed Changes
will cite, at the pinned commit — seeding replaces exploration, never
verification.
Depth is the user's decision, asked once, up front. In an interactive
session, when the invocation carries no explicit depth signal (no depth:,
form:, or freshness: knob, and not Deepen mode), ask one blocking
question before Phase 1 — how deep should this plan go?
depth:narrow form:compact freshness:accept. Fastest useful
plan: 1–2 primary symbols, minimal graph work, core sections only.depth:deep form:full freshness:strict. All 13 sections,
impact_depth 3, clusters/processes read, PDG slices for the central
functions.The answer sets the knobs exactly as if they had been typed in the invocation; explicit knobs win and skip the question. Headless runs never ask — the category posture applies unchanged. Asking up front replaces offering to deepen a finished plan afterwards: Deepen mode (below) remains the mechanism for strengthening an existing plan document — a later session, review findings, an executor route-back — not a default follow-up question.
Turn economy is a deliverable. The plan is judged on decision quality per
token, not thoroughness theater (measured: a 63-turn plan for a two-line
change — the GitNexus repo's eval/workflow_bench/). Stay within the category's tool-call
budget; when the budget runs out with questions still open, record them in
§12 instead of digging further — the executor re-verifies cheaply anyway.
list_repos if in doubt, else the indexed repo
covering the working directory. Pass repo explicitly on every call when
more than one repo is indexed.analyze
command in this skill): node .gitnexus/run.cjs analyze … when the
project has a runner (a previous analyze dropped it next to the index),
else gitnexus analyze … (installed CLI — npm install -g gitnexus),
else npx gitnexus analyze …. Record its path/version and any available
source/build identity; do not manufacture provenance from timestamps.gitnexus://repo/{name}/context — codebase overview + staleness check.
Freshness gate. Plans built on a stale graph make stale blast-radius
claims — but a re-index is the largest fixed cost a planning session
carries, so the gate is category-priced:
freshness: accept: plan on the
current graph with source verification weighted higher — their plans
cite little graph evidence. Escalate to a refresh mid-plan only when a
graph claim becomes load-bearing (e.g. Proposed Changes rest on a d=1
dependent list), and only then.freshness: strict, and under it:index_refresh, the plan header, and §12; rely on targeted source reads
or hand execution to gitnexus-work, which owns the build-current gate.analyze --index-only via the resolved runner
(append --pdg when the task category will reach Phase 3) and re-read
the context resource only when runner provenance is known-current.
Refresh budget, stated once here: at most one --index-only refresh in
Phase 1 plus at most one later --pdg upgrade in Phase 3 (only when
Phase 1's refresh lacked --pdg) per planning session — a Deepen run is
its own session. Record each command, runner identity, and outcome in the
ledger's index_refresh.freshness: accept was passed → proceed on the stale
graph, weight source verification higher, and state the staleness and
the skipped refresh in the plan header and Assumptions.gitnexus://repo/{name}/clusters and .../processes.Use the narrowest operation that answers the current ledger question, in this
order. Budgets: at most max_primary_symbols (5) primary symbols and
max_related_symbols (20) related symbols active in the ledger.
query {search_query, task_context} — locate concepts, execution flows,
modules, and related tests for the task.context {name} — 360° view of each candidate primary symbol: callers,
callees, categorized refs, processes. Promote to primary or discard. An
ambiguous result (ranked candidates) is answered by one retry narrowed
with kind / file_path / uid — that retry is an allowed repeat.impact {target, direction} — upstream/downstream blast radius for shared
or high-connectivity symbols (maxDepth = impact_depth; summaryOnly: true first for hub symbols, then drill in — an allowed repeat). Record the
d=1 items — the direct (depth-1) dependents — the plan must account
for every one of them.trace {from, to} — when the task hinges on how A reaches B, one call
instead of chained context hops.cypher — last resort, only for a precise graph question the tools above
cannot express. Read gitnexus://repo/{name}/schema first; anchor and
LIMIT every query.detect_changes {scope} — only when planning against existing uncommitted
or branch work.Do not run every tool by default. A local test fix may finish the ladder at step 2.
For the 1–3 functions most central to the change, build a bounded PDG
context slice. Read references/pdg-slice.md and follow it — it owns the
tool calls, inclusion criteria, depth bounds, slice schema, the security and
performance modes, and the no-PDG-layer fallback.
GitNexus said where to look; now confirm what is there. Using ordinary file reads (exact line ranges, not whole files unless genuinely required):
source_verified: true as you go. A symbol that
is named in Proposed Changes must be source-verified.evidence_provenance snapshot by invoking
scripts/evidence-provenance.mjs exactly as specified in
references/evidence-provenance.md: the
canonical global dirty digest over all dirty paths and the sorted manifest
of every cited path, including object kind and
HEAD/index/worktree/untracked layer digests. Re-read any citation that
changed during planning. Exclude only the generated plan path.Evidence hierarchy, strongest first: current source and config → current tests and executable behavior → compiler/build/lint output → GitNexus graph and PDG → documentation and comments.
references/plan-template.md and fill the category's form — compact
(core sections, ≤80 lines excluding the pack) or full (all 13 sections) —
from the ledger, tagging claims with the template's four classes —
[verified], [graph], [inferred], [assumed] — and routing open
questions to §12.references/context-pack.md
(this is section 11 of the plan), including mandatory
evidence_provenance in compact and full forms.generated_plan_path to
docs/plans/YYYY-MM-DD-gitnexus-plan-<slug>.md under the root of the repo
being planned (the Phase 1 target repo, not necessarily the cwd); use a
3–5-word kebab-case slug and repo-relative paths inside the document.
Compose the complete document without creating that destination, then
pipe its exact UTF-8 bytes to scripts/evidence-provenance.mjs write-plan
as specified in references/evidence-provenance.md. The helper safely
creates missing parent directories. Initial planning must not pass
--replace. A safe-write failure blocks plan publication: report it and
do not write directly, choose an external destination, or weaken the
repo-relative provenance contract. The snapshot and writer commands apply
the same strict generated-plan filename/date validator; do not substitute a
source, .git, or arbitrary docs/plans/ path in either invocation./gitnexus-plan deepen <plan-path> strengthens an existing plan in place
instead of creating a new one:
scripts/evidence-provenance.mjs read-plan --repo <root> --generated-plan <candidate> exactly as specified in
references/evidence-provenance.md. Reject a missing, external, escaping,
symlinked, or differently scoped path. Decode and parse only the receipt's
exact plan_bytes_base64; retain its canonical generated_plan_path and
plan_digest unchanged for the entire Deepen session.depth: deep (impact_depth 3, clusters/processes read)
unless the invocation overrides knobs explicitly.[graph]/[inferred] claim gets a targeted pass toward [verified];
every [assumed] claim is resolved or kept with its reason; direct
(d=1) dependent accounting is re-checked against the refreshed graph;
PDG slices are built or expanded for the central functions when the
layer is present.gitnexus-work already landed commits
for this plan (a mid-execution route-back), mark the §7 steps present at
HEAD as completed and re-sequence the remainder — the rewritten plan must
be executable from the top without redoing landed steps.scripts/evidence-provenance.mjs write-plan --replace --expected-plan-path <retained-read-plan-path> --expected-plan-digest <retained-read-plan-digest>: same 13 sections,
context pack kept in sync, evidence header updated. --replace is reserved
for Deepen mode, and both expected values must come from the same read-plan
receipt; any digest/path mismatch blocks publication. Retain the successful receipt's
prior_plan_backup_git_path; it names the verified Git-admin backup of the
displaced plan. Summarize the delta in chat: claims upgraded, claims that
failed re-verification, sections changed, and that backup path.Baseline defaults — the Phase 0 category posture overrides them, and inline
key:value tokens before the task text override both (the repo has no
skill-config file mechanism; invocation args are the mechanism):
| Knob | Default | Meaning |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| depth | by category | narrow = impact_depth 1, PDG only if one function is clearly central; default = this table; deep = impact_depth 3 + clusters/processes read |
| form | by category | compact (core sections + mini-pack, ≤80 lines excl. pack — see references/plan-template.md) or full (all 13 sections) |
| impact_depth | 2 | maxDepth for impact |
| pdg_data_depth | 2 | Data-dependence hops in the PDG slice |
| pdg_control_depth | 2 | Control-dependence hops in the PDG slice |
| max_primary_symbols | 5 | Ledger budget (active symbols; discards don't count) |
| max_related_symbols | 20 | Ledger budget (active symbols; discards don't count) |
| max_snippet_lines | 30 | Longest source excerpt quoted in the plan |
| freshness | by category | strict (full-plan categories) = refresh a stale index (and a missing PDG layer) with analyze --index-only [--pdg] before relying on the graph; accept (compact categories) = plan on the current graph, source-weighted and labelled, refreshing only if a graph claim becomes load-bearing |
analyze --index-only (add --pdg for the PDG layers) via
the resolved runner — node .gitnexus/run.cjs, installed gitnexus, or
npx gitnexus — when it would materially raise confidence.If this run exposed friction in the instructions, include concise feedback in the final response. Feedback is chat-only: do not append evaluation learnings, edit benchmark data, or modify this skill during a live planning task.
tools
Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: "What GitNexus tools are available?", "How do I use GitNexus?"
development
Review code changes with GitNexus from a GitHub PR URL or number, a branch/ref or commit range, or local staged, unstaged, and untracked changes. Use when the user asks for a code review, merge-risk assessment, regression hunt, missing-test analysis, or a verdict on whether a PR, branch, commit range, or local diff is safe.
development
Review code changes with GitNexus from a GitHub PR URL or number, a branch/ref or commit range, or local staged, unstaged, and untracked changes. Use when the user asks for a code review, merge-risk assessment, regression hunt, missing-test analysis, or a verdict on whether a PR, branch, commit range, or local diff is safe.
development
Review code changes with GitNexus from a GitHub PR URL or number, a branch/ref or commit range, or local staged, unstaged, and untracked changes. Use when the user asks for a code review, merge-risk assessment, regression hunt, missing-test analysis, or a verdict on whether a PR, branch, commit range, or local diff is safe.