一键导入
write-script-meta
Rules for drafting a new write-script-<lang> skill. Load when creating or updating any write-script-* language-specific skill.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Rules for drafting a new write-script-<lang> skill. Load when creating or updating any write-script-* language-specific skill.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Token-efficient man page reading. Load when looking up CLI tool docs, flags, options, usage examples, config formats. Do NOT use bash to run `man` directly without loading this skill first.
Load when user asks to create, update, edit, or refactor any OpenCode (OC) artefact: skills, agents, commands, tools, plugins, or snippets — including modifying an existing one. Triggers examples: "create skill to …", "draft a command to …", "add Y to OC cmd Z", "edit the W agent", "write a plugin to …", "create a tool for …", "update crafter skill". Guides user through discovery, drafting, and iterative refinement.
Methodology for drafting technical design specs. Load when asked to write, draft, or refine a spec, design doc, architecture note, RFC, or similar document for a system, API, protocol, or subsystem.
Load ONLY when user explicitly invokes /reflect-friction or directly asks to review session friction (e.g. "review friction", "what went wrong", "where did you push back"). Do NOT auto-load speculatively.
General script writing guidelines: structure, naming, error handling, and organization. Language-agnostic. Auto-load when writing or reviewing any script. Language-specific skills (write-script-bash, write-script-bats) build on top of this.
Load whenever new files or directories are created in a git repo — via write, bash, or any other tool. Ensures `git_track_new_file` is called so new files are git-tracked for the user.
| name | write-script-meta |
| description | Rules for drafting a new write-script-<lang> skill. Load when creating or updating any write-script-* language-specific skill. |
| metadata | {"maintainers":["bew"]} |
NOTE: This is a reference document, not a procedure. Load it to look up rules, naming, and structure requirements — not to follow a sequence of steps.
Produce a well-structured write-script-<lang> skill that correctly extends write-script-generic
without restating rules already in write-script-generic.
Create a new write-script-<lang> skill when:
function keyword,
different error signaling, structured data instead of string manipulation).Extend write-script-generic instead when:
Refer to these existing skills as concrete examples of the pattern:
write-script-bash — fully featured: strict mode, boilerplate, output capture, testing sectionwrite-script-nushell — minimal: core idioms only, typed params, native error modelSkill directory and name frontmatter field must follow: write-script-<lang>.
<lang> is lowercase, hyphenated if needed (e.g. write-script-bash, write-script-nushell).
| Concern | Belongs in |
|---|---|
Function decomposition, naming verbs, main entry point | write-script-generic |
| Function comments, local variable scoping | write-script-generic |
| Global variable naming (SCREAMING_SNAKE_CASE) | write-script-generic |
Subcommand dispatch (cmd_* pattern) | write-script-generic |
| Error message actionability rules | write-script-generic |
| Script structure template (pseudo-code) | write-script-generic |
| Code examples for generic rules (no prose restatement) | lang skill |
| Shebang, strict-mode flags | lang skill |
| Language-specific conditionals, quoting, operators | lang skill |
| Full boilerplate template with real syntax | lang skill |
| Language-specific error signaling | lang skill |
| Language-specific idioms (pipelines, types, etc.) | lang skill |
---
name: write-script-<lang>
description: |
<Lang> script writing guidelines: <2-3 key topics>.
Auto-load when writing or reviewing <lang> scripts.
Loads write-script-generic for language-agnostic rules.
metadata:
maintainers: [<github-user>]
---
## Goal
<One sentence: what this skill produces, referencing write-script-generic.>
NOTE: Load `write-script-generic` skill first — it defines the shared structure,
naming conventions, and error-handling rules this skill builds on.
## Rules
[lang-specific hard rules only]
## Guidelines
[lang-specific soft recommendations — omit section if none]
## Full script boilerplate / Script structure
[complete, copy-pasteable template in the target language]
## Testing
[name known testing system(s); load write-script-<testing-skill> when tests are wanted;
if no testing skill exists, say so and instruct agent to ask user]
## Section separators
[syntax only — the threshold rule (5+ functions) is owned by generic, do not restate it]
Required additional section: ## Testing — name the known testing system(s) for the language and
which skill to load for writing tests.
If no testing skill exists yet, say so explicitly and instruct the agent to ask the user.
Optional sections (add when relevant): ## Output capture, ## Error handling, ## Subcommands.
The description field must:
.bats / .nu etc.).write-script-generic.Bad (too vague, won't auto-trigger reliably):
Script writing conventions for shell programs.
Good:
Bash script writing guidelines: shebang, strict mode, bash idioms, and full boilerplate. Auto-load when writing or reviewing bash scripts. Loads write-script-generic for language-agnostic rules.
write-script-generic in a lang skill.
If the rule is generic, it belongs in write-script-generic — move it there instead.write-script-generic.