Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

workflow-test-fix工作流程测试修复

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

1,272

周安装

53

GitHub Stars

1,937

下载量

424
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:workflow-test-fix(工作流程测试修复)
来源仓库:https://github.com/catlog22/claude-code-workflow
仓库路径:skills/workflow-test-fix
安装命令:
npx skills add https://github.com/catlog22/claude-code-workflow --skill workflow-test-fix
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/catlog22/claude-code-workflow --skill workflow-test-fix

简介

用于辅助测试设计、自动化测试、用例整理和回归验证,帮助编写或修复测试代码。

  • 可生成单元测试、端到端测试或根据失败日志定位问题,但需避免为通过测试而破坏逻辑。
  • 使用前需确认项目测试框架、运行命令和夹具数据,区分本地模拟与生产环境。
  • 涉及浏览器或外部服务时,应明确使用测试环境与模拟方式,防止误操作。
  • workflow-test-fix 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

1. Architecture Overview

┌───────────────────────────────────────────────────────────────────────────┐
│  Workflow Test Fix Orchestrator (SKILL.md)                                │
│  → Pure coordinator: Route entry point, track progress, pass context      │
│  → Five phases: Session → Context → Analysis → TaskGen → Execution       │
└──────────────────────────────────┬────────────────────────────────────────┘
                                   │
  ┌────────────┬────────────┬──────┴──────┬────────────┬────────────┐
  ↓            ↓            ↓             ↓            ↓
┌──────────┐┌──────────┐┌──────────┐┌──────────┐    ┌──────────────┐
│ Phase 1  ││ Phase 2  ││ Phase 3  ││ Phase 4  │    │  Phase 5     │
│ Session  ││ Context  ││ Analysis ││ Task Gen │    │  Test Cycle  │
│ Start    ││ Gather   ││ Enhanced ││ Generate │    │  Execute     │
│          ││          ││          ││          │    │              │
│ Input    ││ Coverage ││ Gemini   ││ IMPL_PLAN│    │  1. Discovery│
│ Detect + ││ or Code  ││ L0-L3   ││ IMPL-*   │    │  2. Execute  │
│ Session  ││ Scan     ││ AI Issue ││ TODO_LIST│    │  3. Fix Loop │
│ Create   ││          ││          ││          │    │  4. Complete │
└────┬─────┘└────┬─────┘└────┬─────┘└────┬─────┘    └──────────────┘
     │           │           │           │                  ↑
     │testSessionId          │           │                  │
     └──→────────┘contextPath│           │                  │
                  └──→───────┘AnalysisRes│                  │
                               └──→──────┘ testSessionId    │
                                          └──→──(Summary)──→┘

Task Pipeline (generated in Phase 4, executed in Phase 5):
┌──────────────┐   ┌─────────────────┐   ┌─────────────────┐   ┌──────────────┐
│  IMPL-001    │──→│  IMPL-001.3     │──→│  IMPL-001.5     │──→│  IMPL-002    │
│  Test Gen    │   │  Code Validate  │   │  Quality Gate   │   │  Test & Fix  │
│  L1-L3       │   │  L0 + AI Issues │   │  Coverage 80%+  │   │  Max N iter  │
│@code-developer│  │ @test-fix-agent │   │ @test-fix-agent │   │@test-fix-agent│
└──────────────┘   └─────────────────┘   └─────────────────┘   └──────────────┘

2. Key Design Principles

  1. Unified Pipeline: Generation and execution are one continuous workflow - no manual handoff
  2. Pure Orchestrator: SKILL.md coordinates only - delegates all execution detail to phase files
  3. Auto-Continue: Phase 1→2→3→4→(Summary)→5 automatically
  4. Task Attachment/Collapse: Sub-tasks attached during phase execution, collapsed after completion
  5. Progressive Phase Loading: Phase docs read only when that phase executes, not upfront
  6. Adaptive Strategy: Fix loop auto-selects strategy (conservative/aggressive/surgical) based on iteration context
  7. Quality Gate: Pass rate >= 95% (criticality-aware) terminates the fix loop
  8. Phase File Hygiene: Phase files reference workflowPreferences.* for preferences, no CLI flag parsing

3. Usage

Full pipeline and execute-only modes are triggered by skill name routing (see Mode Detection). Workflow preferences (auto mode) are collected interactively via AskUserQuestion before dispatching to phases.

Full pipeline (workflow-test-fix): Task description or session ID as arguments → interactive preference collection → generate + execute pipeline Execute only (workflow-test-fix): Auto-discovers active session → interactive preference collection → execution loop

4. Interactive Preference Collection

Before dispatching to phase execution, collect workflow preferences via AskUserQuestion:

// ★ 统一 auto mode 检测:-y/--yes 从 $ARGUMENTS 或 ccw 传播
const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS)

if (autoYes) {
  // 自动模式:跳过所有询问,使用默认值
  workflowPreferences = { autoYes: true }
} else {
  const prefResponse = AskUserQuestion({
    questions: [
      {
        question: "是否跳过所有确认步骤(自动模式)?",
        header: "Auto Mode",
        multiSelect: false,
        options: [
          { label: "Interactive (Recommended)", description: "交互模式,包含确认步骤" },
          { label: "Auto", description: "跳过所有确认,自动执行" }
        ]
      }
    ]
  })

  workflowPreferences = {
    autoYes: prefResponse.autoMode === 'Auto'
  }
}

workflowPreferences is passed to phase execution as context variable, referenced as workflowPreferences.autoYes within phases.

5. Compact Recovery (Phase Persistence)

Multi-phase test-fix pipeline (Phase 1-5) spans long conversations, especially Phase 5 fix loops. Uses 双重保险: TodoWrite 跟踪 active phase 保护其不被压缩,sentinel 作为兜底。

⚠️ COMPACT DIRECTIVE: Context compression MUST check TodoWrite phase status. The phase currently marked in_progress is the active execution phase — preserve its FULL content. Only compress phases marked completed or pending.

6. Execution Flow

Entry Point Detection:
   ├─ /workflow-test-fix → Full Pipeline (Phase 1→2→3→4→Summary→5)
   └─ /workflow-test-fix → Execution Only (Phase 5)

Phase 1: Session Start (session-start)
   └─ Read("phases/01-session-start.md")
      ├─ Step 1.0: Detect input mode (session | prompt)
      ├─ Step 1.1: Create test session → testSessionId
      └─ Output: testSessionId, MODE

Phase 2: Test Context Gather (test-context-gather)
   └─ Read("phases/02-test-context-gather.md")
      ├─ Step 1.2: Gather test context → contextPath
      └─ Output: contextPath

Phase 3: Test Concept Enhanced (test-concept-enhanced)
   └─ Read("phases/03-test-concept-enhanced.md")
      ├─ Step 1.3: Test analysis (Gemini) → TEST_ANALYSIS_RESULTS.md
      └─ Output: TEST_ANALYSIS_RESULTS.md

Phase 4: Test Task Generate (test-task-generate)
   └─ Read("phases/04-test-task-generate.md")
      ├─ Step 1.4: Generate test tasks → IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md
      └─ Output: testSessionId, 4+ task JSONs

Summary Output (inline after Phase 4):
   └─ Display summary, auto-continue to Phase 5

Phase 5: Test Cycle Execution (test-cycle-execute)
   └─ Read("phases/05-test-cycle-execute.md")
      ├─ Step 2.1: Discovery (load session, tasks, iteration state)
      ├─ Step 2.2: Execute initial tasks (IMPL-001 → 001.3 → 001.5 → 002)
      ├─ Step 2.3: Fix loop (if pass_rate < 95%)
      │   ├─ Select strategy: conservative/aggressive/surgical
      │   ├─ Generate fix task via @cli-planning-agent
      │   ├─ Execute fix via @test-fix-agent
      │   └─ Re-test → loop or exit
      └─ Step 2.4: Completion (summary, session archive)
         └─ Output: final pass_rate, summary

Phase Reference Documents (read on-demand when phase executes):

PhaseDocumentPurposeCompact
1phases/01-session-start.mdDetect input mode, create test sessionTodoWrite 驱动
2phases/02-test-context-gather.mdGather test context (coverage/codebase)TodoWrite 驱动
3phases/03-test-concept-enhanced.mdGemini analysis, L0-L3 test requirementsTodoWrite 驱动
4phases/04-test-task-generate.mdGenerate task JSONs and IMPL_PLAN.mdTodoWrite 驱动
5phases/05-test-cycle-execute.mdExecute tasks, iterative fix cycles, completionTodoWrite 驱动 + 🔄 sentinel

Compact Rules:

  1. TodoWrite in_progress → 保留完整内容,禁止压缩
  2. TodoWrite completed → 可压缩为摘要
  3. 🔄 sentinel fallback → Phase 5 包含 compact sentinel;若 compact 后仅存 sentinel 而无完整 Step 协议,必须立即 Read("phases/05-test-cycle-execute.md") 恢复

