writing-claude-md

SKILL开发
开发 未标注权限 许可证不明确

Use when creating CLAUDE.md, improving existing CLAUDE.md, or setting up project configuration. Use when user says "create CLAUDE.md", "setup project", "add laws", "configure agent".

一句话选型结论

按资料字段整理

writing-claude-md是开发类的 Agent Skill,安装方式:GitHub 仓库,权限级别未标注,许可证不明确,没有现成安装命令,需按说明手动放置 SKILL.md。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类开发 安装方式GitHub 仓库 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 11 仓库 Reflexive-Claude-Code
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

GitHub 仓库
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    按安装说明或仓库 README,把 SKILL.md 放到客户端的 skills 目录(一般一个技能一个文件夹)。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

开发
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方wayne930242仓库 Reflexive-Claude-Code · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式GitHub 仓库安装包 wayne930242/Reflexive-Claude-Code
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 未标注
正文体量14.2 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
写代码与改 bug

按需求补代码、定位并修掉报错。

读仓库与生成改动

让模型读懂项目结构,再给出可落地的改动。

跑测试与排查故障

按现象排查问题,补测试用例并复跑。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 基础信息齐全,可以先按说明装一个试试。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有现成安装命令,要按安装说明或仓库 README 手动放置。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在开发场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
writing-claude-md当前 未标注权限 GitHub 仓库 未标注 未标注 无
技能审查员 浏览器控制 ClawHub 市场 877.9 万 OpenClaw 有
Vercel React 最佳实践 浏览器控制 GitHub 仓库 849.1 万 Codex、Claude、Cursor 有
GitHub 代码协作 联网访问 ClawHub 市场 763.3 万 OpenClaw 有
网页设计指南 联网访问 GitHub 仓库 668.6 万 Codex、Claude、Cursor 有
本体论 只读 ClawHub 市场 663.7 万 OpenClaw 有

SKILL.md 全文

14.2 KB
模型实际读到的说明书原文,来自技能仓库

Writing CLAUDE.md

Overview

Writing CLAUDE.md IS establishing project memory that persists across sessions.

CLAUDE.md is context, not enforced configuration. Claude treats it as high-priority guidance loaded every session. For deterministic enforcement, use hooks.

Core principle: Only include what Claude can't figure out from reading the code. Specific and verifiable > vague and aspirational.

Task Initialization (MANDATORY)

Follow task initialization protocol.

Tasks:
0. Fetch latest official memory/CLAUDE.md spec
1. Analyze current state
2. RED - test without proper CLAUDE.md
3. GREEN - write CLAUDE.md
4. Add project content
5. Validate structure
6. REFACTOR - quality review
7. Test with new session

Announce: "Created 8 tasks (0–7). Starting execution..."

Task 0: Fetch Latest Official Spec

Goal: Pull the current Anthropic CLAUDE.md / memory spec before designing — never trust cached memory.

Action:

Skill tool: fetching-claude-docs
  component: memory
  question: "CLAUDE.md location precedence (project/user/local), import syntax,
             auto-loading behavior, token cost, recommended structure"

Verification: Received YAML with source: https://code.claude.com/docs/en/memory.md and non-empty spec_excerpt. Use as authoritative reference; if any rule in this SKILL conflicts with the fetched spec, the fetched spec wins.

Task 1: Analyze Current State

Goal: Understand what exists and what's needed.

If CLAUDE.md exists:
1. Read current content
2. Check length (target: < 200 lines)
3. Identify vague or unverifiable instructions
4. Check if content belongs elsewhere (rules, skills, hooks)

If no CLAUDE.md: Document what Claude would need to know that it can't learn from reading the code.

Verification: Can list specific instructions needed and why each can't be derived from code.

Task 2: RED - Test Without Proper CLAUDE.md

Goal: Observe what Claude gets wrong without guidance.

Process:
1. Start session with weak/no CLAUDE.md
2. Ask Claude to perform common project tasks
3. Note where it uses wrong commands, wrong conventions, wrong paths
4. Document specific gaps (not vague "drift")

What to look for:
- Wrong build/test commands
- Incorrect assumptions about project structure
- Missing project-specific conventions
- Wrong language or communication style

Verification: Documented at least 2 specific things Claude got wrong.

Task 3: GREEN - Write CLAUDE.md

Goal: Create specific, verifiable instructions addressing the gaps you documented.

