code-locate
Skill10 starsChanged 34 days agoMITView on GitHub
Locate code paths and line ranges for a described behavior: up to 10 candidates with HIGH/MEDIUM/LOW confidence and a search trail, plus a proposed SOURCE_OF_TRUTH.md update. Use when the first question is where one specific behavior lives and paths are unknown. Do not use when paths are explicit, the codebase is tiny and known, for a whole-repo overview or skeleton, or for architectural understanding (use impact-analysis).
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- a11y-auditSkill
- ai-feature-eval-harnessSkill
- api-contract-reviewSkill
- api-runtime-verifySkill
- apply-sweep-triageSkill
- approve-planSkill
- approve-proposedSkill
- app-runtime-verifySkill
- atom-audit-fleetSkill
- atom-auditSkill
- autonomous-boardSkill
- autonomous-readinessSkill
- autonomous-runSkill
- backend-system-designSkill
- branch-commitSkill
- capture-observationSkill
- capture-referencesSkill
- code-context-mapSkill
- color-contrast-architectSkill
- compact-task-memorySkill
- component-specSkill
- contract-signoffSkill
- db-context-postgresSkill
- db-context-supabaseSkill
- decision-interviewSkill
- delivery-assetSkill
- design-bootstrapSkill
- design-spec-reviewSkill
- direction-adjustSkill
- external-research-fleetSkill
- external-researchSkill
- extract-foundations-from-screensSkill
- feature-library-scout-fleetSkill
- feature-library-scoutSkill
- foundation-auditSkill
- frontend-architecture-reviewSkill
- frontend-system-designSkill
- godot-runtime-verifySkill
- godot-scene-planSkill
- graphql-contract-reviewSkill
- harvest-session-learningsSkill
- image-to-specSkill
- impact-analysisSkill
- implement-approved-sliceSkill
- implementation-planSkill
- implement-fleetSkill
- implement-slice-complementSkill
- im-stuckSkill
- incident-triageSkill
- invariants-and-non-goalsSkill
- inventory-snapshotSkill
- journey-mapSkill
- jtbd-switch-interviewerSkill
- mcp-server-vetSkill
- migration-safety-stewardSkill
- pattern-docSkill
- performance-budgetSkill
- portfolio-reviewSkill
- post-deploy-verifierSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 3 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Read these sections in WORKFLOW_OPERATING_SYSTEM.md first:
- Distinctive: line 31
Read additional sections only when relevant to this command's role.
- Very specific: line 39
search type, exactly one of: implementation (production code), tests (test files), config (configuration files), any (no restriction)
- Distinctive: line 42
search scope hint if known (path prefix, language, glob, etc.), to narrow the search
- Distinctive: line 51
Do not implement code. This command is read-only search.
- Very specific: line 60
If no HIGH-confidence candidates exist, do not pad the list with low-confidence guesses.
- Very specific: line 63
Do not invent paths. If a candidate cannot be confirmed by reading the file, mark its confidence as LOW and state what would confirm it.
- Very specific: line 66
Treat task-memory write policy per WORKFLOW_OPERATING_SYSTEM.md: write the file and mark it APPLIED.
- Very specific: line 68
If SOURCE_OF_TRUTH.md already names the same files the locate would propose, do not rewrite it.
- Very specific: line 69
If the search produced no HIGH and no MEDIUM candidates, do not patch SOURCE_OF_TRUTH.md.
- Very specific: line 73
Search type used (implementation / tests / config / any)
- Very specific: line 103
Default for this command: APPLIED patch on SOURCE_OF_TRUTH.md only.
- Very specific: line 106
Keep this section operational and brief.
- Very specific: line 118
When no HIGH-confidence candidate exists, output explicitly says so and lists what was searched.
- Very specific: line 124
Before declaring this output done, confirm it satisfies the shared Definition of done (command outputs) and Gate conditions in …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Act as a senior engineer locating code in the active codebase for the engineering task.
Goal:
Given a behavior description, locate candidate code paths and line ranges in the active codebase that probably implement that behavior. Output a bounded list of candidates with confidence and one-line rationale per candidate, then propose a SOURCE_OF_TRUTH.md update block so the next workflow step (typically impact-analysis) can run with concrete files instead of a vague codebase pointer.
Mandatory context bootstrap (before any output):
- Read these sections in
WORKFLOW_OPERATING_SYSTEM.mdfirst:## LLM execution contract## Editor mode policy(mode definitions only; the tool mapping table is lazy-loaded inwos/editor-mode-mappings.mdand needed only for non-Claude-Code tools)## Global output contract(including Adaptive handoff and Mode selection rule)## Cross-cutting workflow guardrails
- Bootstrap tiers: the light-weight commands (
branch-commit,what-next,where-we-at,slice-closure,compact-task-memory) plus the high-frequencyimplement-approved-sliceandsync-task-state(v3 wave1 item D) read the four sections above with two subsections of## Cross-cutting workflow guardrailsskipped:### External web access (centralized)and### Sequencing heuristics (by phase). Everything else is read at every tier, including### Proposal vs approved persistenceand### Substrate peer ownership (per ADR-0034), since all seven write substrate sections and reason about PROPOSED (state-reconcilestays on the full tier for cross-artifact judgment). The full tier is measured at 12109 tokens, the four always-read sections combined; the two skipped subsections are 1,034 of those (measured 2026-09-28), so the reduced tier is about 11,074. The leaf-reviewer tier (verify-against-rubric, ADR-0226) reads only## Global output contract, measured at 5215 tokens, plus its rubric. - Session bootstrap reuse (skip-if-unchanged; v3 wave1 item D): WHEN this conversation already read the bootstrap sections in an earlier turn still VISIBLE in the context window AND
WORKFLOW_OPERATING_SYSTEM.mdhas not changed since, the command MAY skip the re-read and cite the earlier one, emitting one Command transcript line:Bootstrap: reusing turn <N> read, WOS unchanged. Scoped exception to the context-budget re-fetch rule (wos/context-budget.md, "The re-fetch rule"), because these sections are one large, static, byte-identical read repeated every turn; every other tool result still re-fetches. VISIBLE means the section text itself is still present and quotable now, not merely that a record of the earlier read exists: a harness that clears a tool result while the record survives (ADR-0114) has not satisfied VISIBLE, and self-declared memory after a compaction never qualifies. A stateless-per-turn harness is excluded. The transcript line is mandatory; a silent skip is invalid output. - Resolving the spec and
wos/<topic>.md: canonical repository FIRST. Otherwise use active-adapter docs:~/.claude/workflow-docs(CLAUDE_WORKFLOW_DOCS_DIR),~/.cursor/workflow-docs(WORKFLOW_DOCS_DIR; project.cursor/workflow-docson project installs),~/.codex/workflow-docs(CODEX_WORKFLOW_DOCS_DIR), or<kimi-home>/workflow-docs(KIMI_WORKFLOW_DOCS_DIR). Nonempty overrides win. Kimi home:KIMI_CODE_HOME, else existing~/.kimi-code, else existing~/.kimi, default~/.kimi-code. Use one root for both paths; try other adapters if absent or unknown. Report resolved root, fallback to other adapters, or missing mandatory context in### Command transcript. Installed snapshots refresh and prune retired topics only on sync. - Read additional sections only when relevant to this command's role.
- Align all routing recommendations and next-command suggestions with the current command set.
- Official next-command names only: recommendations, including
Run now, use registered names fromcommands/<name>.mdorcommands/<name>/SKILL.md; installed mode uses the available Fhorja command or skill inventory. No invented aliases.Run now: nonewithMode: N/Aends only if no honest next step exists, defined under### Official command names (routing integrity)(ADR-0126). Required inputs: - active task folder path
TASK_STATE.md(current phase)SOURCE_OF_TRUTH.md(current state, even if vague, so the patch is correctly scoped)- behavior description in 1 to 3 lines (what the code in question does or should do)
- search type, exactly one of:
implementation(production code),tests(test files),config(configuration files),any(no restriction) - product workspace path (where the actual code lives, for example
~/code/acme-platform). For single-repo tasks, this is the only repo. For multi-repo tasks, this is the workspace path matchingtarget repo(see below). - target repo (only for multi-repo tasks where
SOURCE_OF_TRUTH.mdhas a## Repositoriessection): the repo identifier to search. Must match one entry in the## Repositoriessection. See the spec## Multi-repo support (v1)for the schema. - search scope hint if known (path prefix, language, glob, etc.), to narrow the search
- failing test name and assertion message, if the locate is triggered by a failing test
- last completed step from
TASK_STATE.md(command and summary)
Task repository files to update:
SOURCE_OF_TRUTH.md(propose appending or updatingMain files in scopewith the located candidates; HIGH and MEDIUM confidence only)TASK_STATE.mdonly if the locate result materially changes operational state (rare; typically theSOURCE_OF_TRUTH.mdupdate is the only artifact change)
Operating rules:
- Do not implement code. This command is read-only search.
- Handoff: end with the adaptive
### Handoffblock perWORKFLOW_OPERATING_SYSTEM.md## Global output contract(Mode A compact, Mode B full, or Mode C parallel-fanout when triggered). WHEN this run was entered because the blast-radius gate ofimplement-approved-slicerouted here,Run now:SHALL beimplement-approved-slicefor the same slice (ADR-0244). - Mode C eligibility (parallel fanout, per ADR-0032): when the selected product workspace has >1000 files, emit a
Delegate now:directive dispatching sub-agents to disjoint high-level directories within that workspace. They aremechanicalsub-agents (ADR-0236): each searches and returns candidates without a verdict, and the dispatching session applies the mechanical row ofwos/model-routing.md ## Dispatch roles; the directive line keeps its shape. For multi-repo tasks, this invocation stays within its explicittarget repo; independent per-repo analysis uses separatecode-locateinvocations, each naming its target. Each sub-agent returns up to 3 candidate paths from its scope; the parent integrates the merged candidate list (still capped at 10 total) and emits the normal Mode A handoff for the next step. Otherwise search the selected workspace inline. - Return at most 10 candidate paths. If more than 10 plausible candidates exist, return the 10 most relevant and explicitly note that more exist plus how to narrow the search.
- Each candidate must include:
- file path, relative to the product workspace
- line range (for example
42-67) when a specific function or block is the candidate; use*only when the entire file is the candidate - confidence level, exactly one of
HIGH(direct match: function name, comment, type signature obviously aligns),MEDIUM(likely match: name or context aligns but not definitive),LOW(possible match: contextually adjacent, worth a look but may be wrong) - one-line rationale (why this candidate matches the behavior description)
- If no
HIGH-confidence candidates exist, do not pad the list with low-confidence guesses. Explicitly sayno HIGH-confidence candidates foundand list what was searched (paths, globs, terms). - Make the search scope explicit. The output must include a
What was searchedsection listing paths or globs scanned and search terms used. The user must be able to judge coverage. - Make the search scope's negative space explicit too. If the search excluded common locations (vendor, node_modules, generated code, build artifacts), say so under
What was excluded. - Do not invent paths. If a candidate cannot be confirmed by reading the file, mark its confidence as
LOWand state what would confirm it. - The
confidencegrade here is the carve-outwos/active-epistemic-humility.mdPart 1.3 names, not an exception to the claim-status rule this file also carries: each grade states what was matched, andWhat was searchedprints the trail behind it. - Multi-repo handling: branch behavior on the presence of
## RepositoriesinSOURCE_OF_TRUTH.md. If the section exists, require explicittarget repoinput matching one entry; restrict search to that repo's workspace path. If the section is absent, run as single-repo (existing behavior, no change). Reject unknown repo identifiers with an explicit error rather than searching the wrong workspace. - Treat task-memory write policy per
WORKFLOW_OPERATING_SYSTEM.md: write the file and mark itAPPLIED. - No-op rule for artifacts:
- If
SOURCE_OF_TRUTH.mdalready names the same files the locate would propose, do not rewrite it; emitNO_OP_TRACEand route forward. - If the search produced no
HIGHand noMEDIUMcandidates, do not patchSOURCE_OF_TRUTH.md; route to clarification (targeted-questions) instead.
- If
Required output:
- Behavior description echoed back in 1 line (so the user can confirm the locate matched their intent)
- Search type used (
implementation/tests/config/any) What was searched: paths or globs scanned and search terms usedWhat was excluded: common skipped locations and why (vendor, generated, build artifacts, etc.)- Up to 10 candidates, each with: path, line range, confidence, one-line rationale
- Negative result note when no
HIGH-confidence candidate was found - Proposed
SOURCE_OF_TRUTH.mdupdate block (Main files in scopesection) listing onlyHIGHandMEDIUMcandidates - Recommended next command (
implement-approved-slicefor the same slice when its blast-radius gate routed here; otherwise typicallyimpact-analysiswith the now-populatedSOURCE_OF_TRUTH.md)
Claim grounding (active epistemic humility)
Claim grounding (active epistemic humility). This block governs what you may assert and how you record it. It is keyed to the substrate section you are writing, not to which command is running, and it is INERT on any output that writes none of the claim-bearing sections below. Full contract and rationale: wos/active-epistemic-humility.md.
- When this applies. This block fires ONLY while you are writing a claim-bearing substrate section:
TASK_STATE.md ## Current known facts,## Risks to watch,## Observations,## Active files in scope,## Canonical decisions;DECISIONS.md ## Locked decisions;IMPLEMENTATION_PLAN.md ## Current gaps,## Risks and mitigations;IMPACT_ANALYSIS.md;EXTERNAL_RESEARCH.md;REFERENCES.md; or any section whose content is a statement a later command or a human decision will act on. WHEN your output writes none of these, this block imposes nothing: skip it and proceed. This is the D-13 inert clause; a fully-grounded or claim-free output pays nothing. - The unit is the load-bearing claim. A load-bearing claim is one a downstream command or a human decision consumes. A passing aside is not load-bearing; a statement someone will act on is. Apply the rest of this block per load-bearing claim, not per sentence.
- Ground it or abstain. Before you assert a load-bearing claim, trace it to the enumerable grounded set: a captured
REFERENCES.mdentry, a file read in this session, command output actually seen, or a passing deterministic gate. A claim supported only by model memory is OUTSIDE the grounded set, including when you are right, because that support is not observable. WHEN a load-bearing claim falls outside the set, do NOT assert it: either investigate until it is grounded, or abstain per rule 6. - Status records provenance, never confidence. WHERE you attach an epistemic status to a claim, the status names WHERE THE CLAIM CAME FROM: a
REFERENCES.mdentry title, a file path plus line, or the gate output it came from. It SHALL NOT express a degree of certainty. Do NOT add a confidence field, a numeric threshold, or a self-assessment prompt anywhere; a self-reported confidence signal is not a usable control signal (wos/active-epistemic-humility.mdPart 1.3). A status whose referent slot is empty is read as UNKNOWN, not as a weak yes. - Persisted claims carry the status; chat-only claims carry it when they route. Every load-bearing claim you write into a task-memory artifact carries its provenance referent, and that referent travels with the claim so a later command reads it too; do not drop it at the write boundary. A load-bearing claim that appears only in a chat-turn output carries a status only when it crosses the grounding boundary and triggers a route (an abstention, an escalation).
- Abstain as a routed continuation, never a bare refusal. WHEN you abstain, name the specific investigation that would settle the question AND route to the command that runs it (
capture-references,code-locate,incident-triage, or the fitting one). A withholding that stalls the work is invalid output. Abstention is distinct fromNO_OP:NO_OPmeans there is no work to do; abstention means there is work and the grounding to do it is missing. - An unfired gate is not evidence. The absence of a fired check does not mean grounding existed. Do not read silence here as a pass.
Standard output layout (required)
Produce the command output using this structure (English only):
Artifact changes
- List files in the task repository that would change, or
None. - For each file, mark
APPLIED/PROPOSED/SKIPand follow the task-memory write policy inWORKFLOW_OPERATING_SYSTEM.md(task memory isAPPLIEDin every mode; a section this command does not own gets a<!-- PROPOSED by <command>: ... -->block for its owner, ADR-0034). - Default for this command:
APPLIEDpatch onSOURCE_OF_TRUTH.mdonly.
Command transcript
- Keep this section operational and brief; do not restate file content already listed in
### Artifact changes. - Max 4 lines in normal runs.
- Max 3 lines in no-op runs (including
NO_OP_TRACE). - Include
NO_OP_TRACE(1-3 lines) when no candidate was found, when the locate would not changeSOURCE_OF_TRUTH.md, or when search scope was insufficient (route to user clarification).
Handoff
Use the adaptive ending format of WORKFLOW_OPERATING_SYSTEM.md ## Global output contract. Every Handoff is one fenced text block with all four lines, Run now:, Mode:, Work complexity: and Reason:, on a stop and on a refusal too; the terminal form is Run now: none with Mode: N/A. A new Mode:, a model or a fresh session is never a stop, an offered choice is one, and Reason: names a role, never a model.
Definition of done (command output)
- Output lists at most 10 candidates; padding the list with
LOW-confidence guesses to inflate the count is invalid output. - Each candidate includes path, line range (or
*for full file), confidence (HIGH/MEDIUM/LOW), and one-line rationale; missing any of these fields per candidate is invalid output. What was searchedsection is explicit (paths or globs and search terms); output without it is invalid because the user cannot judge coverage.What was excludedsection names common skipped locations (vendor, generated, build artifacts, etc.); silent exclusion is invalid output.- When no
HIGH-confidence candidate exists, output explicitly says so and lists what was searched; vague "I could not find anything specific" without the search trail is invalid output. SOURCE_OF_TRUTH.mdupdate block is provided when at least oneHIGHorMEDIUMcandidate exists; output without that patch when it would help the next step is invalid.- Paths cited are real (verified by reading the file or directory listing); inventing paths to fill the list is invalid output and contradicts the
fail closedrule. - Multi-repo validation: when
SOURCE_OF_TRUTH.mdhas a## Repositoriessection, output rejects invocations missing thetarget repoinput or with an identifier that does not match any entry; running search against the wrong workspace silently is invalid output. Single-repo tasks (no## Repositoriessection) behave identically to the v1.0 contract. - Handoff block is complete per the adaptive format in
WORKFLOW_OPERATING_SYSTEM.md## Global output contract. - The recommended next command is
implement-approved-slicefor the same slice when its blast-radius gate routed here, and otherwise defaults toimpact-analysis(now able to run with concrete files); other valid options aretargeted-questions(when locate result requires user clarification) orincident-triage(when locate was triggered by a failing test or incident and the result reveals a clear hotfix path). - Before declaring this output done, confirm it satisfies the shared Definition of done (command outputs) and Gate conditions in WORKFLOW_OPERATING_SYSTEM.md.
Quality bar: Optimize for bounded output, accurate path-and-line citations, explicit search coverage, and protection against invented paths. The command exists to move the user from "vague codebase pointer" to "concrete files in scope" with high signal and minimal hallucination risk.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

