Extract project-specific coding rules and domain knowledge from existing codebase, generating markdown documentation for AI agents.
View on GitHubFebruary 2, 2026
Select agents to install to:
npx add-skill https://github.com/hiroro-work/claude-plugins/blob/main/skills/extract-rules/SKILL.md -a claude-code --skill extract-rulesInstallation paths:
.claude/skills/extract-rules/# Extract Rules Analyzes existing codebase to extract project-specific coding rules and domain knowledge, generating structured markdown documentation for AI agents. ## Usage ```text /extract-rules # Extract rules from codebase (initial) /extract-rules --update # Re-scan and add new patterns (preserve existing) /extract-rules --force # Overwrite all rule files (discard existing) /extract-rules --from-conversation # Extract rules from conversation and append ``` ## Configuration Users can configure extraction settings in `extract-rules.local.md`: - Project-level: `.claude/extract-rules.local.md` (takes precedence) - User-level: `~/.claude/extract-rules.local.md` **File format:** YAML frontmatter only (no markdown body). The file uses `.md` extension for consistency with other Claude Code config files, but contains only YAML between `---` delimiters. ```yaml --- # Target directories for analysis # Default: "." (all directories not excluded by .gitignore) # Set specific directories to limit scope target_dirs: - . # Directories to exclude (in addition to .gitignore) # These are applied even if not in .gitignore exclude_dirs: - .git - .claude # File patterns to exclude (in addition to .gitignore) exclude_patterns: - "*.generated.ts" - "*.d.ts" - "*.min.js" # Note: .gitignore patterns are automatically applied # Common exclusions like node_modules/, dist/, build/ are typically in .gitignore # Output directory output_dir: .claude/rules # Output language for reports language: ja --- ``` ## Output Structure ```text .claude/rules/ ├── languages/ │ ├── typescript.md │ └── ... # python.md, go.md, ruby.md, etc. ├── frameworks/ │ ├── react.md │ └── ... # nextjs.md, firebase.md, rails.md, etc. └── project.md # Domain, architecture (not portable) ``` ## Processing Flow ### Mode Detection Check arguments to determine mode: - No arguments or `--force` → **Full Ext