一键导入
mock-updater
Orchestrate parallel subagents to update all mock implementations when a port interface changes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Orchestrate parallel subagents to update all mock implementations when a port interface changes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Show CI/CD pipeline status for current branch with job details and failure diagnostics
Cross-validate documentation and artifacts across the codebase for consistency, conflicts, and contradictions. Use when users ask to "cross-validate", "validate docs", "check documentation consistency", "audit documentation", or find conflicts/contradictions in docs. Supports automatic fixing with "validate and fix" argument. Runs parallel subagents for efficient validation across categories (domain-models, agent-system, tech-stack, architecture, cli-commands). Part of the ShipIT autonomous SDLC platform — https://github.com/jrmatherly/shipit
React Flow (@xyflow/react) for workflow visualization with custom nodes and edges. Use when building graph visualizations, creating custom workflow nodes, implementing edge labels, or controlling viewport. Triggers on ReactFlow, @xyflow/react, Handle, NodeProps, EdgeProps, useReactFlow, fitView.
Diagnose semantic-release and npm publish failures from the latest CI release job
Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind CSS, or implementing UI patterns like buttons, dialogs, dropdowns, tables, and complex form layouts.
Use when ready to commit, push, and create a PR with CI verification. Triggers include "commit and pr", "push pr", "create pr", "ship it", or when implementation is complete and needs CI validation. Watches CI and auto-fixes failures. Part of the ShipIT autonomous SDLC platform — https://github.com/jrmatherly/shipit
| name | mock-updater |
| description | Orchestrate parallel subagents to update all mock implementations when a port interface changes |
| user_invocable | true |
When a port interface changes, this skill orchestrates parallel subagents to update every mock implementation across the test suite.
pnpm typecheck reveals mock type errors across multiple test filescheck-mock-completeness hook warns about incomplete mocks/serena-impact-analysis and seeing many test files in the blast radiusDetermine what changed on the port interface:
# See the diff
git diff packages/core/src/application/ports/output/
Record:
IFeatureRepositorypackages/core/src/application/ports/output/repositories/feature-repository.interface.tsfindByIds(ids: string[]): Promise<Feature[]>ls tests/helpers/mock-*.helper.ts
If a factory exists for this interface (e.g., tests/helpers/mock-feature-repository.helper.ts):
If no factory exists, check mock duplication count:
grep -rl "vi\.fn()" tests/ | xargs grep -l "IFeatureRepository" | wc -l
If count >= 5, strongly recommend creating a factory first with /mock-factory — it's a one-time investment that makes all future updates trivial.
grep -rl "IFeatureRepository\|mockFeatureRepo\|featureRepository.*vi\.fn" tests/ | sort
Save this list. Group into batches of ~5 files per subagent.
Read the full interface to know what methods each mock must implement:
cat packages/core/src/application/ports/output/repositories/feature-repository.interface.ts
For each batch of test files, deploy a subagent using the Agent tool. Each subagent gets:
Deployment pattern:
Agent(
description: "Update mocks batch 1",
name: "mock-update-1",
prompt: "Update mock objects in these test files to match the current IFeatureRepository interface.
The interface now has these methods:
- create(feature: Feature): Promise<void>
- findById(id: string): Promise<Feature | null>
- findByIds(ids: string[]): Promise<Feature[]> ← NEW
- list(): Promise<Feature[]>
- listActive(): Promise<Feature[]>
- update(feature: Feature): Promise<void>
- delete(id: string): Promise<void>
Files to update:
1. /Users/.../tests/unit/application/use-cases/create-feature.test.ts
2. /Users/.../tests/unit/application/use-cases/list-features.test.ts
3. /Users/.../tests/unit/application/use-cases/delete-feature.test.ts
For each file:
- Find the mock object (usually in beforeEach or at describe scope)
- Add: findByIds: vi.fn().mockResolvedValue([])
- Do NOT change existing mock return values or test assertions
- Only add the missing method with a sensible default"
)
Deploy all batches in a single message with multiple Agent tool calls for true parallelism:
// In a single response, call Agent multiple times:
Agent(name: "mock-update-1", prompt: "Update files 1-5...")
Agent(name: "mock-update-2", prompt: "Update files 6-10...")
Agent(name: "mock-update-3", prompt: "Update files 11-15...")
After all subagents complete:
# Type check — all mocks must satisfy the interface
pnpm typecheck
# Run unit tests — no regressions
pnpm test:unit
# Double-check no files were missed
grep -rl "IFeatureRepository" tests/ | xargs grep -L "findByIds" 2>/dev/null
If you just updated 10+ files individually, create a centralized factory to prevent this pain next time:
/mock-factory
Then refactor all test files to use it. Future interface changes will only require updating one file.
Interface changed
├── Factory exists? → Update factory only → Verify → Done
├── < 5 mocks? → Update manually → Verify → Done
└── >= 5 mocks?
├── Create factory first (/mock-factory) → Update factory → Refactor tests → Verify → Done
└── Urgent? Deploy parallel subagents → Verify → Create factory later
| Mock count | Strategy |
|---|---|
| 1-4 | Update manually (no subagents needed) |
| 5-15 | 2-3 subagents, ~5 files each |
| 16-30 | 4-6 subagents, ~5 files each |
| 30+ | Create factory FIRST, then single factory update |