tsa-structurelisted
Install: claude install-skill aimasteracc/tree-sitter-analyzer
# tsa-structure — File shape without the file body
## Tool routing
| Question | Tool |
|-------------------------------------------------|------------------------|
| Outline / table of classes + methods | `analyze_code_structure` |
| Run a tree-sitter query (e.g., all `def` nodes) | `query_code` |
| Detect design patterns (singleton, factory, …) | `code_patterns` |
| Classify a diff (refactor vs feature vs fix) | `semantic_classify` |
## Procedure
### File outline (most common)
```yaml
analyze_code_structure(file_path: "tree_sitter_analyzer/health_scorer.py")
# returns: {classes: [...], functions: [...], imports: [...]}
```
For a markdown-formatted table:
```bash
uv run tree-sitter-analyzer <file> --table full
```
### Custom tree-sitter query
When you need something the built-in tools don't surface:
```yaml
query_code(file_path: "...", query_key: "class")
# OR
query_code(file_path: "...", query_string: "(decorated_definition) @decorated")
```
`--list-queries` (CLI) shows all built-in queries available per language.
### Diff classification
```yaml
semantic_classify(file_path: "...", before_hash: "abc", after_hash: "def")
# returns: {classification: "refactor|feature|bugfix|test|docs|chore", confidence: 0.92}
```
Useful for PR descriptions and CHANGELOG categorization.
### Pattern detection
```yaml
code_patterns(file_path: "...", patterns: ["singleton", "factory", "observ