claude-code-pilot 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +11 -11
  2. package/bin/install.js +20 -2
  3. package/manifest.json +5 -1
  4. package/package.json +18 -6
  5. package/src/agents/a11y-architect.md +141 -0
  6. package/src/agents/code-architect.md +71 -0
  7. package/src/agents/code-explorer.md +69 -0
  8. package/src/agents/code-simplifier.md +47 -0
  9. package/src/agents/comment-analyzer.md +45 -0
  10. package/src/agents/csharp-reviewer.md +101 -0
  11. package/src/agents/dart-build-resolver.md +201 -0
  12. package/src/agents/pr-test-analyzer.md +45 -0
  13. package/src/agents/silent-failure-hunter.md +50 -0
  14. package/src/agents/type-design-analyzer.md +41 -0
  15. package/src/available-rules/README.md +3 -1
  16. package/src/available-rules/dart/coding-style.md +159 -0
  17. package/src/available-rules/dart/hooks.md +66 -0
  18. package/src/available-rules/dart/patterns.md +261 -0
  19. package/src/available-rules/dart/security.md +135 -0
  20. package/src/available-rules/dart/testing.md +215 -0
  21. package/src/available-rules/web/coding-style.md +105 -0
  22. package/src/available-rules/web/design-quality.md +72 -0
  23. package/src/available-rules/web/hooks.md +129 -0
  24. package/src/available-rules/web/patterns.md +88 -0
  25. package/src/available-rules/web/performance.md +73 -0
  26. package/src/available-rules/web/security.md +66 -0
  27. package/src/available-rules/web/testing.md +64 -0
  28. package/src/commands/ccp/ai-integration-phase.md +36 -0
  29. package/src/commands/ccp/audit-fix.md +33 -0
  30. package/src/commands/ccp/code-review-fix.md +52 -0
  31. package/src/commands/ccp/eval-review.md +32 -0
  32. package/src/commands/ccp/extract_learnings.md +22 -0
  33. package/src/commands/ccp/import.md +37 -0
  34. package/src/commands/ccp/ingest-docs.md +42 -0
  35. package/src/commands/ccp/intel.md +179 -0
  36. package/src/commands/ccp/plan-review-convergence.md +58 -0
  37. package/src/commands/ccp/scan.md +26 -0
  38. package/src/commands/ccp/sketch-wrap-up.md +31 -0
  39. package/src/commands/ccp/sketch.md +54 -0
  40. package/src/commands/ccp/spec-phase.md +62 -0
  41. package/src/commands/ccp/spike-wrap-up.md +31 -0
  42. package/src/commands/ccp/spike.md +51 -0
  43. package/src/commands/ccp/ultraplan-phase.md +33 -0
  44. package/src/hooks/ccp-read-injection-scanner.js +152 -0
  45. package/src/hooks/kit-check-update.js +59 -7
  46. package/src/hooks/run-with-flags-shell.sh +1 -0
  47. package/src/hooks/run-with-flags.js +48 -1
  48. package/src/hooks/session-end.js +88 -1
  49. package/src/lib/hook-flags.js +14 -0
  50. package/src/pilot/references/agent-contracts.md +79 -0
  51. package/src/pilot/references/ai-evals.md +156 -0
  52. package/src/pilot/references/ai-frameworks.md +186 -0
  53. package/src/pilot/references/doc-conflict-engine.md +91 -0
  54. package/src/pilot/references/gate-prompts.md +100 -0
  55. package/src/pilot/references/gates.md +70 -0
  56. package/src/pilot/references/mandatory-initial-read.md +2 -0
  57. package/src/pilot/references/project-skills-discovery.md +19 -0
  58. package/src/pilot/references/revision-loop.md +97 -0
  59. package/src/pilot/references/sketch-interactivity.md +41 -0
  60. package/src/pilot/references/sketch-theme-system.md +94 -0
  61. package/src/pilot/references/sketch-tooling.md +45 -0
  62. package/src/pilot/references/sketch-variant-patterns.md +81 -0
  63. package/src/pilot/references/thinking-models-debug.md +44 -0
  64. package/src/pilot/references/thinking-models-execution.md +50 -0
  65. package/src/pilot/references/thinking-models-planning.md +62 -0
  66. package/src/pilot/references/thinking-models-research.md +50 -0
  67. package/src/pilot/references/thinking-models-verification.md +55 -0
  68. package/src/pilot/templates/AI-SPEC.md +246 -0
  69. package/src/pilot/templates/spec.md +307 -0
  70. package/src/pilot/workflows/ai-integration-phase.md +284 -0
  71. package/src/pilot/workflows/audit-fix.md +175 -0
  72. package/src/pilot/workflows/code-review-fix.md +497 -0
  73. package/src/pilot/workflows/eval-review.md +155 -0
  74. package/src/pilot/workflows/extract_learnings.md +242 -0
  75. package/src/pilot/workflows/import.md +246 -0
  76. package/src/pilot/workflows/ingest-docs.md +328 -0
  77. package/src/pilot/workflows/plan-review-convergence.md +329 -0
  78. package/src/pilot/workflows/scan.md +102 -0
  79. package/src/pilot/workflows/sketch-wrap-up.md +285 -0
  80. package/src/pilot/workflows/sketch.md +360 -0
  81. package/src/pilot/workflows/spec-phase.md +262 -0
  82. package/src/pilot/workflows/spike-wrap-up.md +306 -0
  83. package/src/pilot/workflows/spike.md +452 -0
  84. package/src/pilot/workflows/ultraplan-phase.md +189 -0
  85. package/src/skills/accessibility/SKILL.md +146 -0
  86. package/src/skills/agent-eval/SKILL.md +145 -0
  87. package/src/skills/agent-introspection-debugging/SKILL.md +153 -0
  88. package/src/skills/android-clean-architecture/SKILL.md +339 -0
  89. package/src/skills/api-connector-builder/SKILL.md +120 -0
  90. package/src/skills/code-tour/SKILL.md +236 -0
  91. package/src/skills/compose-multiplatform-patterns/SKILL.md +299 -0
  92. package/src/skills/csharp-testing/SKILL.md +321 -0
  93. package/src/skills/dart-flutter-patterns/SKILL.md +563 -0
  94. package/src/skills/dashboard-builder/SKILL.md +108 -0
  95. package/src/skills/dotnet-patterns/SKILL.md +321 -0
  96. package/src/skills/frontend-design/SKILL.md +145 -0
  97. package/src/skills/frontend-slides/SKILL.md +184 -0
  98. package/src/skills/frontend-slides/STYLE_PRESETS.md +330 -0
  99. package/src/skills/gateguard/SKILL.md +121 -0
  100. package/src/skills/github-ops/SKILL.md +144 -0
  101. package/src/skills/hookify-rules/SKILL.md +128 -0
  102. package/src/skills/knowledge-ops/SKILL.md +154 -0
  103. package/src/skills/liquid-glass-design/SKILL.md +279 -0
  104. package/src/skills/nestjs-patterns/SKILL.md +230 -0
  105. package/src/skills/security-bounty-hunter/SKILL.md +99 -0
  106. package/src/skills/swift-actor-persistence/SKILL.md +143 -0
  107. package/src/skills/swift-protocol-di-testing/SKILL.md +190 -0
  108. package/src/skills/swiftui-patterns/SKILL.md +259 -0
  109. package/src/skills/terminal-ops/SKILL.md +109 -0
  110. package/src/skills/ui-demo/SKILL.md +465 -0
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: accessibility
3
+ description: Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA
4
+ standards. Use this skill to generate semantic ARIA for Web and accessibility traits for Web and Native platforms (iOS/Android).
5
+ origin: ECC
6
+ ---
7
+
8
+ # Accessibility (WCAG 2.2)
9
+
10
+ This skill ensures that digital interfaces are Perceivable, Operable, Understandable, and Robust (POUR) for all users, including those using screen readers, switch controls, or keyboard navigation. It focuses on the technical implementation of WCAG 2.2 success criteria.
11
+
12
+ ## When to Use
13
+
14
+ - Defining UI component specifications for Web, iOS, or Android.
15
+ - Auditing existing code for accessibility barriers or compliance gaps.
16
+ - Implementing new WCAG 2.2 standards like Target Size (Minimum) and Focus Appearance.
17
+ - Mapping high-level design requirements to technical attributes (ARIA roles, traits, hints).
18
+
19
+ ## Core Concepts
20
+
21
+ - **POUR Principles**: The foundation of WCAG (Perceivable, Operable, Understandable, Robust).
22
+ - **Semantic Mapping**: Using native elements over generic containers to provide built-in accessibility.
23
+ - **Accessibility Tree**: The representation of the UI that assistive technologies actually "read."
24
+ - **Focus Management**: Controlling the order and visibility of the keyboard/screen reader cursor.
25
+ - **Labeling & Hints**: Providing context through `aria-label`, `accessibilityLabel`, and `contentDescription`.
26
+
27
+ ## How It Works
28
+
29
+ ### Step 1: Identify the Component Role
30
+
31
+ Determine the functional purpose (e.g., Is this a button, a link, or a tab?). Use the most semantic native element available before resorting to custom roles.
32
+
33
+ ### Step 2: Define Perceivable Attributes
34
+
35
+ - Ensure text contrast meets **4.5:1** (normal) or **3:1** (large/UI).
36
+ - Add text alternatives for non-text content (images, icons).
37
+ - Implement responsive reflow (up to 400% zoom without loss of function).
38
+
39
+ ### Step 3: Implement Operable Controls
40
+
41
+ - Ensure a minimum **24x24 CSS pixel** target size (WCAG 2.2 SC 2.5.8).
42
+ - Verify all interactive elements are reachable via keyboard and have a visible focus indicator (SC 2.4.11).
43
+ - Provide single-pointer alternatives for dragging movements.
44
+
45
+ ### Step 4: Ensure Understandable Logic
46
+
47
+ - Use consistent navigation patterns.
48
+ - Provide descriptive error messages and suggestions for correction (SC 3.3.3).
49
+ - Implement "Redundant Entry" (SC 3.3.7) to prevent asking for the same data twice.
50
+
51
+ ### Step 5: Verify Robust Compatibility
52
+
53
+ - Use correct `Name, Role, Value` patterns.
54
+ - Implement `aria-live` or live regions for dynamic status updates.
55
+
56
+ ## Accessibility Architecture Diagram
57
+
58
+ ```mermaid
59
+ flowchart TD
60
+ UI["UI Component"] --> Platform{Platform?}
61
+ Platform -->|Web| ARIA["WAI-ARIA + HTML5"]
62
+ Platform -->|iOS| SwiftUI["Accessibility Traits + Labels"]
63
+ Platform -->|Android| Compose["Semantics + ContentDesc"]
64
+
65
+ ARIA --> AT["Assistive Technology (Screen Readers, Switches)"]
66
+ SwiftUI --> AT
67
+ Compose --> AT
68
+ ```
69
+
70
+ ## Cross-Platform Mapping
71
+
72
+ | Feature | Web (HTML/ARIA) | iOS (SwiftUI) | Android (Compose) |
73
+ | :----------------- | :----------------------- | :----------------------------------- | :---------------------------------------------------------- |
74
+ | **Primary Label** | `aria-label` / `<label>` | `.accessibilityLabel()` | `contentDescription` |
75
+ | **Secondary Hint** | `aria-describedby` | `.accessibilityHint()` | `Modifier.semantics { stateDescription = ... }` |
76
+ | **Action Role** | `role="button"` | `.accessibilityAddTraits(.isButton)` | `Modifier.semantics { role = Role.Button }` |
77
+ | **Live Updates** | `aria-live="polite"` | `.accessibilityLiveRegion(.polite)` | `Modifier.semantics { liveRegion = LiveRegionMode.Polite }` |
78
+
79
+ ## Examples
80
+
81
+ ### Web: Accessible Search
82
+
83
+ ```html
84
+ <form role="search">
85
+ <label for="search-input" class="sr-only">Search products</label>
86
+ <input type="search" id="search-input" placeholder="Search..." />
87
+ <button type="submit" aria-label="Submit Search">
88
+ <svg aria-hidden="true">...</svg>
89
+ </button>
90
+ </form>
91
+ ```
92
+
93
+ ### iOS: Accessible Action Button
94
+
95
+ ```swift
96
+ Button(action: deleteItem) {
97
+ Image(systemName: "trash")
98
+ }
99
+ .accessibilityLabel("Delete item")
100
+ .accessibilityHint("Permanently removes this item from your list")
101
+ .accessibilityAddTraits(.isButton)
102
+ ```
103
+
104
+ ### Android: Accessible Toggle
105
+
106
+ ```kotlin
107
+ Switch(
108
+ checked = isEnabled,
109
+ onCheckedChange = { onToggle() },
110
+ modifier = Modifier.semantics {
111
+ contentDescription = "Enable notifications"
112
+ }
113
+ )
114
+ ```
115
+
116
+ ## Anti-Patterns to Avoid
117
+
118
+ - **Div-Buttons**: Using a `<div>` or `<span>` for a click event without adding a role and keyboard support.
119
+ - **Color-Only Meaning**: Indicating an error or status _only_ with a color change (e.g., turning a border red).
120
+ - **Uncontained Modal Focus**: Modals that don't trap focus, allowing keyboard users to navigate background content while the modal is open. Focus must be contained _and_ escapable via the `Escape` key or an explicit close button (WCAG SC 2.1.2).
121
+ - **Redundant Alt Text**: Using "Image of..." or "Picture of..." in alt text (screen readers already announce the role "Image").
122
+
123
+ ## Best Practices Checklist
124
+
125
+ - [ ] Interactive elements meet the **24x24px** (Web) or **44x44pt** (Native) target size.
126
+ - [ ] Focus indicators are clearly visible and high-contrast.
127
+ - [ ] Modals **contain focus** while open, and release it cleanly on close (`Escape` key or close button).
128
+ - [ ] Dropdowns and menus restore focus to the trigger element on close.
129
+ - [ ] Forms provide text-based error suggestions.
130
+ - [ ] All icon-only buttons have a descriptive text label.
131
+ - [ ] Content reflows properly when text is scaled.
132
+
133
+ ## References
134
+
135
+ - [WCAG 2.2 Guidelines](https://www.w3.org/TR/WCAG22/)
136
+ - [WAI-ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices/)
137
+ - [iOS Accessibility Programming Guide](https://developer.apple.com/documentation/accessibility)
138
+ - [iOS Human Interface Guidelines - Accessibility](https://developer.apple.com/design/human-interface-guidelines/accessibility)
139
+ - [Android Accessibility Developer Guide](https://developer.android.com/guide/topics/ui/accessibility)
140
+
141
+ ## Related Skills
142
+
143
+ - `frontend-patterns`
144
+ - `frontend-design`
145
+ - `liquid-glass-design`
146
+ - `swiftui-patterns`
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: agent-eval
3
+ description: Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics
4
+ origin: ECC
5
+ tools: Read, Write, Edit, Bash, Grep, Glob
6
+ ---
7
+
8
+ # Agent Eval Skill
9
+
10
+ A lightweight CLI tool for comparing coding agents head-to-head on reproducible tasks. Every "which coding agent is best?" comparison runs on vibes — this tool systematizes it.
11
+
12
+ ## When to Activate
13
+
14
+ - Comparing coding agents (Claude Code, Aider, Codex, etc.) on your own codebase
15
+ - Measuring agent performance before adopting a new tool or model
16
+ - Running regression checks when an agent updates its model or tooling
17
+ - Producing data-backed agent selection decisions for a team
18
+
19
+ ## Installation
20
+
21
+ > **Note:** Install agent-eval from its repository after reviewing the source.
22
+
23
+ ## Core Concepts
24
+
25
+ ### YAML Task Definitions
26
+
27
+ Define tasks declaratively. Each task specifies what to do, which files to touch, and how to judge success:
28
+
29
+ ```yaml
30
+ name: add-retry-logic
31
+ description: Add exponential backoff retry to the HTTP client
32
+ repo: ./my-project
33
+ files:
34
+ - src/http_client.py
35
+ prompt: |
36
+ Add retry logic with exponential backoff to all HTTP requests.
37
+ Max 3 retries. Initial delay 1s, max delay 30s.
38
+ judge:
39
+ - type: pytest
40
+ command: pytest tests/test_http_client.py -v
41
+ - type: grep
42
+ pattern: "exponential_backoff|retry"
43
+ files: src/http_client.py
44
+ commit: "abc1234" # pin to specific commit for reproducibility
45
+ ```
46
+
47
+ ### Git Worktree Isolation
48
+
49
+ Each agent run gets its own git worktree — no Docker required. This provides reproducibility isolation so agents cannot interfere with each other or corrupt the base repo.
50
+
51
+ ### Metrics Collected
52
+
53
+ | Metric | What It Measures |
54
+ |--------|-----------------|
55
+ | Pass rate | Did the agent produce code that passes the judge? |
56
+ | Cost | API spend per task (when available) |
57
+ | Time | Wall-clock seconds to completion |
58
+ | Consistency | Pass rate across repeated runs (e.g., 3/3 = 100%) |
59
+
60
+ ## Workflow
61
+
62
+ ### 1. Define Tasks
63
+
64
+ Create a `tasks/` directory with YAML files, one per task:
65
+
66
+ ```bash
67
+ mkdir tasks
68
+ # Write task definitions (see template above)
69
+ ```
70
+
71
+ ### 2. Run Agents
72
+
73
+ Execute agents against your tasks:
74
+
75
+ ```bash
76
+ agent-eval run --task tasks/add-retry-logic.yaml --agent claude-code --agent aider --runs 3
77
+ ```
78
+
79
+ Each run:
80
+ 1. Creates a fresh git worktree from the specified commit
81
+ 2. Hands the prompt to the agent
82
+ 3. Runs the judge criteria
83
+ 4. Records pass/fail, cost, and time
84
+
85
+ ### 3. Compare Results
86
+
87
+ Generate a comparison report:
88
+
89
+ ```bash
90
+ agent-eval report --format table
91
+ ```
92
+
93
+ ```
94
+ Task: add-retry-logic (3 runs each)
95
+ ┌──────────────┬───────────┬────────┬────────┬─────────────┐
96
+ │ Agent │ Pass Rate │ Cost │ Time │ Consistency │
97
+ ├──────────────┼───────────┼────────┼────────┼─────────────┤
98
+ │ claude-code │ 3/3 │ $0.12 │ 45s │ 100% │
99
+ │ aider │ 2/3 │ $0.08 │ 38s │ 67% │
100
+ └──────────────┴───────────┴────────┴────────┴─────────────┘
101
+ ```
102
+
103
+ ## Judge Types
104
+
105
+ ### Code-Based (deterministic)
106
+
107
+ ```yaml
108
+ judge:
109
+ - type: pytest
110
+ command: pytest tests/ -v
111
+ - type: command
112
+ command: npm run build
113
+ ```
114
+
115
+ ### Pattern-Based
116
+
117
+ ```yaml
118
+ judge:
119
+ - type: grep
120
+ pattern: "class.*Retry"
121
+ files: src/**/*.py
122
+ ```
123
+
124
+ ### Model-Based (LLM-as-judge)
125
+
126
+ ```yaml
127
+ judge:
128
+ - type: llm
129
+ prompt: |
130
+ Does this implementation correctly handle exponential backoff?
131
+ Check for: max retries, increasing delays, jitter.
132
+ ```
133
+
134
+ ## Best Practices
135
+
136
+ - **Start with 3-5 tasks** that represent your real workload, not toy examples
137
+ - **Run at least 3 trials** per agent to capture variance — agents are non-deterministic
138
+ - **Pin the commit** in your task YAML so results are reproducible across days/weeks
139
+ - **Include at least one deterministic judge** (tests, build) per task — LLM judges add noise
140
+ - **Track cost alongside pass rate** — a 95% agent at 10x the cost may not be the right choice
141
+ - **Version your task definitions** — they are test fixtures, treat them as code
142
+
143
+ ## Links
144
+
145
+ - Repository: [github.com/joaquinhuigomez/agent-eval](https://github.com/joaquinhuigomez/agent-eval)
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: agent-introspection-debugging
3
+ description: Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.
4
+ origin: ECC
5
+ ---
6
+
7
+ # Agent Introspection Debugging
8
+
9
+ Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.
10
+
11
+ This is a workflow skill, not a hidden runtime. It teaches the agent to debug itself systematically before escalating to a human.
12
+
13
+ ## When to Activate
14
+
15
+ - Maximum tool call / loop-limit failures
16
+ - Repeated retries with no forward progress
17
+ - Context growth or prompt drift that starts degrading output quality
18
+ - File-system or environment state mismatch between expectation and reality
19
+ - Tool failures that are likely recoverable with diagnosis and a smaller corrective action
20
+
21
+ ## Scope Boundaries
22
+
23
+ Activate this skill for:
24
+ - capturing failure state before retrying blindly
25
+ - diagnosing common agent-specific failure patterns
26
+ - applying contained recovery actions
27
+ - producing a structured human-readable debug report
28
+
29
+ Do not use this skill as the primary source for:
30
+ - feature verification after code changes; use `verification-loop`
31
+ - framework-specific debugging when a narrower ECC skill already exists
32
+ - runtime promises the current harness cannot enforce automatically
33
+
34
+ ## Four-Phase Loop
35
+
36
+ ### Phase 1: Failure Capture
37
+
38
+ Before trying to recover, record the failure precisely.
39
+
40
+ Capture:
41
+ - error type, message, and stack trace when available
42
+ - last meaningful tool call sequence
43
+ - what the agent was trying to do
44
+ - current context pressure: repeated prompts, oversized pasted logs, duplicated plans, or runaway notes
45
+ - current environment assumptions: cwd, branch, relevant service state, expected files
46
+
47
+ Minimum capture template:
48
+
49
+ ```markdown
50
+ ## Failure Capture
51
+ - Session / task:
52
+ - Goal in progress:
53
+ - Error:
54
+ - Last successful step:
55
+ - Last failed tool / command:
56
+ - Repeated pattern seen:
57
+ - Environment assumptions to verify:
58
+ ```
59
+
60
+ ### Phase 2: Root-Cause Diagnosis
61
+
62
+ Match the failure to a known pattern before changing anything.
63
+
64
+ | Pattern | Likely Cause | Check |
65
+ | --- | --- | --- |
66
+ | Maximum tool calls / repeated same command | loop or no-exit observer path | inspect the last N tool calls for repetition |
67
+ | Context overflow / degraded reasoning | unbounded notes, repeated plans, oversized logs | inspect recent context for duplication and low-signal bulk |
68
+ | `ECONNREFUSED` / timeout | service unavailable or wrong port | verify service health, URL, and port assumptions |
69
+ | `429` / quota exhaustion | retry storm or missing backoff | count repeated calls and inspect retry spacing |
70
+ | file missing after write / stale diff | race, wrong cwd, or branch drift | re-check path, cwd, git status, and actual file existence |
71
+ | tests still failing after “fix” | wrong hypothesis | isolate the exact failing test and re-derive the bug |
72
+
73
+ Diagnosis questions:
74
+ - is this a logic failure, state failure, environment failure, or policy failure?
75
+ - did the agent lose the real objective and start optimizing the wrong subtask?
76
+ - is the failure deterministic or transient?
77
+ - what is the smallest reversible action that would validate the diagnosis?
78
+
79
+ ### Phase 3: Contained Recovery
80
+
81
+ Recover with the smallest action that changes the diagnosis surface.
82
+
83
+ Safe recovery actions:
84
+ - stop repeated retries and restate the hypothesis
85
+ - trim low-signal context and keep only the active goal, blockers, and evidence
86
+ - re-check the actual filesystem / branch / process state
87
+ - narrow the task to one failing command, one file, or one test
88
+ - switch from speculative reasoning to direct observation
89
+ - escalate to a human when the failure is high-risk or externally blocked
90
+
91
+ Do not claim unsupported auto-healing actions like “reset agent state” or “update harness config” unless you are actually doing them through real tools in the current environment.
92
+
93
+ Contained recovery checklist:
94
+
95
+ ```markdown
96
+ ## Recovery Action
97
+ - Diagnosis chosen:
98
+ - Smallest action taken:
99
+ - Why this is safe:
100
+ - What evidence would prove the fix worked:
101
+ ```
102
+
103
+ ### Phase 4: Introspection Report
104
+
105
+ End with a report that makes the recovery legible to the next agent or human.
106
+
107
+ ```markdown
108
+ ## Agent Self-Debug Report
109
+ - Session / task:
110
+ - Failure:
111
+ - Root cause:
112
+ - Recovery action:
113
+ - Result: success | partial | blocked
114
+ - Token / time burn risk:
115
+ - Follow-up needed:
116
+ - Preventive change to encode later:
117
+ ```
118
+
119
+ ## Recovery Heuristics
120
+
121
+ Prefer these interventions in order:
122
+
123
+ 1. Restate the real objective in one sentence.
124
+ 2. Verify the world state instead of trusting memory.
125
+ 3. Shrink the failing scope.
126
+ 4. Run one discriminating check.
127
+ 5. Only then retry.
128
+
129
+ Bad pattern:
130
+ - retrying the same action three times with slightly different wording
131
+
132
+ Good pattern:
133
+ - capture failure
134
+ - classify the pattern
135
+ - run one direct check
136
+ - change the plan only if the check supports it
137
+
138
+ ## Integration with ECC
139
+
140
+ - Use `verification-loop` after recovery if code was changed.
141
+ - Use `continuous-learning-v2` when the failure pattern is worth turning into an instinct or later skill.
142
+ - Use `council` when the issue is not technical failure but decision ambiguity.
143
+ - Use `workspace-surface-audit` if the failure came from conflicting local state or repo drift.
144
+
145
+ ## Output Standard
146
+
147
+ When this skill is active, do not end with “I fixed it” alone.
148
+
149
+ Always provide:
150
+ - the failure pattern
151
+ - the root-cause hypothesis
152
+ - the recovery action
153
+ - the evidence that the situation is now better or still blocked