buck2-target-determination

Determine affected Buck2 targets between jj revisions using quicktd.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Buck2 projects often require rebuilding only the changed targets to save time; this skill identifies which Buck2 targets are affected by a given set of code changes to enable incremental workflows.

Core Features & Use Cases

  • Identify affected Buck2 targets between two jj revisions using quicktd to generate a focused build/test scope.
  • Outputs a target list to a file, enabling large-scale or CI workflows to operate on only the necessary targets.
  • Includes a Python helper (scripts/quicktd_helper.py) and clear usage notes to simplify pattern-based invocations and scope control.

Quick Start

Run buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/... to identify affected targets, then optionally buck2 build or buck2 test them.

Frequently Asked Questions about buck2-target-determination

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

FAQPage Schema
How do I find affected Buck2 targets for incremental builds?▼

You can identify affected Buck2 targets by running quicktd between two jj revisions, which computes the diff and writes the affected target list to a file for incremental builds.

Can I use jj revisions to determine which Buck2 targets changed?▼

Yes, jj revisions can determine changed Buck2 targets. The skill uses quicktd to compute changes between jj revsets like '@-' and '@' to identify affected targets.

How do I run quicktd to build or test only affected targets in Buck2?▼

Run buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/... to generate the affected target list, then optionally execute buck2 build or buck2 test on those targets.

Does this target detection approach work for CI workflows?▼

Yes, this target detection approach works for CI workflows. It outputs affected targets to a file, enabling large-scale CI pipelines to operate only on necessary targets.

What is the best way to scope Buck2 builds to changed code?▼

The best way to scope Buck2 builds to changed code is using quicktd to compute affected targets between jj revisions, then writing those targets to a file for pattern-based invocation.