write-claude-md
About
This skill generates a CLAUDE.md file with project-specific instructions for AI coding assistants. It helps developers establish conventions, document constraints, and integrate MCP servers when starting new projects or improving AI behavior on existing ones. Use it to create structured guidance covering do/don't patterns, workflows, and agent definitions for consistent AI assistance.
Quick Install
Claude Code
Recommendednpx 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-mdCopy and paste this command in Claude Code to install this skill
Documentation
書 CLAUDE.md
立 CLAUDE.md 予 AI 助手有效案境。
用
- 始用 AI 助手之新案→用
- 改現案 AI 為→用
- 錄案規、流、約→用
- 納 MCP 器或客定於案→用
入
- 必:案型與技棧
- 必:關規與約
- 可:MCP 器配
- 可:作者與貢者
- 可:安與密要
行
一:建基 CLAUDE.md
置 CLAUDE.md 於案根:
# 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
得:`CLAUDE.md` 存於案根,至少含案述、速啟命、構覽、規節。
敗:不確何納→始於僅速啟節含三要命(裝、試、建)。案演中漸擴。
### 二:加技節
**R 包**:
```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/TypeScript**:
```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/`
得:技節合案實棧——R 案 R 包構、網案 Node.js 棧。命與路指真案布。
敗:案用未識棧→察 package.json、DESCRIPTION、Cargo.toml 或同等以辨技、加應節。
三:加 MCP 器信
## 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`
得:每配 MCP 器有副節錄目、態(已配/可用/未配)、加之命。無真令或密。
敗:MCP 器未配→錄為「可用」附建指、非「已配」。憑證用佔位如 your_token_here。
四:加作者信
## Author Information
### Standard Package Authorship
- **Name**: Author Name
- **Email**: [email protected]
- **ORCID**: 0000-0000-0000-0000
- **GitHub**: username
得:作者信節含名、信箱、ORCID(學/研案)、GitHub 用名。R 包式合 DESCRIPTION 要。
敗:作者信敏或不公→用機構名代個、或內案略此節。
五:加安指
## 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`
得:安節列永不可提之檔、文佔位規、確 .gitignore 蓋諸敏檔。
敗:不確何敏→grep -rn "sk-\|ghp_\|password" . 掃露密。任含真憑檔加 .gitignore 並述此節。
六:參技與指
## Development Best Practices References
@agent-almanac/skills/write-testthat-tests/SKILL.md
@agent-almanac/skills/submit-to-cran/SKILL.md
得:關技與指以 @ 路參,予 AI 助手案中常任之詳程。
敗:所參技或指於指路不存→驗路或移參。壞 @ 參無價或惑助手。
七:加質與態信
## Quality Status
- R CMD check: 0 errors, 0 warnings, 1 note
- Test coverage: 85%
- Tests: 200+ passing
- Vignettes: 3 (rated 9/10)
得:質指節映案今態附察果、覆、計、文之準數。
敗:指未備(新案)→佔位「TBD」、案熟後更。勿造數。
驗
- CLAUDE.md 於案根
- 速啟命準且行
- 構節映實案構
- 無敏(令、密、私路)
- MCP 器配為今
- 所參檔與路存
忌
- 舊信:案構變時更 CLAUDE.md
- 過詳:簡。鏈詳指、勿復容
- 敏數:永勿納真令或憑。用佔位
- 衝指:確 CLAUDE.md 不違其他配檔
- 缺於
.Rbuildignore:R 包加^CLAUDE\\.md$於.Rbuildignore
例
成案中觀式:
- putior(829 行):詳 CLAUDE.md 含質指、20 成、MCP 整詳、開發流
- 簡案(20 行):僅速啟命與關規
CLAUDE.md 度合案複。
參
create-r-package- CLAUDE.md 為包設之部configure-mcp-server- CLAUDE.md 中參 MCP 配security-audit-codebase- 驗 CLAUDE.md 中無密
GitHub Repository
Related Skills
content-collections
MetaThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
polymarket
MetaThis skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
creating-opencode-plugins
MetaThis skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
