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.
What this skill does
## What This Skill Does
The DRY philosophy is a central tenet of b00t: YEI exist to contribute ONLY new and novel meaningful work. This skill helps you:
- Identify when code is being duplicated or reinvented
- Find existing libraries instead of writing new code
- Use Rust functionality via PyO3 rather than duplicate in Python
- Contribute upstream rather than maintain private forks
- Write lean, maintainable code with minimal dependencies
## When It Activates
Activate this skill when you see:
- "implement [common functionality]"
- "create a [parser/validator/client]"
- "write code to [read/parse/validate] [format]"
- Any task that sounds like it might already exist in a library
- Code that duplicates existing Rust functionality
- Multiple implementations of the same logic
## Core Principles
### 1. DRY: Don't Repeat Yourself
**AVOID writing code for functionality that exists in libraries:**
❌ **Anti-pattern**:
```python
# Writing custom JSON parser
def parse_json(text):
# 200 lines of parsing logic...
```
✅ **DRY approach**:
```python
import json
data = json.loads(text)
```
### 2. NRtW: Never Reinvent the Wheel
**SEARCH for existing solutions before coding:**
```bash
# 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]
```
### 3. Leverage Rust via PyO3
**USE Rust for heavy lifting, expose to Python:**
❌ **Anti-pattern**:
```python
# 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**:
```python
# 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.
### 4. Contribute Upstream
**FORK and PATCH forward, don't maintain private copies:**
❌ **Anti-pattern**:
```bash
# Copy library code into project
cp -r /path/to/library my_project/vendored/
# Make private modifications
```
✅ **DRY approach**:
```bash
# 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"
]
```
## Decision Tree
```
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
```
## Examples
### Finding Libraries
**Task**: Parse TOML files
```bash
# Search
pip search toml
# Results: tomli, tomlkit, pytoml
# Use established: tomli (or tomllib in Python 3.11+)
```
**Task**: Make HTTP requests
```bash
# DON'T: Write custom HTTP client
# DO: Use httpx or requests
pip install httpx
```
**Task**: Validate Pydantic models
```bash
# DON'T: Write custom validation
# DO: Use Pydantic's built-in validation
from pydantic import BaseModel, field_validator
```
### Using Rust via PyO3
**b00t Pattern**: Rust does heavy lifting, Python uses it.
#### Datum Operations
❌ **Duplicate** (Anti-pattern):
```python
# 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):
```python
# Use PyO3 bindings
import b00t_py
datum = b00t_py.load_ai_model_datum("model-name", "~/.dotfiles/_b00t_")
```
**Why better?**
- ✅ No duplication - single source of truth in Rust
- ✅ Type-safe - Rust ensures correctness
- ✅ Tested - Rust tests cover this
- ✅ Faster - Rust performance
- ✅ Maintainable - one codebase, not two
#### Environment Validation
❌ **Duplicate**:
```python
def validate_provider_env(provider: str) -> bool:
# Read datum
# Parse required env vars
# Check os.environ
# Return result
```
✅ **DRY**:
```python
import b00t_py
validation = b00t_py.check_provider_env("openrouter", "~/.dotfiles/_b00t_")
if not validation["available"]:
print(f"Missing: {validation['missing_env_vars']}")
```
### Contributing Upstream
**Scenario**: Bug in `pydantic-ai` library
❌ **Anti-pattern**:
```bash
# 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**:
```bash
# 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
]
```
## Library Selection Criteria
When choosing a library:
### ✅ Good Signs
- ✅ Many stars (>1000 on GitHub)
- ✅ Active maintenance (commits in last month)
- ✅ Minimal open issues/PRs
- ✅ Good documentation
- ✅ Permissive license (MIT, Apache, BSD)
- ✅ Used by major projects
- ✅ Type hints (Python) or strong types (Rust)
- ✅ Comprehensive tests
- ✅ Lively, polite community discussions
### 🚩 Red Flags
- 🚩 Abandoned (no commits in 1+ years)
- 🚩 Many unresolved issues
- 🚩 No tests
- 🚩 Copyleft license (GPL) for permissive projects
- 🚩 No type hints
- 🚩 Breaking changes without semver
- 🚩 Hostile maintainers
## PyO3 Pattern
### When to Use Rust (via PyO3)
Use Rust for:
- ✅ Performance-critical code
- ✅ Type-safe validation
- ✅ Complex parsing
- ✅ Shared logic between Rust and Python
- ✅ System-level operations
### How to Expose Rust to Python
```rust
// 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
# Python usage
import b00t_py
result = b00t_py.my_function("test")
```
## Code Review Checklist
Before writing code, ask:
1. ☐ Does this functionality exist in a library?
2. ☐ Does similar Rust code exist in b00t?
3. ☐ Can I use PyO3 to expose Rust instead?
4. ☐ Is this truly novel functionality?
5. ☐ Have I searched PyPI/crates.io?
6. ☐ Have I checked existing b00t modules?
If all answers are "no", then implement.
## Anti-Patterns to Avoid
### 1. Reinventing Standard Library
❌ **Bad**:
```python
def read_json_file(path):
with open(path) as f:
return custom_json_parse(f.read())
```
✅ **Good**:
```python
import json
def read_json_file(path):
with open(path) as f:
return json.load(f)
```
### 2. Duplicating Rust Logic
❌ **Bad**:
```python
# Reimplementing datum validation in Python
class DatumValidator:
def validate_env(self, provider): ...
def parse_toml(self, path): ...
```
✅ **Good**:
```python
# Use Rust via PyO3
import b00t_py
validation = b00t_py.check_provider_env(provider, path)
```
### 3. Private Forks
❌ **Bad**:
```bash
# Fork library, never Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.