Agent Skillsn8n-io/n8n › n8n:reproduce-bug

n8n:reproduce-bug

GitHub

根据 Linear 工单上下文,系统性复现 Bug 并编写失败的回归测试。涵盖解析信号、路由测试策略、定位源码、追踪代码路径及生成断言正确行为的测试用例。

.agents/skills/reproduce-bug/SKILL.md n8n-io/n8n

触发场景

需要复现软件缺陷 基于工单编写回归测试

安装

npx skills add n8n-io/n8n --skill n8n:reproduce-bug -g -y
更多选项

非标准路径

npx skills add https://github.com/n8n-io/n8n/tree/master/.agents/skills/reproduce-bug -g -y

不安装直接使用

npx skills use n8n-io/n8n@n8n:reproduce-bug

指定 Agent (Claude Code)

npx skills add n8n-io/n8n --skill n8n:reproduce-bug -a claude-code -g -y

安装 repo 全部 skill

npx skills add n8n-io/n8n --all -g -y

预览 repo 内 skill

npx skills add n8n-io/n8n --list

SKILL.md

Frontmatter
{
    "name": "n8n:reproduce-bug",
    "description": "Reproduce a bug from a Linear ticket with a failing test. Expects the full ticket context (title, description, comments) to be provided as input."
}

Bug Reproduction Framework

Given a Linear ticket context ($ARGUMENTS), systematically reproduce the bug with a failing regression test.

Step 1: Parse Signals

Extract the following from the provided ticket context:

  • Error message / stack trace (if provided)
  • Reproduction steps (if provided)
  • Workflow JSON (if attached)
  • Affected area (node, execution engine, editor, API, config, etc.)
  • Version where it broke / last working version

Step 2: Route to Test Strategy

Based on the affected area, pick the test layer and pattern:

Area Test Layer Pattern Key Location
Node operation Vitest unit NodeTestHarness + nock packages/nodes-base/nodes/*/test/
Node credential Vitest unit vitest-mock-extended packages/nodes-base/nodes/*/test/
Trigger webhook Vitest unit mock IHookFunctions + vi.mock GenericFunctions packages/nodes-base/nodes/*/test/
Binary data Vitest unit NodeTestHarness assertBinaryData packages/core/nodes-testing/
Execution engine Vitest integration WorkflowRunner + DI container packages/cli/src/__tests__/
CLI / API Vitest integration setupTestServer + supertest packages/cli/test/integration/
Config Vitest unit GlobalConfig + Container packages/@n8n/config/src/configs/__tests__/
Editor UI Vitest Vue Test Utils + Pinia packages/frontend/editor-ui/src/**/__tests__/
E2E / Canvas Playwright Test containers + composables packages/testing/playwright/

Step 3: Locate Source Files

Find the source code for the affected area:

  1. Search for the node/service/component mentioned in the ticket
  2. Find the GenericFunctions file (common bug location for nodes)
  3. Check for existing test files in the same area
  4. Look at recent git history on affected files (git log --oneline -10 -- <path>)

Step 4: Trace the Code Path

Read the source code and trace the execution path that triggers the bug:

  • Follow the call chain from entry point to the failure
  • Identify the specific line(s) where the bug manifests
  • Note any error handling (or lack thereof) around the bug

Step 5: Form Hypothesis

State a clear, testable hypothesis:

  • "When [input/condition], the code does [wrong thing] because [root cause]"
  • Identify the exact line(s) that need to change
  • Predict what the test output will show

Step 6: Find Test Patterns

Look for existing tests in the same area:

  1. Check test/ directories near the affected code
  2. Identify which mock/setup patterns they use
  3. Use the same patterns for consistency
  4. If no tests exist, find the closest similar node/service tests as a template

Step 7: Write Failing Test

Write a regression test that:

  • Uses the patterns found in Step 6
  • Targets the specific hypothesis from Step 5
  • Includes a comment referencing the ticket ID
  • Asserts the CORRECT behavior (test will fail on current code)
  • Also includes a "happy path" test to prove the setup works

Complete the test safety gate in /AGENTS.md before you run the test:

  • Trace side effects from imports, constructors, hooks, and mocked branches
  • Keep filesystem access in a test-owned temporary directory
  • Set N8N_USER_FOLDER before importing modules that resolve it
  • When a mock changes a state check, inspect and isolate the branch that it activates

Step 8: Run and Score

Run the test from the package directory (e.g., cd packages/nodes-base && pnpm test <file>).

Classify the result:

Confidence Criteria Output
CONFIRMED Test fails consistently, failure matches hypothesis Reproduction Report
LIKELY Test fails but failure mode differs slightly Report + caveat
UNCONFIRMED Cannot trigger the failure Report: what was tried
SKIPPED Hit a hard bailout trigger Report: why skipped
ALREADY_FIXED Bug no longer reproduces on current code Report: when fixed

Step 9: Iterate or Bail

If UNCONFIRMED after first attempt:

  • Revisit hypothesis — re-read the code path
  • Try a different test approach or layer
  • Maximum 3 attempts before declaring UNCONFIRMED

Hard bailout triggers (stop immediately):

  • Requires real third-party API credentials
  • Race condition / timing-dependent
  • Requires specific cloud/enterprise infrastructure
  • Requires manual UI interaction that can't be scripted

Output: Reproduction Report

Present findings in this format:


Ticket: [ID] — [title] Confidence: [CONFIRMED | LIKELY | UNCONFIRMED | SKIPPED | ALREADY_FIXED]

Root Cause

[1-2 sentences explaining the bug mechanism]

Location

File Lines Issue
path/to/file.ts XX-YY Description of the problem

Failing Test

path/to/test/file.test.ts — X/Y tests fail:

  1. test name — [failure description]

Fix Hint

[Pseudocode or description of the fix approach]


Important

  • DO NOT fix the bug — only reproduce it with a failing test
  • Leave test files in place as evidence (don't commit unless asked)
  • Run tests from the package directory (e.g., pushd packages/nodes-base && pnpm test <file> && popd)
  • Always redirect build output: pnpm build > build.log 2>&1
  • DO NOT look at existing fix PRs — the goal is to reproduce from signals alone

版本历史

  • fe0fad5 当前 2026-09-23 10:21
  • c31d0e5 2026-08-20 19:08

同 Skill 集合

.agents/skills/community-pr-readiness-check/SKILL.md
.agents/skills/content-design/SKILL.md
.agents/skills/conventions/SKILL.md
.agents/skills/create-agent-builder-eval/SKILL.md
.agents/skills/create-community-node-lint-rule/SKILL.md
.agents/skills/create-instance-ai-eval/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-pr/SKILL.md
.agents/skills/create-skill/SKILL.md
.agents/skills/db-migrations/SKILL.md
.agents/skills/design-system/SKILL.md
.agents/skills/experiments/SKILL.md
.agents/skills/gh-stack/SKILL.md
.agents/skills/human-like-code-review/SKILL.md
.agents/skills/linear-issue/SKILL.md
.agents/skills/loom-transcript/SKILL.md
.agents/skills/nathan/SKILL.md
.agents/skills/node-add-oauth/SKILL.md
.agents/skills/protect-endpoints/SKILL.md
.agents/skills/public-api/SKILL.md
.agents/skills/spec-driven-development/SKILL.md
.agents/skills/telemetry/SKILL.md
.agents/skills/ui-design/SKILL.md
.claude/plugins/n8n/skills/setup-mcps/SKILL.md
.opencode/skills/setup-mcps/SKILL.md
packages/@n8n/cli/skills/n8n-cli/SKILL.md
packages/@n8n/instance-ai/skills/agent-builder/SKILL.md
packages/@n8n/instance-ai/skills/config-evals/SKILL.md
packages/@n8n/instance-ai/skills/credential-recipe-research/SKILL.md
packages/@n8n/instance-ai/skills/credential-setup-with-computer-use/SKILL.md
packages/@n8n/instance-ai/skills/debugging-executions/SKILL.md
packages/@n8n/instance-ai/skills/instance-awareness/SKILL.md
packages/@n8n/instance-ai/skills/n8n-docs-assistant/SKILL.md
packages/@n8n/instance-ai/skills/planned-task-runtime/SKILL.md
packages/@n8n/instance-ai/skills/planning/SKILL.md
packages/@n8n/instance-ai/skills/post-build-flow/SKILL.md
packages/@n8n/instance-ai/skills/data-table-manager/SKILL.md
packages/@n8n/instance-ai/skills/intent-recognition/SKILL.md
packages/@n8n/instance-ai/skills/model-selection/SKILL.md
packages/@n8n/instance-ai/skills/one-off-operations/SKILL.md
packages/@n8n/instance-ai/skills/progressive-building/SKILL.md
packages/@n8n/instance-ai/skills/workflow-builder/SKILL.md

元信息

文件数
0
版本
fe0fad5
Hash
3117b072
收录时间
2026-08-20 19:08

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 15:21
浙ICP备14020137号-1