Loading...
Loading...
Enforces using shell script one-liners as the primary approach for scripts. Prohibits Node.js and Python usage. Use TypeScript with Deno only when variables or complex branching are necessary. MUST ALWAYS be applied when creating scripts, automation tasks, or executing commands.
npx skill4agent add totto2727-dotfiles/agents script-creation-rules# File operations
find . -name "*.js" -type f | xargs grep "pattern"
# Text processing
cat file.txt | grep "pattern" | sed 's/old/new/g'
# File counting
ls -1 | wc -l
# Directory operations
mkdir -p path/to/dir && cd path/to/dir
# Conditional execution
[ -f file.txt ] && echo "exists" || echo "not found"sfw deno run <file>// Example: Complex script with variables and branching
const files = Deno.readDirSync(".");
const results: string[] = [];
for (const file of files) {
if (file.isFile && file.name.endsWith(".ts")) {
const content = Deno.readTextFileSync(file.name);
if (content.includes("pattern")) {
results.push(file.name);
}
}
}
console.log(results.join("\n"));sfw deno run --allow-read script.tssfw deno rundeno runnode script.jsnpm runpython script.pypython3 script.pypip installdeno runsfw deno runsfw deno run <file>deno runsfw deno run# Find and count TypeScript files
find . -name "*.ts" -type f | wc -l// Complex file processing with error handling
try {
const files = Array.from(Deno.readDirSync(".")).filter((f) => f.isFile && f.name.endsWith(".ts"));
for (const file of files) {
const content = Deno.readTextFileSync(file.name);
// Complex processing...
}
} catch (error) {
console.error("Error:", error);
}// DO NOT USE
const fs = require("fs");
const files = fs.readdirSync(".");# DO NOT USE
import os
files = os.listdir('.')# Shell one-liner
find . -type f -name "*.md" -exec wc -l {} \;# Shell one-liner
grep -r "pattern" . | sed 's/old/new/g' | sort | uniq# Shell one-liner
[ -d "dir" ] && echo "exists" || mkdir -p "dir"// TypeScript with Deno
const dirs = ["dir1", "dir2", "dir3"];
for (const dir of dirs) {
try {
const stat = Deno.statSync(dir);
if (stat.isDirectory) {
console.log(`${dir} exists`);
}
} catch {
Deno.mkdirSync(dir, { recursive: true });
console.log(`Created ${dir}`);
}
}sfw deno run --allow-read --allow-write script.ts