Before writing, walk through prompt-design-principles.md:

  • 5-skeleton framework — CLAUDE.md typically needs Role (what Claude does in this project), Scope (what's in/out), and Standards (concrete rules). Workflow and Completion usually live in skills / rules, not CLAUDE.md.
  • Failure-mode reverse engineering — every MUST / NEVER line should trace to an observed or predicted failure (documented in Task 2 RED), not an aspirational wish.
  • Conditional dispatch — avoid absolute rules that don't hold across all task variants.

What to Include vs Exclude

Filter every line through this question first: "Can Claude derive this from reading the code, package.json, or running ls?" If yes, exclude — it's noise that pushes real signal out of attention budget.

The 2026 ETH Zürich study found that LLM-auto-generated CLAUDE.md files reduced task success by ~3% and increased cost ~20% precisely because they re-stated derivable content. The same study found that named tools/commands in CLAUDE.md are used ~160× more — confirming Claude reads it carefully, so every wasted line displaces a useful one.

Three-axis frame (WHAT / WHY / HOW):

  • WHAT — non-obvious project identity Claude can't infer: monorepo layout, unusual subdirectory roles
  • WHY — rationale for surprising choices: historical constraints, legal/compliance drivers, prior incidents
  • HOW — non-default tooling and commands: bun not npm, uv not pip, custom build scripts, project-specific test filters
Include (Claude can't guess) Exclude (Claude already knows or can derive)
Non-default tooling (bun not npm, uv not pip) Standard language conventions
Build/test/deploy commands with project-specific flags Things a linter or formatter enforces
Repo conventions (branch naming, PR format) General programming practices
Why a surprising architecture exists (incident, constraint) Big architecture overviews / directory listings (Claude can ls)
Environment quirks, gotchas, prior incidents Detailed API docs (link instead)
Hidden invariants not visible in code Restating what package.json / pyproject.toml already says
Anti-patterns previously caught in review Aspirational "write clean code" / "follow best practices"

CLAUDE.md Structure

Sections: Code Style, Workflow, Architecture, Gotchas. See references/examples.md for complete example.

Writing Rules

Instructions MUST be SPECIFIC, VERIFIABLE, NON-OBVIOUS, and ACTIONABLE.

Use MUST/NEVER/IMPORTANT sparingly — if everything is critical, nothing is.

When to Use Other Mechanisms Instead

If the instruction is... Use...
A focused convention scoped to a directory or file glob .claude/rules/&lt;name&gt;.md with paths: — loads only when Claude reads a matching file, so it costs nothing until relevant
A reusable multi-step workflow A skill in .claude/skills/ (loaded on-demand)
Must NEVER be bypassed (force-push protection, secret-commit block, destructive ops) A hook with exit 2 — text in CLAUDE.md is ~70% compliance, not 100%. Hard rules live in hooks.
Only relevant for certain tasks A skill (loaded on-demand, saves tokens)
Specific to a subdirectory of a monorepo A nested CLAUDE.md inside that subdirectory — Claude Code merges parent + child when working in that path

Conditional Dispatch (for instructions only relevant to specific tasks)

When a section only applies to certain task types (testing, deploying, migrating), wrap it in a conditional block instead of always-on prose. Claude reads the condition and skips the body when it doesn't apply, freeing attention budget for the rest of the file.

&lt;important if=&quot;writing or modifying tests&quot;&gt;
- Use `createTestApp()` helper for integration tests
- Mock the database with `dbMock` (NEVER hit real DB in unit tests)
&lt;/important&gt;

&lt;important if=&quot;deploying to production&quot;&gt;
- Run `bun build` locally first; CI does not auto-build
- Tag the release before pushing to main
&lt;/important&gt;

Use this for: test setup, deploy steps, migration procedures, environment-specific gotchas. Do not wrap core identity (tech stack, build command, project layout) — those need to stay always-on.

Nested CLAUDE.md (monorepos and multi-package repos)

Claude Code merges nested CLAUDE.md files: when working in apps/api/handlers/foo.ts, it loads root CLAUDE.md + apps/CLAUDE.md + apps/api/CLAUDE.md if they exist. Files above the working directory load in full at launch; files in subdirectories below it load on demand, when Claude first reads a file there. Nested files are also not re-injected after /compact — they reload the next time Claude touches that subdirectory. Use this for monorepos:

  • Root CLAUDE.md: project identity, top-level layout, shared commands
  • packages/&lt;name&gt;/CLAUDE.md: package-specific tooling, test command, gotchas
  • apps/&lt;name&gt;/CLAUDE.md: app-specific build, deploy, runtime quirks

Reference: OpenAI's Codex repo uses 88 nested CLAUDE.md files. For a 5+ package monorepo, a single 500-line root file is worse than five 80-line nested files.

Hard Rules — Must Live in Hooks

CLAUDE.md text is advisory: empirical compliance is roughly 70%. For any rule where the 30% miss is unacceptable (force-pushing main, committing secrets, deleting prod data, bypassing pre-commit), encode it as a hook with exit 2 so Claude is mechanically blocked, not asked nicely.

CLAUDE.md may describe the rule for human readers, but the enforcement must be a hook. If you find yourself writing MUST NEVER about a destructive action without a backing hook, you're shipping a 30%-broken safety net.

Verification:
- [ ] < 200 lines (hard target; 60 lines optimal)
- [ ] Every instruction is specific and verifiable
- [ ] No content that belongs in rules, skills, or hooks
- [ ] No vague/obvious guidance ("write clean code")
- [ ] No content that restates README, package.json, or visible directory layout
- [ ] No big architecture overviews / directory listings (Claude can ls)
- [ ] Uses emphasis words (MUST, NEVER) sparingly but effectively
- [ ] Every MUST NEVER about a destructive/irreversible action has a backing hook
- [ ] Task-specific instructions wrapped in &lt;important if=&quot;...&quot;&gt; conditional blocks where appropriate
- [ ] Monorepo: subdirectory-specific guidance moved to nested CLAUDE.md files, not crammed into root

Task 4: Add Project Content

Goal: Add project-specific information that helps agent work effectively. Use the section structure from references/examples.md as a starting point.

Token efficiency:
- CLAUDE.md loads every session — every line costs tokens
- Move domain knowledge to skills (loaded on-demand)
- Move file-scoped conventions into .claude/rules/&lt;name&gt;.md with paths: — these load only when Claude touches a matching file, so they leave the always-resident budget entirely
- A rule without paths: still loads at launch; it buys readability, not tokens
- Link to detailed docs instead of inlining them (@path imports load at launch too, so they don't save context either)

Verification: Total < 200 lines. Every line earns its place.

Task 5: Validate Structure

Goal: Verify CLAUDE.md is effective and efficient.

Checklist:
- [ ] < 200 lines total
- [ ] Every instruction is specific and verifiable
- [ ] No content duplicated in .claude/rules/ (rules are auto-loaded into context — do NOT Read or Grep rule files; compare against auto-loaded rule content already in context)
- [ ] No multi-step workflows (belongs in skills)
- [ ] No linter-enforceable rules (use hooks instead)
- [ ] Referenced paths actually exist
- [ ] Commands actually work

Verification: All checklist items pass.

Task 6: REFACTOR - Quality Review

Goal: Have CLAUDE.md reviewed by claudemd-reviewer subagent.

Agent tool:
- subagent_type: &quot;rcc:claudemd-reviewer&quot;
- prompt: &quot;Review CLAUDE.md at [path]&quot;

Interpret YAML output:
- pass: true → Proceed to Task 7
- pass: false → Fix all issues listed, re-run reviewer, repeat until pass: true

Verification: claudemd-reviewer returns YAML with pass: true.

Task 7: Test with New Session

Goal: Verify CLAUDE.md works in practice.

Process:
1. Start new Claude Code session in project
2. Ask Claude to perform common tasks
3. Verify it uses correct commands, follows conventions
4. Check it doesn't do things the CLAUDE.md says not to
5. If Claude asks questions answered in CLAUDE.md → phrasing is ambiguous, fix it

Signs of a good CLAUDE.md:
- Claude uses the right build/test commands without asking
- Claude follows project conventions automatically
- Claude doesn't need correction on documented gotchas

Signs of a bad CLAUDE.md:
- Claude ignores instructions → file too long, instruction lost in noise
- Claude asks questions answered in CLAUDE.md → phrasing is ambiguous
- Claude follows CLAUDE.md but breaks things → instructions are wrong/outdated

Verification: Claude follows documented conventions correctly over 5+ turns.

Red Flags - STOP

These thoughts mean you're rationalizing. STOP and reconsider:

  • "Skip baseline test, I know what's needed"
  • "Instructions can be general guidance"
  • "Put all project details in CLAUDE.md"
  • "200 lines is too restrictive"
  • "Skip reviewer, it's obviously good"
  • "Add instructions for things a linter can check"
  • "Include standard language conventions"
  • "Restate the README so Claude has the context handy" (it doesn't help — see ETH 2026 study, ~3% drop in success rate)
  • "A big architecture overview helps Claude find files faster" (false — measured zero improvement on time-to-first-relevant-file)
  • "Writing 'NEVER force-push' here will stop it" (no — that's ~70% compliance; needs a hook)
  • "Cram every monorepo package's quirks into root CLAUDE.md" (use nested CLAUDE.md per package)
  • "Always-on prose for test setup is fine" (use &lt;important if=&quot;writing tests&quot;&gt; instead)

All of these mean: You're about to create a bloated, ineffective CLAUDE.md.

Common Rationalizations

Excuse Reality
"I know what instructions are needed" You know what YOU think. Baseline reveals actual gaps.
"Instructions can be vague for flexibility" Vague instructions = Claude interprets freely = no control.
"Everything goes in CLAUDE.md" CLAUDE.md = always loaded = expensive. Use skills and rules.
"More instructions = better coverage" More instructions = more noise = important ones get lost.
"Standard practices need documenting" Claude already knows standard practices. Document the exceptions.
"Linter rules belong here" Linter rules belong in linters + hooks. Deterministic > advisory.

References

  • references/examples.md — Complete CLAUDE.md example and good/bad instructions
  • ../../references/prompt-design-principles.md — 5-skeleton framework, failure-mode reverse engineering, conditional dispatch, completion semantics
  • Scaffold script: ${CLAUDE_SKILL_DIR}/scripts/init_claude_md.py — generates initial CLAUDE.md from project structure

常见问题

5 问
答案由本站依据条目字段整理
writing-claude-md怎么安装?

没有现成安装命令:按安装说明或仓库 README,把 SKILL.md 放进客户端的 skills 目录(一般一个技能一个文件夹)。

writing-claude-md支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

writing-claude-md权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

writing-claude-md收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

writing-claude-md用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。