tree-sitter-analyzer: Skill for Claude Code

.claude/skills/tsa-constraints/SKILL.md

tsa-constraints is a skill for Claude Code from aimasteracc/tree-sitter-analyzer. It costs 161 tokens per session (1,211 once invoked), scanned A, original, MIT.

A set of rules that checks whether code breaks declared architectural boundaries, such as forbidding one module from calling another. The rules are stored in a YAML configuration file and checked against the project’s recorded call relationships.

In plain words
What is it for?
Use it to audit architecture, check a proposed change before editing, filter violations by severity or path, and add or update dependency rules.
Why use it?
It catches unwanted dependencies before or during edits and reports whether the project is safe, needs attention, or violates a rule.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is aimasteracc/tree-sitter-analyzer's own configuration. It tells Claude Code how to work on tree-sitter-analyzer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tree-sitter-analyzer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to aimasteracc/tree-sitter-analyzer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/aimasteracc/tree-sitter-analyzer/main/.claude/skills/tsa-constraints/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/aimasteracc/tree-sitter-analyzer

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tsa-constraints

README.md
[![agentmods](https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-constraints.svg)](https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-constraints)
Your own site
<a href="https://agentmods.dev/skills/aimasteracc/tree-sitter-analyzer/tsa-constraints"><img src="https://agentmods.dev/badge/skills/aimasteracc/tree-sitter-analyzer/tsa-constraints.svg" alt="Measured on agentmods" height="20"></a>
Per session 161 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,211 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00161 $0.01211
Opus 5 $0.00081 $0.00606
Sonnet 5 $0.00032 $0.00242
Haiku 4.5 $0.00016 $0.00121

Measured 8d ago against content hash 16be04723fc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tsa-constraints scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/tsa-constraints/SKILL.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

tsa-constraints — Inhibitory edges as code

Bio-analogy: inhibitory synapses — declared "X must NOT call Y" rules that fire UNSAFE verdicts when violated. Rules live in architectural-constraints.yml at repo root, are evaluated against the persisted call graph, and persist violations in SQLite for fast re-reads.

When to use

Goal Action
List current rules Read architectural-constraints.yml
Check repo against rules edit action=constraints (no args)
Pre-edit gate (includes rule check) edit action=safe (auto)
Add a new rule Edit YAML + re-run edit action=constraints
Filter violations by severity edit action=constraints severity_min="error"
Filter by path edit action=constraints path_filter="mcp/**"

Procedure

One-shot audit

edit action=constraints

Returns:

success: true
verdict: SAFE | CAUTION | UNSAFE
violations: [
  {rule_id, caller_file, caller_line, callee_name, callee_file, severity, reason}
]
rule_count: <int>
evaluated_edge_count: <int>

Verdict cascade:

  • UNSAFE → any error-severity violation
  • CAUTION → any warn-severity violation
  • SAFE → none

Adding a new rule

  1. Open architectural-constraints.yml at repo root
  2. Append:
    - id: <slug, kebab-case>
      severity: error | warn | info
      rule: forbid
      from: "path/glob/**"
      to:   "path/glob/**"
      reason: "<why this is forbidden>"
      exceptions: ["specific/file.py"]   # optional
    
  3. Run edit action=constraints to see if existing code violates the new rule
  4. Either: fix the violations OR add them to exceptions

Reading violations

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 147 lines · 161 tokens per session scan A 16be04723fc9

Subscribe to this mod's changes

tsa-constraints is a skill published in the GitHub repository aimasteracc/tree-sitter-analyzer (49 stars, last pushed today), licensed MIT. It adds 161 tokens to every session and 1,211 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

codegraph

Use for repo structure, symbol navigation, dependency analysis, duplicate triage, and PR impact review when plain text search is too shallow.

lzehrung/codegraph · 30 tokens

plan-eng-review

Eng manager-mode plan review. Lock in the execution plan — architecture, data flow, diagrams, edge cases, test coverage, performance. Walks through issues interactively with opinionated recommendations. Use when asked to "review the architecture", "engineering review", or "lock in the plan". Proactively suggest when…

GCWing/BitFun · 116 tokens

autoplan

Auto-review pipeline — reads the full CEO, design, eng, and DX review skills from disk and runs them sequentially with auto-decisions using 6 decision principles. Surfaces taste decisions (close approaches, borderline scope, codex disagreements) at a final approval gate. One command, fully reviewed plan out. Use when…

GCWing/BitFun · 152 tokens

pre-landing-review

Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust boundary violations, conditional side effects, and other structural issues. Use when explicitly asked for the specialized pre-landing workflow. Product /review requests are handled by OpenBitFun's unified Review mechanism instead.…

GCWing/BitFun · 75 tokens

systemic-issue-triage

Trigger: new issue, bug report, triage, backlog, issue flood, community report, root cause, dead-end, blocked user. Attack issues by root class, never one-by-one; fixes must shrink the system, not grow it.

Gentleman-Programming/gentle-ai · 57 tokens

investigate

Systematic debugging with root cause investigation. Four phases: investigate, analyze, hypothesize, implement. Iron Law: no fixes without root cause. Use when asked to "debug this", "fix this bug", "why is this broken", "investigate this error", or "root cause analysis". Proactively invoke this skill (do NOT debug…

GCWing/BitFun · 112 tokens