xiaohongshu
xiaohongshu
buck2-new-project
Scaffolds new Buck2 projects with proper BUILD/PACKAGE files, SPDX headers, and depot shims. Use when creating new Rust binaries/libraries, Deno tools, or C++ projects in the monorepo. Ensures consistent structure and metadata from the start.
Full skill instructions
This skill scaffolds new Buck2 projects with all required boilerplate: BUILD files with proper depot.* shims, PACKAGE files with metadata, SPDX license headers, and language-specific source templates. It saves time and ensures consistency across the monorepo.
Use this skill when:
src/tools/This skill provides:
scripts/new_project.pydepot.* shim wrappersThe fastest way to create a new project:
# Run the scaffolding script
python3 /path/to/skills/buck2-new-project/scripts/new_project.py \
--type rust_binary \
--name my-tool \
--path src/tools/my-tool \
--description "My awesome new tool" \
--author "Your Name"
# This creates:
# - src/tools/my-tool/BUILD (with depot.rust_binary())
# - src/tools/my-tool/PACKAGE (with metadata)
# - src/tools/my-tool/src/main.rs (with SPDX headers)
rust_binary - Rust executable with main.rsrust_library - Rust library with lib.rsdeno_binary - Deno/TypeScript tool with main.tsFor standalone executables and CLI tools:
python3 scripts/new_project.py \
--type rust_binary \
--name quicktd \
--path src/tools/quicktd \
--description "Fast target determination for Buck2" \
--author "Austin Seipp"
Generated BUILD file:
load("@root//buck/shims:shims.bzl", depot = "shims")
depot.rust_binary(
name = "quicktd",
srcs = glob(["src/**/*.rs"]),
deps = [
"third-party//mimalloc:rust",
],
visibility = ["PUBLIC"],
)
Generated main.rs:
// SPDX-FileCopyrightText: © 2024-2026 Austin Seipp
// SPDX-License-Identifier: Apache-2.0
fn main() {
println!("Hello from quicktd!");
}
For reusable code libraries:
python3 scripts/new_project.py \
--type rust_library \
--name common-utils \
--path src/lib/common-utils \
--description "Common utility functions" \
--author "Austin Seipp"
Generated BUILD file:
load("@root//buck/shims:shims.bzl", depot = "shims")
depot.rust_library(
name = "common-utils",
srcs = glob(["src/**/*.rs"]),
visibility = ["PUBLIC"],
)
Generated lib.rs:
// SPDX-FileCopyrightText: © 2024-2026 Austin Seipp
// SPDX-License-Identifier: Apache-2.0
pub fn example() {
println!("Example function");
}
For TypeScript-based tools:
python3 scripts/new_project.py \
--type deno_binary \
--name formatter \
--path src/tools/formatter \
--description "Code formatting tool" \
--author "Austin Seipp"
Generated BUILD file:
load("@root//buck/shims:shims.bzl", depot = "shims")
load("@toolchains//deno:defs.bzl", deno = "rules")
deno.binary(
name = "formatter",
main = "main.ts",
permissions = ["read", "write"],
visibility = ["PUBLIC"],
)
Generated main.ts:
// SPDX-FileCopyrightText: © 2024-2026 Austin Seipp
// SPDX-License-Identifier: Apache-2.0
function main() {
console.log("Hello from formatter!");
}
if (import.meta.main) {
main();
}
All BUILD files follow this pattern:
load("@root//buck/shims:shims.bzl", depot = "shims")depot.rust_binary() NOT rust_binary()["PUBLIC"] for reusable componentsthird-party//mimalloc:rust for Rust binariesGenerated PACKAGE files include:
load("@root//buck/shims:package.bzl", pkg = "package")
pkg.info(
copyright = ["© 2024-2026 Austin Seipp"],
license = "Apache-2.0",
description = "Fast target determination for Buck2",
version = "1.0.0",
)
This enables:
All source files include mandatory SPDX headers:
// SPDX-FileCopyrightText: © 2024-2026 Austin Seipp
// SPDX-License-Identifier: Apache-2.0
These are required by monorepo policy and enable automated license tracking.
After generation, edit the BUILD file to add dependencies:
depot.rust_binary(
name = "my-tool",
srcs = glob(["src/**/*.rs"]),
deps = [
"third-party//mimalloc:rust",
"third-party//clap:clap", # Add CLI argument parser
"//src/lib/common-utils", # Add internal library
],
visibility = ["PUBLIC"],
)
Control who can depend on your target:
# Public - anyone can use it
visibility = ["PUBLIC"]
# Private - only this package
visibility = []
# Specific targets
visibility = ["//src/tools/...", "//src/lib/..."]
Extend the BUILD file with test targets:
depot.rust_test(
name = "test",
srcs = glob(["src/**/*.rs"]),
deps = [":my-tool"],
)
Create a project with both a library and binary:
# Create library first
python3 scripts/new_project.py \
--type rust_library \
--name myapp \
--path src/myapp
# Then manually add a binary target to BUILD:
depot.rust_binary(
name = "myapp-cli",
srcs = ["src/bin/main.rs"],
deps = [":myapp", "third-party//mimalloc:rust"],
)
For tools that need config files:
# Generate base project
python3 scripts/new_project.py --type deno_binary --name tool --path src/tools/tool
# Add config.jsonc manually
echo '{"version": "1.0"}' > src/tools/tool/config.jsonc
# Update BUILD to include config:
deno.binary(
name = "tool",
main = "main.ts",
data = ["config.jsonc"],
permissions = ["read", "write"],
)
--type TYPE Project type: rust_binary, rust_library, deno_binary
--name NAME Target name (used in BUILD file)
--path PATH Directory path relative to repo root
--description DESC Brief description for PACKAGE metadata
--author AUTHOR Copyright holder name
--license LICENSE SPDX license ID (default: Apache-2.0)
--version VERSION Initial version (default: 1.0.0)
--visibility VIS Visibility list (default: ["PUBLIC"])
# Minimal - uses defaults
python3 scripts/new_project.py --type rust_binary --name tool --path src/tools/tool
# Full customization
python3 scripts/new_project.py \
--type rust_library \
--name mylib \
--path src/lib/mylib \
--description "My awesome library" \
--author "Jane Doe" \
--license "MIT" \
--version "0.1.0" \
--visibility '["//src/..."]'
# Deno project with specific permissions
python3 scripts/new_project.py \
--type deno_binary \
--name webserver \
--path src/tools/webserver \
--description "HTTP server tool"
The script won't overwrite existing directories. Either:
Ensure --type is one of: rust_binary, rust_library, deno_binary
Common issues:
depot.* shims instead of native rulesload("@root//buck/shims:shims.bzl", depot = "shims")["PUBLIC"])Verify with:
buck2 build //path/to/project:name
Tests need explicit targets in BUILD:
depot.rust_test(
name = "test",
srcs = glob(["src/**/*.rs"]),
)
Then run:
buck2 test //path/to/project:test
buck2 build //path/to/projectbuck2 test //path/to/project:testjj new -m "feat: add new project"
# Make changes...
jj describe -m "feat(myapp): add initial implementation"
jj commit
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