[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M759959KMN4V7EXK1DP8Y8HG":3,"skill-same:01M759959KMN4V7EXK1DP8Y8HG":66},{"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":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M759959KMN4V7EXK1DP8Y8HG","write-system-prompt",null,"Expert framework for writing, auditing, and optimizing production-grade LLM system prompts. Synthesizes patterns from OpenCode's multi-provider architecture, Claude Code\u002FAGENTS.md conventions, HumanLayer context engineering research, and community lean-prompt benchmarks. Covers structure design, persona definition, constraint setting, tool declarations, reasoning protocols, progressive disclosure, and provider-specific optimization. Use when designing, reviewing, or iterating on any agent system prompt, CLAUDE.md, AGENTS.md, or SKILL.md instruction body.","fagerbergj\u002Fquack","fagerbergj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F33072697?v=4","01M7598SKYWYZ082FS6E50M3WV","Jason Fagerberg","01M7598SMVNYG05G13KBTK1923",1,"MIT","https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-system-prompt\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: write-system-prompt\ndescription: >\n  Expert framework for writing, auditing, and optimizing production-grade LLM\n  system prompts. Synthesizes patterns from OpenCode's multi-provider architecture,\n  Claude Code\u002FAGENTS.md conventions, HumanLayer context engineering research, and\n  community lean-prompt benchmarks. Covers structure design, persona definition,\n  constraint setting, tool declarations, reasoning protocols, progressive disclosure,\n  and provider-specific optimization. Use when designing, reviewing, or iterating on\n  any agent system prompt, CLAUDE.md, AGENTS.md, or SKILL.md instruction body.\nlicense: MIT\ncompatibility: No external dependencies; works with any LLM-based agent framework.\nmetadata:\n  author: PromptCraft Contributors\n  version: \"1.1\"\n---\n\n# System Prompt Engineer - Agent Skill\n\n## Checklist (validate before shipping)\n\n- [ ] Role defined in one sentence at the top\n- [ ] All tools declared with name, purpose, and key parameters\n- [ ] Explicit \"Always\" \u002F \"Never\" blocks with atomic, testable rules\n- [ ] Reasoning protocol present for multi-step work\n- [ ] Output format requirements stated\n- [ ] Edge cases covered: tool failure, ambiguous input, conflicting instructions\n- [ ] Core prompt under 50 individual instructions; detail offloaded to separate files\n- [ ] Most critical rules appear at the **start and end** of the prompt (not buried)\n- [ ] No duplicate rules; no vague constraints (\"be helpful\", \"follow best practices\")\n- [ ] Tested with adversarial and ambiguous inputs\n\n## Step 1 - Gather Inputs\n\n| Field | Why It Matters |\n|---|---|\n| Agent role \u002F persona | One-sentence identity anchors model behavior |\n| Primary task(s) | Determines tool declarations and reasoning depth |\n| Target model(s) | Provider response characteristics differ (see `references\u002Fopencode-patterns.md`) |\n| Available tools | Must be declared explicitly - models hallucinate undeclared tools |\n| Hard constraints \u002F guardrails | Safety boundaries and formatting rules |\n| Environment \u002F domain context | Working directory, platform, codebase conventions |\n\n## Step 2 - Seven-Section Template\n\nEvery production prompt follows this structure. Use `assets\u002Fskeleton-system-prompt.md` as a clean fill-in copy.\n\n```markdown\n### 1. ROLE \u002F IDENTITY\nYou are [agent name], an AI assistant designed to [primary capability].\nYour personality is [tone: precise, professional, etc.].\n\n### 2. CAPABILITIES & SCOPE\n- You can [capability 1]\n- You specialize in [domain]\n\n### 3. AVAILABLE TOOLS\nYou have access to the following tools. Do not hallucinate tool availability:\n- `tool_name`: [What it does, when to use it, key parameters]\n\n### 4. BEHAVIORAL RULES \u002F CONSTRAINTS\nAlways:\n- [Specific, testable rule]\n\nNever:\n- [Specific, testable forbidden behavior]\n\nWhen uncertain, ask at most 2 clarifying questions before proceeding.\n\n### 5. REASONING & DECISION PROTOCOL\n1. Parse the request - identify all explicit and implicit requirements.\n2. Determine which tools are needed and why.\n3. For multi-step work: outline a plan before executing.\n4. Self-check output against Section 4 before responding.\n\n### 6. OUTPUT FORMAT\n- Use [markdown \u002F JSON \u002F XML] as appropriate.\n- Always include [required elements: headers, summaries, error traces].\n- Target brevity unless detail is explicitly requested.\n\n### 7. EDGE CASES & ERROR HANDLING\n- Tool failure → retry once, then explain and suggest alternatives.\n- Conflicting instructions → Section 4 rules take priority. Ask for clarification.\n```\n\n## Step 3 - Design Principles\n\n**A. Front-load critical rules.** LLMs bias toward the peripheries of a prompt - the very start and end. Put safety constraints and must-follow rules at both ends, never buried in the middle. (Source: HumanLayer CLAUDE.md analysis)\n\n**B. Fewer, better instructions.** Frontier thinking models follow ~150–200 instructions reliably; smaller models degrade exponentially past ~50. Instruction-following quality weakens *uniformly* as count grows - not just for newer rules. Keep core prompts under 50 instructions; use progressive disclosure for the rest.\n\n**C. Progressive disclosure.** Core prompt holds universal rules only. Task-specific and project-specific guidance lives in separate files the agent is told to read before acting. Target under 300 lines for `CLAUDE.md`\u002F`AGENTS.md`. (Source: HumanLayer context engineering research)\n\n**D. Provider-specific tuning.** Claude: numbered lists, explicit always\u002Fnever. GPT: detailed planning, self-correction loops. Gemini: explicit step-by-step reasoning. Multi-model targets should be provider-agnostic. See `references\u002Fopencode-patterns.md` for OpenCode's per-provider file approach.\n\n**E. Negative constraints outperform positive ones.** \"No silent defaults - fail loudly on missing config\" prevents more bugs than \"handle configuration carefully.\" See `references\u002Flean-prompts-benchmarks.md` for the 4000→350-word experiment showing how bloat causes instruction-following collapse.\n\n**F. Constraints must be atomic and testable.** \"Never write to system directories\" passes; \"Be safe with file operations\" fails - a model can't self-check against a vague rule.\n\n## Step 4 - Tool Declarations\n\n- One line per tool: what it does + when to use it + key parameter names\u002Ftypes\n- Declare restrictions and fallback behavior inline\n- Side-effecting tools (file writes, shell, destructive ops) need explicit \"require user confirmation\" rules in Section 4\n- If a tool has runtime-substituted values (working dir, date), note the substitution in the declaration\n\n## Step 5 - Iteration\n\nTreat prompts as code: change one section at a time, test with adversarial inputs, score against \"does the agent execute without hesitation or contradiction?\" - not \"does this read well to a human?\"\n\n---\n\n*Sources: OpenCode prompt architecture (`anomalyco\u002Fopencode`), HumanLayer CLAUDE.md analysis, Agent Skills spec (`agentskills.io\u002Fspecification`), community lean-prompt benchmarks. Details in `references\u002F`.*\n","# System Prompt Engineer - Agent Skill\n\n## Checklist (validate before shipping)\n\n- [ ] Role defined in one sentence at the top\n- [ ] All tools declared with name, purpose, and key parameters\n- [ ] Explicit \"Always\" \u002F \"Never\" blocks with atomic, testable rules\n- [ ] Reasoning protocol present for multi-step work\n- [ ] Output format requirements stated\n- [ ] Edge cases covered: tool failure, ambiguous input, conflicting instructions\n- [ ] Core prompt under 50 individual instructions; detail offloaded to separate files\n- [ ] Most critical rules appear at the **start and end** of the prompt (not buried)\n- [ ] No duplicate rules; no vague constraints (\"be helpful\", \"follow best practices\")\n- [ ] Tested with adversarial and ambiguous inputs\n\n## Step 1 - Gather Inputs\n\n| Field | Why It Matters |\n|---|---|\n| Agent role \u002F persona | One-sentence identity anchors model behavior |\n| Primary task(s) | Determines tool declarations and reasoning depth |\n| Target model(s) | Provider response characteristics differ (see `references\u002Fopencode-patterns.md`) |\n| Available tools | Must be declared explicitly - models hallucinate undeclared tools |\n| Hard constraints \u002F guardrails | Safety boundaries and formatting rules |\n| Environment \u002F domain context | Working directory, platform, codebase conventions |\n\n## Step 2 - Seven-Section Template\n\nEvery production prompt follows this structure. Use `assets\u002Fskeleton-system-prompt.md` as a clean fill-in copy.\n\n```markdown\n### 1. ROLE \u002F IDENTITY\nYou are [agent name], an AI assistant designed to [primary capability].\nYour personality is [tone: precise, professional, etc.].\n\n### 2. CAPABILITIES & SCOPE\n- You can [capability 1]\n- You specialize in [domain]\n\n### 3. AVAILABLE TOOLS\nYou have access to the following tools. Do not hallucinate tool availability:\n- `tool_name`: [What it does, when to use it, key parameters]\n\n### 4. BEHAVIORAL RULES \u002F CONSTRAINTS\nAlways:\n- [Specific, testable rule]\n\nNever:\n- [Specific, testable forbidden behavior]\n\nWhen uncertain, ask at most 2 clarifying questions before proceeding.\n\n### 5. REASONING & DECISION PROTOCOL\n1. Parse the request - identify all explicit and implicit requirements.\n2. Determine which tools are needed and why.\n3. For multi-step work: outline a plan before executing.\n4. Self-check output against Section 4 before responding.\n\n### 6. OUTPUT FORMAT\n- Use [markdown \u002F JSON \u002F XML] as appropriate.\n- Always include [required elements: headers, summaries, error traces].\n- Target brevity unless detail is explicitly requested.\n\n### 7. EDGE CASES & ERROR HANDLING\n- Tool failure → retry once, then explain and suggest alternatives.\n- Conflicting instructions → Section 4 rules take priority. Ask for clarification.\n```\n\n## Step 3 - Design Principles\n\n**A. Front-load critical rules.** LLMs bias toward the peripheries of a prompt - the very start and end. Put safety constraints and must-follow rules at both ends, never buried in the middle. (Source: HumanLayer CLAUDE.md analysis)\n\n**B. Fewer, better instructions.** Frontier thinking models follow ~150–200 instructions reliably; smaller models degrade exponentially past ~50. Instruction-following quality weakens *uniformly* as count grows - not just for newer rules. Keep core prompts under 50 instructions; use progressive disclosure for the rest.\n\n**C. Progressive disclosure.** Core prompt holds universal rules only. Task-specific and project-specific guidance lives in separate files the agent is told to read before acting. Target under 300 lines for `CLAUDE.md`\u002F`AGENTS.md`. (Source: HumanLayer context engineering research)\n\n**D. Provider-specific tuning.** Claude: numbered lists, explicit always\u002Fnever. GPT: detailed planning, self-correction loops. Gemini: explicit step-by-step reasoning. Multi-model targets should be provider-agnostic. See `references\u002Fopencode-patterns.md` for OpenCode's per-provider file approach.\n\n**E. Negative constraints outperform positive ones.** \"No silent defaults - fail loudly on missing config\" prevents more bugs than \"handle configuration carefully.\" See `references\u002Flean-prompts-benchmarks.md` for the 4000→350-word experiment showing how bloat causes instruction-following collapse.\n\n**F. Constraints must be atomic and testable.** \"Never write to system directories\" passes; \"Be safe with file operations\" fails - a model can't self-check against a vague rule.\n\n## Step 4 - Tool Declarations\n\n- One line per tool: what it does + when to use it + key parameter names\u002Ftypes\n- Declare restrictions and fallback behavior inline\n- Side-effecting tools (file writes, shell, destructive ops) need explicit \"require user confirmation\" rules in Section 4\n- If a tool has runtime-substituted values (working dir, date), note the substitution in the declaration\n\n## Step 5 - Iteration\n\nTreat prompts as code: change one section at a time, test with adversarial inputs, score against \"does the agent execute without hesitation or contradiction?\" - not \"does this read well to a human?\"\n\n---\n\n*Sources: OpenCode prompt architecture (`anomalyco\u002Fopencode`), HumanLayer CLAUDE.md analysis, Agent Skills spec (`agentskills.io\u002Fspecification`), community lean-prompt benchmarks. Details in `references\u002F`.*\n",{"name":5,"license":15,"metadata":24,"description":27,"compatibility":28},{"author":25,"version":26},"PromptCraft Contributors","1.1","Expert framework for writing, auditing, and optimizing production-grade LLM system prompts. Synthesizes patterns from OpenCode's multi-provider architecture, Claude Code\u002FAGENTS.md conventions, HumanLayer context engineering research, and community lean-prompt benchmarks. Covers structure design, persona definition, constraint setting, tool declarations, reasoning protocols, progressive disclosure, and provider-specific optimization. Use when designing, reviewing, or iterating on any agent system prompt, CLAUDE.md, AGENTS.md, or SKILL.md instruction body.\n","No external dependencies; works with any LLM-based agent framework.","main","ee56fa2c361ddac0a541d4a37e07292226298fa4",".agents\u002Fskills\u002Fwrite-system-prompt",0,"https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack","https:\u002F\u002Fgithub.com\u002Ffagerbergj","2026-11-15 00:17:15",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add fagerbergj\u002Fquack --skill write-system-prompt",{"tool":42,"command":43},"bunx","bunx skills add fagerbergj\u002Fquack --skill write-system-prompt",{"tool":45,"command":46},"pnpm","pnpm dlx skills add fagerbergj\u002Fquack --skill write-system-prompt","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-system-prompt\u002FSKILL.md",true,[50,56,62],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"assets\u002Fskeleton-system-prompt.md","ASSET","资产文件",1329,"https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-system-prompt\u002Fassets\u002Fskeleton-system-prompt.md",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Flean-prompts-benchmarks.md","REFERENCE","参考文档",3155,"https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-system-prompt\u002Freferences\u002Flean-prompts-benchmarks.md",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fopencode-patterns.md",2632,"https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-system-prompt\u002Freferences\u002Fopencode-patterns.md",[67],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7598XB2KRPE48T1JXYTCGRP","react-testing","React Testing Library + Vitest\u002FJest best practices (2025–2026): unit, integration, mocking,\nasync, CI\u002FCD, and advanced (visual-regression, a11y, performance) testing. Covers the Testing\nTrophy philosophy, query priority (getByRole first, getByTestId last), userEvent over fireEvent,\nfindBy\u002FwaitFor async patterns, custom render with providers, vi.fn\u002FspyOn\u002Fmock, renderHook, React\nQuery + Suspense testing, Vitest vs Jest config (pools, sharding, coverage thresholds), and when\nto reach for axe-core, Chromatic\u002FPlaywright CT, or the Profiler.\nUse when writing or reviewing React component\u002Fhook tests, picking a query or interaction API,\nsetting up Vitest\u002FJest config or coverage gates, or deciding on visual\u002Fa11y\u002Fperf testing.\nDo NOT use for non-React testing or E2E flow design unrelated to components.","https:\u002F\u002Fgithub.com\u002Ffagerbergj\u002Fquack\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Freact-testing\u002FSKILL.md",[],[]]