write-claude-md
关于
This skill generates CLAUDE.md files that provide project-specific instructions to AI coding assistants. It covers file structure, common sections, do/don't patterns, and MCP server integration. Use it when starting new AI-assisted projects or improving AI behavior on existing codebases.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/write-claude-md在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Write CLAUDE.md
CLAUDE.md → AI assistants effective project-specific ctx.
Use When
- New project → AI used
- Improve AI behavior on existing
- Doc project conventions, workflows, constraints
- Integrate MCP servers|agent defs
In
- Required: Project type + tech stack
- Required: Key conventions + constraints
- Optional: MCP server configs
- Optional: Author + contributor info
- Optional: Security + confidentiality reqs
Do
Step 1: Basic CLAUDE.md
Place CLAUDE.md in project root:
# Project Name
Brief description of what this project is and its purpose.
## Quick Start
Essential commands for working on this project:
```bash
# Install dependencies
npm install # or renv::restore() for R
# Run tests
npm test # or devtools::test() for R
# Build
npm run build # or devtools::check() for R
Architecture
Key architectural decisions and patterns used in this project.
Conventions
- Always use descriptive variable names
- Follow [language-specific style guide]
- Write tests for all new functionality
**Got:** `CLAUDE.md` in project root w/ min: project desc, quick start cmds, architecture, conventions.
**If err:** Unsure what to include → start w/ Quick Start only (3 most important: install, test, build). Expand incrementally.
### Step 2: Tech-Specific Sections
**R packages**:
```markdown
## Development Workflow
```r
devtools::load_all() # Load for development
devtools::document() # Regenerate docs
devtools::test() # Run tests
devtools::check() # Full package check
Package Structure
R/- Source code (one function per file)tests/testthat/- Tests mirror R/ structurevignettes/- Long-form documentationman/- Generated by roxygen2 (do not edit manually)
Critical Files (Do Not Delete)
.Rprofile- Session configuration.Renviron- Environment variables (git-ignored)renv.lock- Locked dependencies
**Node.js/TS**:
```markdown
## Stack
- Next.js 15 with App Router
- TypeScript strict mode
- Tailwind CSS for styling
- Vercel for deployment
## Conventions
- Use `@/` import alias for src/ directory
- Server Components by default, `"use client"` only when needed
- API routes in `src/app/api/`
Got: Tech-specific sections match actual stack — R pkg structure for R, Node.js details for web. Cmds + paths reference real layout.
If err: Unfamiliar stack → inspect package.json, DESCRIPTION, Cargo.toml, equivalent → ID tech + add corresponding section.
Step 3: MCP Server Info
## Available MCP Servers
### r-mcptools (R Integration)
- **Purpose**: Connect to R/RStudio sessions
- **Status**: Configured
- **Configuration**: `claude mcp add r-mcptools stdio "Rscript.exe" -- -e "mcptools::mcp_server()"`
### hf-mcp-server (Hugging Face)
- **Purpose**: AI/ML model and dataset access
- **Status**: Configured
- **Configuration**: `claude mcp add hf-mcp-server -e HF_TOKEN=token -- mcp-remote https://huggingface.co/mcp`
Got: Each MCP server: purpose, status (configured|available|not configured), cmd to add. No actual tokens|secrets.
If err: MCP not yet configured → doc as "Available" w/ setup instructions, not "Configured." Placeholder vals like your_token_here.
Step 4: Author Info
## Author Information
### Standard Package Authorship
- **Name**: Author Name
- **Email**: [email protected]
- **ORCID**: 0000-0000-0000-0000
- **GitHub**: username
Got: Author section w/ name, email, ORCID (academic|research), GitHub. R pkgs match DESCRIPTION reqs.
If err: Author info sensitive|shouldn't be public → org name vs personal, or omit for internal-only.
Step 5: Security Guidelines
## Security & Confidentiality
- Never commit `.Renviron`, `.env`, or files containing tokens
- Use placeholder values in documentation: `YOUR_TOKEN_HERE`
- Environment variables for all secrets
- Git-ignored: `.Renviron`, `.env`, `credentials.json`
Got: Security section lists never-commit files, placeholder conventions, confirms .gitignore covers sensitive.
If err: Unsure which sensitive → grep -rn "sk-\|ghp_\|password" . for exposed secrets. Real creds → .gitignore + mention here.
Step 6: Reference Skills + Guides
## Development Best Practices References
@agent-almanac/skills/write-testthat-tests/SKILL.md
@agent-almanac/skills/submit-to-cran/SKILL.md
Got: Relevant skills + guides ref'd via @ paths → AI assistants get detailed procedures for common tasks.
If err: Ref'd skills|guides don't exist at paths → verify or remove. Broken @ refs no value, may confuse.
Step 7: Quality + Status
## Quality Status
- R CMD check: 0 errors, 0 warnings, 1 note
- Test coverage: 85%
- Tests: 200+ passing
- Vignettes: 3 (rated 9/10)
Got: Quality metrics → current state, accurate nums for check, coverage, test count, doc status.
If err: Metrics not yet avail (new project) → placeholder "TBD" + update as matures. No fabricate.
Check
- CLAUDE.md in project root
- Quick start cmds accurate + work
- Architecture reflects actual structure
- No sensitive (tokens, passwords, private paths)
- MCP server configs current
- Ref'd files + paths exist
Traps
- Stale info: Update CLAUDE.md when project structure changes
- Too much detail: Concise. Link detailed guides vs duplicate
- Sensitive data: Never include actual tokens|creds. Placeholders.
- Conflicting instructions: CLAUDE.md doesn't contradict other config
- Missing from
.Rbuildignore: R pkgs → add^CLAUDE\\.md$to.Rbuildignore
Examples
Pattern across successful projects:
- putior (829 lines): Comprehensive CLAUDE.md w/ quality metrics, 20 accomplishments, MCP integration, dev workflow
- Simple project (20 lines): Quick start + key conventions
Scale to match project complexity.
→
create-r-package— CLAUDE.md as part of pkg setupconfigure-mcp-server— MCP config ref'd in CLAUDE.mdsecurity-audit-codebase— verify no secrets in CLAUDE.md
GitHub 仓库
相关推荐技能
content-collections
元Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
polymarket
元这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
creating-opencode-plugins
元该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
sglang
元SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
