From rnd-framework
Use when writing helper scripts, utility tasks, or automation within the R&D pipeline — prefer Bun (TypeScript) over Python when available
How this skill is triggered — by the user, by Claude, or both
Slash command
/rnd-framework:bun-scriptingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When the `bun` binary is available on the system, **prefer Bun (TypeScript) over Python** for helper scripts, utility tasks, and automation. Bun provides faster startup, built-in TypeScript support, and a rich set of zero-dependency APIs that cover most scripting needs.
When the bun binary is available on the system, prefer Bun (TypeScript) over Python for helper scripts, utility tasks, and automation. Bun provides faster startup, built-in TypeScript support, and a rich set of zero-dependency APIs that cover most scripting needs.
Before writing a helper script, check for Bun availability:
command -v bun >/dev/null 2>&1
If bun is present, write the script in TypeScript and run it with bun run script.ts. If bun is not available, fall back to Python as usual.
.ts scripts only. No project setup, no package.json, no tsconfig.json needed.bun install, bun add, or use any npm packages. Use only Bun built-in APIs and Node.js compatible standard modules.Bun.* globals (always available, no import needed)bun:sqlite — embedded SQLitebun:ffi — foreign function interface (only if calling system C libraries)node:fs, node:fs/promises — file system operationsnode:path — path manipulationnode:child_process — spawning processesnode:os — OS informationnode:crypto — hashing and cryptographynode:util — utilities like promisify, TextDecodernode:stream — stream primitivesnode:url — URL parsingnode:zlib — compressionnode:assert — assertionsnode:buffer — binary data handlingnode:events — event emittersimport express from "express" is forbidden).Bun.$ for shell commands instead of node:child_process when possible — it is safer and more ergonomic.Use these built-in APIs instead of reaching for external packages:
// Read
const text = await Bun.file("path/to/file.txt").text();
const json = await Bun.file("data.json").json();
const bytes = await Bun.file("image.png").arrayBuffer();
// Write
await Bun.write("output.txt", "hello");
await Bun.write("data.json", JSON.stringify(obj, null, 2));
// Check existence
import { existsSync } from "node:fs";
// GET
const res = await fetch("https://api.example.com/data");
const data = await res.json();
// POST
const res = await fetch("https://api.example.com/submit", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ key: "value" }),
});
// Simple execution
const result = await Bun.$`ls -la /tmp`.text();
// With variables (auto-escaped, safe from injection)
const dir = "/some/path";
const output = await Bun.$`find ${dir} -name "*.ts"`.text();
// Check exit code
const proc = await Bun.$`grep -r "pattern" ./src`.nothrow();
if (proc.exitCode !== 0) {
console.error("not found");
}
// JSON is native — no imports needed
const parsed = JSON.parse(rawString);
const serialized = JSON.stringify(obj, null, 2);
import { Database } from "bun:sqlite";
const db = new Database("mydb.sqlite");
db.run("CREATE TABLE IF NOT EXISTS kv (key TEXT PRIMARY KEY, value TEXT)");
db.run("INSERT INTO kv VALUES (?, ?)", ["name", "agent"]);
const row = db.query("SELECT value FROM kv WHERE key = ?").get("name");
const hash = Bun.hash("some content");
// Or use crypto hashes:
const sha = new Bun.CryptoHasher("sha256").update("content").digest("hex");
const glob = new Bun.Glob("**/*.ts");
for await (const path of glob.scan({ cwd: "./src" })) {
console.log(path);
}
import { join, resolve, basename, dirname, extname } from "node:path";
await Bun.sleep(1000); // ms
Fall back to Python when the task specifically requires:
uv (not pip/pip3/pipx) to install packages and manage environmentsInstead of:
#!/usr/bin/env python3
import json, subprocess, sys
data = json.loads(open("config.json").read())
result = subprocess.run(["grep", "-r", data["pattern"], "./src"], capture_output=True, text=True)
with open("results.txt", "w") as f:
f.write(result.stdout)
print(f"Found {len(result.stdout.splitlines())} matches")
Write:
const data = await Bun.file("config.json").json();
const result = await Bun.$`grep -r ${data.pattern} ./src`.nothrow().text();
await Bun.write("results.txt", result);
console.log(`Found ${result.split("\n").filter(Boolean).length} matches`);
npx claudepluginhub oleksify/rnd-framework --plugin rnd-frameworkProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.