Skip to content
Development
Skill

/slicing-code-context

Use when an exact symbol, path, entrypoint, or line range can bound a focused code question or patch proposal under a fixed source budget. Not for source changes or broad repository exploration.

From plugin
odin-claude-plugin
40200 skills

Claude Code

$ npx -y skills add OutlineDriven/odin-claude-plugin --skill slicing-code-context --agent claude-code

SKILL.md

slicing-code-context.SKILL.md
name: slicing-code-context
description: 'Use when an exact symbol, path, entrypoint, or line range can bound a focused code question or patch proposal under a fixed source budget. Not for source changes or broad repository exploration.'

Slicing code context

Refuse first

  • Reject source mutation: this skill returns proposed edits but never applies them.
  • Reject broad or anchorless exploration: require an exact anchor and a focused task.
  • Reject lexical approximations when parser-backed graph analysis is unavailable.

Contract

| Field | Bound contract | |---|---| | Trigger | A focused code question or patch proposal can be delegated using an exact symbol, path, entrypoint, or line-range anchor under a fixed source budget. | | Authority | Read-only. No file, VCS, credential, paid, published, deployed, or remote mutation. | | Side effect | A deterministic slice packet and one constrained worker response, with at most one coordinator-built replacement packet. | | Done | Packet budget and boundaries validate, every worker claim and proposed edit cites included ranges, uncertain edges remain hypotheses, and consequential conclusions are independently checked by the coordinator. |

Inputs

  • Target source tree root (required): canonical directory containing the source to slice.
  • Anchor (required): one repository-relative `FILE:START-END` line range, one exact path, one fully qualified symbol, or one exact entrypoint.
  • Worker task (required): concrete question or patch proposal whose answer can be checked from source.
  • Mode and depth (optional): `neighborhood` depth 1 by default; `upstream` or `downstream` depth 2–4; `path` or `entrypoint` depth 10–20.
  • Peer anchor (required only for `path`): exact second symbol or line range.
  • Budget (optional): positive integer estimated-token limit, default 8192.

Procedure

1. **Validate the request.** Canonicalize the target root. Reject an empty task, an anchor outside the root, an invalid or reversed line range, a mode/depth combination outside the table below, or `path` without a peer.

| Question | Mode | Depth | |---|---|---:| | Explain or review one unit with immediate context | `neighborhood` | 1 exactly | | Who can reach this sink? | `upstream` | 2–4 | | What behavior can this entry trigger? | `downstream` | 2–4 | | How does one unit reach another? | `path` | 10–20 | | Which public entrypoint reaches this target? | `entrypoint` | 10–20 |

**Done when:** the root, task, anchor, mode, depth, peer requirement, and positive budget all satisfy the request contract.

2. **Resolve exact anchors.** A line-range anchor resolves only to those live lines. A path anchor resolves to the full file only if it fits the budget; otherwise require a line range or symbol. Resolve a symbol or entrypoint with the repository's available parser-backed symbol/reference index. Sort candidates by repository-relative path, start line, end line, then fully qualified name. Zero matches is `symbol_not_found`; more than one exact-name match is `ambiguous_symbol` and returns the sorted candidates without choosing. If no parser-backed index exists for a graph mode, return `analysis_unavailable`; do not substitute lexical search or hand-selected context.

**Done when:** the exact live anchor resolves uniquely, or the procedure returns the precise deterministic resolution failure without choosing or approximating.

3. **Construct graph ranges.** The anchor is hop 0. Obtain parser-backed references/calls/import relationships appropriate to the selected mode. `neighborhood` includes the anchor unit plus directly enclosing unit, direct callers/references, and direct callees/dependencies at one hop. `upstream` traverses incoming edges breadth-first; `downstream` traverses outgoing edges breadth-first; `path` takes the shortest directed path from anchor to peer; `entrypoint` takes the shortest reverse path from the anchor to a public entrypoint. At each breadth, sort edges by destination path, destination start/end lines, edge kind, then source path/start/end lines. Deduplicate identical ranges; first discovery wins. Mark an edge `certain` only when the parser/index establishes it; include unresolved dynamic or indirect edges only in `uncertain_edges`, never as traversal proof.

**Done when:** all included graph ranges obey the selected traversal and deterministic ordering, with indirect or unresolved edges isolated as uncertainty.

4. **Build one deterministic packet.** Use this exact top-level key order and field schema:

   {
     "schema": "odin-slice-packet-v1",
     "task": "string",
     "root": "canonical absolute path",
     "anchor": {"kind":"line_range|path|symbol|entrypoint","value":"string"},
     "peer": null,
     "mode": "neighborhood|upstream|downstream|path|entrypoint",
     "depth": 1,
     "budget": {"limit_estimated_tokens":8192,"used_estimated_tokens":0},
     "slices": [
       {"file":"repository/relative/path","start_line":1,"end_line":1,"symbol":null,"hop":0,"relationship":"anchor","certainty":"certain","content":"exact source text"}
     ],
     "uncertain_edges": [
       {"from":"file:start-end","to":"file:start-end or unresolved label","kind":"string","reason":"string"}
     ],
     "omissions": [
       {"candidate":"file:start-end","reason":"budget|depth|uncertain|unavailable"}
     ]
   }

`peer` is `null` except in path mode, where it has the same object schema as `anchor`. Store source with LF line endings and no synthetic elision markers. Order slices by hop, file, start line, end line, relationship. Order uncertain edges and omissions lexicographically by all displayed fields. Serialize as compact UTF-8 JSON with no insignificant whitespace and no trailing newline.

**Done when:** one compact packet matches the schema, key order, source-byte, slice-order, uncertainty-order, omission-order, and newline rules exactly.

5. **Apply the exact budget algorithm.** Start `used

Read more
@outlinedriven
Ships withodin-claude-plugin

Formerly the ODIN Claude Plugin. The repository URL is unchanged. Outline-Driven Development, nicknamed ODIN, is a highly opinionated code-agent skill library: principles-first engineering, surgical editing, and workflow automation, published as installable

Stars on GitHub

Momentum

stars in total
40
Star history of OutlineDriven/odin-claude-plugin on GitHub, a chart by star-history.com

Other skills on odin-claude-plugin.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about slicing-code-context.

Which coding agents can use slicing-code-context?
slicing-code-context installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.