workflow-monitor
npx machina-cli add skill athola/claude-night-market/workflow-monitor --openclawTable of Contents
- Philosophy
- Quick Start
- Detection Patterns
- Workflow
- Issue Template
- Configuration
- Guardrails
- Integration Points
- Output Format
Workflow Monitor
Monitor workflow executions for errors and inefficiencies, automatically creating issues on the detected git platform (GitHub/GitLab) for improvements. Check session context for git_platform: and use Skill(leyline:git-platform) for CLI command mapping.
Philosophy
Workflows should improve over time. When execution issues occur, capturing them systematically enables continuous improvement. This skill hooks into workflow execution to detect problems and propose fixes.
Quick Start
Manual Invocation
# After a failed workflow
/workflow-monitor --analyze-last
# Monitor a specific workflow execution
/workflow-monitor --session <session-id>
# Analyze efficiency of recent workflows
/workflow-monitor --efficiency-report
Automatic Monitoring (via hooks)
When enabled, workflow-monitor observes execution and flags:
- Command failures (exit codes > 0)
- Timeout events
- Repeated retry patterns
- Context exhaustion
- Inefficient tool usage
Detection Patterns
Error Detection
| Pattern | Signal | Severity |
|---|---|---|
| Command failure | Exit code > 0 | High |
| Timeout | Exceeded timeout limit | High |
| Retry loop | Same command >3 times | Medium |
| Context exhaustion | >90% context used | Medium |
| Tool misuse | Wrong tool for task | Low |
Efficiency Detection
| Pattern | Signal | Threshold |
|---|---|---|
| Verbose output | >1000 lines from command | 500 lines recommended |
| Redundant reads | Same file read >2 times | 2 reads max |
| Sequential vs parallel | Independent tasks run sequentially | Should parallelize |
| Over-fetching | Read entire file when snippet needed | Use offset/limit |
Workflow
Phase 1: Capture (workflow-monitor:capture-complete)
- Log execution events - Commands, outputs, timing
- Tag anomalies - Failures, timeouts, inefficiencies
- Store evidence - For reproducibility
Phase 2: Analyze (workflow-monitor:analysis-complete)
- Classify issues - Error type, severity, scope
- Identify root cause - What triggered the issue
- Suggest fix - What would prevent recurrence
Phase 3: Report (workflow-monitor:report-generated)
- Generate issue body - Structured format
- Assign labels - workflow, bug, enhancement
- Link evidence - Command outputs, session info
Phase 4: Create Issue (workflow-monitor:issue-created)
- Check for duplicates - Search existing issues
- Create if unique - Via gh CLI
- Link to session - For traceability
Issue Template
## Background
Detected during workflow execution on [DATE].
**Source:** [workflow name] session [session-id]
## Problem
[Description of the error or inefficiency]
**Evidence:**
[Command that failed or was inefficient] [Output excerpt]
## Suggested Fix
[What should change to prevent this]
## Acceptance Criteria
- [ ] [Specific fix criterion]
- [ ] Tests added for new behavior
- [ ] Documentation updated
---
*Created automatically by workflow-monitor*
Configuration
# .workflow-monitor.yaml
enabled: true
auto_create_issues: false # Require approval before creating
severity_threshold: "medium" # Only report medium+ severity
efficiency_threshold: 0.7 # Flag workflows below 70% efficiency
detection:
command_failures: true
timeouts: true
retry_loops: true
context_exhaustion: true
tool_misuse: true
efficiency:
verbose_output_limit: 500
max_file_reads: 2
parallel_detection: true
Guardrails
- No duplicate issues - Check existing issues before creating
- Approval required - Unless
auto_create_issues: true - Evidence required - Every issue must have reproducible evidence
- Rate limiting - Max 5 issues per session
Required TodoWrite Items
workflow-monitor:capture-completeworkflow-monitor:analysis-completeworkflow-monitor:report-generatedworkflow-monitor:issue-created(if issue created)
Integration Points
imbue:evidence-logging: Captures execution evidencesanctum:fix-workflow: Implements suggested fixes- Hooks: Can be triggered by session hooks for automatic monitoring
Output Format
Efficiency Report
## Workflow Efficiency Report
**Session:** [session-id]
**Duration:** 12m 34s
**Efficiency Score:** 0.72 (72%)
### Issues Detected
| Type | Count | Impact |
|------|-------|--------|
| Verbose output | 3 | Medium |
| Redundant reads | 2 | Low |
| Sequential tasks | 1 | Medium |
### Recommendations
1. Use `--quiet` flags for npm/pip commands
2. Cache file contents instead of re-reading
3. Parallelize independent file operations
### Create Issues?
- [ ] Issue 1: Verbose output from npm install
- [ ] Issue 2: Redundant file reads in validation
Related Skills
imbue:evidence-logging: Evidence capture methodologysanctum:fix-workflow: Workflow improvement commandimbue:proof-of-work: Validation methodology
Status: Skeleton implementation. Requires:
- Hook integration for automatic monitoring
- Efficiency scoring algorithm
- Duplicate detection logic
Source
git clone https://github.com/athola/claude-night-market/blob/master/plugins/imbue/skills/workflow-monitor/SKILL.mdView on GitHub Overview
Workflow Monitor watches executions for errors and inefficiencies and automatically opens issues on the configured git platform. It detects command failures, timeouts, retry patterns, and inefficient tool usage, then captures evidence and generates a structured issue body. This keeps your workflows improving over time.
How This Skill Works
It logs execution events, tags anomalies, and stores evidence during Capture. Then it classifies issues, identifies root causes, and suggests fixes in Analyze. Finally it generates a formatted issue body, assigns labels, links evidence, checks duplicates, and creates the issue via gh/glab in Create Issue.
When to Use It
- When a workflow command fails (non-zero exit code).
- When a workflow experiences a timeout.
- When there is a retry loop with the same command more than three times.
- When context usage approaches exhaustion (over 90%).
- When tool usage is inefficient or overly verbose (e.g., redundant reads).
Quick Start
- Step 1: After a failed workflow
- Step 2: Monitor a specific workflow execution
- Step 3: Analyze efficiency of recent workflows
Best Practices
- Enable automatic monitoring hooks to run continuously on workflows.
- Define clear timeout thresholds and retry limits for detection.
- Tune the issue template and labels (workflow, bug, enhancement) to match your project.
- Implement a duplicate-check step before creating an issue.
- Always link evidence and session context in the issue body for traceability.
Example Use Cases
- A flaky test causes a workflow failure; an issue is opened with command outputs and failure context.
- A long-running step times out; an issue is created detailing timing data and suggested fixes.
- Redundant reads are detected in a data-processing step; issue recommends caching and a workflow adjustment.
- Independent tasks run sequentially instead of in parallel; issue suggests parallelization.
- Tool misuse detected (wrong tool for task); issue requests using a more appropriate tool or approach.
Frequently Asked Questions
Related Skills
rigorous-reasoning
athola/claude-night-market
'Prevents sycophantic reasoning through checklist-based analysis, categorical
proof-of-work
athola/claude-night-market
'Enforces "prove before claim" discipline - validation, testing, and
feature-review
athola/claude-night-market
'Feature review and prioritization with RICE/WSJF/Kano scoring. Creates
scope-guard
athola/claude-night-market
'Use this skill BEFORE implementing any new feature. This is NON-NEGOTIABLE