Write system prompts, tool docs, and agent definitions. Project tag conventions + RFC 2119 keywords + dense compression. Use when authoring or editing any promp
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-system-prompts-5103dbb9a76b ,按照其中的说明把「system-prompts」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
House style: dense, imperative, RFC-keyed.
Small models (≤2B; tiny/on-device, e.g. LFM2): MUST read small-models.md. Rules below assume frontier-class instruction following; several invert at that scale.
Tags: authoritative, literal structural markers; meaning exactly matches name. NEVER invent ornamental tags: <north-star>, <stance>, <protocol>, <directives>, <strengths> — noise.
| Tag | Purpose |
|---|---|
<system-conventions> | Tag/RFC-keyword interpretation; contract. |
<stakes> | Correctness importance; domain framing. |
<communication> | Voice, tone, response shape. |
<critical> | Inviolable rules; place at START and END. |
<completeness> | Done definition; anti-shrink rules. |
<yielding> | Pre-yield checklist; block conditions. |
<workflow> | Numbered phases: scope → edit → decompose → work → verify. |
RFC 2119: full caps, no bold; all-caps form is the marker.
| Keyword | Meaning | Replaces |
|---|---|---|
| MUST / REQUIRED | Absolute requirement | "always", "make sure", "ensure" |
| NEVER (= MUST NOT) | Absolute prohibition | "do not", "don't" |
| SHOULD / RECOMMENDED | Strong preference; known-tradeoff deviation allowed | "prefer", "it's best to" |
| AVOID (= SHOULD NOT) | Strong discouragement | "try not to" |
| MAY / OPTIONAL | Truly optional | "can", "you could" |
Aliases: prefer NEVER to MUST NOT; AVOID to SHOULD NOT. Both: single-token in cl100k/o200k; identical authority.
Near top, inside <system-conventions>, state once:
RFC 2119 applies to MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL.
NEVERandAVOIDMUST be interpreted as aliases forMUST NOTandSHOULD NOTrespectively.
NEVER convert factual descriptions (tool returns, parameter behavior), code blocks, examples, schema, or Handlebars template syntax.
Load-bearing tokens only; every bullet adds a claim.
X? Y. replaces “If X, then Y.”→, =, +/</-, B+1, A..B.add → +/<; delete → -; = ONLY when modifying inside.Bad: - **Never fabricate anchor hashes.** Hashes are 2-letter content fingerprints, not arbitrary suffixes. You cannot increment them, guess the "next" one, or compute them locally. If a needed anchor is not in your last `read` output, issue another `read`.
Good: - **NEVER fabricate anchor hashes.** Missing? Re-`read`.
Bad: - **Do not replay the line past your range.** For `= A..B`, never end the payload with content that already exists at B+1. Stop the payload at the last line you are actually changing; if you need that next line gone, extend B.
Good: - **NEVER replay past your range.** Stop before B+1; extend B if it must go.
Tactical bullets: 5–12 words. Longer ONLY for multi-part contracts where every clause constrains parameter semantics or edge enumeration.
AVOID compressing factual reference (operator definitions, return formats, schema), worked examples, or first use of a non-obvious term.
Direct, imperative, second-person: “You MUST/NEVER/SHOULD.” No hedging, apology, ceremony, closing summaries, or time estimates.
Bad: "You might want to consider using X..."
Good: "You SHOULD use X."
Bad: "Please note that this is important..."
Good: "Critical: X."
Bad: "Make sure to run lsp references before modifying a symbol"
Good: "You MUST run `lsp references` before modifying any exported symbol."
Negation: pair positive alternative when non-obvious; otherwise NEVER X. alone.
“Lost in the Middle”: start/end retain; middle degrades ~20%. Critical constraints at both edges; reference material, environment, templated content in middle.
Front matter:
You are THE staff engineer…).<system-conventions> — RFC contract, tag semantics.<stakes> — importance.<communication> — style.<critical> — top-priority rules.Back matter:
<critical> rule.Live-system-prompt patterns:
| Pattern | Problem |
|---|---|
Politeness padding ("Would you be so kind…") | +perplexity, −accuracy |
Bribes ("I'll tip $2000") | No improvement; sometimes worse |
| Few-shot on advanced models + clear task | Noise/bias |
| Explicit CoT on reasoning models (o1/o3) | Conflicts with internal reasoning |
"Be efficient with tokens" | Premature task abandonment |
"Don't do X" without alternative | "Always do Y" processes better |
| Self-critique without external feedback | Detection bottleneck, not correction |
| Critical instructions only in middle | 20%+ degradation vs edges |
| Restating bold lead in body | Token waste; AI-padding signal |
| Inventing emphasis tags | Tags have semantics; ornament dilutes |
| Lowercase RFC keywords | All-caps is marker; lowercase ordinary prose |
<system-conventions> defines NEVER/AVOID aliases.Tool prompts teach when to use the tool, input shape, and agent-owned failures — not API docs. Engine internals, recovery heuristics, fallback chains, performance tuning: code.
Agents choose tools from prose: state WHEN/WHY; NEVER internal HOW.
read.md: enumerate every covered source — file/dir/archive/sqlite/PDF/URL — so agent avoids cat/curl/tar; omit chunker, binary sniffer, cache layer.lsp.md: "You MUST use lsp whenever a language server is available — safer than text-based alternatives." Omit LSP wire protocol, server lifecycle, capability negotiation.ast_edit: teach metavariable syntax + workflow: "Loosest existence check: pat: 'executeBash' with narrow paths"; omit AST engine, query compilation, tree-sitter grammar selection.hashline.md (this repo): teach patch grammar — anchors, ops, payloads, ranges — and successful edit shapes. NEVER expose tryRecoverHashlineWithCache, fuzz factor, bigram tables, findUniqueSuffixMatch, untilAborted, formatGroupedFiles; agent sees only "the tool resolved your typo" or "the anchor was stale, re-read".Behavior-invariant detail: exclude. Every sentence MUST shift an agent decision.
<critical> recap — 3–6 load-bearing lines, for body-skipping agents.O(n)) unless strategy-changing.this calls \read` under the hood`) unless coordination required.Tool prompts rely on examples more than agent prompts:
Examples MUST be runnable, not pseudo-code. JSON tool → JSON example; custom grammar → real anchors, payload prefixes, line numbers.