Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Survey Code?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nirecom-survey-code)
---
name: survey-code
description: Explore the codebase to understand existing patterns, constraints, and relevant files before planning.
model: sonnet
user-invocable: false
---
Investigate the codebase related to the given task.
## Procedure
### SVC-0 — Resolve <PLANS_DIR>
Before any tool call below that references <PLANS_DIR>, run `bash "$AGENTS_MAIN_ROOT/bin/workflow-plans-dir"` exactly once as one bare command — never assigned to a variable and echoed back.
Read the printed absolute path from its stdout and substitute it for every <PLANS_DIR>
placeholder in the remainder of this SKILL.md. Subagent prompts must receive
the resolved absolute path as a literal string (subagents cannot expand $VAR).
Reuse across all subsequent in-skill steps in this invocation — do not re-resolve.
When invoked as a parallel Agent subagent by workflow-init, the orchestrator
passes `artifact_path` and `context_path` as resolved absolute strings — use
those instead of running SVC-0.
Canonical documentation: skills/_shared/resolve-plans-dir.md.
SVC-1. **Claim extraction** (run before reading any code):
Input precedence (read whichever exists first):
(a) the path printed by `node "$AGENTS_MAIN_ROOT/bin/plan-artifact-path" --step clarify_intent` (it follows a resumed session's session-upstream) — preferred (post-clarify-intent calls)
(b) `<PLANS_DIR>/<session-id>-context.md` — fallback (pre-clarify-intent calls
from workflow-init; use "User initial prompt" and "Issue body" sections)
If neither exists: proceed to SVC-2 with an empty claim list.
Extract up to 5 behavioral/factual claims from Background/Motivation and Scope.
Target: "X is blocked", "X does Y", "X is broken", "X cannot Z". Exclude aesthetic
claims and pure preferences. Works with Japanese and English content.
SVC-2. Identify candidate files and areas using Glob and Grep.
SVC-3. Read relevant source files, configs, tests, and docs.
SVC-4. For each claim extracted in SVC-1, verify it against the current codebase:
- `verdict: holds` — evidence in code confirms the claim
- `verdict: contradicted` — evidence in code contradicts the claim
- `verdict: indeterminate` — insufficient evidence to confirm or deny
SVC-5. Summarize: existing patterns, architectural constraints, relevant files (with line numbers), and anything that affects implementation.
SVC-6. Write findings to `<PLANS_DIR>/<session-id>-survey-code.md`. The file must
include a `## Verified Claims` section:
```
## Verified Claims
- claim: <text from intent.md>
verdict: holds | contradicted | indeterminate
evidence: <file:line or "no matching code found">
```
If no claims were extracted in SVC-1, write the section with the note
"No verifiable behavioral/factual claims found in intent.md or context.md."
The file must also include a `## Candidate class members` section:
```
## Candidate class members
- <member name>: <one-line role> (<file>:<line>)
proposed triage: <MUST | OPTIONAL | NA> — <one-line rationale>
```
List sibling members of the class being changed (per `rules/core-principles.md`
CPR-E2C Elevate to the Class). Each member is two lines: (a) name + role + primary
file:line reference; (b) `proposed triage:` value and 1-line rationale grounded
in the survey evidence. Triage values:
- `proposed triage: MUST` — symmetric to the user-requested change; failing to fix it leaves the class inconsistent.
- `proposed triage: OPTIONAL` — related but independently fixable; user choice whether to bundle.
- `proposed triage: NA` — sibling exists but genuinely orthogonal; no fix needed for this task.
When uncertain, propose `OPTIONAL`. If no candidates are detected, write a
single line: `- (none detected)`. This section is required.
SVC-7. Present findings for user review before proceeding to plan.
## Rules
- Read **project source files** only — do not modify them. Writing the output
artifact to `<PLANS_DIR>/<session-id>-survey-code.md` (SVC-6 above) is
REQUIRED and allowed — `<PLANS_DIR>` lives outside the git repo. See
`skills/_shared/survey-artifact-valid.md` for the artifact validity contract.
- Use Explore subagents for broad searches when needed
- Each Explore prompt carries the canonical line of the `rules/shell-commands.md` Subagent Dispatch Prompts section.
- Follow `rules/core-principles.md`.
- Do NOT emit the research-complete sentinel — `make-outline-plan` MOP-0 aggregates
both survey-code and survey-history before emitting it.
## Completion
Skip this skill when the change target is already known (single file/function).
If research is genuinely not needed for this task (typo fix, docs-only change):
1. Run: `echo "<<WORKFLOW_RESEARCH_NOT_NEEDED: {reason}>>"` (reason must be ≥3 non-space chars, not a placeholder like "none"/"skip", and contain no '>')