buck2-query-helper

Run Buck2 dependency queries with shortcuts and formatted outputs.

11|1|Updated Apr 9, 2025
One-click install
npx skills add https://github.com/thoughtpolice/a --skill buck2-query-helper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: buck2-query-helper
Source: https://github.com/thoughtpolice/a/tree/main/.claude/skills/buck2-query-helper
Command: npx skills add https://github.com/thoughtpolice/a --skill buck2-query-helper

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Buck2-based dependency analysis in large monorepos can be verbose and repetitive; this skill provides a compact, scriptable helper to run common Buck2 queries with consistent formatting and ready-to-use patterns.

Core Features & Use Cases

  • Enhanced Buck2 query runner with shortcuts for deps, rdeps, kind, attrs, and path.
  • Prebuilt patterns and examples to explore build graphs, dependencies, reverse dependencies, and target attributes.
  • Real-world workflows: identify why a target is built, discover cycles, and audit dependencies across Buck2 projects.

Quick Start

Run a sample query to list dependencies of a target using the query helper.

Frequently Asked Questions about buck2-query-helper

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

FAQPage Schema
How do I query reverse dependencies in a Buck2 monorepo?

To query reverse dependencies in a Buck2 monorepo, you can use a scriptable query helper that executes buck2 queries with prebuilt shortcuts for rdeps. This provides formatted results to quickly identify why a specific target is built.

What is the best way to analyze build graphs and target attributes in Buck2?

Analyzing Buck2 build graphs and target attributes is best handled by a Python-based wrapper that runs buck2 queries. It exposes a simple command interface with optional JSON and attribute outputs for ready-to-use dependency exploration.

Can I get JSON output from buck2 queries for dependency analysis?

Yes, you can get JSON output from buck2 queries by using a command-line helper that formats dependency analysis results. The wrapper exposes optional JSON outputs, making it scriptable for automated target attribute exploration.

How do I find dependency paths between targets in a multi-target build?

To find dependency paths between targets in a multi-target build, apply a query helper with path analysis shortcuts. It executes the underlying buck2 queries and formats the path results to help you discover cycles and audit dependencies.

Does this Buck2 query helper work for large monorepos?

Yes, this Buck2 query helper is designed for large monorepos and multi-target builds. It solves the verbose and repetitive complexity of dependency analysis by providing compact, scriptable shortcuts with consistent formatting.