一键导入
speckit-agent-assign-assign
Scan available Claude Code agents and assign them to tasks in tasks.md
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scan available Claude Code agents and assign them to tasks in tasks.md
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Think before building. Use when the user asks to reason about, analyze, evaluate, compare options, make an architecture decision, choose between approaches, think through a problem, or assess trade-offs. Also use when the user asks 'why did we...', 'should we...', 'what are our options', 'is this the right approach', or wants to frame/reframe a problem.
Archive a feature specification into main project memory after merge, resolving gaps and conflicts
Generate spec-kit configuration tailored to the existing codebase
Incrementally adopt SDD for existing features with reverse-engineered specs
Auto-discover project structure, tech stack, frameworks, and architecture patterns
Verify bootstrap output matches actual project structure and conventions
| name | speckit-agent-assign-assign |
| description | Scan available Claude Code agents and assign them to tasks in tasks.md |
| compatibility | Requires spec-kit project structure with .specify/ directory |
| metadata | {"author":"github-spec-kit","source":"agent-assign:commands/assign.md"} |
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Check for extension hooks (before agent assignment):
.specify/extensions.yml exists in the project root.hooks.before_implement keyenabled is explicitly false. Treat hooks without an enabled field as enabled by default.condition expressions:
condition field, or it is null/empty, treat the hook as executablecondition, skip the hook and leave condition evaluation to the HookExecutor implementationoptional flag:
optional: true):
## Extension Hooks
**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
optional: false):
## Extension Hooks
**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
Wait for the result of the hook command before proceeding to the Outline.
.specify/extensions.yml does not exist, skip silentlySetup: Run .specify/scripts/bash/check-prerequisites.sh --json --require-tasks from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'''m Groot' (or double-quote if possible: "I'm Groot").
Scan Agent Definitions: Discover all available Claude Code agent definition files following the official hierarchy. Higher-priority levels override lower-priority agents with the same name.
Scanning priority order (highest to lowest):
.claude/agents/*.md in the repository root~/.claude/agents/*.md in the user's home directoryFor each agent file found:
name (filename without .md if not in frontmatter) and descriptionBuild an Agent Registry table:
| # | Agent Name | Source | Description |
|---|-----------------|---------|------------------------------------------|
| 1 | backend-dev | project | Backend development specialist |
| 2 | frontend-dev | project | Frontend React/TypeScript specialist |
| 3 | test-writer | user | Unit and integration test author |
If no agent definition files are found at any level, STOP and report: "No agent definition files found at any hierarchy level. Since there are no specialized agents available, it is recommended to use /speckit.implement directly for task execution."
Load Tasks: Read tasks.md from FEATURE_DIR. Parse each task line following the checklist format:
- [ ] [TaskID] [P?] [Story?] Description with file path
Extract: Task ID, parallel marker, story label, description, and file paths mentioned.
Auto-Match Agents to Tasks: For each task, analyze its description and file paths against each agent's description and capabilities. Consider:
src/api/ → API agent, src/models/ → backend agent, tests/ → test agent)Produce a proposed assignment for every task. If no agent is a good fit, assign default.
Present Assignments for Confirmation: Display a summary table of all proposed assignments:
| Task ID | Description (truncated) | Assigned Agent | Reason |
|---------|----------------------------------|-----------------|---------------------------|
| T001 | Create project structure... | default | General setup task |
| T002 | Implement User model in src/... | backend-dev | Data model creation |
| T003 | Write API endpoint in src/api/... | backend-dev | API implementation |
| T004 | Create React component in src/... | frontend-dev | UI component development |
| T005 | Write unit tests for... | test-writer | Test authoring |
Ask the user: "Review the proposed agent assignments above. You can:
Wait for user response. Apply any requested changes before proceeding.
Write Agent Assignments File: Generate agent-assignments.yml in FEATURE_DIR with the following structure:
# Agent Assignments
# Feature: <feature-name from plan.md or branch name>
# Generated: <timestamp>
# Command: /speckit.agent-assign.assign
agents_scanned:
- name: "backend-dev"
source: "project"
description: "Backend development specialist"
- name: "frontend-dev"
source: "project"
description: "Frontend React/TypeScript specialist"
assignments:
T001:
agent: "default"
reason: "General setup task, no specialized agent needed"
T002:
agent: "backend-dev"
reason: "Task involves data model creation, matches backend-dev capabilities"
T003:
agent: "backend-dev"
reason: "API endpoint implementation aligns with backend-dev skills"
Write this file to FEATURE_DIR/agent-assignments.yml.
Report: Output a summary:
agent-assignments.ymldefault/speckit.agent-assign.validate to verify assignmentsCheck for extension hooks: After assignment completion, check if .specify/extensions.yml exists in the project root.
hooks.after_implement keyenabled is explicitly false. Treat hooks without an enabled field as enabled by default.condition expressions:
condition field, or it is null/empty, treat the hook as executablecondition, skip the hook and leave condition evaluation to the HookExecutor implementationoptional flag:
optional: true):
## Extension Hooks
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
optional: false):
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
.specify/extensions.yml does not exist, skip silentlyNote: This command requires tasks.md to exist. If it does not exist, suggest running /speckit.tasks first.