用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ForceInjection/domain-driven-design-skills --skill reinvoke-agent-fixes命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Conduct deep academic research for philosophy, neuroscience, cognitive science, and theoretical computer science (computability, complexity, AI theory, logic). Use when user asks to: research academic topics, find scholarly papers, conduct literature reviews, analyze citations, synthesize research findings, explore philosophical arguments, investigate consciousness/cognition, study computability/decidability/Turing machines, or analyze academic debates. Triggers on: 'research papers', 'literature review', 'academic sources', 'scholarly articles', 'philosophy of mind', 'computability theory', 'neuroscience studies', 'find papers on', 'what does the research say'.
Create clear action plans with steps, success criteria, and risk awareness. Use before implementing features, making changes, starting projects, or anytime you need a roadmap to success. Triggers on "plan this", "how should we approach", "what's the strategy", "steps to complete", or when facing complex multi-step work.
Add keyboard navigation to a feature using CommandRegistryService. Use when implementing keyboard shortcuts, vim-style navigation, or hotkeys for a page or component.
基于 SOC 职业分类
正在显示 SKILL.md
| name | reinvoke-agent-fixes |
| description | Re-invoke agents to fix issues found during validation (style, tests, logic) |
| allowed-tools | Task, Bash, Read, Write |
Purpose: Analyze validation failures and re-invoke appropriate stakeholder agents with scoped fix requirements.
Performance: Proper delegation of fixes, avoids main agent protocol violations
# Categorizes failure type:
- Style violations (Checkstyle, PMD) → formatter agent
- Test failures → tester agent (or engineer if quality issue)
- Logic errors → architect agent
- Compilation errors → main agent (if trivial)
# Decision tree from CLAUDE.md:
- Style violations → Re-invoke formatter
- Test failures → Re-invoke tester (or engineer)
- Logic errors → Re-invoke architect
- Complex refactoring → Re-invoke appropriate agent
# Scoped requirements document:
- Specific failures to fix
- Context from original implementation
- Constraints (don't break existing functionality)
- Validation criteria
# Uses Task tool with:
- Agent type (architect/tester/formatter/engineer)
- Scoped fix requirements
- Same worktree as original implementation
- IMPLEMENTATION mode (fixes are implementation)
# After agent completes:
- Merge agent branch to task branch
- Re-run validation
- Repeat if new issues found
# After validation finds style violations
TASK_NAME="implement-formatter-api"
FAILURE_TYPE="style"
VIOLATIONS="$(cat checkstyle-violations.txt)"
/workspace/main/.claude/scripts/reinvoke-agent-fixes.sh \
--task "$TASK_NAME" \
--failure-type "$FAILURE_TYPE" \
--violations "$VIOLATIONS"
# Multiple issues found
TASK_NAME="implement-formatter-api"
/workspace/main/.claude/scripts/reinvoke-agent-fixes.sh \
--task "$TASK_NAME" \
--style-violations "checkstyle.txt" \
--test-failures "test-failures.txt" \
--logic-errors "logic-issues.txt"
Triggers:
Fix Scope:
Fix the following style violations:
1. Missing JavaDoc on public method Foo.bar()
File: src/main/java/Foo.java:15
2. Line too long (>120 chars)
File: src/main/java/Bar.java:42
DO NOT change logic or tests. ONLY fix style/documentation issues.
Triggers:
Fix Scope:
Fix the following test failures:
1. TestFoo.testBar() - AssertionError
Expected: 5, Actual: 3
File: src/test/java/TestFoo.java:25
2. TestBaz.testEdgeCase() - NullPointerException
File: src/test/java/TestBaz.java:40
DO NOT change production code unless fixing a logic bug.
Focus on making tests pass correctly.
Triggers (quality issues):
Fix Scope:
Improve code quality to fix test issues:
1. Foo.bar() has cyclomatic complexity of 15
Refactor to reduce complexity
2. Duplicated code in Foo and Bar
Extract common logic
Ensure tests pass after refactoring.
Triggers:
Fix Scope:
Fix the following logic errors:
1. ValidationEngine.validate() incorrectly handles null input
Current: Throws NPE
Expected: Returns validation error
2. RuleEngine.apply() performance O(n²) instead of O(n)
Optimize algorithm
Ensure all tests still pass after fixes.
# Fix Requirements: {task-name}
## Failure Summary
{Brief description of what failed}
## Specific Issues
1. {Issue 1 description}
- Location: {file:line}
- Current behavior: {what happens}
- Expected behavior: {what should happen}
2. {Issue 2 description}
- Location: {file:line}
- Error: {error message}
- Fix needed: {specific change}
## Constraints
- DO NOT modify files: {list files to preserve}
- DO NOT break existing tests
- Maintain API compatibility
- Follow existing patterns
## Validation Criteria
- All tests pass
- No Checkstyle violations
- No PMD violations
- Build succeeds
VALIDATION state: Run build/tests/checks
↓
Issues found
↓
[reinvoke-agent-fixes skill] ← THIS SKILL
↓
Analyze failure type
↓
Determine responsible agent
↓
Create fix requirements
↓
Re-invoke agent with fixes
↓
Agent fixes issues
↓
Merge fixes to task branch
↓
Re-run validation
↓
If issues remain: Repeat loop
If all pass: Continue to AWAITING_USER_APPROVAL
Script returns JSON:
{
"status": "success",
"message": "Agent re-invoked for fixes",
"task_name": "implement-formatter-api",
"failure_type": "style",
"agent_invoked": "formatter",
"fix_requirements_file": "/workspace/tasks/implement-formatter-api/fix-requirements-formatter.md",
"agent_branch": "implement-formatter-api-formatter",
"issues_count": 5,
"timestamp": "2025-11-11T12:34:56-05:00"
}
Compilation Errors:
Infrastructure:
Trivial Fixes:
Style Violations:
Test Failures:
Logic Errors:
Complex Refactoring:
Question: "Can this fix be applied mechanically without changing logic?"
On any error:
# Ambiguous failure type
# Options:
1. Categorize manually based on nature
2. Start with most likely agent (usually formatter for style)
3. Invoke multiple agents if needed
4. Ask user which agent should fix
# Agent worktree removed prematurely
# Re-create:
git worktree add /workspace/tasks/{task}/agents/{agent}/code \
-b {task}-{agent}
# Then retry fix invocation
# Fix introduced new failures
# Options:
1. Re-invoke same agent with additional constraints
2. Invoke different agent to fix new issues
3. Rollback agent fix and try different approach
# Never converges to passing validation
# Possible causes:
1. Contradictory requirements (impossible to satisfy both)
2. Agent misunderstanding requirements
3. Tests themselves incorrect
# Solutions:
1. Manual investigation of root cause
2. Simplify requirements
3. Fix tests if they're wrong
4. Escalate to user for guidance
Validation: Checkstyle failures
Agent: formatter
Scope: Add missing JavaDoc, fix line lengths
Result: Tests still pass, style clean
Validation: 3 test failures
Agent: tester
Scope: Fix assertions, handle edge cases
Result: All tests pass, no logic changes
Validation: Logic error found by tests
Agent 1: architect (fix logic)
Agent 2: tester (update tests for new logic)
Result: Correct behavior, tests updated
Validation: Complexity too high
Agent: engineer
Scope: Refactor to reduce complexity
Result: Same behavior, better quality
The reinvoke-agent-fixes script performs:
Analysis Phase
Agent Selection Phase
Requirements Creation Phase
Invocation Phase
Monitoring Phase
Integration Phase