[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKE3D8434H5YF6GPF0ABDW":3,"skill-same:01M7EKE3D8434H5YF6GPF0ABDW":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7EKE3D8434H5YF6GPF0ABDW","lang-bash",null,"Production-grade Bash shell engineering, strict mode (set -euo pipefail), comprehensive quoting hygiene, trap-driven deterministic resource cleanup, safe file locking, and zero-eval security discipline.","raillen\u002Fdaisy-code-editor","raillen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50306048?v=4","01M7EKBDVVBSPF21PBPVJYMNYR","Raillen Santos","01M7EKBDWD12A1K9N9Y638FGX9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: lang-bash\ndescription: Production-grade Bash shell engineering, strict mode (set -euo pipefail), comprehensive quoting hygiene, trap-driven deterministic resource cleanup, safe file locking, and zero-eval security discipline.\n---\n\n# Bash Strict Defensive Engineering Contract\n\n## 1. Purpose\nDefine, author, and audit hardened, deterministic shell scripts in Bash, guaranteeing strict error propagation (`set -euo pipefail`), total quoting discipline to eliminate word splitting and globbing vulnerabilities, deterministic trap-driven cleanup of temporary resources, atomic file operations, and zero code injection risks (`eval` proscription).\n\n---\n\n## 2. Use When\n- Authoring CI\u002FCD pipeline automation, developer environment bootstrap scripts, or build runners.\n- Implementing local CLI wrappers, tooling orchestrators, or deployment hooks.\n- Automating file system maintenance, backup routines, or container entrypoints.\n- Managing low-level POSIX process orchestration where higher-level runtimes are unavailable.\n\n---\n\n## 3. Do Not Use When\n- Building complex domain logic, data models, or microservices (use Go, Rust, or Python).\n- Implementing mathematical calculations, 3D graphics, or raw memory allocations.\n- Complex multi-threaded concurrent applications requiring fine-grained synchronization.\n\n---\n\n## 4. Required Context\nBefore writing or refactoring Bash scripts, verify:\n1. **Target Shell Interpreter**: `bash` (version 4.0+) vs POSIX `\u002Fbin\u002Fsh` compatibility requirements.\n2. **Environment Constraints**: Operating system tools (GNU coreutils on Linux vs BSD coreutils on macOS).\n3. **Execution Privileges**: Unprivileged user execution vs elevated root\u002Fsudo operations.\n4. **Interactive vs Non-Interactive**: Terminal output (colors, progress indicators) vs automated headless CI.\n\n---\n\n## 5. Procedure\n\n### Step 1: Strict Execution Baseline\n1. Begin every Bash script with the standard shebang and strict safety flags:\n   ```bash\n   #!\u002Fusr\u002Fbin\u002Fenv bash\n   set -euo pipefail\n   IFS=$'\\n\\t'\n   ```\n   - `-e`: Exit immediately if any pipeline or command fails.\n   - `-u`: Treat unset variables and parameters as errors and exit immediately.\n   - `-o pipefail`: Return the exit status of the last command in the pipeline that failed, preventing silent intermediate pipe failures.\n   - `IFS=$'\\n\\t'`: Split only on newlines and tabs by default, avoiding dangerous word splitting on spaces.\n\n### Step 2: Parameter & Variable Expansion Discipline\n1. Quote every variable and command substitution without exception:\n   ```bash\n   # CORRECT\n   rm -rf -- \"${TARGET_DIR:?Target directory must be defined}\"\n   cp -- \"$source_file\" \"$dest_file\"\n\n   # PROHIBITED (Catastrophic vulnerability if TARGET_DIR is unset or contains spaces)\n   # rm -rf $TARGET_DIR\n   ```\n2. Distinguish array expansions:\n   - `\"${array[@]}\"`: Expands each element as a separate quoted word (REQUIRED).\n   - `\"${array[*]}\"`: Concatenates all elements into a single word separated by IFS.\n3. Use defensive parameter expansion:\n   - `${var:-default}`: Provide fallback default if unset.\n   - `${var:?error message}`: Abort with error message if unset or null.\n\n### Step 3: Trap-Driven Resource Cleanup\n1. Never leave temporary files or directories upon script termination or interruption.\n2. Pair every temporary creation (`mktemp`) with an immediate `trap` handler:\n   ```bash\n   WORK_DIR=\"$(mktemp -d -t \"prumo-runner-XXXXXX\")\"\n   cleanup() {\n       local exit_code=$?\n       trap - EXIT INT TERM HUP\n       rm -rf -- \"$WORK_DIR\"\n       exit \"$exit_code\"\n   }\n   trap cleanup EXIT INT TERM HUP\n   ```\n3. Ensure trap handlers preserve the original exit code of the failing command.\n\n### Step 4: Atomic Locking & Concurrency Defense\n1. When multiple scripts or background processes may access shared resources, use atomic directory creation or `flock`:\n   ```bash\n   LOCKDIR=\"\u002Ftmp\u002Fprumo-build.lock\"\n   if ! mkdir \"$LOCKDIR\" 2>\u002Fdev\u002Fnull; then\n       echo \"ERROR: Process is already running (locked by $LOCKDIR)\" >&2\n       exit 1\n   fi\n   trap 'rmdir \"$LOCKDIR\" 2>\u002Fdev\u002Fnull || true' EXIT\n   ```\n\n### Step 5: Input Parsing & Dependency Verification\n1. Validate external command dependencies before execution:\n   ```bash\n   for cmd in git jq curl; do\n       command -v \"$cmd\" >\u002Fdev\u002Fnull 2>&1 || {\n           echo \"ERROR: Required command '$cmd' is not installed or not in PATH.\" >&2\n           exit 1\n       }\n   done\n   ```\n2. Parse command-line flags defensively using POSIX `getopts` or explicit flag matching with full `--help` documentation.\n\n---\n\n## 6. Decision Rules\n1. **Absolute Eval Proscription**: Never call `eval` on dynamic, external, or user-supplied variables. Use arrays or bash indirect parameter expansions (`${!var}`) instead.\n2. **Never Ignore Exit Codes**: If a command is legitimately expected to fail, handle it explicitly:\n   ```bash\n   command_that_may_fail || true\n   # or\n   if ! result=$(command); then ...\n   ```\n3. **No Unchecked `cd`**: Never execute `cd` without an explicit guard:\n   ```bash\n   cd -- \"$target_dir\" || { echo \"Failed to enter $target_dir\" >&2; exit 1; }\n   ```\n4. **ShellCheck Compliance**: All scripts must pass ShellCheck without warnings when available.\n\n---\n\n## 7. Evidence Required\n- **Syntax Check**: `bash -n script.sh` exits with 0 errors.\n- **Strict Mode Verification**: `set -euo pipefail` confirmed at head of script.\n- **Trap Cleanup Execution**: Automated test asserting temporary directories are deleted upon exit.\n\n---\n\n## 8. Output Contract\nA production Bash artifact must provide:\n1. Hardened executable script (`chmod +x script.sh`) with `set -euo pipefail`.\n2. Fully quoted variable expansions and array handling.\n3. Clean error reporting with output directed to stderr (`>&2`).\n4. Trap signal handlers covering `EXIT`, `INT`, `TERM`, `HUP`.\n\n---\n\n## 9. Stop Conditions\n- Script syntax verified with `bash -n`.\n- All temporary directories cleaned up on both success and early error exits.\n- No unquoted parameter expansions.\n\n---\n\n## 10. Escalation Rules\n- Escalate to Lead Architect if script complexity exceeds 300 lines of procedural shell code; refactor into a compiled language (Go, Rust).\n- Escalate to Security Officer if a script requires root privileges or handles secrets\u002Fcredentials.\n","# Bash Strict Defensive Engineering Contract\n\n## 1. Purpose\nDefine, author, and audit hardened, deterministic shell scripts in Bash, guaranteeing strict error propagation (`set -euo pipefail`), total quoting discipline to eliminate word splitting and globbing vulnerabilities, deterministic trap-driven cleanup of temporary resources, atomic file operations, and zero code injection risks (`eval` proscription).\n\n---\n\n## 2. Use When\n- Authoring CI\u002FCD pipeline automation, developer environment bootstrap scripts, or build runners.\n- Implementing local CLI wrappers, tooling orchestrators, or deployment hooks.\n- Automating file system maintenance, backup routines, or container entrypoints.\n- Managing low-level POSIX process orchestration where higher-level runtimes are unavailable.\n\n---\n\n## 3. Do Not Use When\n- Building complex domain logic, data models, or microservices (use Go, Rust, or Python).\n- Implementing mathematical calculations, 3D graphics, or raw memory allocations.\n- Complex multi-threaded concurrent applications requiring fine-grained synchronization.\n\n---\n\n## 4. Required Context\nBefore writing or refactoring Bash scripts, verify:\n1. **Target Shell Interpreter**: `bash` (version 4.0+) vs POSIX `\u002Fbin\u002Fsh` compatibility requirements.\n2. **Environment Constraints**: Operating system tools (GNU coreutils on Linux vs BSD coreutils on macOS).\n3. **Execution Privileges**: Unprivileged user execution vs elevated root\u002Fsudo operations.\n4. **Interactive vs Non-Interactive**: Terminal output (colors, progress indicators) vs automated headless CI.\n\n---\n\n## 5. Procedure\n\n### Step 1: Strict Execution Baseline\n1. Begin every Bash script with the standard shebang and strict safety flags:\n   ```bash\n   #!\u002Fusr\u002Fbin\u002Fenv bash\n   set -euo pipefail\n   IFS=$'\\n\\t'\n   ```\n   - `-e`: Exit immediately if any pipeline or command fails.\n   - `-u`: Treat unset variables and parameters as errors and exit immediately.\n   - `-o pipefail`: Return the exit status of the last command in the pipeline that failed, preventing silent intermediate pipe failures.\n   - `IFS=$'\\n\\t'`: Split only on newlines and tabs by default, avoiding dangerous word splitting on spaces.\n\n### Step 2: Parameter & Variable Expansion Discipline\n1. Quote every variable and command substitution without exception:\n   ```bash\n   # CORRECT\n   rm -rf -- \"${TARGET_DIR:?Target directory must be defined}\"\n   cp -- \"$source_file\" \"$dest_file\"\n\n   # PROHIBITED (Catastrophic vulnerability if TARGET_DIR is unset or contains spaces)\n   # rm -rf $TARGET_DIR\n   ```\n2. Distinguish array expansions:\n   - `\"${array[@]}\"`: Expands each element as a separate quoted word (REQUIRED).\n   - `\"${array[*]}\"`: Concatenates all elements into a single word separated by IFS.\n3. Use defensive parameter expansion:\n   - `${var:-default}`: Provide fallback default if unset.\n   - `${var:?error message}`: Abort with error message if unset or null.\n\n### Step 3: Trap-Driven Resource Cleanup\n1. Never leave temporary files or directories upon script termination or interruption.\n2. Pair every temporary creation (`mktemp`) with an immediate `trap` handler:\n   ```bash\n   WORK_DIR=\"$(mktemp -d -t \"prumo-runner-XXXXXX\")\"\n   cleanup() {\n       local exit_code=$?\n       trap - EXIT INT TERM HUP\n       rm -rf -- \"$WORK_DIR\"\n       exit \"$exit_code\"\n   }\n   trap cleanup EXIT INT TERM HUP\n   ```\n3. Ensure trap handlers preserve the original exit code of the failing command.\n\n### Step 4: Atomic Locking & Concurrency Defense\n1. When multiple scripts or background processes may access shared resources, use atomic directory creation or `flock`:\n   ```bash\n   LOCKDIR=\"\u002Ftmp\u002Fprumo-build.lock\"\n   if ! mkdir \"$LOCKDIR\" 2>\u002Fdev\u002Fnull; then\n       echo \"ERROR: Process is already running (locked by $LOCKDIR)\" >&2\n       exit 1\n   fi\n   trap 'rmdir \"$LOCKDIR\" 2>\u002Fdev\u002Fnull || true' EXIT\n   ```\n\n### Step 5: Input Parsing & Dependency Verification\n1. Validate external command dependencies before execution:\n   ```bash\n   for cmd in git jq curl; do\n       command -v \"$cmd\" >\u002Fdev\u002Fnull 2>&1 || {\n           echo \"ERROR: Required command '$cmd' is not installed or not in PATH.\" >&2\n           exit 1\n       }\n   done\n   ```\n2. Parse command-line flags defensively using POSIX `getopts` or explicit flag matching with full `--help` documentation.\n\n---\n\n## 6. Decision Rules\n1. **Absolute Eval Proscription**: Never call `eval` on dynamic, external, or user-supplied variables. Use arrays or bash indirect parameter expansions (`${!var}`) instead.\n2. **Never Ignore Exit Codes**: If a command is legitimately expected to fail, handle it explicitly:\n   ```bash\n   command_that_may_fail || true\n   # or\n   if ! result=$(command); then ...\n   ```\n3. **No Unchecked `cd`**: Never execute `cd` without an explicit guard:\n   ```bash\n   cd -- \"$target_dir\" || { echo \"Failed to enter $target_dir\" >&2; exit 1; }\n   ```\n4. **ShellCheck Compliance**: All scripts must pass ShellCheck without warnings when available.\n\n---\n\n## 7. Evidence Required\n- **Syntax Check**: `bash -n script.sh` exits with 0 errors.\n- **Strict Mode Verification**: `set -euo pipefail` confirmed at head of script.\n- **Trap Cleanup Execution**: Automated test asserting temporary directories are deleted upon exit.\n\n---\n\n## 8. Output Contract\nA production Bash artifact must provide:\n1. Hardened executable script (`chmod +x script.sh`) with `set -euo pipefail`.\n2. Fully quoted variable expansions and array handling.\n3. Clean error reporting with output directed to stderr (`>&2`).\n4. Trap signal handlers covering `EXIT`, `INT`, `TERM`, `HUP`.\n\n---\n\n## 9. Stop Conditions\n- Script syntax verified with `bash -n`.\n- All temporary directories cleaned up on both success and early error exits.\n- No unquoted parameter expansions.\n\n---\n\n## 10. Escalation Rules\n- Escalate to Lead Architect if script complexity exceeds 300 lines of procedural shell code; refactor into a compiled language (Go, Rust).\n- Escalate to Security Officer if a script requires root privileges or handles secrets\u002Fcredentials.\n",{"name":5,"description":7},"main","2e465213b972294984c8c9515a47f811e4b358da",".agents\u002Fskills\u002Flang-bash","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor","https:\u002F\u002Fgithub.com\u002Fraillen","https:\u002F\u002Fraillen.com","\u003C\u003CMarketing & IT>>\r\n\r\n@poppy-team\r\n@wasd-lat ","2026-10-16 09:17:52",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add raillen\u002Fdaisy-code-editor --skill lang-bash",{"tool":38,"command":39},"bunx","bunx skills add raillen\u002Fdaisy-code-editor --skill lang-bash",{"tool":41,"command":42},"pnpm","pnpm dlx skills add raillen\u002Fdaisy-code-editor --skill lang-bash","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002FSKILL.md",true,[46,52,58,62,66,70],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"checks\u002Fbash-rules.md","REFERENCE","参考文档",1573,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002Fchecks\u002Fbash-rules.md",{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"examples\u002Fsafe_runner.sh","SCRIPT","脚本",3087,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002Fexamples\u002Fsafe_runner.sh",{"path":59,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":60,"sourceHtmlUrl":61},"manifest.json",1759,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002Fmanifest.json",{"path":63,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fbash-defensive.md",2531,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002Freferences\u002Fbash-defensive.md",{"path":67,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fverify.sh",1982,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002Fscripts\u002Fverify.sh",{"path":71,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":72,"sourceHtmlUrl":73},"templates\u002Fbash-verification-report.md",1437,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flang-bash\u002Ftemplates\u002Fbash-verification-report.md",[75,81,87,94,101,108],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7EKQYSDAX3SGSCRF873Z8E2","zoom-reflow","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7EKQX0MWJNQD482GGZPGES4","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7EKQS57FS6JYE6KWW6X5ADJ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7EKQMFR7651NVH100P5781Z","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7EKQG3NVX6DPCYS6Q4PA71V","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M7EKQEJ993JGC72FE2KFY3ZZ","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]