My5t3r10us/cesizen / .agents/skills/apex
apex
VerifiedSystematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with optional parallel subagents, self-validation, and adversarial review. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
steps/step-00-init.md
View on GitHub---
name: step-00-init
description: Initialize APEX workflow - parse flags, detect continuation, setup state
next_step: steps/step-01-analyze.md
---
# Step 0: Initialization
## MANDATORY EXECUTION RULES (READ FIRST):
- π NEVER skip flag parsing
- π ONLY check for existing workflow if resume_task is set
- β
ALWAYS parse ALL flags before any other action
- β
ONLY check for resume if {resume_task} is set
- π YOU ARE AN INITIALIZER, not an executor
- π¬ FOCUS on setup only - don't look ahead to implementation
- π« FORBIDDEN to load step-01 until init is complete
## EXECUTION PROTOCOLS:
- π― Parse flags first, then check resume, then setup
- πΎ Create output structure if save_mode enabled
- π Initialize all state variables before proceeding
- π« FORBIDDEN to start analysis (that's step-01's job)
- β
ALWAYS show COMPACT summary (one table) and proceed immediately
- π« FORBIDDEN to show verbose parsing logs or explanations
## CONTEXT BOUNDARIES:
- This is the FIRST step - no previous context exists
- User input contains flags and task description
- Output folder may or may not exist
- Don't assume anything about the codebase yet
## YOUR TASK:
Initialize the APEX workflow by parsing flags, detecting continuation state, and setting up the execution environment.
---
<defaults>
## Default Configuration
**Edit these values to change default behavior. Flags always override defaults.**
```yaml
# ===========================================
# APEX DEFAULT SETTINGS
# ===========================================
auto_mode: false # -a: Skip confirmations, use recommended options
examine_mode: false # -x: Auto-proceed to adversarial review
save_mode: false # -s: Save outputs to .claude/output/apex/
test_mode: false # -t: Include test creation and runner steps
verify_mode: false # -v: Launch app and verify feature works via real user surface
economy_mode: false # -e: No subagents, save tokens (for limited plans)
branch_mode: false # -b: Verify not on main, create branch if needed
pr_mode: false # -pr: Create pull request at end (enables -b)
interactive_mode: false # -i: Configure flags interactively
tasks_mode: false # -k: Generate task breakdown after plan
teams_mode: false # -m: Use available subagents for parallel execution
# Presets:
# Budget-friendly: economy_mode: true
# Full quality: examine_mode: true, save_mode: true, test_mode: true
# Autonomous: auto_mode: true, examine_mode: true, save_mode: true, test_mode: true
```
**Flag Reference:** See `SKILL.md` for complete flag documentation and examples.
</defaults>
---
## EXECUTION SEQUENCE:
### 1. Parse Flags and Input
**Step 1: Load defaults from config above**
```
{auto_mode} = <default>
{examine_mode} = <default>
{save_mode} = <default>
{test_mode} = <default>
{verify_mode} = <default>
{economy_mode} = <default>
{branch_mode} = <default>
{pr_mode} = <default>
{interactive_mode} = <default>
{tasks_mode} = <default>
{teams_mode} = <default>
```
**Step 2: Parse user input and override defaults:**
```
Enable flags (lowercase - turn ON):
-a or --auto β {auto_mode} = true
-x or --examine β {examine_mode} = true
-s or --save β {save_mode} = true
-t or --test β {test_mode} = true
-v or --verify β {verify_mode} = true
-e or --economy β {economy_mode} = true
Disable flags (UPPERCASE - turn OFF):
-A or --no-auto β {auto_mode} = false
-X or --no-examine β {examine_mode} = false
-S or --no-save β {save_mode} = false
-T or --no-test β {test_mode} = false
-V or --no-verify β {verify_mode} = false
-E or --no-economy β {economy_mode} = false
-B or --no-branch β {branch_mode} = false
-PR or --no-pull-request β {pr_mode} = false
-K or --no-tasks β {tasks_mode} = false
-M or --no-teams β {teams_mode} = false
Tasks mode:
-k or --tasks β {tasks_mode} = true
Teams mode:
-m or --teams β {teams_mode} = true, {tasks_mode} = true
Branch/PR flags:
-b or --branch β {branch_mode} = true
-pr or --pull-request β {pr_mode} = true, {branch_mode} = true
Interactive:
-i or --interactive β {interactive_mode} = true
Other:
-r or --resume β {resume_task} = <next argument>
Remainder β {task_description}
```
**Step 3: Generate feature_name and task_id:**
```
{feature_name} = kebab-case-description (without number prefix)
Example: "add user authentication" β "add-user-authentication"
{task_id} will be generated by the setup script:
- Script auto-detects next available number in .claude/output/apex/
- Result: "01-add-user-authentication" (or 02, 03, etc.)
```
### 2. Check Resume Mode
<critical>
ONLY execute this section if {resume_task} is set!
If {resume_task} is NOT set, skip directly to step 3.
</critical>
**If `{resume_task}` is set:**
1. **Search for matching task:**
```bash
ls .claude/output/apex/ | grep "^{resume_task}"
```
2. **If exact match found:**
- Read `00-context.md` to restore state variables
- Scan step files to find last completed step (check for completion marker)
- Load next incomplete step
- **STOP** - do not continue with fresh init
3. **If partial match (e.g., `-r 01`):**
- If single match: use it
- If multiple matches: list them and ask user to specify
4. **If no match found:**
- List available tasks
- Ask user to provide correct ID
**If {resume_task} is NOT set:** β Skip directly to step 3
### 3. Run Optional Sub-Steps
**Load sub-steps in order (if flags enabled):**
```
IF {interactive_mode} = true:
β Load steps/step-00b-interactive.md
β User configures flags interactively
β Return here with updated flags
IF {branch_mode} = true:
β Load steps/step-00b-branch.md
β Verify/create branch
β Return here with {branch_name} set
IF {economy_mode} = true:
β Load steps/step-00b-economy.md
β Apply economy overrides
IF {save_mode} = true:
β Load steps/step-00b-save.md
β Create output structure, generate {task_id} and {output_dir}
β Return here with {task_id} and {output_dir} set
```
### 4. Initialize and Proceed
**Always (regardless of auto_mode):**
Show COMPACT initialization summary (one table, then proceed immediately):
```
β APEX: {task_description}
| Variable | Value |
|----------|-------|
| `{task_id}` | 01-kebab-name |
| `{auto_mode}` | true/false |
| `{examine_mode}` | true/false |
| `{save_mode}` | true/false |
| `{test_mode}` | true/false |
| `{verify_mode}` | true/false |
| `{economy_mode}` | true/false |
| `{branch_mode}` | true/false |
| `{pr_mode}` | true/false |
| `{tasks_mode}` | true/false |
| `{teams_mode}` | true/false |
β Analyzing...
```
<critical>
KEEP OUTPUT MINIMAL:
- One line header with task
- One table with ALL variables (use brackets to show they're available)
- One line "β Analyzing..." then IMMEDIATELY load step-01
- NO verbose explanations, NO parsing logs, NO separators
</critical>
**Then proceed directly to step-01-analyze.md**
---
## SUCCESS METRICS:
β
All flags correctly parsed (enable AND disable)
β
Output is COMPACT (one table, no verbose logs)
β
Variables shown with `{brackets}` notation
β
Proceeded to step-01 immediately after table
β
Output folder created with 00-context.md (if save_mode)
## FAILURE MODES:
β Verbose output with separators and explanations
β Showing parsing steps/logs to user
β Not using `{variable}` bracket notation
β Not proceeding immediately after summary
β **CRITICAL**: Blocking workflow with unnecessary confirmations
## INITIALIZATION PROTOCOLS:
- Parse ALL flags before any other action
- Check resume BEFORE creating new output folder
- Verify branch BEFORE creating output structure (if branch_mode)
- Create output structure BEFORE confirming start
- Load economy overrides BEFORE proceeding to step-01
---
## NEXT STEP:
After showing initialization summary, always proceed directly to `./step-01-analyze.md`
<critical>
Remember:
- Step-00 is an INITIALIZER, not a GATEKEEPER
- Output MUST be compact: one table, no verbose logs
- Use `{variable}` notation to show available state
- Proceed immediately - never block!
</critical>
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why β repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" β or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself β your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |