.config/claude/skills/optimize-instructions/SKILL.md
This skill should be used when the user asks to "optimize CLAUDE.md", "review CLAUDE.md", "clean up instructions", "CLAUDE.md最適化", "指示ファイルの見直し", "CLAUDE.mdの無駄を削除".
npx skillsauth add kokatsu/dotfiles optimize-instructionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review CLAUDE.md for redundant or unnecessary content and suggest improvements. Based on the research finding that instruction files should only contain information agents cannot discover on their own.
CLAUDE.md is injected as a User Message (not System Prompt) at session start. As conversation progresses, its influence fades because it becomes an old message buried under newer ones. Therefore, CLAUDE.md should act as a Session Start Hook — containing only information needed at session initialization, not persistent rules.
Instruction files hurt performance when they contain:
CLAUDE.md should contain:
.claude/rules/ should contain:
Rules in .claude/rules/ are injected as conditional rules when relevant files are first touched, so they arrive as newer messages closer to the actual work.
Find all instruction files in the project:
CLAUDE.md (project root and subdirectories).claude/rules/*.md (rule files)AGENTS.md, .cursorrules etc. (if present)Read the full content of every instruction file found. Also check for cross-file redundancy (e.g., CLAUDE.md and rules covering the same topic).
Use the Explore agent to check what information is already discoverable:
For every section or bullet point in CLAUDE.md and each rule file, classify it:
| Category | Action | Example |
|----------|--------|---------|
| Discoverable | Remove | "Directory structure: src/ contains..." |
| Duplicated | Remove | Content that mirrors README |
| General knowledge | Remove | "Flakes provide reproducibility" |
| Internal redundancy | Merge or remove | Same info in two sections |
| Project overview | Keep in CLAUDE.md | "ECサイトのバックエンドAPI" |
| Module guide | Keep in CLAUDE.md | Module descriptions not obvious from names |
| Session start procedure | Keep in CLAUDE.md | "Create worktree with feat/{issue}-{name}" |
| Coding rule | Move to .claude/rules/ | "Use interface over type in TypeScript" |
| Project convention | Move to .claude/rules/ | Commit message format |
| Non-obvious command | Move to .claude/rules/ | Specific lint/format commands |
| Critical warning | Move to .claude/rules/ | "Secretlint prevents committing secrets" |
| Workflow rule | Move to .claude/rules/ | "Never edit ~/.config/ directly" |
Report findings organized as:
## 分析結果
### 削除候補 (Items to remove)
- **項目名** — 理由 (discoverable / duplicated / general knowledge / redundancy)
### CLAUDE.mdに保持 (Keep in CLAUDE.md)
- **項目名** — 理由 (project overview / module guide / session start procedure)
### `.claude/rules/` に移動 (Move to rules)
- **項目名** — 理由 (coding rule / convention / warning / workflow rule)
- Suggest appropriate `paths` frontmatter if the rule applies to specific file patterns
### 改善提案 (Improvements)
- Suggestions for restructuring, merging, or rewording
Use AskUserQuestion to confirm which items to remove before making changes.
Edit CLAUDE.md and/or rule files based on confirmed actions:
.claude/rules/*.md file with paths frontmatter if applicabledevelopment
Apply UX psychology principles when building UI components, forms, pricing pages, onboarding flows, checkout experiences, modals, or any user-facing interface. Use when designing CTAs, implementing progress indicators, creating loading states, improving user engagement, or reviewing UI for psychological effectiveness.
development
Guide TDD workflow with Red-Green-Refactor cycle. Use when the user asks to "write tests first", "TDD", "test-driven", "テスト駆動", "TDDで実装", "テストファースト".
development
Deep-read a codebase area and write findings to research.md. Use for thorough investigation before planning.
development
Create a detailed implementation plan in plan.md. Never implements code. Use after /research or when planning a feature.