APEX - Autonomous Pattern-Enhanced eXecution. AI-powered development workflow with APEX Intelligence for pattern recognition and task execution
npm install @benredmond/apex> APEX gives AI assistants memory, learning, and pattern recognition for 40-55% faster development


``bash`See APEX in action - no installation required!
npx @benredmond/apex start
Your AI coding assistant is powerful, but it:
- š Repeats the same mistakes
- 𤷠Doesn't learn from your codebase
- š Lacks memory between sessions
- šÆ Misses patterns that could save hours
APEX transforms your AI assistant into an intelligent development partner that learns and improves:
``
Without APEX: AI suggests generic solution ā Often wrong ā You fix it ā AI forgets
With APEX: AI recalls what worked ā Applies proven patterns ā Prevents past failures ā Gets smarter
1. Zero-Runtime Intelligence - No background processes, no performance impact
2. Pattern Evolution - Discovers, validates, and promotes patterns automatically
3. Failure Prevention - Learns from mistakes to prevent repetition
> "After 50 tasks, APEX prevented every single MongoDB async/await error that used to waste 30 minutes each time. The pattern system is like having a senior developer's knowledge built into my AI." - APEX User
Choose your preferred way to start:
bash
Run this in any project - installs nothing globally
npx @benredmond/apex startThat's it! APEX is now active in your AI assistant
`$3
`bash
Install once, use everywhere
npm install -g @benredmond/apex
apex start
`$3
`bash
apex start # Quick setup (simplified from apex init)
apex patterns list # View available patterns
apex patterns search # Find patterns by text
apex tasks list # View tasks
apex tasks stats # Task metrics
apex doctor # System health check
apex mcp install # Setup MCP integration
`Your First APEX Workflow
Let's fix a bug using APEX intelligence - this takes less than 5 minutes:
`bash
1. In your project with a failing test
npx @benredmond/apex start2. Open your AI assistant (Claude Code, Cursor, etc.)
3. Create a task for the bug
/create_task "Fix authentication test timeout error"4. Let APEX guide the fix
/task T001
`$3
`
š§ ANALYZING... Complexity: 3/10
š LOADING... Found 3 similar past fixes
ā” PATTERN... Applying [FIX:TEST:ASYNC_TIMEOUT] (ā
ā
ā
ā
ā
98% success)
š”ļø PREVENTING... Warning: This error often caused by missing await
ā
EXECUTING... Test fixed in one try (vs 3 tries typically)
š LEARNING... Pattern trust score increased
`Core Concepts
$3
Think of APEX as your AI's long-term memory and pattern recognition system:
`
Your Code ā APEX Learns ā AI Remembers ā Better Suggestions ā Less Debugging
`Key Components:
- Pattern Recognition: Tracks what works with trust scores (ā
ā
ā
ā
ā
)
- Failure Database: Never repeat the same mistake
- Smart Context: Loads only relevant patterns per task
- Complexity Routing: Simple tasks stay fast, complex tasks get deep analysis
$3
Watch patterns evolve from discovery to trusted solution:
`
NEW DISCOVERY TESTING VALIDATED TRUSTED
ā ā ā ā
[untracked] āāā [ā
ā
ā
āā 1 use] āāā [ā
ā
ā
ā
ā 3 uses] āāā [ā
ā
ā
ā
ā
47 uses]
CONVENTIONS.pending.md CONVENTIONS.md
`Real example:
`javascript
[PAT:AUTH:JWT] ā
ā
ā
ā
ā
(47 uses, 98% success)
// Secure JWT implementation - discovered in T012, now prevents auth vulnerabilities
const token = jwt.sign(payload, process.env.JWT_SECRET, { expiresIn: '24h' });
`$3
Every task follows a proven methodology:
`
ARCHITECT ā BUILDER ā VALIDATOR ā REVIEWER ā DOCUMENTER
ā ā ā ā ā
Research Implement Test Review Learn & Document
`This isn't just process - it's intelligence-driven:
- ARCHITECT: Loads similar task solutions
- BUILDER: Applies proven patterns
- VALIDATOR: Runs learned test strategies
- REVIEWER: AI + Gemini review (complex tasks)
- DOCUMENTER: Captures new patterns
$3
Organize work the way you think:
`
š Milestone: "User Authentication System"
āāā š
Sprint: "Core Auth Features"
āāā š Task: "Design auth schema" [2h]
āāā š Task: "Build login API" [3h]
āāā š Task: "Add JWT middleware" [2h]
`Workflows & Examples
$3
Scenario: Your test suite has a flaky test that fails intermittently.
`bash
Create the bug fix task
/create_task "Fix flaky user creation test"
Output: Created task T001
Execute with APEX intelligence
/task T001
`APEX in Action:
`
š§ ANALYZING...
- Complexity: 3/10 (single test file)
- Similar issues: Found 5 flaky test fixes
- Pattern match: [FIX:TEST:ASYNC_RACE] likely appliesš INTELLIGENCE LOADED:
- TX089: Fixed similar race condition (2h ā 15min with pattern)
- Pattern: Always await user.save() before assertions
- Warning: db.clean() must complete before test
šØ IMPLEMENTING...
Applied [FIX:TEST:ASYNC_RACE] pattern:
- Added await before user.save()
- Wrapped in act() for React updates
- Added afterEach cleanup
ā
VALIDATING...
- Ran test 50x: 0 failures (was failing 30% before)
- All related tests still passing
š DOCUMENTING...
- Pattern success rate: 94% ā 95%
- Saved to learning database
- Estimated time saved: 1.5 hours
`$3
Scenario: Add email notifications to your application.
`bash
Create a sprint for the feature
/sprint M01 "Email Integration"
Output: Created sprint S03
Break down into tasks
/create_task "Design email template system" --sprint S03
/create_task "Integrate SendGrid API" --sprint S03
/create_task "Add email preferences to user model" --sprint S03Execute first task
/task T001
`APEX Intelligence Throughout:
`
ARCHITECT PHASE:
š§ Loading email patterns from 12 previous implementations
š Complexity: 6/10 - Will engage Gemini for architecture review
šÆ Suggested approach: Template-based with provider abstractionBUILDER PHASE:
ā” Auto-applied patterns:
- [PAT:EMAIL:TEMPLATE_ENGINE] - Handlebars with layouts
- [PAT:API:RETRY_LOGIC] - Exponential backoff for sends
- [PAT:CONFIG:ENV_VALIDATION] - Ensure API keys present
VALIDATOR PHASE:
ā
Tests generated using [PAT:TEST:EMAIL_MOCK] pattern
š”ļø Prevented common issue: Emails sending in test environment
RESULT: Feature complete in 2.5h (vs 5h estimated)
`$3
Scenario: Modernize callback-based code to async/await.
`bash
Create refactoring task
/create_task "Refactor payment.js from callbacks to async/await"Execute with intelligence
/task T001
`Pattern Discovery in Action:
`
š§ ANALYZING payment.js...
- 147 callback chains detected
- Error handling inconsistent
- Similar refactor: TX142 (saved 3 hours)š APPLYING PATTERNS:
1. [PAT:REFACTOR:CALLBACK_TO_ASYNC] ā
ā
ā
ā
ā
- Preserve error handling semantics
- Maintain callback API for backwards compatibility
2. [PAT:REFACTOR:PROGRESSIVE] ā
ā
ā
ā
ā
- Refactor in testable chunks
- Keep tests green throughout
š DISCOVERING NEW PATTERN:
Found repeated pattern not in database:
- Payment providers need .catch() ā try/catch wrapper
- Adding to CONVENTIONS.pending.md for validation
ā
RESULT:
- 147 callbacks ā clean async/await
- All tests passing
- 0 production issues after deploy
- New pattern discovered for future use
`Command Reference
APEX commands are organized by development phase:
$3
`bash
/milestone "Project Goal" # Create high-level milestone
/sprint M01 "Sprint Name" # Create sprint in milestone
/create_task "Task" --sprint S01 # Create task in sprint
/plan # View current plan
`$3
`bash
/task T001 # Execute task with full intelligence
/task # Continue current task
/yolo # Autonomous multi-task mode
`$3
`bash
/review # AI code review with learning
/test # Run tests with pattern analysis
/debug "error message" # Debug with failure database
/design "component" # Architecture assistance
`$3
`bash
/commit # Smart commit with context
/reflect # Extract and save learnings
`$3
`bash
apex start # Initialize APEX patterns database (in terminal)
/prime # Load APEX context into AI
/verify # Check APEX health
`Advanced Usage
$3
View and manage your pattern library:
`bash
In terminal
npx @benredmond/apex patterns # List all active patterns
npx @benredmond/apex patterns pending # Show patterns being tested
npx @benredmond/apex patterns stats # Pattern usage statistics
`Share patterns with your team:
`bash
Patterns are stored in version control
git add .apex/CONVENTIONS.md
git commit -m "Share authentication patterns"
`$3
For complex tasks (complexity ā„7), APEX automatically engages Gemini for deeper analysis:
`json
// .apex/config.json
{
"apex": {
"geminiApiKey": "your-api-key",
"complexityThreshold": 7, // When to engage Gemini
"geminiModel": "gemini-pro"
}
}
`$3
Fine-tune APEX behavior:
`json
{
"apex": {
"patternPromotionThreshold": 3, // Uses before promotion
"trustScoreThreshold": 0.8, // Success rate for promotion
"autoPatternDiscovery": true, // Find patterns automatically
"contextTokenBudget": 30000, // Max context size
"enableFailurePrevention": true // Warn about past failures
}
}
`Project Structure
APEX creates an intelligent project organization:
`
your-project/
āāā .apex/ # APEX Intelligence Hub
ā āāā CONVENTIONS.md # Trusted patterns (ā
ā
ā
ā
ā+)
ā āāā CONVENTIONS.pending.md # Testing patterns (<3 uses)
ā āāā 09_LEARNING/
ā ā āāā failures.jsonl # What went wrong & how to prevent
ā ā āāā TASK_LEARNINGS.md # Successful approaches
ā āāā PATTERN_METADATA.json # Pattern statistics & trust scores
ā
āāā .claude/commands/apex/ # AI command templates
āāā 01_plan/ # Planning phase commands
āāā 02_execute/ # Execution with intelligence
āāā 03_quality/ # Smart testing & review
āāā 04_finalize/ # Learning capture
`Troubleshooting
$3
"Command not found" in AI assistant
- Run
/prime to load APEX commands into context
- Ensure you ran apex start in your project root
- Check that .claude/commands/apex/ existsPatterns not being applied
- Check pattern trust score - must be ā
ā
ā
āā or higher
- Verify pattern context matches your use case
- Run
apex patterns stats to see pattern healthHigh complexity score on simple task
- Review task description for trigger words
- Check if task touches multiple systems
- Complexity can be manually overridden in task file
$3
Q: How does APEX work with my AI assistant?
A: APEX provides markdown-based commands that guide your AI through proven workflows. It's like giving your AI a memory and a methodology.
Q: Is my code/data private?
A: Yes. APEX runs locally and stores all patterns/learnings in your project. Nothing is sent to external servers except optional Gemini API calls for complex tasks.
Q: Can I use APEX with [Cursor/GitHub Copilot/other AI]?
A: Yes! APEX works with any AI that can read markdown files and execute commands. The commands are universal.
Q: How long before I see productivity gains?
A: Immediately for workflow organization. Pattern benefits appear after 5-10 tasks. Full 40-55% gains typically seen after 50+ tasks as the pattern library grows.
Q: Can I share patterns with my team?
A: Yes! Patterns are stored in
.apex/CONVENTIONS.md which can be committed to version control and shared.Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Key areas for contribution:
- Domain-specific pattern libraries
- AI assistant integrations
- Workflow improvements
- Documentation examples
License
MIT License - see LICENSE for details
Acknowledgments
APEX was inspired by the need for AI assistants that truly learn and improve. Special thanks to:
- The Claude, Cursor, and Copilot communities
- Early adopters who provided pattern data
- Contributors who shaped the workflow methodology
---
Ready to stop repeating mistakes? Run
npx @benredmond/apex start` and watch your AI assistant get smarter with every task.Built with ā¤ļø and Intelligence by the APEX Community