trace

Identify structural boundaries and implementations in codebases using ast-grep AST analysis.

2|Updated Sep 12, 2016
One-click install
npx skills add https://github.com/paulnsorensen/dotfiles --skill trace-paulnsorensen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trace
Source: https://github.com/paulnsorensen/dotfiles/tree/main/claude/skills/trace
Command: npx skills add https://github.com/paulnsorensen/dotfiles --skill trace-paulnsorensen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Structural analysis of code architecture using ast-grep to map boundaries, dependencies, and implementations without requiring full-file reads. It helps identify SOLID principle adherence, adapters/interfaces, and hexagonal architecture layering by parsing ASTs rather than text.

Core Features & Use Cases

  • Structural mapping of classes, ports, adapters, and boundaries.
  • Hexagonal architecture auditing and dependency direction enforcement.
  • Enumerating method signatures and locating interface implementations across a codebase.
  • Real-world scenario: map module boundaries in a microservices repository to identify coupling.

Quick Start

Ask me to map a repository's code structure and I will use sg to generate a structural audit.

Frequently Asked Questions about trace

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit hexagonal architecture boundaries in a codebase?

To audit hexagonal architecture boundaries, you can analyze the abstract syntax tree to identify and map ports, adapters, and boundary layers without reading full files. This structural analysis reports dependency directions and interface implementations deterministically.

What is AST-based static analysis for code structure mapping?

AST-based static analysis for code structure mapping parses the abstract syntax tree to identify classes, method signatures, and module boundaries. It determines code shape and SOLID principle adherence deterministically using syntax tree outputs rather than performing full-file text reads.

Can I analyze cross-language projects to locate interface implementations?

Yes, you can analyze cross-language projects to locate interface implementations by applying structural queries across the codebase. AST-based analysis scopes to multiple languages to enumerate method signatures and find adapter classes implementing specific ports.

How do I identify coupling and dependency direction in a microservices repository?

To identify coupling and dependency direction in a microservices repository, apply AST-based queries to map module boundaries. This structural analysis exposes how services interact and enforces architectural layering rules without requiring full-file reads.

Does ast-grep work for enforcing SOLID principles through structural queries?

Yes, ast-grep works for enforcing SOLID principles by running deterministic structural queries against the codebase. It identifies structural boundaries and implementations by parsing ASTs, enabling auditing of interface adherence and dependency isolation.

When should I not use AST-based structural analysis for architecture auditing?

You should not use AST-based structural analysis when you need to evaluate runtime behavior, dynamic dispatch, or business logic correctness, as it only reports deterministic code-shape patterns and static structural boundaries without executing the code.