Skill站外收录 @skilllib/skill-2117939930272412383
claudemd-writer
为代码目录生成轻量级上下文说明文件,帮助 Claude Code 理解项目结构、模块职责、设计意图与常见陷阱,通过路径层级自动注入相关提示,强调精准性与实用性,避免冗余信息干扰模型注意力。
效率工具 AI 技能
Skills.MD
# CLAUDE.md Writer
CLAUDE.md files provide context to Claude Code when working in a directory. Claude reads them automatically based on the files being accessed.
## Core Principle: Less is More
Claude Code's system prompt tells Claude to **ignore CLAUDE.md content if it seems irrelevant**. The more irrelevant content, the more likely Claude ignores everything.
Frontier LLMs reliably follow ~150-200 instructions. Claude Code's system prompt uses ~50. Every line in CLAUDE.md competes for attention.
## Hierarchical Injection
CLAUDE.md files inject based on path depth. When reading `modules/payments/lib/checkout.ts`, Claude receives CLAUDE.md from: project root → modules/ → payments/ → lib/
**Closest file wins** if instructions conflict. Keep each CLAUDE.md focused on its level — don't duplicate parent content.
## What Goes Where
**Root CLAUDE.md**: Commands (install/dev/test/build/lint), project purpose, stack overview, project-wide conventions.
**Domain CLAUDE.md** (e.g., `modules/`, `services/`): What the domain handles, shared patterns, cross-module dependencies.
**Module CLAUDE.md** (e.g., `payments/`, `auth/`): Module-specific test commands, what it does, how it works, why it's designed this way, gotchas.
## Writing Guidelines
### Describe What, How, Why — Concisely
- **What** this module does
- **How** it works (architecture, data flow, key patterns)
- **Why** it's designed this way (rationale, constraints)
- **Gotchas** that cause mistakes
Don't write API reference documentation. Write context that helps agents make good decisions.
### Use Pointers, Not Copies
Reference canonical examples by file and line number: "Follow the pattern in `src/services/UserService.ts:45-60`"
Code snippets go stale. File references can be verified.
### Provide Alternatives to "Never"
"Never use `--force`" leaves Claude stuck. "Never use `--force`, use `--force-with-lease` instead" gives a path forward.
### Don't Use CLAUDE.md as a Linter
Style rules (indentation, semicolons, quotes) belong in ESLint/Prettier. Claude learns style from existing code.
## When to Create
- New module or significant directory
- Patterns need explanation
- Agent repeatedly makes wrong assumptions
- You fix a bug caused by missing context
## When NOT to Create/Update
- Bug fixes that don't change behavior
- Refactoring that preserves API
- Internal implementation details
- Small utility files or tests
## Structure
No rigid template. Common sections, in order of usefulness:
1. **Commands** — Put runnable commands first (test, dev, lint)
2. **How It Works** — Architecture, data flow, key components
3. **Why This Design** — Rationale, constraints, tradeoffs
4. **Key Patterns** — Reference canonical examples by file:line
5. **Gotchas** — Non-obvious things that cause mistakes
Include only sections that help agents work effectively in this directory.
## Checklist
Before saving:
- [ ] Explains what, how, and why — concisely?
- [ ] Includes gotchas not obvious from code?
- [ ] Every line relevant to this directory?
- [ ] File references instead of code snippets?
- [ ] Every "never" has an alternative?
- [ ] Concise enough that Claude won't ignore it?
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「claudemd-writer」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次