claude-md-global

📁 reizam/claude-md-templates 📅 1 day ago
3
总安装量
3
周安装量
#58507
全站排名
安装命令
npx skills add https://github.com/reizam/claude-md-templates --skill claude-md-global

Agent 安装分布

opencode 3
github-copilot 3
codex 3
kimi-cli 3
gemini-cli 3
cursor 3

Skill 文档

claude-md-global

Generate or audit a global ~/.claude/CLAUDE.md — your personal defaults for every project.

The global file lives at ~/.claude/CLAUDE.md and applies to ALL projects. Target: ~30 lines maximum.

  1. Ask the user about their preferences Only ask what cannot be inferred:

    • Preferred response language
    • Primary language/framework (TypeScript, Python, Go, etc.)
    • Package manager preference (pnpm, npm, yarn, bun, uv, etc.)
    • Test runner preference (vitest, jest, pytest, etc.)
    • Commit convention (conventional commits, other)
  2. Generate the file following these principles

    The golden rule: write only what the agent cannot discover on its own.

    Include ONLY these sections:

    Response language & style (~2 lines)

    • Language to respond in
    • Communication style (e.g., no unsolicited explanations)

    Code conventions (~4 lines)

    • Naming conventions (files, variables, components, constants)
    • Strictness rules (e.g., strict TypeScript, unknown over any)
    • Only conventions the agent would get wrong without guidance

    Tools (~3 lines)

    • Package manager
    • Test runner
    • “Run tests after changes” if that’s the user’s expectation

    Git (~3 lines)

    • Commit message format
    • Key guardrails (no force push, no amend published commits)

    Workflow (~3 lines)

    • Critical process rules (read before edit, one task at a time)
    • Only rules the agent tends to violate
  3. Apply the anti-bloat checklist Remove any line that matches:

    • Agent can discover this from package.json / pyproject.toml
    • This is a generic best practice (“write clean code”)
    • This duplicates what the agent already does by default
    • This is project-specific (belongs in project CLAUDE.md)
    • This is a directory listing or codebase overview
  4. Verify line count

    • Target: ~30 lines (25-35 acceptable)
    • If over 35 lines, cut the least impactful lines
    • Every remaining line must answer: “Would the agent get this wrong without it?”
  5. Write the file

    • Write to ~/.claude/CLAUDE.md
    • Use # headers for sections (no nested headers)
    • Use - bullet lists, no numbered lists
    • No XML tags, no code blocks, no frontmatter — plain markdown only
# Language
Always respond in [language].

# Code conventions
- Files: kebab-case | Variables: camelCase | Components: PascalCase
- Strict TypeScript: prefer unknown over any
- Use @/ path aliases when available

# Tools
- Package manager: pnpm
- Tests: vitest — run after every change

# Git
- Conventional commits: feat(scope): msg, fix:, refactor:, chore:
- Never force push to main

# Workflow
- Read files before editing
- One task at a time: finish and verify before starting the next

After writing, display a summary:

  • Line count
  • Sections included
  • What was intentionally left out and why