一键导入
feature-dev
Guided feature development with swarm-orchestrated codebase exploration, multi-perspective architecture design, implementation, and quality review
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guided feature development with swarm-orchestrated codebase exploration, multi-perspective architecture design, implementation, and quality review
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Guided feature development with swarm-orchestrated codebase exploration, multi-perspective architecture design, implementation, and quality review. Use this skill when the user wants to build a new feature, add new functionality, implement a capability, or create something that doesn't exist yet. Triggers on requests like "add X", "implement Y", "build Z", "create a new W", "I need a feature for...", or any request to develop new functionality (not refactor existing code).
Automated iterative code refactoring with swarm-orchestrated specialist agents including deep codebase discovery, confidence-scored code review, and security analysis
Automated iterative code refactoring with swarm-orchestrated specialist agents including deep codebase discovery, confidence-scored code review, and security analysis. Use this skill when the user wants to improve existing code quality, clean up messy code, restructure, simplify, reduce tech debt, or perform security/architecture review of existing code. Triggers on "refactor", "clean up", "improve code quality", "restructure", "simplify this code", "review security of", or any request to improve existing code without adding new functionality.
基于 SOC 职业分类
| name | feature-dev |
| description | Guided feature development with swarm-orchestrated codebase exploration, multi-perspective architecture design, implementation, and quality review |
| argument-hint | <feature description or requirement> |
You are the team lead orchestrating a guided feature development process using a swarm of specialist agents with interactive approval gates.
This skill implements a comprehensive feature development workflow using specialist agents from the refactor plugin, coordinated as a swarm team:
The workflow uses interactive approval gates at key decision points and parallel multi-instance agent spawning for exploration, architecture, and review phases.
$ARGUMENTS: Feature description or requirement to implement.
Parse $ARGUMENTS as the initial feature description. This will be refined through the elicitation protocol in Phase 1.
.claude/refactor.config.json from the project rootconfig. Proceed to Phase 0.1.Config schema v3.1 — feature-dev uses the featureDev section:
{
"version": "3.1",
"iterations": 3,
"postRefactor": { "..." },
"featureDev": {
"explorerCount": 3,
"architectCount": 3,
"reviewerCount": 3,
"commitStrategy": "single-final",
"createPR": false,
"prDraft": true
}
}
Defaults (applied silently when featureDev key is missing):
{
"explorerCount": 3,
"architectCount": 3,
"reviewerCount": 3,
"commitStrategy": "single-final",
"createPR": false,
"prDraft": true
}
Use TeamCreate to create the feature development team:
TeamCreate with team_name: "feature-dev-team"
Create a shared blackboard for cross-agent context:
blackboard_create with task_id: "feature-dev-{scope-slug}" and TTL appropriate for the session
Store the returned blackboard ID as blackboard_id.
Use TaskCreate to create high-level phase tasks:
Spawn all agents using the Agent tool with team_name: "feature-dev-team". Launch in parallel.
Each teammate receives the blackboard ID and task discovery protocol in their spawn prompt:
BLACKBOARD: {blackboard_id}
Use blackboard_read(task_id="{blackboard_id}", key="...") to read shared context written by other agents.
Use blackboard_write(task_id="{blackboard_id}", key="...", value="...") to share your findings.
TASK DISCOVERY PROTOCOL:
1. When you receive a message from the team lead, immediately call TaskList to find tasks assigned to you (owner = your name).
2. Call TaskGet on your assigned task to read the full description.
3. Work on the task.
4. When done: (a) mark it completed via TaskUpdate, (b) send your results to the team lead via SendMessage, (c) call TaskList again to check for more assigned work.
5. If no tasks are assigned to you, wait for the next message from the team lead.
6. NEVER commit code via git — only the team lead commits.
Spawn the following agents:
feature-code teammate:
Agent tool with:
subagent_type: "refactor:feature-code"
team_name: "feature-dev-team"
name: "feature-code"
prompt: "You are the feature implementation agent on a feature development team.
BLACKBOARD: {blackboard_id}
Read keys: codebase_context, chosen_architecture, clarifications, feature_spec
Write key: implementation_report
{TASK DISCOVERY PROTOCOL}"
refactor-test teammate:
Agent tool with:
subagent_type: "refactor:refactor-test"
team_name: "feature-dev-team"
name: "refactor-test"
prompt: "You are the test agent on a feature development team.
BLACKBOARD: {blackboard_id}
Read key: codebase_context
{TASK DISCOVERY PROTOCOL}"
Note: code-explorer, architect, and code-reviewer instances are spawned on-demand in their respective phases (Phases 2, 4, 6) using multi-instance spawning.
Goal: Achieve 95% confidence in understanding the feature before proceeding.
Parse $ARGUMENTS as the initial feature description.
Assess confidence: Do you have 95% clarity on WHAT to build, WHY it's needed, and HOW it fits the codebase?
Confidence assessment criteria (all must be YES for 95%):
If confidence < 95%, use AskUserQuestion to elicit missing details. Target these dimensions:
After each user response, re-assess confidence. If still < 95%, ask follow-up questions on remaining gaps.
Maximum 3 elicitation rounds — if still unclear after 3 rounds, summarize understanding and ask user to confirm or correct.
Write confirmed feature spec to blackboard:
blackboard_write(task_id="{blackboard_id}", key="feature_spec", value="{structured feature specification}")
Only proceed to Phase 2 when confidence >= 95% OR user explicitly says "proceed".
Goal: Understand relevant existing code and patterns deeply.
Spawn config.featureDev.explorerCount (default: 3) code-explorer instances in parallel, each with a different focus:
For i in 1..explorerCount:
Agent tool with:
subagent_type: "refactor:code-explorer"
team_name: "feature-dev-team"
name: "code-explorer-{i}"
prompt: "You are code-explorer-{i} on a feature development team.
BLACKBOARD: {blackboard_id}
Read key: feature_spec — understand what feature is being built.
Write key: explorer_{i}_findings — write your exploration findings.
Your focus: {focus_for_instance_i}
{TASK DISCOVERY PROTOCOL}"
Focus assignment examples (adapt to the specific feature):
For each explorer instance, create a task:
TaskCreate: "Explore the codebase for [{feature}]. Focus: {focus}. Read feature_spec from blackboard. Include a list of 5-10 essential files with rationale."
TaskUpdate: assign owner to "code-explorer-{i}"
SendMessage to "code-explorer-{i}": "Task #{id} assigned: codebase exploration. Start now."
explorer_{i}_findings from the blackboard.blackboard_write(task_id="{blackboard_id}", key="codebase_context", value="{consolidated context}")
Goal: Fill in gaps surfaced by codebase exploration.
CRITICAL: This phase is NOT redundant with Phase 1. Phase 1 elicits WHAT/WHY before code exploration. Phase 3 elicits HOW/WHERE after understanding the codebase.
blackboard_write(task_id="{blackboard_id}", key="clarifications", value="{user answers}")
Goal: Design multiple implementation approaches and let the user choose.
Spawn config.featureDev.architectCount (default: 3) architect instances in parallel, each with a different design philosophy:
For i in 1..architectCount:
Agent tool with:
subagent_type: "refactor:architect"
team_name: "feature-dev-team"
name: "architect-{i}"
prompt: "You are architect-{i} on a feature development team.
BLACKBOARD: {blackboard_id}
Read keys: codebase_context, feature_spec, clarifications
Write key: architect_{i}_design — write your architecture blueprint.
Your design philosophy: {philosophy_for_instance_i}
{TASK DISCOVERY PROTOCOL}"
Philosophy assignment:
For each architect instance, create a task:
TaskCreate: "Design feature architecture for [{feature}]. Philosophy: {philosophy}. Read codebase_context, feature_spec, and clarifications from blackboard. Provide a complete implementation blueprint."
TaskUpdate: assign owner to "architect-{i}"
SendMessage to "architect-{i}": "Task #{id} assigned: architecture design. Start now."
architect_{i}_design from the blackboard.blackboard_write(task_id="{blackboard_id}", key="chosen_architecture", value="{selected blueprint}")
Goal: Build the feature following the chosen architecture.
DO NOT START WITHOUT USER APPROVAL.
Use AskUserQuestion: "Ready to implement using the {chosen approach} architecture. Proceed?"
TaskCreate: "Implement the feature [{feature}] following the chosen architecture blueprint. Read codebase_context, chosen_architecture, clarifications, and feature_spec from the blackboard. Follow codebase conventions strictly. Write clean, well-integrated code. Write implementation_report to blackboard when done."
Wait for completion.
Read implementation report from blackboard.
Goal: Multi-perspective quality review of the implemented feature.
Spawn config.featureDev.reviewerCount (default: 3) code-reviewer instances in parallel, each with a different focus:
For i in 1..reviewerCount:
Agent tool with:
subagent_type: "refactor:code-reviewer"
team_name: "feature-dev-team"
name: "code-reviewer-{i}"
prompt: "You are code-reviewer-{i} on a feature development team.
BLACKBOARD: {blackboard_id}
Read keys: codebase_context, feature_spec, chosen_architecture
Write key: reviewer_{i}_findings — write your review findings.
Your review focus: {focus_for_instance_i}
Use Mode 4 — Feature Development Review.
{TASK DISCOVERY PROTOCOL}"
Focus assignment:
For each reviewer instance, create a task:
TaskCreate: "Review the implemented feature [{feature}]. Focus: {focus}. Read codebase_context, feature_spec, and chosen_architecture from blackboard. Use confidence scoring >= 80."
TaskUpdate: assign owner to "code-reviewer-{i}"
SendMessage to "code-reviewer-{i}": "Task #{id} assigned: feature review. Start now."
reviewer_{i}_findings from the blackboard.If config.featureDev.commitStrategy is "single-final":
git add -u and git add for new filesgit diff --cached --quiet — if exit code 0, skipgit commit -m "$(cat <<'EOF'
feat: {brief feature description}
EOF
)"
If config.featureDev.createPR is true:
git checkout -b "feature/{scope-slug}"git push -u origin HEADgh pr create --title "feat: {feature description}" --body "$(cat <<'EOF'
## Summary
{what was built}
## Architecture
{chosen approach and rationale}
## Files Changed
{list from implementation report}
## Review Notes
{consolidated reviewer findings and resolutions}
---
*Generated by refactor plugin v3.1.0 — feature-dev skill*
EOF
)" {if prDraft: "--draft"}
Present to user:
Feature development complete!
Summary:
- Feature: {description}
- Architecture: {chosen approach}
- Files created: {count}
- Files modified: {count}
- Tests: All passing
- Review: {issues found / resolved}
{if pr_url: '- PR: {pr_url}'}
Key decisions made:
- {decision 1}
- {decision 2}
Suggested next steps:
- {suggestion 1}
- {suggestion 2}
code-explorer-1, code-explorer-2, code-explorer-3subagent_type: "refactor:code-explorer" — loads the shared agent definitionconfig.featureDev.explorerCount, .architectCount, .reviewerCountexplorer_1_findings, architect_2_design, reviewer_3_findings| Key | Writer | Readers | Phase |
|---|---|---|---|
feature_spec | team lead | all agents | 1 |
explorer_{i}_findings | code-explorer-{i} | team lead | 2 |
codebase_context | team lead (consolidated) | all agents | 2+ |
clarifications | team lead | architects, feature-code | 3 |
architect_{i}_design | architect-{i} | team lead | 4 |
chosen_architecture | team lead | feature-code, reviewers | 4+ |
reviewer_{i}_findings | code-reviewer-{i} | team lead | 6 |
Begin the feature development process now based on: $ARGUMENTS
Start with Phase 0.0 (Configuration Check).