phx:init
Initialize Elixir/Phoenix plugin in a project. Installs auto-activation rules into CLAUDE.md for complexity detection, interview mode, Iron Laws enforcement, and reference auto-loading.
Best use case
phx:init is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Initialize Elixir/Phoenix plugin in a project. Installs auto-activation rules into CLAUDE.md for complexity detection, interview mode, Iron Laws enforcement, and reference auto-loading.
Teams using phx:init should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/phx-init/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How phx:init Compares
| Feature / Agent | phx:init | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Initialize Elixir/Phoenix plugin in a project. Installs auto-activation rules into CLAUDE.md for complexity detection, interview mode, Iron Laws enforcement, and reference auto-loading.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Plugin Initialization
Install the Elixir/Phoenix plugin's behavioral instructions into the project's CLAUDE.md.
## Usage
```
/phx:init # First-time installation
/phx:init --update # Update existing installation with latest rules
```
## Workflow
### Step 1: Check Existing CLAUDE.md
```bash
# Check if CLAUDE.md exists
ls -la CLAUDE.md 2>/dev/null
# Check for existing plugin installation
grep -q "ELIXIR-PHOENIX-PLUGIN:START" CLAUDE.md 2>/dev/null
```
### Step 2: Detect Project Stack
Scan the project to customize the injected instructions:
```bash
# Phoenix version
grep -oP 'phoenix.*"~> \K[0-9.]+' mix.exs 2>/dev/null || echo "unknown"
# Ecto version
grep -oP 'ecto.*"~> \K[0-9.]+' mix.exs 2>/dev/null || echo "unknown"
# Oban detection
grep -q '"oban"' mix.exs && echo "oban"
grep -q '"oban_pro"' mix.exs && echo "oban_pro"
# Framework detection
grep -q '"ash"' mix.exs && echo "ash"
grep -q '"surface"' mix.exs && echo "surface"
# Tidewave detection
grep -q '"tidewave"' mix.exs && echo "tidewave"
# Project size
find lib -name "*.ex" 2>/dev/null | wc -l
```
### Step 3: Handle Installation Modes
**Mode A: Fresh Install** (no CLAUDE.md or no markers)
1. Create/append to CLAUDE.md
2. Insert full behavioral instructions between markers
3. Include only relevant sections based on detected stack
**Mode B: Update** (`--update` flag or markers exist)
1. Find content between `<!-- ELIXIR-PHOENIX-PLUGIN:START -->` and `<!-- ELIXIR-PHOENIX-PLUGIN:END -->`
2. Replace with latest behavioral instructions
3. Preserve everything outside the markers
### Step 4: Generate Content
Write the following structure to CLAUDE.md:
```markdown
<!-- ELIXIR-PHOENIX-PLUGIN:START -->
<!-- Last updated: {date} | Plugin version: 1.0 | Stack: Phoenix {version}, Ecto {version}, {optional: Oban, Tidewave} -->
# Elixir/Phoenix Plugin - Auto-Activation Rules
{Include all sections from the Content Template below, filtered by detected stack}
<!-- ELIXIR-PHOENIX-PLUGIN:END -->
```
### Step 5: Output Summary
```
✅ Elixir/Phoenix plugin initialized
Detected stack:
- Phoenix {version}
- Ecto {version}
- {Oban standard | Oban Pro | not detected}
- {Tidewave ✓ | Tidewave not detected}
- {Ash Framework detected - Ecto patterns disabled | not detected}
Added to CLAUDE.md:
- Auto-activation rules (complexity detection, interview mode)
- Agent trigger patterns ({n} agents available)
- Reference auto-loading ({n} reference docs)
- Iron Laws enforcement ({n} laws)
- Verification rules
Run /phx:init --update after plugin updates.
Run /phx:audit for a full project health check.
```
## Content Template
The exact content to inject is in `references/injectable-template.md`.
**Key structure:**
1. **7-Step Mandatory Procedure** — Claude Code MUST execute before every response
2. **Iron Laws** — STOP behavior on violations
3. **Conditional Sections** — Include based on detected stack:
- `{OBAN_SECTION}` — If Oban detected (not Pro)
- `{OBAN_PRO_SECTION}` — If Oban Pro detected
- `{ASH_SECTION}` — If Ash Framework detected
- `{TIDEWAVE_SECTION}` — If Tidewave detected
4. **Verification** — Mandatory after code changes
5. **Quick Reference** — Skill routing table
**Placeholder substitution:**
| Placeholder | Source |
|-------------|--------|
| `{DATE}` | Current date |
| `{PHOENIX_VERSION}` | From mix.exs |
| `{ECTO_VERSION}` | From mix.exs |
| `{OPTIONAL_STACK}` | Detected optional deps |
See `references/injectable-template.md` for full template with all placeholders and conditional sections.
## Validation
After running `/phx:init`:
1. Check CLAUDE.md contains markers
2. Verify detected stack matches actual project
3. New session should:
- Auto-detect complexity when given tasks
- Stop on Iron Law violations
- Offer relevant workflows based on task
## Error Handling
| Scenario | Action |
|----------|--------|
| CLAUDE.md read-only | Error: "Cannot modify CLAUDE.md - check permissions" |
| Markers corrupted | Warn, offer to remove and reinstall |
| Unknown Phoenix version | Use conservative defaults (all features enabled) |
| Not an Elixir project | Error: "No mix.exs found - is this an Elixir project?" |
## Relationship to Other Commands
| Command | When to Use |
|---------|-------------|
| `/phx:init` | First time, or after plugin updates |
| `/phx:audit` | Periodic project health check |
| `/phx:verify` | After code changes |Related Skills
repo-init
Initialize a new repository with standard scaffolding - git, gitignore, CLAUDE.md, justfile, mise, and beads. Use when starting a new project or setting up an existing repo for Claude Code workflows.
openspec-initial
Run `openspec init` to initialize OpenSpec in a project directory, creating the openspec/ folder structure and configuring AI tool integrations. Use when the user says "initialize OpenSpec", "openspec init", or "set up OpenSpec in this project".
neotex-init
Use when user runs /neotex-init to deeply scan a codebase and auto-generate organizational knowledge for neotex.
initialize-repo
Analyze the codebase and generate an INIT.md onboarding file for AI coding assistants. Also creates or updates AGENTS.md. Use when the user wants to initialize a repo for AI-assisted development, generate INIT.md, create CLAUDE.md, or bootstrap AI context files.
git-initial-setup
Default git setup to protect main after git init/clone. Use when standardizing repo bootstrap and absorbing environment differences.
Generate multilingual sentences with contextual definitions
Generates a set of sentences using a specific target word with varying meanings, translates them into a target language, and provides the contextual meaning of the word on the following line.
definition.tech_spike
Scope and prioritize technical spikes that de-risk architecture or implementation questions.
chrome-extension-init-skill
Initialize a Chrome/Chromium browser extension project from an empty folder by having the user choose a scaffolding toolchain (Plasmo, WXT, or Vite + CRXJS), then running the official interactive CLI (e.g., `npm create plasmo`, `npx wxt@latest init`, `npm create crxjs@latest`) to scaffold the project, and finishing with git init + first commit. Use when a user asks to start or bootstrap a browser extension from scratch.
affinity-automation
Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.
infinite-gratitude
Multi-agent research skill for parallel research execution (10 agents, battle-tested with real case studies).
Requirements Definition
This skill should be used when the user asks to "define requirements", "create specification", "clarify requirements", "write requirements document", or mentions requirement analysis. Provides comprehensive requirements definition methodology.
strategic-initiative-tracking
Track and report on strategic initiative progress using milestone management, KPI monitoring, and portfolio-level health assessments. Use when monitoring strategic plan execution, preparing initiative status reports for leadership, identifying at-risk initiatives, or managing strategic portfolio prioritization.