AgentSkillsCN

apex

采用 APEX 方法论(分析-计划-执行-审视),结合并行代理、自我验证,以及可选的对抗性评审,进行系统化的实现。适用于实现功能、修复缺陷,或进行那些受益于结构化工作流程的代码变更时使用。

SKILL.md
--- frontmatter
name: apex
description: Systematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with parallel agents, self-validation, and optional adversarial review. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
argument-hint: "[-a] [-x] [-s] [-t] [-b] [-pr] [-i] [-m] [-r <task-id>] <task description>"
<objective> Execute systematic implementation workflows using the APEX methodology with progressive step loading. </objective>

<quick_start>

bash
/apex add authentication middleware           # Basic
/apex -a -s implement user registration       # Autonomous + save
/apex -a -x -s fix login bug                  # With adversarial review
/apex -a -m implement full auth system        # Agent Teams (parallel)
/apex -a -x -s -t add auth middleware         # Full workflow with tests
/apex -a -pr add auth middleware              # With PR creation
/apex -r 01-auth-middleware                   # Resume previous task
/apex -e add auth middleware                  # Economy mode (save tokens)
/apex -i add auth middleware                  # Interactive flag config

</quick_start>

<flags> **Enable (lowercase ON) / Disable (UPPERCASE OFF):**
ONOFFLongDescription
-a-A--autoSkip confirmations, auto-approve
-x-X--examineAdversarial code review
-s-S--saveSave outputs to .claude/output/apex/
-t-T--testInclude test creation + runner
-e-E--economyNo subagents, save tokens
-b-B--branchVerify not on main, create branch
-pr-PR--pull-requestCreate PR at end (enables -b)
-i--interactiveConfigure flags via menu
-k-K--tasksTask breakdown with dependencies
-m-M--teamsAgent Teams parallel execution (enables -k)
-r--resumeResume from previous task ID

Parsing: Defaults from steps/step-00-init.md, flags override, remainder = {task_description}, ID = NN-kebab-case. </flags>

<workflow> 1. **Init** → Parse flags, setup state 2. **Analyze** → Context gathering (1-10 parallel agents) 3. **Plan** → File-by-file strategy + TaskList creation 4. **Tasks** → Task breakdown (if -k or -m) 5. **Execute** → Implementation (standard or Agent Teams if -m) 6. **Validate** → Typecheck, lint, tests 7. **Tests** → Create + run tests (if -t) 8. **Examine** → Adversarial review (if -x) 9. **Resolve** → Fix findings (if examine found issues) 10. **Finish** → Create PR (if -pr) </workflow>

<step_files>

StepFilePurpose
00steps/step-00-init.mdParse flags, initialize state
00bsteps/step-00b-save.mdSetup save output structure (if -s)
00bsteps/step-00b-branch.mdGit branch setup (if -b)
00bsteps/step-00b-economy.mdEconomy mode overrides (if -e)
00bsteps/step-00b-interactive.mdInteractive flag config (if -i)
01steps/step-01-analyze.mdSmart context gathering
02steps/step-02-plan.mdFile-by-file plan + TaskList
02bsteps/step-02b-tasks.mdTask breakdown (if -k/-m)
03steps/step-03-execute.mdTodo-driven implementation
03tsteps/step-03-execute-teams.mdAgent Team execution (if -m)
04steps/step-04-validate.mdSelf-check and validation
05steps/step-05-examine.mdAdversarial code review
06steps/step-06-resolve.mdFinding resolution
07steps/step-07-tests.mdTest analysis and creation
08steps/step-08-run-tests.mdTest runner loop
09steps/step-09-finish.mdCreate pull request

</step_files>

<state_variables>

VariableTypeSet by
{task_description}stringstep-00
{feature_name}stringstep-00
{task_id}stringstep-00 / step-00b-save
{acceptance_criteria}liststep-01
{auto_mode}booleanstep-00
{examine_mode}booleanstep-00
{save_mode}booleanstep-00
{test_mode}booleanstep-00
{economy_mode}booleanstep-00
{branch_mode}booleanstep-00
{pr_mode}booleanstep-00
{tasks_mode}booleanstep-00
{teams_mode}booleanstep-00
{output_dir}stringstep-00b-save
{branch_name}stringstep-00b-branch

</state_variables>

<execution_rules>

  • Load one step at a time (progressive loading)
  • ULTRA THINK before major decisions
  • Persist state variables across all steps
  • Follow next_step directive at end of each step
  • Save outputs if {save_mode} = true (each step appends to its file)
  • Use parallel agents for independent exploration (step-01) </execution_rules>

<entry_point> FIRST ACTION: Load steps/step-00-init.md </entry_point>