claude-md-architect by samhvw8/dot-claude
npx skills add https://github.com/samhvw8/dot-claude --skill claude-md-architect通过分析代码库上下文并应用 Anthropic 工程最佳实践,为软件项目生成和优化 CLAUDE.md 文件。创建简洁、可维护的项目指令,以最大化 Claude Code 的有效性,同时最小化令牌消耗。
当用户请求以下内容时激活:
User Request
│
├─→ "init" or "create" → Initialize New CLAUDE.md
│ └─→ Follow: @refs/initialization-workflow.md
│
├─→ "optimize" or "improve" → Optimize Existing CLAUDE.md
│ └─→ Follow: @refs/optimization-patterns.md
│
└─→ "integrate" or "setup MCP/slash commands" → Integration
└─→ Follow: @refs/integration-strategies.md
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
详细说明: @refs/initialization-workflow.md
快速步骤:
详细说明: @refs/optimization-patterns.md
When you are implementing new features in this codebase, it's very important that you always make sure to write comprehensive tests for all the functionality you add. We use Jest as our testing framework, and we expect all new code to have at least 80% code coverage.
### Testing Requirements
- New features require tests (Jest, >80% coverage)
- Unit tests: Individual functions in `src/lib/`
- Integration tests: API endpoints with Supertest
结果: 令牌减少 70%,信息量相同
| 项目类型 | 关键指标 | 模板重点 |
|---|---|---|
| Web 应用 | React/Vue/Angular,前端构建 | UI 组件、响应式设计、路由 |
| 后端 API | Express/FastAPI,数据库,身份验证 | RESTful 约定、验证、安全性 |
| CLI 工具 | Commander/Click,标准输入输出 | 命令、用户体验、文件操作 |
| 库 | 包导出,无应用逻辑 | API 设计、版本控制、向后兼容性 |
| Monorepo | 工作区,多个包 | 跨包更改、工作区命令 |
在呈现 CLAUDE.md 之前:
| 项目复杂度 | 目标令牌数 |
|---|---|
| 简单(单一用途工具) | 100-200 令牌 |
| 中等(标准 Web 应用) | 200-400 令牌 |
| 复杂(多服务平台) | 400-800 令牌 |
| 最大(仅限例外情况) | 1000 令牌 |
如果接近最大值,请拆分为:
.claude/CLAUDE.md(核心内容).claude/ARCHITECTURE.md(参考,不自动加载).claude/commands/*.md(工作流作为斜杠命令)When working on authentication:
@src/lib/auth.ts
@src/middleware/authenticate.ts
用户拥有 ~/.claude/CLAUDE.md(全局):
项目 CLAUDE.md 应:
示例标题:
# MyProject - Development Guide
> Note: General software engineering principles are in your global CLAUDE.md.
> This guide focuses on project-specific patterns and requirements.
## MCP Tools Configuration
### context7 (Official Documentation)
Use for React hooks, Next.js routing, Prisma schema
### magic (UI Component Generation)
Use for new components, accessibility improvements
### Playwright (E2E Testing)
Use for user flows, visual regression, accessibility audits
详细集成指南: @refs/integration-strategies.md
详细模板: @refs/output-templates.md
| 问题 | 解决方案 |
|---|---|
| 过度文档化 | 仅记录项目特定的决策 |
| 信息过时 | 根据当前的 package.json、文件进行验证 |
| 冗余上下文 | 链接到 README,仅添加独特模式 |
| 令牌浪费 | 按功能区域进行按需上下文加载 |
| 通用内容 | 具体模式:"使用 Zod 验证,Prisma 事务" |
记住:
如有疑问:
快速开始: 当用户请求创建/优化 CLAUDE.md 时,请遵循上述决策树,并查阅相关参考文件以获取详细说明。
每周安装量
98
仓库
GitHub 星标数
10
首次出现
2026年1月20日
安全审计
安装于
claude-code86
opencode84
gemini-cli76
codex75
cursor72
github-copilot69
Generate and optimize CLAUDE.md files for software projects by analyzing codebase context and applying Anthropic engineering best practices. Creates concise, maintainable project instructions that maximize Claude Code effectiveness while minimizing token consumption.
Activate when user requests:
User Request
│
├─→ "init" or "create" → Initialize New CLAUDE.md
│ └─→ Follow: @refs/initialization-workflow.md
│
├─→ "optimize" or "improve" → Optimize Existing CLAUDE.md
│ └─→ Follow: @refs/optimization-patterns.md
│
└─→ "integrate" or "setup MCP/slash commands" → Integration
└─→ Follow: @refs/integration-strategies.md
Quick Steps:
Detailed Instructions: @refs/initialization-workflow.md
Quick Steps:
Detailed Instructions: @refs/optimization-patterns.md
When you are implementing new features in this codebase, it's very important that you always make sure to write comprehensive tests for all the functionality you add. We use Jest as our testing framework, and we expect all new code to have at least 80% code coverage.
### Testing Requirements
- New features require tests (Jest, >80% coverage)
- Unit tests: Individual functions in `src/lib/`
- Integration tests: API endpoints with Supertest
Result: 70% token reduction, same information
| Project Type | Key Indicators | Template Focus |
|---|---|---|
| Web App | React/Vue/Angular, frontend build | UI components, responsive design, routing |
| Backend API | Express/FastAPI, database, auth | RESTful conventions, validation, security |
| CLI Tool | Commander/Click, stdio | Commands, user experience, file operations |
| Library | Package exports, no app logic | API design, versioning, backward compatibility |
| Monorepo | Workspaces, multiple packages | Cross-package changes, workspace commands |
Before presenting CLAUDE.md:
| Project Complexity | Target Token Count |
|---|---|
| Simple (single-purpose tool) | 100-200 tokens |
| Medium (standard web app) | 200-400 tokens |
| Complex (multi-service platform) | 400-800 tokens |
| Maximum (exception only) | 1000 tokens |
If approaching max, split into:
.claude/CLAUDE.md (essentials).claude/ARCHITECTURE.md (reference, not auto-loaded).claude/commands/*.md (workflows as slash commands)When working on authentication:
@src/lib/auth.ts
@src/middleware/authenticate.ts
User has ~/.claude/CLAUDE.md (global):
Project CLAUDE.md should:
Example header:
# MyProject - Development Guide
> Note: General software engineering principles are in your global CLAUDE.md.
> This guide focuses on project-specific patterns and requirements.
## MCP Tools Configuration
### context7 (Official Documentation)
Use for React hooks, Next.js routing, Prisma schema
### magic (UI Component Generation)
Use for new components, accessibility improvements
### Playwright (E2E Testing)
Use for user flows, visual regression, accessibility audits
Detailed Integration Guide: @refs/integration-strategies.md
Detailed Templates: @refs/output-templates.md
| Problem | Solution |
|---|---|
| Over-Documentation | Document project-specific decisions only |
| Stale Information | Verify against current package.json, files |
| Redundant Context | Link to README, add only unique patterns |
| Token Waste | On-demand context by functional area |
| Generic Fluff | Specific patterns: "Use Zod validation, Prisma transactions" |
Remember:
When in doubt:
Quick Start: When user requests CLAUDE.md creation/optimization, follow the decision tree above and consult relevant reference files for detailed instructions.
Weekly Installs
98
Repository
GitHub Stars
10
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code86
opencode84
gemini-cli76
codex75
cursor72
github-copilot69
Kotlin 开发模式与最佳实践 | 构建健壮高效应用程序的惯用指南
1,000 周安装