ast-first-gate

Builds and validates an AST dependency graph before any code analysis.

Updated Oct 9, 2025
One-click install
npx skills add https://github.com/Siamese001/Agentic-Workflow --skill ast-first-gate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ast-first-gate
Source: https://github.com/Siamese001/Agentic-Workflow/tree/main/.windsurf/skills/ast-first-gate
Command: npx skills add https://github.com/Siamese001/Agentic-Workflow --skill ast-first-gate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill prevents premature or unreliable code analysis by mandating the construction and validation of an Abstract Syntax Tree (AST) dependency graph before any code investigation begins.

Core Features & Use Cases

  • Mandatory AST Graph: Ensures a detailed AST dependency graph is built and documented before any code analysis, impact assessment, or modification.
  • Fail-Closed Behavior: Blocks work if the graph cannot be built, preventing analysis based on incomplete or unreliable data.
  • Use Case: When asked to refactor a function, this Skill will first build the AST graph to understand all its dependencies and callers, ensuring the refactoring is safe and comprehensive.

Quick Start

Use the ast-first-gate skill to ensure the AST dependency graph is built before analyzing code.

Frequently Asked Questions about ast-first-gate

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

FAQPage Schema
How do I enforce AST dependency graph analysis before refactoring code?

To enforce AST dependency graph analysis before refactoring code, you need a fail-closed gatekeeping mechanism that blocks all code modification until the graph is built, documented, and validated. This prevents unreliable text-based search methods from being used as primary analysis tools.

Why does code investigation require building an AST dependency graph first?

Code investigation requires building an AST dependency graph first to ensure safe and comprehensive analysis. This constitutional enforcement prevents premature modifications by validating all dependencies and callers, ensuring adherence to default analysis modes and preventing incomplete impact assessments.

What is fail-closed behavior in AST code analysis gatekeeping?

Fail-closed behavior in AST code analysis gatekeeping blocks all work if the dependency graph cannot be built. This prevents analysis based on incomplete or unreliable data, ensuring that no code investigation, impact analysis, or refactoring proceeds without a validated AST graph.

How do I stop unreliable text-based search from being used for code impact analysis?

To stop unreliable text-based search from being used for code impact analysis, implement a mandatory AST graph gate. This enforces default analysis modes by requiring a detailed, validated dependency graph to be documented before any code investigation or modification begins.

When do I need an AST dependency graph for code modification?

You need an AST dependency graph for code modification whenever performing refactoring, impact analysis, or investigation. Mandating this graph first ensures you understand all dependencies and callers, which makes the modification safe and comprehensive.

Can I use text-based search as a primary analysis tool if the AST graph fails to build?

No, you cannot use text-based search as a primary analysis tool if the AST graph fails to build. The fail-closed behavior blocks all work when the dependency graph cannot be built, preventing any analysis based on incomplete data.