[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MZ20VHREVV6SVMMFXGGQZS":3,"skill-same:01M6MZ20VHREVV6SVMMFXGGQZS":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6MZ20VHREVV6SVMMFXGGQZS","execute-aa-ma-step",null,"Executes one sub-step of an active AA-MA plan, the next PENDING one or a named N.M: checks its dependencies and acceptance criteria, does the work, then records its Result Log. Use when asked for the next AA-MA step, a specific step, or one-step-at-a-time progress on an AA-MA task.","snewhouse\u002Faa-ma-forge","snewhouse","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6317143?v=4","01M6MYYWF28C4KBQHHWB9SC6TS","Stephen J Newhouse","01M6MYYWJWQMDN2ZPFMJ584SSM",6,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Fexecute-aa-ma-step\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"execute aa ma step","execute","dependencies","result","pending","for","at","records","progress","active","time","acceptance","next","acceptance criteria","task","log","use","work","plan","2026-11-10 10:12:30",false,"---\nname: execute-aa-ma-step\ndescription: \"Executes one sub-step of an active AA-MA plan, the next PENDING one or a named N.M: checks its dependencies and acceptance criteria, does the work, then records its Result Log. Use when asked for the next AA-MA step, a specific step, or one-step-at-a-time progress on an AA-MA task.\"\n---\n\n# AA-MA Step Execution\n\nYou are executing a **single task** from an AA-MA (Advanced Agentic Memory Architecture) tracked plan.\n\n**Scope**: One HTP task node (maximum granular control)\n**Validation**: Lightweight guardrails (Result Log enforcement, acceptance criteria check, milestone boundary detection)\n**Git**: No auto-commit (changes accumulate)\n\n---\n\n## 1. Locate Active Task & Pre-Execution Validation\n\nCheck `.claude\u002Fdev\u002Factive\u002F` for the most recent task directory:\n\n```bash\nls -lt .claude\u002Fdev\u002Factive\u002F | head -5\n```\n\n**Expected structure**: `.claude\u002Fdev\u002Factive\u002F[task-name]\u002F`\n\n### Tier 1: Existence Check (Fast)\n\nVerify all 5 required AA-MA files exist and are non-empty:\n\n```bash\nTASK_DIR=\".claude\u002Fdev\u002Factive\u002F[task-name]\"\nTASK_NAME=\"[task-name]\"\nMISSING=0\nfor file in \"${TASK_NAME}-plan.md\" \"${TASK_NAME}-reference.md\" \"${TASK_NAME}-context-log.md\" \"${TASK_NAME}-tasks.md\" \"${TASK_NAME}-provenance.log\"; do\n  if [[ ! -s \"${TASK_DIR}\u002F${file}\" ]]; then\n    echo \"❌ MISSING or EMPTY: ${file}\"\n    MISSING=$((MISSING + 1))\n  fi\ndone\necho \"Tier 1 result: ${MISSING} files missing\"\n```\n\n**If Tier 1 fails (any files missing or empty):**\n\n```\n⚠️ AA-MA ARTIFACTS INCOMPLETE — AUTO-RECOVERY TRIGGERED\n\nMissing\u002Fempty files detected: [list]\n\nAuto-recovery: Triggering Phase 5 artifact creation with scribe+validator agents...\n```\n\n1. Notify user that auto-recovery is starting\n2. Spawn `aa-ma-scribe` agent to create missing files from available plan context\n3. Spawn `aa-ma-validator` agent to verify created files (5-dimension check)\n4. If validator reports PASS\u002FWARN → continue execution\n5. If validator reports FAIL → retry once (re-scribe → re-validate)\n6. If still FAIL after retry → HALT and alert user: \"Auto-recovery failed. Run `\u002Faa-ma-plan` to recreate artifacts.\"\n7. If agent spawning unavailable → fallback: create files directly inline, then continue\n\n**Note:** Step execution uses Tier 1 only (existence check). Full content validation (Tier 2) runs at milestone boundaries via `\u002Fexecute-aa-ma-milestone`.\n\n---\n\n## 2. Priority Context Injection\n\n**REQUIRED - Auto-inject with XML delimiters:**\n\nLoad and inject these two files immediately:\n\n```xml\n\u003CREFERENCE>\n{Read contents of [task-name]-reference.md}\n# Immutable facts and constants. Treat as non-negotiable.\n# Examples: API endpoints, file paths, configuration values, core function signatures\n\u003C\u002FREFERENCE>\n\n\u003CTASKS>\n{Read contents of [task-name]-tasks.md}\n# HTP (Hierarchical Task Planning) roadmap. Defines your required next action.\n# Current execution scope: SINGLE STEP\n# Status values: PENDING | ACTIVE | COMPLETE | BLOCKED\n\u003C\u002FTASKS>\n```\n\n**CONDITIONAL - Load if tokens allow**:\n3. `[task-name]-context-log.md` (summarized architectural decisions)\n4. `[task-name]-plan.md` (original strategy and rationale)\n\n---\n\n## 3. Validate Loaded Context\n\n**Required checks**:\n- ✅ REFERENCE contains key constants (APIs, paths, configs)\n- ✅ TASKS has clear HTP structure with Status fields\n- ✅ At least one task has `Status: PENDING` or `Status: ACTIVE`\n\n**If validation fails**:\n```\nERROR: [Specific issue]\n- Missing AA-MA files → \"AA-MA files not found. Run \u002Faa-ma-plan first.\"\n- Malformed HTP → \"tasks.md lacks proper HTP format. Review AA-MA Planning Standard.\"\n- No pending tasks → \"All tasks complete. Check tasks.md status.\"\n```\n\n---\n\n## 4. Parse HTP & Create TodoWrite Todos\n\n**Parse tasks.md for HTP structure**:\n- `## headers` = Milestones (e.g., \"## Step 1: Setup Infrastructure\")\n- `### headers` = Sub-tasks (e.g., \"### Sub-step: Install dependencies\")\n- Extract `Status:` field (PENDING | ACTIVE | COMPLETE | BLOCKED)\n- Extract `Complexity:` percentage\n\n**Identify next PENDING task**:\n- Find first task node with `Status: PENDING`\n- This is your target task for this execution\n\n**Create TodoWrite todos for**:\n- The target task (## level)\n- All its sub-tasks (### level)\n\n**Todo format**:\n```json\n{\n  \"content\": \"[Task title from HTP]\",\n  \"status\": \"pending|in_progress|completed\",\n  \"activeForm\": \"[Present continuous form]\"\n}\n```\n\n**Status mapping**:\n- HTP `PENDING` → TodoWrite `pending`\n- HTP `ACTIVE` → TodoWrite `in_progress`\n- HTP `COMPLETE` → TodoWrite `completed`\n- HTP `BLOCKED` → TodoWrite `pending` (prefix content with \"BLOCKED: \")\n\n**Complexity flagging**:\n- If `Complexity: ≥ 80%` → Prefix content with \"[High Complexity] \"\n- High complexity signals need for deep reasoning \u002F Chain-of-Thought\n\n---\n\n## 4.5 Quality Standards (Actionable Triggers)\n\nThese principles apply DURING execution. Each has a trigger and skip condition.\n\n- **KISS:** If implementation exceeds 200 lines for a single function, decompose. Skip for generated code.\n- **DRY:** Before writing a new utility, grep the codebase for existing implementations.\n- **SOLID:** If a class has >5 public methods, evaluate single-responsibility. If a module mixes data access + business logic + presentation, separate.\n- **SOC:** If a file grows beyond one clear responsibility, split.\n- **TDD:** If this step produces code, invoke `superpowers:test-driven-development`. Skip for docs\u002Fconfig.\n- **12-Factor:** If task involves services\u002Fdeployment, reference 12-Factor. For tasks with `.env` files, verify env-var-drift (see `rules\u002Fenv-var-drift.md`).\n- **Context7 MCP:** Use for library docs. Retry once on failure, fall back to WebSearch + official docs.\n- **WebSearch:** Fallback when Context7 fails. Use proactively for unfamiliar APIs or recent library changes.\n\n---\n\n## 5. Execute Target Task\n\n**Set task status to ACTIVE**:\n1. Update tasks.md: Change target task `Status: PENDING` → `Status: ACTIVE`\n2. Update TodoWrite: Mark corresponding todo as `in_progress`\n\n**Mode Dispatch (HITL \u002F AFK)**:\n- Parse `Mode:` field from the target task in tasks.md\n- If not present, inherit from parent milestone; default to `HITL`\n- **HITL**: Display task summary and acceptance criteria, use `AskUserQuestion` [Proceed \u002F Skip \u002F Abort]. Only continue if Proceed.\n- **AFK**: Proceed directly to execution without pause\n\n**Execute the task**:\n- Follow task instructions and acceptance criteria\n- Use agents, skills, Context7 MCP as appropriate for efficiency\n- For high complexity tasks (≥80%), use deep reasoning \u002F Chain-of-Thought\n- Execute all sub-tasks (### nodes) within the target task\n\n**Impact awareness** (lightweight, no blocking):\n- **Before editing existing code**, run `Skill(impact-analysis)` on it (callers, contracts, tests)\n- Be aware of contract changes (function signatures, return types)\n- Full impact analysis verification runs at **milestone boundary** (not step level)\n- If editing shared\u002Fcore modules, note potential impacts in Result Log\n\n**For each sub-task**:\n1. Mark TodoWrite sub-task as `in_progress`\n2. Execute sub-task\n3. Verify result meets expectations (guidance-based, trust your assessment)\n4. **IMMEDIATELY** update `Result Log:` field in tasks.md with specific evidence — do not batch to end of task\n5. If sub-task has acceptance criteria, verify them now (quick pass\u002Ffail)\n6. Mark TodoWrite sub-task as `completed`\n\n---\n\n## 6. Complete Task\n\n**When all sub-tasks done**:\n\n### 6.1 Result Log Enforcement (REQUIRED)\n\n**Before marking any sub-step or task COMPLETE, you MUST write its Result Log entry in tasks.md.**\n\nThis is not optional. Per L-080\u002FL-081\u002FL-082, Result Log drift is the #1 cause of sub-step state loss.\n\nFor each sub-step and the parent task:\n- Write `Status: COMPLETE` and a concise `Result Log:` with **specific evidence** (file paths created, test counts, pass\u002Ffail verdicts, IDs generated)\n- Vague Result Logs are rejected. Bad: \"Done.\" Good: \"Created `src\u002Fauth\u002Fmiddleware.py` with JWT validation; 3\u002F3 unit tests pass.\"\n- **Do not proceed to the next step until the current step's Result Log is written and saved to tasks.md.**\n\n### 6.2 Step Acceptance Criteria Check (if defined)\n\nIf the step has `Acceptance Criteria:` defined in tasks.md, verify each criterion before marking COMPLETE:\n\n1. Read the acceptance criteria for this step\n2. For each criterion, confirm it is met (run the test, check the file exists, verify the output)\n3. If any criterion FAILS: set `Status: BLOCKED` with the failing criterion in the Result Log, do not mark COMPLETE\n4. If no explicit acceptance criteria exist: proceed with guidance-based assessment (trust your judgment)\n\nThis is lightweight — no formal verification matrix, just a quick pass\u002Ffail check per criterion.\n\n### 6.2.5 Engineering Standards Advisory Checklist\n\nReference: `claude-code\u002Frules\u002Fengineering-standards.md` Theme 5 (Execution Checklist).\n\nBefore flipping `Status: COMPLETE`, the agent self-reports against this 7-item\nchecklist. **HARD items are advisory at step level — final enforcement happens\nat the milestone HARD gate** in `\u002Fexecute-aa-ma-milestone` (Section 6 boundary\nvalidation). Step-level reporting surfaces issues early without blocking atomic\nflow.\n\n| # | Item                                            | Tier | Step-level action                                                  |\n|---|-------------------------------------------------|------|--------------------------------------------------------------------|\n| 1 | Implementation tested with running code\u002FAPI     | HARD | Note evidence in Result Log; verified at milestone gate            |\n| 2 | Tests written and passing                       | HARD | Note pass count in Result Log; verified at milestone gate          |\n| 3 | Non-breaking constraint verified                | HARD | Note any contract changes in Result Log; verified at milestone gate |\n| 4 | AA-MA artifacts in sync; git clean for AA-MA    | HARD | Note any drift in Result Log; verified at milestone gate           |\n| 5 | No assumptions left unvalidated                 | SOFT | **Declare in context-log.md** if any assumption remains untested   |\n| 6 | Relevant skills\u002Fsubagents consulted             | SOFT | **Declare in context-log.md** which skills\u002Fsubagents were used     |\n| 7 | Changes reviewed against past mistakes          | SOFT | **Declare in context-log.md** which lessons (Phase 1 scan) applied |\n\n**Conditional sub-items** (when present in tasks.md, surface evidence in Result Log):\n- `Critical-Path: \u003Cvalue>` → mention `CRITICAL_PATH_REVIEW` evidence (verified at milestone gate)\n- `Prototype-Required: YES` → mention `PROTOTYPE — \u003Cmilestone heading> — \u003Cverdict> — verdict-changes-plan: YES|NO` evidence (YES → a plan-verification Angle-3 check on the decision delta); a sub-step's YES rolls up to the milestone gate (§6.7 reads it via `aa-ma-gate`), so the entry must name the **milestone** heading\n\nWhen `Critical-Path:` or `Prototype-Required:` is **absent** from the task, skip\nthe corresponding check (no failure).\n\nThis step-level checklist is advisory. Atomic step flow proceeds even if HARD\nitems are partial — the milestone HARD gate is the structural enforcer.\n\n### 6.3 Last-Step-of-Milestone Detection\n\n**After completing this step, check: are there any remaining PENDING steps in the current milestone?**\n\n```bash\n# Quick check — count PENDING steps in the current milestone section\ngrep -c \"Status: PENDING\" [relevant milestone section of tasks.md]\n```\n\n- **If PENDING steps remain**: Report completion normally (Section 7)\n- **If this was the LAST step of the milestone**: Display prominently:\n\n```\n=== MILESTONE BOUNDARY REACHED ===\n\nAll steps in [Milestone Name] are COMPLETE.\nRun \u002Fexecute-aa-ma-milestone for full validation, impact analysis, and auto-commit.\n\nDo NOT proceed to the next milestone without running milestone validation.\n```\n\n### 6.4 Update State\n\n1. **Update tasks.md**:\n   - Change target task `Status: ACTIVE` → `Status: COMPLETE`\n   - Confirm task-level `Result Log:` is filled (Section 6.1 should have done this already)\n\n2. **Update TodoWrite**:\n   - Mark task todo as `completed`\n\n3. **Sync changes**:\n   - Save tasks.md with updated Status and Result Log\n   - Ensure TodoWrite reflects all status changes\n\n4. **NO AUTO-COMMIT**:\n   - Changes accumulate in working directory\n   - Allows related tasks to be committed together\n   - User will commit manually or use execute-aa-ma-milestone for auto-commit\n   - **IMPORTANT**: When commits are made (manually or via milestone), include the AA-MA signature:\n     ```\n     [AA-MA Plan] [task-name] .claude\u002Fdev\u002Factive\u002F[task-name]\n     ```\n\n5. **FINALIZATION NOTE**:\n   - The **Finalization Protocol** (integrity check, doc auto-update, user approval) does NOT run at step level\n   - Finalization runs at **milestone completion** only (via `\u002Fexecute-aa-ma-milestone` or `\u002Fexecute-aa-ma-full`)\n   - Steps accumulate until milestone boundary is reached\n\n---\n\n## 7. Next Actions\n\n**Report completion to user**:\n```\n✅ Task completed: [task title]\n\nSummary: [brief outcome summary]\n\nResult Log updated in tasks.md.\n\nNext steps:\n- Run \u002Fexecute-aa-ma-step again to continue with next task\n- OR run \u002Fexecute-aa-ma-milestone to execute remaining tasks in this milestone\n- OR commit changes manually when ready: git add . && git commit -m \"...\"\n```\n\n**If blocked**:\n```\n? Task blocked: [task title]\n\nIssue: [specific blocker]\n\nActions taken:\n- Set Status: BLOCKED in tasks.md\n- Created new sub-task: \"### Sub-step N.M: Resolve [blocker]\"\n\nSuggested resolution:\n[remediation steps]\n\nPlease resolve blocker, then re-run \u002Fexecute-aa-ma-step.\n```\n\n---\n\n## Token & Context Optimization\n\n- **Monitor token usage**: Check current session context usage\n- **If approaching limits**: Consider context compaction:\n  1. Summarize completed work\n  2. Preserve essential state and open issues\n  3. Discard redundant tool outputs\n  4. Reset session with compacted context\n\n---\n\n## Error Handling\n\n**Missing dependencies**:\n```\nERROR: Task has unmet dependencies\n- Task: [task-id]\n- Dependencies: [list]\n- Status of dependencies: [check Status: fields]\n\nResolution: Complete dependency tasks first, then retry.\n```\n\n**Malformed acceptance criteria**:\n```\nWARNING: Acceptance criteria unclear or missing\n- Task: [task-id]\n- Issue: [description]\n\nProceeding with best-effort execution. Consider updating tasks.md with clearer criteria.\n```\n\n---\n\n**End of execute-aa-ma-step.md**\n","# AA-MA Step Execution\n\nYou are executing a **single task** from an AA-MA (Advanced Agentic Memory Architecture) tracked plan.\n\n**Scope**: One HTP task node (maximum granular control)\n**Validation**: Lightweight guardrails (Result Log enforcement, acceptance criteria check, milestone boundary detection)\n**Git**: No auto-commit (changes accumulate)\n\n---\n\n## 1. Locate Active Task & Pre-Execution Validation\n\nCheck `.claude\u002Fdev\u002Factive\u002F` for the most recent task directory:\n\n```bash\nls -lt .claude\u002Fdev\u002Factive\u002F | head -5\n```\n\n**Expected structure**: `.claude\u002Fdev\u002Factive\u002F[task-name]\u002F`\n\n### Tier 1: Existence Check (Fast)\n\nVerify all 5 required AA-MA files exist and are non-empty:\n\n```bash\nTASK_DIR=\".claude\u002Fdev\u002Factive\u002F[task-name]\"\nTASK_NAME=\"[task-name]\"\nMISSING=0\nfor file in \"${TASK_NAME}-plan.md\" \"${TASK_NAME}-reference.md\" \"${TASK_NAME}-context-log.md\" \"${TASK_NAME}-tasks.md\" \"${TASK_NAME}-provenance.log\"; do\n  if [[ ! -s \"${TASK_DIR}\u002F${file}\" ]]; then\n    echo \"❌ MISSING or EMPTY: ${file}\"\n    MISSING=$((MISSING + 1))\n  fi\ndone\necho \"Tier 1 result: ${MISSING} files missing\"\n```\n\n**If Tier 1 fails (any files missing or empty):**\n\n```\n⚠️ AA-MA ARTIFACTS INCOMPLETE — AUTO-RECOVERY TRIGGERED\n\nMissing\u002Fempty files detected: [list]\n\nAuto-recovery: Triggering Phase 5 artifact creation with scribe+validator agents...\n```\n\n1. Notify user that auto-recovery is starting\n2. Spawn `aa-ma-scribe` agent to create missing files from available plan context\n3. Spawn `aa-ma-validator` agent to verify created files (5-dimension check)\n4. If validator reports PASS\u002FWARN → continue execution\n5. If validator reports FAIL → retry once (re-scribe → re-validate)\n6. If still FAIL after retry → HALT and alert user: \"Auto-recovery failed. Run `\u002Faa-ma-plan` to recreate artifacts.\"\n7. If agent spawning unavailable → fallback: create files directly inline, then continue\n\n**Note:** Step execution uses Tier 1 only (existence check). Full content validation (Tier 2) runs at milestone boundaries via `\u002Fexecute-aa-ma-milestone`.\n\n---\n\n## 2. Priority Context Injection\n\n**REQUIRED - Auto-inject with XML delimiters:**\n\nLoad and inject these two files immediately:\n\n```xml\n\u003CREFERENCE>\n{Read contents of [task-name]-reference.md}\n# Immutable facts and constants. Treat as non-negotiable.\n# Examples: API endpoints, file paths, configuration values, core function signatures\n\u003C\u002FREFERENCE>\n\n\u003CTASKS>\n{Read contents of [task-name]-tasks.md}\n# HTP (Hierarchical Task Planning) roadmap. Defines your required next action.\n# Current execution scope: SINGLE STEP\n# Status values: PENDING | ACTIVE | COMPLETE | BLOCKED\n\u003C\u002FTASKS>\n```\n\n**CONDITIONAL - Load if tokens allow**:\n3. `[task-name]-context-log.md` (summarized architectural decisions)\n4. `[task-name]-plan.md` (original strategy and rationale)\n\n---\n\n## 3. Validate Loaded Context\n\n**Required checks**:\n- ✅ REFERENCE contains key constants (APIs, paths, configs)\n- ✅ TASKS has clear HTP structure with Status fields\n- ✅ At least one task has `Status: PENDING` or `Status: ACTIVE`\n\n**If validation fails**:\n```\nERROR: [Specific issue]\n- Missing AA-MA files → \"AA-MA files not found. Run \u002Faa-ma-plan first.\"\n- Malformed HTP → \"tasks.md lacks proper HTP format. Review AA-MA Planning Standard.\"\n- No pending tasks → \"All tasks complete. Check tasks.md status.\"\n```\n\n---\n\n## 4. Parse HTP & Create TodoWrite Todos\n\n**Parse tasks.md for HTP structure**:\n- `## headers` = Milestones (e.g., \"## Step 1: Setup Infrastructure\")\n- `### headers` = Sub-tasks (e.g., \"### Sub-step: Install dependencies\")\n- Extract `Status:` field (PENDING | ACTIVE | COMPLETE | BLOCKED)\n- Extract `Complexity:` percentage\n\n**Identify next PENDING task**:\n- Find first task node with `Status: PENDING`\n- This is your target task for this execution\n\n**Create TodoWrite todos for**:\n- The target task (## level)\n- All its sub-tasks (### level)\n\n**Todo format**:\n```json\n{\n  \"content\": \"[Task title from HTP]\",\n  \"status\": \"pending|in_progress|completed\",\n  \"activeForm\": \"[Present continuous form]\"\n}\n```\n\n**Status mapping**:\n- HTP `PENDING` → TodoWrite `pending`\n- HTP `ACTIVE` → TodoWrite `in_progress`\n- HTP `COMPLETE` → TodoWrite `completed`\n- HTP `BLOCKED` → TodoWrite `pending` (prefix content with \"BLOCKED: \")\n\n**Complexity flagging**:\n- If `Complexity: ≥ 80%` → Prefix content with \"[High Complexity] \"\n- High complexity signals need for deep reasoning \u002F Chain-of-Thought\n\n---\n\n## 4.5 Quality Standards (Actionable Triggers)\n\nThese principles apply DURING execution. Each has a trigger and skip condition.\n\n- **KISS:** If implementation exceeds 200 lines for a single function, decompose. Skip for generated code.\n- **DRY:** Before writing a new utility, grep the codebase for existing implementations.\n- **SOLID:** If a class has >5 public methods, evaluate single-responsibility. If a module mixes data access + business logic + presentation, separate.\n- **SOC:** If a file grows beyond one clear responsibility, split.\n- **TDD:** If this step produces code, invoke `superpowers:test-driven-development`. Skip for docs\u002Fconfig.\n- **12-Factor:** If task involves services\u002Fdeployment, reference 12-Factor. For tasks with `.env` files, verify env-var-drift (see `rules\u002Fenv-var-drift.md`).\n- **Context7 MCP:** Use for library docs. Retry once on failure, fall back to WebSearch + official docs.\n- **WebSearch:** Fallback when Context7 fails. Use proactively for unfamiliar APIs or recent library changes.\n\n---\n\n## 5. Execute Target Task\n\n**Set task status to ACTIVE**:\n1. Update tasks.md: Change target task `Status: PENDING` → `Status: ACTIVE`\n2. Update TodoWrite: Mark corresponding todo as `in_progress`\n\n**Mode Dispatch (HITL \u002F AFK)**:\n- Parse `Mode:` field from the target task in tasks.md\n- If not present, inherit from parent milestone; default to `HITL`\n- **HITL**: Display task summary and acceptance criteria, use `AskUserQuestion` [Proceed \u002F Skip \u002F Abort]. Only continue if Proceed.\n- **AFK**: Proceed directly to execution without pause\n\n**Execute the task**:\n- Follow task instructions and acceptance criteria\n- Use agents, skills, Context7 MCP as appropriate for efficiency\n- For high complexity tasks (≥80%), use deep reasoning \u002F Chain-of-Thought\n- Execute all sub-tasks (### nodes) within the target task\n\n**Impact awareness** (lightweight, no blocking):\n- **Before editing existing code**, run `Skill(impact-analysis)` on it (callers, contracts, tests)\n- Be aware of contract changes (function signatures, return types)\n- Full impact analysis verification runs at **milestone boundary** (not step level)\n- If editing shared\u002Fcore modules, note potential impacts in Result Log\n\n**For each sub-task**:\n1. Mark TodoWrite sub-task as `in_progress`\n2. Execute sub-task\n3. Verify result meets expectations (guidance-based, trust your assessment)\n4. **IMMEDIATELY** update `Result Log:` field in tasks.md with specific evidence — do not batch to end of task\n5. If sub-task has acceptance criteria, verify them now (quick pass\u002Ffail)\n6. Mark TodoWrite sub-task as `completed`\n\n---\n\n## 6. Complete Task\n\n**When all sub-tasks done**:\n\n### 6.1 Result Log Enforcement (REQUIRED)\n\n**Before marking any sub-step or task COMPLETE, you MUST write its Result Log entry in tasks.md.**\n\nThis is not optional. Per L-080\u002FL-081\u002FL-082, Result Log drift is the #1 cause of sub-step state loss.\n\nFor each sub-step and the parent task:\n- Write `Status: COMPLETE` and a concise `Result Log:` with **specific evidence** (file paths created, test counts, pass\u002Ffail verdicts, IDs generated)\n- Vague Result Logs are rejected. Bad: \"Done.\" Good: \"Created `src\u002Fauth\u002Fmiddleware.py` with JWT validation; 3\u002F3 unit tests pass.\"\n- **Do not proceed to the next step until the current step's Result Log is written and saved to tasks.md.**\n\n### 6.2 Step Acceptance Criteria Check (if defined)\n\nIf the step has `Acceptance Criteria:` defined in tasks.md, verify each criterion before marking COMPLETE:\n\n1. Read the acceptance criteria for this step\n2. For each criterion, confirm it is met (run the test, check the file exists, verify the output)\n3. If any criterion FAILS: set `Status: BLOCKED` with the failing criterion in the Result Log, do not mark COMPLETE\n4. If no explicit acceptance criteria exist: proceed with guidance-based assessment (trust your judgment)\n\nThis is lightweight — no formal verification matrix, just a quick pass\u002Ffail check per criterion.\n\n### 6.2.5 Engineering Standards Advisory Checklist\n\nReference: `claude-code\u002Frules\u002Fengineering-standards.md` Theme 5 (Execution Checklist).\n\nBefore flipping `Status: COMPLETE`, the agent self-reports against this 7-item\nchecklist. **HARD items are advisory at step level — final enforcement happens\nat the milestone HARD gate** in `\u002Fexecute-aa-ma-milestone` (Section 6 boundary\nvalidation). Step-level reporting surfaces issues early without blocking atomic\nflow.\n\n| # | Item                                            | Tier | Step-level action                                                  |\n|---|-------------------------------------------------|------|--------------------------------------------------------------------|\n| 1 | Implementation tested with running code\u002FAPI     | HARD | Note evidence in Result Log; verified at milestone gate            |\n| 2 | Tests written and passing                       | HARD | Note pass count in Result Log; verified at milestone gate          |\n| 3 | Non-breaking constraint verified                | HARD | Note any contract changes in Result Log; verified at milestone gate |\n| 4 | AA-MA artifacts in sync; git clean for AA-MA    | HARD | Note any drift in Result Log; verified at milestone gate           |\n| 5 | No assumptions left unvalidated                 | SOFT | **Declare in context-log.md** if any assumption remains untested   |\n| 6 | Relevant skills\u002Fsubagents consulted             | SOFT | **Declare in context-log.md** which skills\u002Fsubagents were used     |\n| 7 | Changes reviewed against past mistakes          | SOFT | **Declare in context-log.md** which lessons (Phase 1 scan) applied |\n\n**Conditional sub-items** (when present in tasks.md, surface evidence in Result Log):\n- `Critical-Path: \u003Cvalue>` → mention `CRITICAL_PATH_REVIEW` evidence (verified at milestone gate)\n- `Prototype-Required: YES` → mention `PROTOTYPE — \u003Cmilestone heading> — \u003Cverdict> — verdict-changes-plan: YES|NO` evidence (YES → a plan-verification Angle-3 check on the decision delta); a sub-step's YES rolls up to the milestone gate (§6.7 reads it via `aa-ma-gate`), so the entry must name the **milestone** heading\n\nWhen `Critical-Path:` or `Prototype-Required:` is **absent** from the task, skip\nthe corresponding check (no failure).\n\nThis step-level checklist is advisory. Atomic step flow proceeds even if HARD\nitems are partial — the milestone HARD gate is the structural enforcer.\n\n### 6.3 Last-Step-of-Milestone Detection\n\n**After completing this step, check: are there any remaining PENDING steps in the current milestone?**\n\n```bash\n# Quick check — count PENDING steps in the current milestone section\ngrep -c \"Status: PENDING\" [relevant milestone section of tasks.md]\n```\n\n- **If PENDING steps remain**: Report completion normally (Section 7)\n- **If this was the LAST step of the milestone**: Display prominently:\n\n```\n=== MILESTONE BOUNDARY REACHED ===\n\nAll steps in [Milestone Name] are COMPLETE.\nRun \u002Fexecute-aa-ma-milestone for full validation, impact analysis, and auto-commit.\n\nDo NOT proceed to the next milestone without running milestone validation.\n```\n\n### 6.4 Update State\n\n1. **Update tasks.md**:\n   - Change target task `Status: ACTIVE` → `Status: COMPLETE`\n   - Confirm task-level `Result Log:` is filled (Section 6.1 should have done this already)\n\n2. **Update TodoWrite**:\n   - Mark task todo as `completed`\n\n3. **Sync changes**:\n   - Save tasks.md with updated Status and Result Log\n   - Ensure TodoWrite reflects all status changes\n\n4. **NO AUTO-COMMIT**:\n   - Changes accumulate in working directory\n   - Allows related tasks to be committed together\n   - User will commit manually or use execute-aa-ma-milestone for auto-commit\n   - **IMPORTANT**: When commits are made (manually or via milestone), include the AA-MA signature:\n     ```\n     [AA-MA Plan] [task-name] .claude\u002Fdev\u002Factive\u002F[task-name]\n     ```\n\n5. **FINALIZATION NOTE**:\n   - The **Finalization Protocol** (integrity check, doc auto-update, user approval) does NOT run at step level\n   - Finalization runs at **milestone completion** only (via `\u002Fexecute-aa-ma-milestone` or `\u002Fexecute-aa-ma-full`)\n   - Steps accumulate until milestone boundary is reached\n\n---\n\n## 7. Next Actions\n\n**Report completion to user**:\n```\n✅ Task completed: [task title]\n\nSummary: [brief outcome summary]\n\nResult Log updated in tasks.md.\n\nNext steps:\n- Run \u002Fexecute-aa-ma-step again to continue with next task\n- OR run \u002Fexecute-aa-ma-milestone to execute remaining tasks in this milestone\n- OR commit changes manually when ready: git add . && git commit -m \"...\"\n```\n\n**If blocked**:\n```\n? Task blocked: [task title]\n\nIssue: [specific blocker]\n\nActions taken:\n- Set Status: BLOCKED in tasks.md\n- Created new sub-task: \"### Sub-step N.M: Resolve [blocker]\"\n\nSuggested resolution:\n[remediation steps]\n\nPlease resolve blocker, then re-run \u002Fexecute-aa-ma-step.\n```\n\n---\n\n## Token & Context Optimization\n\n- **Monitor token usage**: Check current session context usage\n- **If approaching limits**: Consider context compaction:\n  1. Summarize completed work\n  2. Preserve essential state and open issues\n  3. Discard redundant tool outputs\n  4. Reset session with compacted context\n\n---\n\n## Error Handling\n\n**Missing dependencies**:\n```\nERROR: Task has unmet dependencies\n- Task: [task-id]\n- Dependencies: [list]\n- Status of dependencies: [check Status: fields]\n\nResolution: Complete dependency tasks first, then retry.\n```\n\n**Malformed acceptance criteria**:\n```\nWARNING: Acceptance criteria unclear or missing\n- Task: [task-id]\n- Issue: [description]\n\nProceeding with best-effort execution. Consider updating tasks.md with clearer criteria.\n```\n\n---\n\n**End of execute-aa-ma-step.md**\n",{"name":5,"description":7},"main","cd9a2962c9a7e0797fe440f7b1ba4ceccc16ae0d","claude-code\u002Fskills\u002Fexecute-aa-ma-step",1,"https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge","https:\u002F\u002Fgithub.com\u002Fsnewhouse","Data Scientist, Bioinformatician, Dad, Husband, MS warrior","2026-11-12 06:45:42",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add snewhouse\u002Faa-ma-forge --skill execute-aa-ma-step",{"tool":57,"command":58},"bunx","bunx skills add snewhouse\u002Faa-ma-forge --skill execute-aa-ma-step",{"tool":60,"command":61},"pnpm","pnpm dlx skills add snewhouse\u002Faa-ma-forge --skill execute-aa-ma-step","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Fexecute-aa-ma-step\u002FSKILL.md",true,[],[66,85,101,120,145,171],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":38},"01M6MZ588SD5DDH59H18PRNWEV","deploy-helper","You can use this to help with deploy stuff, deploying, deployments, releases, shipping, pushing to prod, going live, rollouts.","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fevals\u002Fskill-draft\u002Fdraft\u002FSKILL.md",[],[73,74,75,76,77,78,79,80,81,35,82,83,84],"deploy","deploy helper","helper","you","live","with","can","rollouts","shipping","deployments","releases","help",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":89,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":38},"01M6MZ54NEKRYXGMJ1KJWYMKM7","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","MIT","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Fwriting-for-agents\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[94,95,24,96,35,97,98,99,100],"writing","writing for agents","line","instructions","read","editing","documents",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":38},"01M6MZ500T0FH1G8TBSQV7G5G2","verify-plan","Slash entry for plan verification: runs plan-verification on an existing AA-MA plan, writes [task]-verification.md, and with --iterate loops until the plan converges. Use when the user types \u002Fverify-plan or wants the verification report saved.","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Fverify-plan\u002FSKILL.md",[],[108,37,109,110,33,35,111,78,112,113,114,115,116,117,118,24,119],"verify","verify plan","loops","user","verification","report","types","plan verification","entry","iterate","Existing","saved",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":38},"01M6MZ4V9ST4K54NT1SRBGCE7P","verify-impl","Post-impl adversarial review symmetric to \u002Fverify-plan. Dispatches up to 5 parallel audit agents (code-reviewer, security-auditor, tdd-sequence-auditor, context7-evidence-auditor, future-proofing-auditor) based on the milestone's plan-declared Audit-Profile. CRITICAL findings surface via AskUserQuestion accept\u002Fdispute\u002Fdefer panel before §7.3 user authorization. Introduced in v0.8.0 per ADR-0005. Invoked by Phase 6.8 of \u002Fexecute-aa-ma-milestone.","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Fverify-impl\u002FSKILL.md",[],[127,128,108,129,130,131,132,133,134,135,136,137,138,139,140,37,141,142,143,144],"impl","verify impl","adversarial","post","panel","via","critical","review","context7","up","evidence","reviewer","parallel","adr","audit","code","tdd","milestone",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":38},"01M6MZ4K7CC9PMJ1KEY3F53RS1","understand-codebase","Onboard to a new, inherited, or shared codebase. Read it, understand it, map it, and learn its conventions, versioning, tests, tech stack, rules (AGENTS.md \u002F CLAUDE.md \u002F .cursorrules \u002F etc.), build\u002Frun\u002FCI, integrations, security posture, and repo health — then produce an honest pros\u002Fcons verdict, a \"contribute safely\" playbook, and an \"add a feature\" playbook, written to ONBOARDING.md at the repo root plus a .claude\u002Fonboarding\u002F set of deep-dives — and optionally author an AGENTS.md if one is missing, or review and propose improvements to an existing one. Tiered (Quick \u002F Standard \u002F Deep). Reuses codemem (index + diagrams), gsd-map-codebase, system-mapping, code-intelligence, impact-analysis rather than re-implementing them; Deep tier runs a TeamCreate agent-team. Keywords: new codebase, shared codebase, inherited code, onboard, understand this repo, how do I contribute, how do I add a feature, ramp up, get oriented, ONBOARDING.md, AGENTS.md, codebase walkthrough, joining a project.","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Funderstand-codebase\u002FSKILL.md",[],[152,153,154,136,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170],"understand codebase","codebase","understand","walkthrough","analysis","SET","ci","learn","diagrams","repo health","implementing","re","quick","impact","get","project","deep","shared","map",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":38},"01M6MZ4D1ZC8MTW064QXY6WC76","token-compression","Output token compression for AA-MA workflows. Reduces response tokens by 40-75% while preserving full technical accuracy. Three intensity levels mapped to execution modes: lite (HITL), full (general), ultra (AFK). Auto-activates during AA-MA execution based on task Mode field. Manual activation via \u002Fcompress lite|full|ultra.","https:\u002F\u002Fgithub.com\u002Fsnewhouse\u002Faa-ma-forge\u002Fblob\u002Fmain\u002Fclaude-code\u002Fskills\u002Ftoken-compression\u002FSKILL.md",[],[178,179,180,181,182,183,184,24,185,186,132,187,188,189,190,33,191,192,193,194],"compression","token compression","token","workflows","output","modes","accuracy","mode","manual","intensity","tokens","hitl","three","general","auto","technical","execution"]