xiaohongshu
xiaohongshu
buck2-target-determination
This skill should be used when determining which Buck2 targets are affected by code changes for incremental builds and tests. Use this when users ask to test/build changed code, find affected targets, or run incremental workflows with jj revisions.
Full skill instructions
Target determination identifies which Buck2 targets are affected by code changes between two jj revisions. This enables incremental workflows that only build/test what changed, dramatically reducing build times (often 10-100x faster than full builds).
Use this skill when:
quicktd or target determinationThe quicktd tool:
'@-' and '@')Critical: Always use the root// cell prefix with quicktd to avoid ambiguous cell references.
# Find targets affected between parent (@-) and current (@)
TARGETS=$(buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/...)
# Build affected targets
buck2 build @$TARGETS
# Test affected targets
buck2 test @$TARGETS
Why at-file syntax (@$TARGETS)? Target lists can be extremely large (thousands of targets), exceeding command-line length limits. At-file syntax loads targets from a file.
# Changes in current commit (most common)
buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/...
# Changes since trunk
buck2 run root//buck/tools/quicktd -- 'trunk()' '@' depot//src/...
# Last 3 commits
buck2 run root//buck/tools/quicktd -- '@---' '@' depot//src/...
# Specific commit range
buck2 run root//buck/tools/quicktd -- 'abc123' 'def456' depot//src/...
# Changes in pull request (compared to main)
buck2 run root//buck/tools/quicktd -- 'trunk()' '@' depot//...
# Full repository scan
buck2 run root//buck/tools/quicktd -- 'root()' '@' depot//...
# Only specific directory
buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/myproject/...
# Multiple directories
buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/... depot//tools/...
# 1. Make changes
jj new -m "feat: implement feature"
# ... edit files ...
# 2. Find affected targets
TARGETS=$(buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/...)
# 3. Build affected targets
buck2 build @$TARGETS
# 4. Test affected targets
buck2 test @$TARGETS
# 5. If passing, commit
jj commit -m "feat: implement feature"
# See what targets are affected
TARGETS=$(buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/...)
# Count affected targets
wc -l $TARGETS
# Show affected targets
cat $TARGETS
# Find which are tests
buck2 query "kind('.*_test', set(@$TARGETS))"
# Find which are binaries
buck2 query "kind('.*_binary', set(@$TARGETS))"
Use scripts/quicktd_helper.py for simplified invocations:
# Interactive mode - prompts for revsets
python3 scripts/quicktd_helper.py
# Quick patterns
python3 scripts/quicktd_helper.py --pattern current # '@-' to '@'
python3 scripts/quicktd_helper.py --pattern trunk # 'trunk()' to '@'
python3 scripts/quicktd_helper.py --pattern full # 'root()' to '@'
# Custom revsets
python3 scripts/quicktd_helper.py --from '@---' --to '@' --scope depot//src/myproject/...
# Auto-build affected targets
python3 scripts/quicktd_helper.py --pattern current --build
# Auto-test affected targets
python3 scripts/quicktd_helper.py --pattern current --test
# Both build and test
python3 scripts/quicktd_helper.py --pattern trunk --build --test
The helper provides:
Possible causes:
jj diff)depot//src/myproject/... to depot//src/...)Solution:
# Check what changed
jj diff
# Verify files are committed
jj status
# Expand scope
buck2 run root//buck/tools/quicktd -- '@-' '@' depot//...
The root// prefix is missing. Always use:
# ✓ Correct
buck2 run root//buck/tools/quicktd -- ...
# ✗ Wrong
buck2 run //buck/tools/quicktd -- ...
Use at-file syntax (@filename) instead of passing targets directly:
# ✓ Correct
TARGETS=$(buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/...)
buck2 test @$TARGETS
# ✗ Wrong (may exceed command-line limits)
buck2 test $(cat $TARGETS)
Real-world example:
# Without target determination (builds everything)
time buck2 test depot//src/...
# → 1847 actions, 15m 23s
# With target determination (1 file changed)
TARGETS=$(buck2 run root//buck/tools/quicktd -- '@-' '@' depot//src/...)
time buck2 test @$TARGETS
# → 12 actions, 8.3s
# → 111x faster!
root// prefix - Prevents cell reference errors$TARGETS for multiple commandswc -l $TARGETS to verify resultsdepot//buck/tests/... aren't in quicktd scopePython helper script that wraps quicktd with common patterns and better output formatting.
Comprehensive guide to jj revset patterns for use with quicktd.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience