Function-level refactor with call graph

VerifiedSafe

Symbol-level refactor workflow using call graph tools to map blast radius before editing functions or signatures.

Sby Skills Guide Bot
DevelopmentIntermediate
7/26/2026
Claude Code
#refactoring#call-graph#impact-analysis#mcp#code-quality

Recommended for

Automated summary

This skill defines a function-level refactoring workflow that uses the nlt-build MCP call-graph tools to map the blast radius before any symbol change.

Strengths

  • Surfaces callers and downstream dependencies of a symbol before altering its signature or deleting it
  • Pairs each Python file edit with a tapps_quick_check in a tight edit loop
  • Combines module-level impact analysis with diff impact to confirm the real reach of changes
  • Ends with a task-type checklist tailored to refactor work

Limitations

  • Tightly bound to the nlt-build MCP server and its proprietary tools, so it does not port to other setups
  • Assumes a built call graph; degraded states require reading docs/CALL_GRAPH.md for semantics
  • Examples and guidance center on Python and do not address other languages
When to use it

Use it before changing a function's signature, deleting a symbol, or refactoring its callers so you can size the blast radius first.

When not to use it

Skip it for cosmetic local tweaks that leave contracts untouched, or in projects without the nlt-build MCP server and its call graph.

Security analysis

Safe
Quality score78/100

The skill only invokes a fixed set of read-only MCP analysis tools (session start, call graph, impact analysis, diff impact, quick check, checklist) to map blast radius before refactoring. There are no shell commands, network fetches, file writes, credential access, or obfuscated payloads, and the workflow is transparent and limited in scope.

No concerns found

How this analysis is made

Examples

Signature change
I need to add a required parameter to `build_report` in src/reports/builder.py. Before I touch it, use the call graph to show me every caller and tell me what will break.
Delete a function
I want to delete the function `legacy_parse_header` in parsers/legacy.py. Run tapps_refactor on it first and map the blast radius so I know which callers need updating.
Refactor impact check
Refactor the callers of `normalize_path` in utils/paths.py, then run a diff impact analysis on the changed files to confirm nothing downstream is missed.

name: tapps-refactor user-invocable: true model: claude-sonnet-4-6 description: >- Function-level refactor workflow using call graph tools (Epic 114). Use before changing a symbol's signature, deleting a function, or refactoring callers — maps blast radius via tapps_call_graph and diff_impact. allowed-tools: >- mcp__nlt-build__tapps_session_start mcp__nlt-build__tapps_call_graph mcp__nlt-build__tapps_impact_analysis mcp__nlt-build__tapps_diff_impact mcp__nlt-build__tapps_quick_check mcp__nlt-build__tapps_validate_changed mcp__nlt-build__tapps_checklist argument-hint: "[symbol or file-path]"

Symbol-level refactor workflow (Epic 114 / ADR-0017):

  1. Session bootstrap. Call mcp__nlt-build__tapps_session_start() — read data.call_graph (ready, stale, degraded). Stale is informational; graph tools auto-rebuild on first use.

  2. Before editing a function. mcp__nlt-build__tapps_call_graph(symbol='...', query='callers') — who calls this symbol? Use query='callees' for downstream dependencies or query='chain' for bounded chains.

  3. Optional module context. mcp__nlt-build__tapps_impact_analysis(file_path='...', symbol='...', granularity='both') for import + symbol blast radius.

  4. Edit loop. After each Python file change, mcp__nlt-build__tapps_quick_check(file_path='...').

  5. After edits. mcp__nlt-build__tapps_diff_impact(file_paths='...') or finish with /tapps-finish-task (include_impact default true refreshes cache).

  6. Close out. /tapps-finish-task with task_type=refactor — checklist recommends tapps_call_graph and tapps_diff_impact.

See docs/CALL_GRAPH.md for gap_rate / degraded semantics.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/function-level-refactor-with-call-graph-ms1aw4gg/download' --output '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md.part' && mv '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md.part' '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): mcp__nlt-build__tapps_session_start mcp__nlt-build__tapps_call_graph mcp__nlt-build__tapps_impact_analysis mcp__nlt-build__tapps_diff_impact mcp__nlt-build__tapps_quick_check mcp__nlt-build__tapps_validate_changed mcp__nlt-build__tapps_checklist

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md' && test -s '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/tapps-refactor' && cp -R '.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg' '.claude/skills/tapps-refactor'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg'

openskills read 'function-level-refactor-with-call-graph-ms1aw4gg'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/function-level-refactor-with-call-graph-ms1aw4gg/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills