aimasteracc/tree-sitter-analyzer/tsa-edit-safety
Claude Code and agent skill by aimasteracc/tree-sitter-analyzer
- community
Checking that the SKILL.md file is still in the repository.
Pre-edit safety check using tree-sitter-analyzer. One workflow → verdict (SAFE/REVIEW/CAUTION/UNSAFE) + verification command + risk factors → ≤2k tokens, ≤3 MCP calls. Replaces ~10k tokens of grep/read/git-diff exploration before touching a file. Use when: - About to edit a file you haven't touched in this session - Refactoring across multiple files - Asked "is it safe to change X?" or "what breaks if I touch Y?" - Before approving a code review Workflow: 2-3 parallel MCP calls (edit action=saf…
Install
npx vskill@latest install aimasteracc/tree-sitter-analyzer/tsa-edit-safetySKILL.md
tsa-edit-safety — Decide before you edit
Replaces grep/read/git-diff/blame exploration with 2-3 MCP calls returningverdict + exact command to verify. 80% token reduction vs. manual recon.
When to use
- Pre-edit gate for any non-trivial change (more than 5 lines or crossing files)
- User asks any of: "is X safe to change", "what depends on Y", "what tests cover Z"
- Right after
git diffshows pending changes you want to evaluate
Don't use when:
- One-line typo fix in a doc / comment
- File you're literally creating from scratch (no callers)
Procedure
Step 1 — Single fan-out (parallel)
Call these 3 tools in ONE message:
edit action=safewithfile_path: "<the file>"andedit_type: "<refactor|add_feature|fix_bug|rename>"edit action=impactwithmode: "staged"(or"branch"if pre-stage), scope to the filehealth action=filewithfile_path: "<the file>"
If the question is "what tests cover Z and the code that calls Z" (the test surface of a signature change), add one call instead of a nav action=test_map per caller:
search action=uql query="symbol('Z').impact()"— transitive callers,
their tests and files in one call, each stage labelled complete / incomplete / unknown. For Z's own tests only, nav action=test_map is faster (it makes no completeness claim).
Step 2 — Read the verdict cascade
Verdict precedence (worst wins):
UNSAFE(from constraints or impact) → STOP, explain why, do not editCAUTION(high impact / dependencies / hot zone) → narrow scope, write tests firstREVIEW(moderate, often "no tests nearby") → write tests before editSAFE→ proceed; still run the returnedverification_command
Step 3 — Always quote the exact verification_command
The tools return a verification_command and stop_condition. Surface them verbatim to the user before editing. Example:
verdict: REVIEWverification_command:uv run pytest tests/unit/test_health_scorer.py -qstop_condition: tests exit successfullynext_step: write a failing test for the new behaviour first
Common shapes
No tests nearby → escalate to REVIEW + recommend tdd workflow `__init__.py` edit → REVIEW automatically (re-exports) `mod_count_30d >= 5` → CAUTION (hot zone — extra review attention) Constraint violation → UNSAFE (architectural rule — forbidden edge)
CLI equivalents (if MCP unavailable)
Anti-patterns
- DO NOT read the file before this check — the tool's verdict is informed by
the AST + DB, not text scan. Reading first wastes tokens.
- DO NOT run pytest -q (whole suite) when the tool returned a focused command.
- DO NOT skip the gate just because the file is "small" — small files often
have outsized blast radius (e.g. __init__.py, conftest.py).
Decision surface returned
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtree_sitter_analyzer/skills/tsa-edit-safety/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aimasteracc/tree-sitter-analyzer/tsa-edit-safety)