optimus-prime
npx machina-cli add skill Vibe-Builders/claude-prime/optimus-prime --openclawUltrathink.
Role
You are a project configurator. Analyze the codebase and configure Claude to work effectively with it.
Context Assessment
Before starting, check:
.claude/rules/has path-scoped files besides_apply-all.md? → Ask if user wants to reconfigure (_apply-all.mdis a boilerplate default and should not be touched).claude/project/exists? → Ask if user wants to reconfigure./CLAUDE.mdexists? → Ask if user wants to regenerate
Wait for user confirmation before proceeding.
Quick Start
- Analyze project codebase (patterns, stack, conventions)
- Copy matching starter skills from
.claude/starter-skills/to.claude/skills/, adapt generic parts - Create skills for uncovered stacks via
/touch-skill - Create
.claude/project/with on-demand references - Identify
.claude/rules/path-scoped guardrails (if any — rules are optional) - Generate
./CLAUDE.mdentry point - Delete
.claude/starter-skills/(starters have been processed)
Core Philosophy
- Three-layer system — Skills (framework knowledge) + Rules (guardrails, auto-attach) + Project references (on-demand context)
- Context-aware placement — Auto-attach only what prevents wrong code; everything else is on-demand
- LLM-driven analysis — Claude explores codebase, not scripts
- Leverage existing tools — Use
/touch-skill+docs-seekerfor skill generation
Decision Matrix
| Detected | Where | Rule Test |
|---|---|---|
| General framework/library | Skill via /touch-skill | — |
| Project-specific constraint (wrong code even with skill) | .claude/rules/ with paths: | "With the relevant skill activated, will code still be wrong without this?" → Yes |
| Architecture, structure, domain context | .claude/project/ | — |
Rules are optional. "Important" ≠ "must auto-attach." Only create rules for things skills can't cover.
Red flags that something is NOT a rule:
- Applies to all files (
**/*.swift,**/*.ts) → probably general knowledge, belongs in skill - A skill already teaches this pattern → redundant, don't duplicate
- It's a language/framework feature, not a project decision → skill
Output Structure
./CLAUDE.md # Entry point
.claude/rules/
└── <name>.md # Path-scoped guardrails (auto-attached)
.claude/project/
└── *.md # On-demand references (architecture, structure)
Constraints
- Rule files must be concise — guardrails only, not documentation
- Rules auto-attach: do NOT reference them in CLAUDE.md
- Project references go to
.claude/project/and ARE referenced in CLAUDE.md - Show what will be created before creating
- Ask for confirmation at gates
References
| Reference | Content |
|---|---|
| analysis-checklist.md | What to look for in projects |
| claude-md-template.md | CLAUDE.md format guide |
Workflows
- Full Setup — Complete project setup flow (default workflow)
Templates
templates/CLAUDE.template.md— CLAUDE.md starter
Additional Context (Optional)
<user-context>$ARGUMENTS</user-context>
Source
git clone https://github.com/Vibe-Builders/claude-prime/blob/main/.claude/skills/optimus-prime/SKILL.mdView on GitHub Overview
Optimus-prime analyzes the codebase to tailor Claude for a given project. It detects conventions and stack, decides which skills to create, and generates CLAUDE.md entry points with project-specific rules.
How This Skill Works
The role acts as a project configurator: it examines the repository for patterns, stack, and conventions, checks for existing .claude/rules, .claude/project, and CLAUDE.md, and then copies matching starter skills from .claude/starter-skills/. It creates or updates project-specific rules and CLAUDE.md, then prompts for confirmation before applying any changes.
When to Use It
- Starting a new project and configuring Claude for that repository
- Introducing a new tech stack or framework into an existing project
- Reconfiguring Claude when project conventions or architecture change
- Regenerating CLAUDE.md entry points after major refactors
- Preparing to deploy or hand over a repository with project-specific guardrails
Quick Start
- Step 1: Analyze the project codebase (patterns, stack, and conventions)
- Step 2: Copy matching starter skills from .claude/starter-skills/ to .claude/skills/ and adapt
- Step 3: Generate CLAUDE.md entry point, create .claude/project/ if needed, and review before applying
Best Practices
- Ask for user confirmation at each gate before making changes
- Do not touch _apply-all.md inside .claude/rules (keep boilerplate safe)
- Reuse and adapt matching starter-skills from .claude/starter-skills/ rather than building from scratch
- Create rules only for gaps that skills cannot cover; avoid over-attachment
- Document exactly what will be created and shown to the user before proceeding
Example Use Cases
- Configure Claude for a React + Node API project to auto-attach relevant rules and generate CLAUDE.md
- Set up Claude for a Django + PostgreSQL backend with REST endpoints and project-specific guardrails
- Add a new microservice in a polyrepo and generate per-service CLAUDE.md and rules
- Migrate an in-house monorepo to per-project context with .claude/project references
- Regenerate CLAUDE.md after major refactor to reflect new conventions and stacks