360 Secure SkillHub
360 安全技能中心

workflow-monitor

面向工作流执行的监控 Skill:捕获命令失败、超时、重试循环、上下文耗尽等异常,以及冗长输出、重复读取、串行执行等低效模式,分类严重级别、生成结构化 issue 模板,并在去重与审批后通过 gh CLI 提交到 GitHub/GitLab。当前为骨架实现,自动钩子监控、效率评分算法与重复检测逻辑尚未补齐。

athola
athola
热度 61.65
最近更新 2026-08-26 21:14:58
分类:自动化依赖:代码执行 / 第三方 API / 读写文件应用场景:工作流 / DevOps / 自动化脚本 / 报告撰写 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nm-imbue-workflow-monitor
Metadata
name
workflow-monitor
description
Detects workflow failures and inefficient patterns then files GitHub issues
version
1.9.8
triggers
["workflow","monitoring","error-detection","efficiency","automation","a workflow step repeatedly fails or produces inconsistent output"]
metadata
{"openclaw":{"homepage":"https://github.com/athola/claude-night-market/tree/master/plugins/imbue","emoji":"🦞","requires":{"config":["night-market.leyline:git-platform","night-market.imbue:proof-of-work","night-market.sanctum:fix-workflow"]}}}
source
claude-night-market
source_plugin
imbue

Night Market Skill — ported from claude-night-market/imbue. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Table of Contents

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)

  1. Log execution events - Commands, outputs, timing
  2. Tag anomalies - Failures, timeouts, inefficiencies
  3. Store evidence - For reproducibility

Phase 2: Analyze (workflow-monitor:analysis-complete)

  1. Classify issues - Error type, severity, scope
  2. Identify root cause - What triggered the issue
  3. Suggest fix - What would prevent recurrence

Phase 3: Report (workflow-monitor:report-generated)

  1. Generate issue body - Structured format
  2. Assign labels - workflow, bug, enhancement
  3. Link evidence - Command outputs, session info

Phase 4: Create Issue (workflow-monitor:issue-created)

  1. Check for duplicates - Search existing issues
  2. Create if unique - Via gh CLI
  3. 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

  1. No duplicate issues - Check existing issues before creating
  2. Approval required - Unless auto_create_issues: true
  3. Evidence required - Every issue must have reproducible evidence
  4. Rate limiting - Max 5 issues per session

Required TodoWrite Items

  1. workflow-monitor:capture-complete
  2. workflow-monitor:analysis-complete
  3. workflow-monitor:report-generated
  4. workflow-monitor:issue-created (if issue created)

Integration Points

  • imbue:proof-of-work: Captures execution evidence
  • sanctum: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:proof-of-work: Evidence capture methodology
  • sanctum:fix-workflow: Workflow improvement command
  • imbue:proof-of-work: Validation methodology

Status: Skeleton implementation. Requires:

  • Hook integration for automatic monitoring
  • Efficiency scoring algorithm
  • Duplicate detection logic