analyze-script-failures
Analyze script failures to identify source components and propose fixes
Best use case
analyze-script-failures is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Analyze script failures to identify source components and propose fixes
Teams using analyze-script-failures should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/analyze-script-failures/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How analyze-script-failures Compares
| Feature / Agent | analyze-script-failures | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Analyze script failures to identify source components and propose fixes
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Analyze Script Failures Skill
**EXECUTION MODE**: You are now executing this skill. DO NOT explain or summarize these instructions to the user. IMMEDIATELY begin the workflow below.
Analyzes script failures from the current session to identify the source component, trace how instructions led to the failed call, and propose fixes.
## What This Skill Provides
- Script failure detection from conversation history
- Origin tracing (command/agent/skill that triggered failure)
- Instruction path analysis (how LLM interpreted instructions)
- Root cause categorization
- Fix proposals with lessons learned integration
## When to Activate
Activate when:
- Script execution returns non-zero exit code
- User asks to analyze script failures
- Debugging why a script call failed
## Workflow: Analyze Script Failures
### Step 0: Load Foundation Skills
```
Skill: pm-plugin-development:plugin-architecture
Skill: plan-marshall:ref-development-standards
```
These provide architecture principles and non-prompting tool usage patterns.
### Step 1: Gather Failure Data
**A. Description Analysis** (if provided):
- Parse user's description for specific failure context
- Note: Which script, what error, expected behavior
**B. Chat History Analysis**:
- Review conversation for script errors (non-zero exit codes)
- A script error is: `python3 .plan/execute-script.py` returning non-zero result
- Extract: Full script command, exit code, error output
- Note: What command/agent was active when failure occurred
### Step 2: For Each Failure Found
**A. Extract Failure Details**:
- Complete script call including all parameters
- Exit code and error message
- Naming or parameter errors if any
**B. Trace Origin**:
Determine source component type:
| Source Type | How to Identify |
|-------------|-----------------|
| **Command** | Script call within `/command-name` invocation |
| **Agent** | Script call within Task agent context |
| **Skill** | Script call after `Skill: skill-name` activation |
Read source component file to find instruction context.
**C. Analyze Instruction Path**:
1. **Load source component**:
```
Read: {bundle}/{type}s/{name}.md
```
2. **Find the instruction** that led to script call:
- Search for script notation (`python3 .plan/execute-script.py`)
- Search for script API mentions
- Note: Is script explicitly documented or was it inferred?
3. **Capture context** (1-5 lines surrounding instruction)
### Step 3: Root Cause Analysis
For each failure, categorize the root cause:
| Category | Description | Fix Location |
|----------|-------------|--------------|
| **Missing Script Instruction** | Script not documented in component | Add to component |
| **Wrong Script Parameters** | Parameters incorrect or missing | Fix component instruction |
| **LLM Invented Script** | No instruction, LLM guessed script call | Add flow step to component |
| **Missing API** | Operation needed but no script exists | Create new script |
| **Script Bug** | Script exists but has bug | Fix script implementation |
| **Script Not Found** | Notation invalid or script missing | Fix notation or add script |
### Step 4: Generate Analysis Report
Display comprehensive analysis:
```
+================================================================+
| Script Failure Analysis |
+================================================================+
## Failure {n}: {short_description}
### The Actual Failure
**Script Call**:
```bash
python3 .plan/execute-script.py {notation} {subcommand} {args}
```
**Error**:
- Exit code: {code}
- Error type: {naming_error | parameter_error | execution_error}
- Message: {error_message}
### Source of Script Call
**Component**: {type}: {name} ({bundle})
**File**: {file_path}:{line_number}
**Context** (instruction that triggered this):
```markdown
{3-5 lines of context from source component}
```
### Root Cause
**Category**: {category from Step 3}
**Analysis**: {why this happened - how LLM interpreted instructions}
```
### Step 5: Propose Solutions
For each failure, generate appropriate fixes:
**If Missing Script Instruction**:
```markdown
## Proposed Fix: Add Script Instruction
Add to {component_file}:
### Script: {notation}
```bash
python3 .plan/execute-script.py {notation} {subcommand} {params}
```
**Reasoning**: Component uses this script but lacks explicit instruction.
```
**If Wrong Script Parameters**:
```markdown
## Proposed Fix: Correct Parameters
Update {component_file} at line {n}:
FROM:
```bash
{incorrect_call}
```
TO:
```bash
{correct_call}
```
**Reasoning**: {explanation of parameter error}
```
**If LLM Invented Script**:
```markdown
## Proposed Fix: Add Workflow Step
The LLM invented this script call because the workflow is missing a step.
Add to {component_file}:
### Step {n}: {step_name}
{workflow step with proper script call}
**Reasoning**: LLM tried to accomplish {goal} but no instruction existed.
```
**If Missing API**:
```markdown
## Proposed Fix: Create New Script
A new script API is needed:
**Script**: {notation}
**Subcommand**: {subcommand}
**Purpose**: {what operation is needed}
**Reasoning**: This operation is sensible for {context} but no script supports it.
```
### Step 6: Interactive Resolution
Present solutions using AskUserQuestion:
```
Based on my analysis, I found {n} script failure(s).
For each failure, which action would you like to take?
```
Options for each failure:
1. **Apply fix** - Apply the proposed fix to the component
2. **Record as lesson** - Document this analysis in lessons learned
3. **Skip** - Take no action for this failure
### Step 7: Apply Selected Actions
For each selected action:
**If Apply fix**:
- Use Edit tool to apply fix to component
- Verify fix applied correctly
**If Record as lesson**:
- Activate: `Skill: plan-marshall:manage-lessons`
- Create lesson with:
```bash
python3 .plan/execute-script.py plan-marshall:manage-lessons:manage-lesson add \
--component "{source_component}" \
--category "bug" \
--title "Script failure: {short_description}" \
--detail "{detailed analysis and solution}"
```
### Step 8: Summary
Display actions taken:
```
+================================================================+
| Script Failure Analysis Complete |
+================================================================+
Failures analyzed: {total}
Fixes applied: {applied_count}
Lessons recorded: {lessons_count}
Skipped: {skipped_count}
Applied fixes:
- {component_1}: {fix_description}
- {component_2}: {fix_description}
Recorded lessons:
- {lesson_id}: {title}
```
## Critical Rules
**Analysis Accuracy**:
- Only report actual script failures (non-zero exits)
- Trace to exact source file and line number
- Read actual component files, don't assume content
**Script Identification**:
- Script calls match pattern: `python3 .plan/execute-script.py {notation}`
- Notation format: `{bundle}:{skill}:{script}`
- Parse full command including subcommand and arguments
**Context Extraction**:
- Show enough context (1-5 lines) to understand the instruction
- Don't expose unrelated conversation content
- Focus on the instruction path that led to failure
**Fix Safety**:
- Proposed fixes must be minimal and targeted
- Don't suggest unrelated improvements
- Preserve existing component structure
**Lessons Learned Integration**:
- Use `plan-marshall:manage-lessons` skill for recording
- Category should reflect nature: bug, improvement, anti-pattern
- Include enough detail for future reference
## Non-Prompting Requirements
This skill is designed to run without user prompts for analysis operations.
**File Operations:**
- `Read(marketplace/**)` - Read marketplace components
- `Grep(marketplace/**)` - Search for patterns
- `Glob(marketplace/**)` - Find files
**Prompting Behavior:**
- Analysis and tracing: Non-prompting
- Fix application: AskUserQuestion for user selection
- Lessons learned: Uses script API (non-prompting)Related Skills
standards-typescript
This skill provides TypeScript coding standards and is automatically loaded for TypeScript projects. It includes naming conventions, best practices, and recommended tooling.
springboot-architecture-analyzer
系統化分析 Spring Boot 專案並生成完整的企業級架構文件,涵蓋系統概述、架構視圖、技術細節、部署策略等所有關鍵面向。
script-executor
Executes shell scripts in a safe environment.
repository-analyzer
Comprehensive repository analysis using Explore agents, web search, and Context7 to investigate codebase structure, technology stack, configuration, documentation quality, and provide actionable insights. Use this skill when asked to analyze, audit, investigate, or report on a repository or codebase. | Exploreエージェント、Web検索、Context7を用いた包括的なリポジトリ分析。コードベース構造、技術スタック、設定、ドキュメント品質を調査し、実用的な洞察を提供。リポジトリやコードベースの分析、監査、調査、レポート作成を依頼された場合に使用。
pulumi-typescript
Pulumi infrastructure as code using TypeScript with Pulumi Cloud and ESC integration. Use when working with Pulumi TypeScript projects, ESC environments, dynamic secrets, OIDC credentials, or infrastructure automation with Node.js/TypeScript.
project-analyzer
Automated brownfield codebase analysis. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile. Essential for Conductor integration and onboarding existing projects.
analyze-project
Use when starting work on an unfamiliar project or needing to understand a codebase - performs comprehensive analysis discovering architecture, patterns, dependencies, testing coverage, and improvement opportunities. Do NOT use on projects you already know well or for targeted questions about specific files - use direct exploration instead for focused queries.
product-appeal-analyzer
Evaluate product desirability, market positioning, and emotional resonance—the complement to friction analysis. Assess whether users will WANT a product (not just use it), identity fit, trust signals, and value proposition clarity. Activate on "will they like it", "market positioning", "appeal analysis", "product desirability", "value proposition", "why would someone choose this", "landing page review", "conversion optimization", "messaging strategy". NOT for UX friction analysis (use ux-friction-analyzer), visual design implementation (use web-design-expert), or A/B test setup (use frontend-developer).
PatchEvergreen Breaking Changes Analyzer
Expert skill for analyzing breaking changes, compatibility issues, and migration planning for programming libraries across multiple languages using the PatchEvergreen database.
nodejs-javascript-vitest
Guidelines for writing Node.js and JavaScript code with Vitest testing Triggers on: **/*.js, **/*.mjs, **/*.cjs
nodejs-backend-typescript
Node.js backend development with TypeScript, Express/Fastify servers, routing, middleware, and database integration
Node Tuning Helper Scripts
Generate tuned manifests and evaluate node tuning snapshots