7. Core Rules

  1. Start Immediately: First action is TaskCreate initialization, second action is Phase 1 (or Phase 5 for execute-only entry)
  2. No Preliminary Analysis: Do not read files or gather context before starting the phase
  3. Parse Every Output: Extract required data from each step output for next step
  4. Auto-Continue: Phase 1→2→3→4→(Summary)→5 automatically (for full pipeline entry)
  5. Track Progress: Update TaskCreate/TaskUpdate dynamically with task attachment/collapse pattern
  6. Task Attachment Model: Sub-tasks attached during phase, collapsed after completion
  7. DO NOT STOP: Continuous workflow until quality gate met or max iterations reached
  8. Progressive Loading: Read phase doc ONLY when that phase is about to execute
  9. Entry Point Routing: workflow-test-fix skill → Phase 1-5; workflow-test-fix skill → Phase 5 only

8. Input Processing

test-fix-gen Entry (Full Pipeline)

User input → Detect type:
  ├─ Starts with "WFS-" → MODE=session, sourceSessionId=input
  ├─ Ends with ".md"    → MODE=prompt, description=Read(input)
  └─ Otherwise          → MODE=prompt, description=input

test-cycle-execute Entry (Phase 5 Only)

Arguments → Parse flags:
  ├─ --resume-session="WFS-xxx" → sessionId=WFS-xxx
  ├─ --max-iterations=N         → maxIterations=N (default: 10)
  └─ (no args)                  → auto-discover active test session

9. Data Flow

User Input (session ID | description | file path)
    ↓
[Detect Mode: session | prompt]
    ↓
Phase 1: Session Start ─────────────────────────────────────────
    ↓ 1.0+1.1: session:start → testSessionId, MODE
    ↓
Phase 2: Test Context Gather ────────────────────────────────────
    ↓ 1.2: test-context-gather/context-gather → contextPath
    ↓
Phase 3: Test Concept Enhanced ──────────────────────────────────
    ↓ 1.3: test-concept-enhanced → TEST_ANALYSIS_RESULTS.md
    ↓
Phase 4: Test Task Generate ─────────────────────────────────────
    ↓ 1.4: test-task-generate → IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md
    ↓
Summary Output (inline) ─────────────────────────────────────────
    ↓ Display summary with next step
    ↓
Phase 5: Test Cycle Execution ───────────────────────────────────
    ↓ 2.1: Load session + tasks + iteration state
    ↓ 2.2: Execute IMPL-001 → 001.3 → 001.5 → 002
    ↓ 2.3: Fix loop (analyze → fix → retest) until pass_rate >= 95%
    ↓ 2.4: Completion → summary → session archive

10. Summary Output (after Phase 4)

After Phase 4 completes, display the following summary before auto-continuing to Phase 5:

Test-fix workflow created successfully!

Input: [original input]
Mode: [Session|Prompt]
Test Session: [testSessionId]

Tasks Created:
- IMPL-001: Test Understanding & Generation (@code-developer)
- IMPL-001.3: Code Validation Gate - AI Error Detection (@test-fix-agent)
- IMPL-001.5: Test Quality Gate - Static Analysis & Coverage (@test-fix-agent)
- IMPL-002: Test Execution & Fix Cycle (@test-fix-agent)

Quality Thresholds:
- Code Validation: Zero CRITICAL issues, zero compilation errors
- Minimum Coverage: 80% line, 70% branch
- Static Analysis: Zero critical anti-patterns
- Max Fix Iterations: 5

Review artifacts:
- Test plan: .workflow/[testSessionId]/IMPL_PLAN.md
- Task list: .workflow/[testSessionId]/TODO_LIST.md
- Analysis: .workflow/[testSessionId]/.process/TEST_ANALYSIS_RESULTS.md

CRITICAL - Next Step: Auto-continue to Phase 5: Test Cycle Execution. Pass testSessionId to Phase 5 for test execution pipeline. Do NOT wait for user confirmation — the unified pipeline continues automatically.

11. Test Strategy Overview

Progressive Test Layers (L0-L3):

LayerNameFocus
L0Static AnalysisCompilation, imports, types, AI code issues
L1Unit TestsFunction/class behavior (happy/negative/edge cases)
L2Integration TestsComponent interactions, API contracts, failure modes
L3E2E TestsUser journeys, critical paths (optional)

Quality Thresholds:

  • Code Validation (IMPL-001.3): Zero CRITICAL issues, zero compilation errors
  • Minimum Coverage: 80% line, 70% branch
  • Static Analysis (IMPL-001.5): Zero critical anti-patterns
  • Pass Rate Gate: >= 95% (criticality-aware) or 100%
  • Max Fix Iterations: 10 (default, adjustable)

12. Strategy Engine (Phase 5)

StrategyTriggerBehavior
ConservativeIteration 1-2 (default)Single targeted fix, full validation
AggressivePass rate >80% + similar failuresBatch fix related issues
SurgicalRegression detected (pass rate drops >10%)Minimal changes, rollback focus

Selection logic and CLI fallback chain (Gemini → Qwen → Codex) are detailed in Phase 5.

13. Agent Roles

AgentUsed InResponsibility
OrchestratorAll phasesRoute entry, track progress, pass context
@code-developerPhase 5 (IMPL-001)Test generation (L1-L3)
@test-fix-agentPhase 5Test execution, code fixes, criticality assignment
@cli-planning-agentPhase 5 (fix loop)CLI analysis, root cause extraction, fix task generation

14. TodoWrite Pattern

Core Concept: Dynamic task tracking with attachment/collapse for real-time visibility.

Implementation Note: Phase files use TodoWrite syntax to describe the conceptual tracking pattern. At runtime, these are implemented via TaskCreate/TaskUpdate/TaskList tools from the allowed-tools list. Map TodoWrite examples as follows: - Initial list creation → TaskCreate for each item - Status changes → TaskUpdate({taskId, status}) - Sub-task attachment → TaskCreate + TaskUpdate({addBlockedBy}) - Sub-task collapse → TaskUpdate({status: "completed"}) + TaskUpdate({status: "deleted"}) for collapsed sub-items

Full Pipeline (Phase 1-5)

[
  {"content": "Phase 1: Session Start", "status": "in_progress"},
  {"content": "Phase 2: Test Context Gather", "status": "pending"},
  {"content": "Phase 3: Test Analysis (Gemini)", "status": "pending"},
  {"content": "Phase 4: Test Task Generate", "status": "pending"},
  {"content": "Phase 5: Test Cycle Execution", "status": "pending"}
]

Phase 1-4 Collapsed → Phase 5 Active

[
  {"content": "Phase 1: Session Start", "status": "completed"},
  {"content": "Phase 2: Test Context Gather", "status": "completed"},
  {"content": "Phase 3: Test Analysis (Gemini)", "status": "completed"},
  {"content": "Phase 4: Test Task Generate", "status": "completed"},
  {"content": "Phase 5: Test Cycle Execution", "status": "in_progress"},
  {"content": "  → Execute IMPL-001 [code-developer]", "status": "in_progress"},
  {"content": "  → Execute IMPL-001.3 [test-fix-agent]", "status": "pending"},
  {"content": "  → Execute IMPL-001.5 [test-fix-agent]", "status": "pending"},
  {"content": "  → Execute IMPL-002 [test-fix-agent]", "status": "pending"},
  {"content": "  → Fix Loop", "status": "pending"}
]

Fix Loop Iterations

[
  {"content": "Phase 1-4: Test Generation", "status": "completed"},
  {"content": "Phase 5: Test Cycle Execution", "status": "in_progress"},
  {"content": "  → Initial tasks", "status": "completed"},
  {"content": "  → Iteration 1: Initial test (pass: 70%, conservative)", "status": "completed"},
  {"content": "  → Iteration 2: Fix validation (pass: 82%, conservative)", "status": "completed"},
  {"content": "  → Iteration 3: Batch fix (pass: 89%, aggressive)", "status": "in_progress"}
]

15. Session File Structure

.workflow/active/WFS-test-{session}/
├── workflow-session.json              # Session metadata
├── IMPL_PLAN.md                       # Test generation and execution strategy
├── TODO_LIST.md                       # Task checklist
├── .task/
│   ├── IMPL-001.json                  # Test understanding & generation
│   ├── IMPL-001.3-validation.json     # Code validation gate
│   ├── IMPL-001.5-review.json         # Test quality gate
│   ├── IMPL-002.json                  # Test execution & fix cycle
│   └── IMPL-fix-{N}.json             # Generated fix tasks (Phase 5 fix loop)
├── .process/
│   ├── [test-]context-package.json    # Context and coverage analysis
│   ├── TEST_ANALYSIS_RESULTS.md       # Test requirements (L0-L3)
│   ├── iteration-state.json           # Current iteration + strategy + stuck tests
│   ├── test-results.json              # Latest results (pass_rate, criticality)
│   ├── test-output.log                # Full test output
│   ├── fix-history.json               # All fix attempts
│   ├── iteration-{N}-analysis.md      # CLI analysis report
│   └── iteration-{N}-cli-output.txt
└── .summaries/
    └── iteration-summaries/

