Get the FREE Ultimate OpenClaw Setup Guide →

pactkit-trace

Scanned
npx machina-cli add skill pactkit/claude-code-plugin/pactkit-trace --openclaw
Files (1)
SKILL.md
1.1 KB

PactKit Trace

Deep code analysis and execution path tracing via static analysis.

When Invoked

  • Plan Phase 1 (Archaeology): Trace existing logic before designing changes.
  • Act Phase 1 (Precision Targeting): Confirm call sites before touching code.

Protocol

1. Feature Discovery

  • Use Grep to locate entry points (API route, CLI arg, Event handler).
  • Map core files involved — don't read everything yet.

2. Call Graph Analysis

  • Run visualize --mode call --entry <function_name> to obtain call chains.
  • Read docs/architecture/graphs/call_graph.mmd to see all reachable functions.

3. Deep Tracing

  • Follow call chain file by file, recording data transformations.
  • Note how data structures change (e.g., dict -> UserObj -> JSON).

4. Visual Synthesis

Output a Mermaid Sequence Diagram to visualize the flow.

5. Archaeologist Report

  • Patterns: Design Patterns used.
  • Debt: Hardcoded values, complex logic, lack of tests.
  • Key Files: Top 3 files critical to this feature.

Source

git clone https://github.com/pactkit/claude-code-plugin/blob/main/pactkit-plugin/skills/pactkit-trace/SKILL.mdView on GitHub

Overview

PactKit Trace performs static analysis to map execution flow and trace call paths across a project. It helps identify call sites before making changes and documents the data transformations along the way.

How This Skill Works

Discovery starts with Grep to locate entry points (API routes, CLI args, or event handlers) and maps core files. Then visualize --mode call --entry <function> yields the call graph, with docs/architecture/graphs/call_graph.mmd listing reachable functions. Finally, it follows the chain file-by-file to record data transformations and outputs a Mermaid Sequence Diagram plus an Archaeologist Report on patterns, debt, and key files.

When to Use It

  • During Plan Phase 1 (Archaeology): trace existing logic before designing changes.
  • During Act Phase 1 (Precision Targeting): confirm call sites before modifying code.
  • When preparing a refactor: map data flow and identify critical paths.
  • When debugging complex flows: follow the call chain and data transformations.
  • For architecture audits: capture design patterns, debt, and key files.

Quick Start

  1. Step 1: Use Grep to locate entry points (API routes, CLI args, Event handlers).
  2. Step 2: Run visualize --mode call --entry <function_name> to build the call graph; inspect docs/architecture/graphs/call_graph.mmd.
  3. Step 3: Trace the chain, record transformations, and output a Mermaid Sequence Diagram plus the Archaeologist Report.

Best Practices

  • Start with entry-point discovery using Grep to scope the analysis.
  • Limit scope to relevant modules to keep the graph readable.
  • Use visualize --mode call to build a clean call graph before deep tracing.
  • Record data transformations step by step and watch for changes in data structures.
  • Generate Mermaid diagrams and complete Archaeologist Report with patterns, debt, and key files.

Example Use Cases

  • Trace API route to JSON serialization in a REST service.
  • Trace a CLI workflow from argument parsing to output file generation.
  • Follow an event handler flow across modules in an event-driven system.
  • Audit a feature refactor to identify dead code and tight coupling.
  • Document data transformation pipelines in a microservice.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers