Analyze code structure using AST parsing. Extract classes, functions, interfaces, and types from Python and TypeScript/JavaScript files without reading full implementations.
- Python Support: Full AST analysis using Python's built-in
astmodule - TypeScript/JavaScript Support: Full AST analysis using the TypeScript Compiler API
- Multiple Output Formats: skeleton, signatures, json, detailed
- Smart Filtering: Focus on specific classes, interfaces, or functions
- Token-Efficient: Designed for LLM consumption with minimal context usage
# Add the marketplace
/plugin marketplace add yourusername/code-structure-plugin
# Install the plugin
/plugin install code-structure@code-structure-marketplace# Test with local plugin directory
claude --plugin-dir ./code-structure-pluginAnalyze Python files using AST parsing.
# Basic usage
python "${CLAUDE_PLUGIN_ROOT}/skills/python-structure/scripts/cli.py" myfile.py
# Get signatures only
python "${CLAUDE_PLUGIN_ROOT}/skills/python-structure/scripts/cli.py" myfile.py --format=signatures
# Focus on a class
python "${CLAUDE_PLUGIN_ROOT}/skills/python-structure/scripts/cli.py" myfile.py --class=MyClassAnalyze TypeScript/JavaScript files using the TypeScript Compiler API.
# Basic usage
node "${CLAUDE_PLUGIN_ROOT}/skills/typescript-structure/dist/cli.js" myfile.ts
# Get signatures only
node "${CLAUDE_PLUGIN_ROOT}/skills/typescript-structure/dist/cli.js" myfile.ts --format=signatures
# Focus on an interface
node "${CLAUDE_PLUGIN_ROOT}/skills/typescript-structure/dist/cli.js" myfile.ts --interface=MyInterface| Format | Description | Best For |
|---|---|---|
skeleton |
Code outline with ... bodies |
Quick overview |
signatures |
Just function/method signatures | Maximum density |
json |
Structured JSON data | Programmatic use |
detailed |
Full structure with docs | Documentation |
# models.py (150 lines)
"""Data models for the application."""
from dataclasses import dataclass
from typing import Optional
@dataclass
class User:
"""Represents a user."""
id: int
name: str
email: Optional[str] = None
def validate(self) -> bool: ...
def to_dict(self) -> dict: ...
def create_user(name: str, email: str) -> User: ...// services.ts (200 lines)
import { Database } from "./db"
import type { User, Config } from "./types"
export interface ServiceConfig {
timeout: number
retries: number
}
export class UserService {
private db: Database
constructor(config: ServiceConfig) { ... }
async getUser(id: string): Promise<User | null> { ... }
async createUser(data: Partial<User>): Promise<User> { ... }
}Both skills support these options:
| Option | Description |
|---|---|
--format=FORMAT |
Output format (skeleton, signatures, json, detailed) |
--only=TYPE |
Filter by element type |
--class=NAME |
Focus on specific class |
--no-docstrings / --no-jsdoc |
Omit documentation comments |
--line-numbers |
Show line numbers |
--compact |
Remove blank lines |
- Python skill: Python 3.9+ (uses built-in
astmodule) - TypeScript skill: Node.js 18+ (includes TypeScript compiler)
MIT