buck2-rule-basics

Guide new Buck2 learners through eight interactive rule-writing steps.

1|Updated Oct 23, 2023
One-click install
npx skills add https://github.com/Unity-Billal-mesloub/buck2. --skill buck2-rule-basics-unity-billal-mesloub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: buck2-rule-basics
Source: https://github.com/Unity-Billal-mesloub/buck2./tree/main/.claude/skills/buck2-rule-basics
Command: npx skills add https://github.com/Unity-Billal-mesloub/buck2. --skill buck2-rule-basics-unity-billal-mesloub

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Buck2 beginners often struggle to understand how to write rules, run actions, and reason about targets, artifacts, and configurations. This skill provides an interactive, step-by-step tutorial to learn Buck2 rule basics by building a simple uppercase transformation.

Core Features & Use Cases

  • Interactive, guided 8-step tutorial that checks the user's state, asks for confirmation, and tracks progress with TodoWrite.
  • Teaches core Buck2 concepts including rules, actions, artifacts, targets, configurations, analysis, select(), and the difference between unconfigured and configured targets.
  • Includes reference materials and example files under references/ and assets/ to deepen understanding.

Quick Start

Begin the Buck2 Rule Basics interactive tutorial to learn core Buck2 rule concepts through eight guided steps.

Frequently Asked Questions about buck2-rule-basics

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

FAQPage Schema
How do I write a basic Buck2 rule in Starlark?

To write a basic Buck2 rule in Starlark, you define the rule implementation function, declare attributes, and register actions. This interactive tutorial guides you step-by-step through building a simple uppercase transformation rule.

What is the difference between configured and unconfigured targets in Buck2?

Configured and unconfigured targets in Buck2 differ based on select() evaluation and configuration constraints. The tutorial explains this analysis model, teaching how to transition targets from unconfigured to configured states using configuration-aware patterns.

How do I run actions and manage artifacts in a Buck2 build system?

Running actions and managing artifacts in a Buck2 build system involves declaring actions within your rule implementation to produce output artifacts. The tutorial provides hands-on practice with these core concepts across eight interactive steps.

Can I learn Buck2 rule basics without prior build system experience?

You can learn Buck2 rule basics without prior build system experience, as the tutorial starts with a minimal rule and progresses to configuration-aware patterns. It includes reference materials and tracks your progress interactively.

How does the select() function work for Buck2 configuration?

The select() function in Buck2 works by mapping configuration constraints to specific attribute values during the analysis phase. This tutorial covers select() extensively, demonstrating how to apply configuration-aware patterns to your rules.

Why does my Buck2 rule fail during the analysis phase?

A Buck2 rule might fail during the analysis phase due to incorrect attribute declarations or invalid artifact references. The tutorial's references and example files help diagnose these issues by demonstrating correct analysis and execution models.