xiaohongshu
xiaohongshu
dry-philosophy
Don't Repeat Yourself (DRY) and Never Reinvent the Wheel (NRtW) - core b00t principles. Use existing libraries, leverage Rust via PyO3 instead of duplicating logic in Python, and contribute to upstream projects rather than fork privately.
Full skill instructions
The DRY philosophy is a central tenet of b00t: YEI exist to contribute ONLY new and novel meaningful work. This skill helps you:
Activate this skill when you see:
AVOID writing code for functionality that exists in libraries:
❌ Anti-pattern:
# Writing custom JSON parser
def parse_json(text):
# 200 lines of parsing logic...
✅ DRY approach:
import json
data = json.loads(text)
SEARCH for existing solutions before coding:
# Search for Python packages
pip search [functionality]
# or
uv pip search [functionality]
# Check PyPI
https://pypi.org/search/?q=[functionality]
# Check Rust crates
https://crates.io/search?q=[functionality]
USE Rust for heavy lifting, expose to Python:
❌ Anti-pattern:
# Duplicating Rust datum parsing in Python
def parse_datum_file(path: str) -> dict:
with open(path) as f:
toml_data = toml.load(f)
# Validation logic...
# Parsing logic...
return processed_data
✅ DRY approach:
# Use Rust via PyO3
import b00t_py
datum = b00t_py.load_ai_model_datum("model-name", "~/.dotfiles/_b00t_")
Why? Rust implementation already exists, is faster, type-safe, and tested.
FORK and PATCH forward, don't maintain private copies:
❌ Anti-pattern:
# Copy library code into project
cp -r /path/to/library my_project/vendored/
# Make private modifications
✅ DRY approach:
# Fork the library
gh repo fork upstream/library
# Create patch
git checkout -b fix/issue-123
# Make changes
git commit -m "fix: resolve issue #123"
# Submit PR
gh pr create --upstream
# Use your fork temporarily
# pyproject.toml
dependencies = [
"library @ git+https://github.com/you/library@fix/issue-123"
]
Need to implement functionality?
↓
Does it already exist in a library?
├─ YES → Use the library (DRY)
└─ NO ↓
Is it standard functionality?
├─ YES → Search harder, it probably exists
└─ NO ↓
Does similar Rust code exist in b00t?
├─ YES → Expose via PyO3 (DRY)
└─ NO ↓
Is this truly novel?
├─ YES → Implement (with tests!)
└─ NO → Reconsider: use library
Task: Parse TOML files
# Search
pip search toml
# Results: tomli, tomlkit, pytoml
# Use established: tomli (or tomllib in Python 3.11+)
Task: Make HTTP requests
# DON'T: Write custom HTTP client
# DO: Use httpx or requests
pip install httpx
Task: Validate Pydantic models
# DON'T: Write custom validation
# DO: Use Pydantic's built-in validation
from pydantic import BaseModel, field_validator
b00t Pattern: Rust does heavy lifting, Python uses it.
❌ Duplicate (Anti-pattern):
# b00t_j0b_py/datum_parser.py
import toml
class DatumParser:
def load_provider(self, name: str):
path = f"~/.dotfiles/_b00t_/{name}.ai.toml"
with open(os.path.expanduser(path)) as f:
data = toml.load(f)
# Validation...
# Parsing...
return data
✅ DRY (Use Rust):
# Use PyO3 bindings
import b00t_py
datum = b00t_py.load_ai_model_datum("model-name", "~/.dotfiles/_b00t_")
Why better?
❌ Duplicate:
def validate_provider_env(provider: str) -> bool:
# Read datum
# Parse required env vars
# Check os.environ
# Return result
✅ DRY:
import b00t_py
validation = b00t_py.check_provider_env("openrouter", "~/.dotfiles/_b00t_")
if not validation["available"]:
print(f"Missing: {validation['missing_env_vars']}")
Scenario: Bug in pydantic-ai library
❌ Anti-pattern:
# Copy code into project
cp -r site-packages/pydantic_ai b00t_j0b_py/vendored/
# Fix bug privately
# Now you maintain a fork forever
✅ DRY approach:
# Fork
gh repo fork pydantic/pydantic-ai
# Fix and test
git checkout -b fix/agent-validation-bug
# Make changes
pytest tests/
git commit -m "fix: agent validation for None values"
# Submit PR
gh pr create --title "fix: agent validation for None values"
# Temporarily use your fork
# pyproject.toml
dependencies = [
"pydantic-ai @ git+https://github.com/elasticdotventures/pydantic-ai@fix/agent-validation-bug"
]
# After PR merged, switch back to upstream
dependencies = [
"pydantic-ai>=0.0.15" # includes fix
]
When choosing a library:
Use Rust for:
// b00t-py/src/lib.rs
use pyo3::prelude::*;
#[pyfunction]
fn my_function(py: Python<'_>, arg: &str) -> PyResult<String> {
// Rust implementation
Ok(format!("Processed: {}", arg))
}
#[pymodule]
fn b00t_py(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(my_function, m)?)?;
Ok(())
}
# Python usage
import b00t_py
result = b00t_py.my_function("test")
Before writing code, ask:
If all answers are "no", then implement.
❌ Bad:
def read_json_file(path):
with open(path) as f:
return custom_json_parse(f.read())
✅ Good:
import json
def read_json_file(path):
with open(path) as f:
return json.load(f)
❌ Bad:
# Reimplementing datum validation in Python
class DatumValidator:
def validate_env(self, provider): ...
def parse_toml(self, path): ...
✅ Good:
# Use Rust via PyO3
import b00t_py
validation = b00t_py.check_provider_env(provider, path)
❌ Bad:
# Fork library, never contribute back
# Maintain private version forever
✅ Good:
# Fork, fix, PR upstream
# Use fork temporarily until merged
# Switch back to upstream after merge
❌ Bad:
def process_data(data):
# No types, unclear what's expected
return data.transform()
✅ Good:
from pydantic import BaseModel
def process_data(data: dict[str, Any]) -> ProcessedData:
return ProcessedData(**data)
CLAUDE.md - YEI MUST ALWAYS/NEVER sectionb00t-py/src/lib.rs - PyO3 bindings exampleb00t-j0b-py/pyproject.toml - Dependency managementDRY Philosophy:
Alignment: A lean hive is a happy hive. Finding and patching bugs in libraries is divine; committing buggy code is unforgivable.
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