Pular para o conteúdo
Skillpedia
Código em geral46 mil · #6321

claude-md

O que ela faz

Orienta seu agente a escrever ou auditar o arquivo CLAUDE.md que explica como um projeto funciona. Ela é para desenvolvedores que querem que o assistente de IA comece cada sessão com o contexto certo.

Quando usar

  • ✓Quando você começar um projeto novo e quiser que um arquivo CLAUDE.md seja escrito.
  • ✓Quando um CLAUDE.md existente estiver longo ou confuso e precisar de melhorias.
  • ✓Quando quiser uma verificação de qualidade do CLAUDE.md de um projeto antes de compartilhá-lo com a equipe.

Link da skill

https://github.com/luongnv89/claude-howto/blob/main/03-skills/claude-md/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/luongnv89/claude-howto/blob/main/03-skills/claude-md/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Pode auditar meu CLAUDE.md e sugerir o que cortar para que ele fique curto e útil?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente analisa o projeto, verifica os arquivos CLAUDE.md existentes e depois cria, atualiza ou audita os arquivos segundo um conjunto de princípios. Ele mantém apenas as informações que valem para toda sessão.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty). User may specify:

  • create - Create new CLAUDE.md from scratch
  • update - Improve existing CLAUDE.md
  • audit - Analyze and report on current CLAUDE.md quality
  • A specific path to create/update (e.g., src/api/CLAUDE.md for directory-specific instructions)

Core Principles

LLMs are stateless: CLAUDE.md is the main project file loaded into every conversation (alongside auto memory and unscoped rules). It serves as the primary onboarding document for AI agents into your codebase.

The Golden Rules

  1. Less is More: Frontier LLMs can follow ~150-200 instructions. Claude Code's system prompt already uses ~50. Keep your CLAUDE.md focused and concise.

  2. Universal Applicability: Only include information relevant to EVERY session. Task-specific instructions belong in separate files.

  3. Don't Use Claude as a Linter: Style guidelines bloat context and degrade instruction-following. Use deterministic tools (prettier, eslint, etc.) instead.

  4. Never Auto-Generate: CLAUDE.md is the highest leverage point of the AI harness. Craft it manually with careful consideration.

Execution Flow

1. Project Analysis

First, analyze the current project state:

  1. Check for existing CLAUDE.md files:

    • Root level: ./CLAUDE.md or .claude/CLAUDE.md
    • Directory-specific: **/CLAUDE.md
    • Global user config: ~/.claude/CLAUDE.md
  2. Identify the project structure:

    • Technology stack (languages, frameworks)
    • Project type (monorepo, single app, library)
    • Development tools (package manager, build system, test runner)
  3. Review existing documentation:

    • README.md
    • CONTRIBUTING.md
    • package.json, pyproject.toml, Cargo.toml, etc.

2. Content Strategy (WHAT, WHY, HOW)

Structure CLAUDE.md around three dimensions:

WHAT - Technology & Structure

  • Technology stack overview
  • Project organization (especially important for monorepos)
  • Key directories and their purposes

WHY - Purpose & Context

  • What the project does
  • Why certain architectural decisions were made
  • What each major component is responsible for

HOW - Workflow & Conventions

  • Development workflow (bun vs node, pip vs uv, etc.)
  • Testing procedures and commands
  • Verification and build methods
  • Critical "gotchas" or non-obvious requirements

3. Progressive Disclosure Strategy

For larger projects, recommend creating an agent_docs/ folder:

agent_docs/
  |- building_the_project.md
  |- running_tests.md
  |- code_conventions.md
  |- architecture_decisions.md

In CLAUDE.md, reference these files with instructions like:

For detailed build instructions, refer to `agent_docs/building_the_project.md`

Important: Use file:line references instead of code snippets to avoid outdated context.

4. Quality Constraints

When creating or updating CLAUDE.md:

  1. Target Length: Keep it under 200 lines; shorter is better
  2. No Style Rules: Remove any linting/formatting instructions
  3. No Task-Specific Instructions: Move to separate files
  4. No Code Snippets: Use file references instead
  5. No Redundant Information: Don't repeat what's in package.json or README

5. Essential Sections

A well-structured CLAUDE.md should include:

# Project Name

Brief one-line description.

## Tech Stack
- Primary language and version
- Key frameworks/libraries
- Database/storage (if any)

## Project Structure
[Only for monorepos or complex structures]
- `apps/` - Application entry points
- `packages/` - Shared libraries

## Development Commands
- Install: `command`
- Test: `command`
- Build: `command`

## Critical Conventions
[Only non-obvious, high-impact conventions]
- Convention 1 with brief explanation
- Convention 2 with brief explanation

## Known Issues / Gotchas
[Things that consistently trip up developers]
- Issue 1
- Issue 2

6. Anti-Patterns to Avoid

DO NOT include:

  • Code style guidelines (use linters)
  • Documentation on how to use Claude
  • Long explanations of obvious patterns
  • Copy-pasted code examples
  • Generic best practices ("write clean code")
  • Instructions for specific tasks
  • Auto-generated content
  • Extensive TODO lists

7. Validation Checklist

Before finalizing, verify:

  • Kept under 200 lines; shorter is better
  • Every line applies to ALL sessions
  • No style/formatting rules
  • No code snipp
Perguntas frequentes

Por que manter o arquivo curto?

A skill diz que modelos de fronteira conseguem seguir apenas cerca de 150 a 200 instruções, e o prompt de sistema já usa parte desse limite.

O agente deve escrevê-lo automaticamente?

Não. A skill diz para não gerá-lo automaticamente, e sim redigi-lo à mão, com cuidado.

Ele consegue trabalhar em um arquivo de uma subpasta?

Sim. Você pode indicar um caminho, como um subdiretório, para instruções que se aplicam só àquela pasta.

Detalhes

Descrição original do autor

Create or update CLAUDE.md files following best practices for optimal AI agent onboarding

repo: luongnv89/claude-howto

Popularidade

Estrelas no GitHub
46 mil
Posição no ranking
#6321
Licença
MIT
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas