Overview
Magic commands are AI-powered automation features that streamline common development workflows. Each command uses customizable prompts and can be configured with specific models, backends, and providers.Available Commands
Jean includes 14 magic commands, each with a dedicated prompt template:GitHub Investigation
Investigate Issue
Trigger: Click “Investigate” on GitHub issue What it does:- Creates worktree for the issue
- Loads issue description and comments
- Analyzes problem and proposes solution
- Identifies root cause
- Checks for regressions
- Suggests implementation approach
Investigate PR
Trigger: Click “Investigate” on pull request What it does:- Checks out PR branch as worktree
- Loads PR description, reviews, and comments
- Analyzes changes and approach
- Security review - checks for malicious code
- Identifies action items from reviews
- Proposes next steps
- Malicious or obfuscated code
- Suspicious dependency changes
- Hardcoded secrets or credentials
- Backdoors or unauthorized access
- Injection vulnerabilities
- Weakened authentication/permissions
Investigate Workflow Run
Trigger: Click “Investigate” on failed CI workflow What it does:- Fetches workflow run logs via
gh run view {runId} --log-failed - Analyzes error output
- Explores relevant code
- Determines if code issue, config issue, or flaky test
- Proposes fix with specific changes
Security Analysis
Investigate Security Alert
Trigger: View Dependabot vulnerability alerts What it does:- Reads vulnerability details (CVE, GHSA, severity)
- Identifies affected dependency and version range
- Searches codebase for package usage
- Assesses actual impact (is vulnerable code used?)
- Evaluates remediation options
- Proposes fix with compatibility assessment
- Is the vulnerability actually exploitable?
- Is the vulnerable function/API used?
- Breaking changes in patched version?
Investigate Advisory
Trigger: View repository security advisories What it does:- Reads full vulnerability details (GHSA, CVE, CWE)
- Understands vulnerability type and preconditions
- Locates vulnerable code in repository
- Develops comprehensive fix
- Verifies completeness across codebase
- Documents vulnerability and remediation
- Think like an attacker
- Check for bypass attempts
- Look for same pattern elsewhere
Investigate Linear Issue
Trigger: Click “Investigate” on Linear issue What it does: Similar to GitHub issue investigation but for Linear:- Loads Linear issue context (embedded in prompt)
- Analyzes problem
- Explores codebase
- Identifies root cause
- Proposes solution
Git Operations
Commit Message
Trigger: Toolbar → Commit button What it does:- Runs
git status --porcelain - Gets staged diff
- Reads recent commits for style
- Generates concise commit message
- Creates commit with AI message
- Optionally pushes to remote
PR Content
Trigger: Toolbar → Open PR button What it does:- Collects branch info and commit history
- Gets diff between branches
- Generates PR title and description
- Creates PR on GitHub via
gh pr create - Links PR to worktree
Code Review
Trigger: Toolbar → Review button What it does:- Collects branch info and commits
- Gets diff and uncommitted changes
- Performs comprehensive code review
- Returns structured findings
- Provides approval status
- Security & supply-chain risks
- Performance issues
- Code quality and maintainability
- Potential bugs
- Best practices violations
- Findings displayed in ReviewResultsPanel
- Track which findings have been fixed
- Persisted in UI state
Resolve Conflicts
Trigger: Automatic when merge/rebase conflicts detected What it does:- Appends conflict resolution prompt to message
- Shows conflict diff
- AI explains what’s conflicting
- Guides through resolving each conflict
- Stages files with
git add - Continues operation until complete
Release Notes
Trigger: Manual invocation What it does:- Lists commits since last release
- Fetches previous release info via
gh release list - Generates structured release notes
- Groups into categories (Features, Fixes, etc.)
- Filters out merge commits and trivial changes
Session Management
Session Naming
Trigger: Automatic on first message (if enabled) What it does:- Analyzes first user message
- Generates 4-5 word session name
- Updates session title
- Uses sentence case
- Avoids generic names
- Maximum 4-5 words
- Sentence case only
- Descriptive and concise
- No special characters
- No commit-style prefixes (Add, Fix, Update)
Session Recap
Trigger: Returning to unfocused session (if enabled) What it does:- Summarizes entire conversation
- Extracts main goal and status
- Highlights last completed action
- Shows in popup before resuming
Context Summary
Trigger: Toolbar → Save Context What it does:- Summarizes entire conversation
- Extracts key decisions and rationale
- Documents trade-offs considered
- Lists problems solved
- Notes current state and next steps
- Saves as markdown file
System Prompts
Global System Prompt
Application: Appended to every chat session Default content:- Plan mode guidelines
- Subagent strategy
- Self-improvement loop (.ai/lessons.md)
- Verification requirements
- Code elegance standards
- Autonomous bug fixing
Parallel Execution
Application: Encourages parallel sub-agent usage What it does:- Suggests structuring plans for parallelism
- Recommends launching Task agents in single message
- Groups independent work items
How to Use
Customizing Prompts
Access magic prompts:- Settings (Cmd/Ctrl + ,)
- AI section
- Magic Prompts tab
- Select prompt to customize
- Click “Edit” next to prompt
- Modify template in text editor
- Use placeholders:
{variable} - Save changes
- Set to
nullto use app default
{issueRefs},{prRefs}: Reference numbers{workflowName},{branch}: Context info{commits},{diff}: Git data{message}: User input
Configuring Models
Per-prompt model selection:- Settings → AI → Magic Prompts
- Find prompt in list
- Click model dropdown
- Choose from available models
- Presets: Claude, Codex, OpenCode
Backend & Provider Overrides
Per-prompt backend:- Settings → AI → Magic Prompts
- Advanced options
- Select backend for each prompt
null= use session backend
- Same location as backend
- Choose provider profile
null= use session provider
- Route expensive operations to specific backend
- Use regional models for certain tasks
- Cost optimization
- Performance tuning
Using Magic Commands
Issue investigation:- Open project
- Click GitHub icon in sidebar
- Browse issues
- Click “Investigate” button
- Worktree creates and AI starts analysis
- Find PR in GitHub panel
- Click “Investigate”
- Worktree checks out PR branch
- AI analyzes changes and reviews
- Stage changes with git
- Click Commit button in toolbar
- AI generates message
- Review and confirm
- Optionally push
- Complete feature work
- Click Review button
- AI analyzes all changes
- Findings shown in panel
- Fix issues and re-review
Configuration Options
Magic Prompt Settings
All prompts stored inAppPreferences.magic_prompts:
Model Overrides
Backend Overrides
Provider Overrides
Best Practices
Prompt Design
Structure prompts clearly:{variable}: Required data- Document what each placeholder contains
- Test with sample data
- One clear objective
- Specific output format
- Actionable instructions
Model Selection
By task complexity:- Haiku: Fast and cheap, good enough for most
- Sonnet: Balanced, best default
- Opus: Expensive, use for critical tasks
Security Best Practices
For PR investigation:- Always enable security checks
- Review AI findings carefully
- Don’t auto-merge based on AI approval
- Use as one input in review process
- Verify AI’s impact assessment
- Check if vulnerability actually applies
- Test patches before deploying
- Document remediation decisions
Performance Optimization
Choose appropriate models:- Don’t use Opus for commit messages
- Haiku is often sufficient
- Measure response times
- Adjust based on results
- Use fastest backend for frequent operations
- Route expensive tasks to powerful models
- Balance cost and performance