16. Error Handling

Phase 1-4 (Generation)

PhaseError ConditionAction
1: Session StartSource session not found (session mode)Return error with session ID
1: Session StartNo completed IMPL tasks (session mode)Return error, source incomplete
2: Context GatherContext gathering failedReturn error, check source artifacts
3: AnalysisGemini analysis failedReturn error, check context package
4: Task GenTask generation failedRetry once, then return error

Phase 5 (Execution)

ScenarioAction
Test execution errorLog, retry with error context
CLI analysis failureFallback: Gemini → Qwen → Codex → manual
Agent execution errorSave state, retry with simplified context
Max iterations reachedGenerate failure report, mark blocked
Regression detectedRollback last fix, switch to surgical strategy
Stuck tests detectedContinue with alternative strategy, document

17. Commit Strategy (Phase 5)

Automatic commits at key checkpoints:

  1. After successful iteration (pass rate increased): test-cycle: iteration N - strategy (pass: old% → new%)
  2. Before rollback (regression detected): test-cycle: rollback iteration N - regression detected

18. Completion Conditions

ConditionPass RateAction
Full Success100%Auto-complete session
Partial Success>= 95%, all failures low criticalityAuto-approve with review note
Failure< 95% after max iterationsFailure report, mark blocked

19. Post-Completion Expansion

Auto-sync: Execute /workflow:session:sync -y "{summary}" to update specs/*.md + project-tech.

After completion, ask user if they want to expand into issues (test/enhance/refactor/doc). Selected items call /issue:new "{summary} - {dimension}".

20. Coordinator Checklist

Phase 1 (session-start)

  • Detect input type (session ID / description / file path)
  • Initialize TaskCreate before any execution
  • Read("phases/01-session-start.md"), execute Steps 1.0 + 1.1
  • Parse testSessionId from step output, store in memory

Phase 2 (test-context-gather)

  • Read("phases/02-test-context-gather.md"), execute Step 1.2
  • Parse contextPath from step output, store in memory

Phase 3 (test-concept-enhanced)

  • Read("phases/03-test-concept-enhanced.md"), execute Step 1.3
  • Verify TEST_ANALYSIS_RESULTS.md created

Phase 4 (test-task-generate)

  • Read("phases/04-test-task-generate.md"), execute Step 1.4
  • Verify all Phase 1-4 outputs (4 task JSONs, IMPL_PLAN.md, TODO_LIST.md)
  • Display Summary output (inline)
  • Collapse Phase 1-4 tasks, auto-continue to Phase 5

Phase 5 (test-cycle-execute)

  • Read("phases/05-test-cycle-execute.md")
  • Load session, tasks, iteration state
  • Execute initial tasks sequentially
  • Calculate pass rate from test-results.json
  • If pass_rate < 95%: Enter fix loop
  • Track iteration count, stuck tests, regression
  • If pass_rate >= 95% or max iterations: Complete
  • Generate completion summary
  • Offer post-completion expansion

21. Related Skills

Prerequisite Skills:

  • workflow-plan skill or workflow-execute skill - Complete implementation (Session Mode source)
  • None for Prompt Mode

Follow-up Skills:

  • Display session status inline - Review workflow state
  • review-cycle skill - Post-implementation review
  • /issue:new - Create follow-up issues

<auto_mode> When -y or --yes is detected in $ARGUMENTS or propagated via ccw:

  • Skip all AskUserQuestion confirmations
  • Use default values for all workflow preferences (workflowPreferences = {autoYes: true})
  • Auto-continue through all phases without user interaction
  • Phase 1→2→3→4→Summary→5 executes as a fully automatic pipeline </auto_mode>

<success_criteria>

  • Input type correctly detected (session ID / description / file path)
  • All 5 phases execute in sequence (full pipeline) or Phase 5 only (execute-only)
  • Phase documents loaded progressively via Read() only when phase executes
  • TaskCreate/TaskUpdate tracking maintained throughout with attachment/collapse pattern
  • All phase outputs parsed and passed to subsequent phases (testSessionId, contextPath, etc.)
  • Summary displayed after Phase 4 with all task and threshold details
  • Phase 5 fix loop iterates with adaptive strategy until pass rate >= 95% or max iterations
  • Completion summary generated with final pass rate and session archived
  • Post-completion expansion offered to user </success_criteria>

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.41%
按下载量换算159

Claude

31.45%
按下载量换算133

Cursor

17.53%
按下载量换算74

Gemini CLI

9.01%
按下载量换算38

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills