用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill agent-handoffs命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | agent-handoffs |
| description | Agent parameter passing, memory files, and data handoffs between agents |
Agents are workflow-agnostic. They perform specific tasks regardless of which workflow invokes them.
Workflows pass parameters to agents to tell them:
All agents that work with memory files MUST accept these parameters:
interface AgentParameters {
workflow: string; // "create-module" | "add-operation" | "update-module"
moduleId: string; // "github-github" | "amazon-aws-s3"
inputFile?: string; // File to read from (optional if agent doesn't need input)
outputFile: string; // File to write to
}
CRITICAL: Always use absolute paths for .localmemory to avoid issues when working from different directories.
# Get project root (choose method based on context)
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
# Standard pattern - ALWAYS use absolute paths
MEMORY_PATH="${PROJECT_ROOT}/.claude/.localmemory/${workflow}-${moduleId}"
# Examples (where PROJECT_ROOT is your project's absolute path):
# ${PROJECT_ROOT}/.claude/.localmemory/create-module-github-github/
# ${PROJECT_ROOT}/.claude/.localmemory/add-operation-github-github/
# ${PROJECT_ROOT}/.claude/.localmemory/update-module-amazon-aws-s3/
# Method 1: Using git (preferred if in git repo)
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
# Method 2: Using script location (if you know the script depth)
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# Always construct absolute paths
MEMORY_PATH="${PROJECT_ROOT}/.claude/.localmemory/${workflow}-${moduleId}"
Agents should always receive or construct absolute paths. When constructing paths in agent responses, use the working directory from the environment.
# Agent receives parameters
WORKFLOW="create-module"
MODULE_ID="github-github"
INPUT_FILE="phase-01-discovery.json"
# Get project root and construct absolute paths
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
MEMORY_PATH="${PROJECT_ROOT}/.claude/.localmemory/${WORKFLOW}-${MODULE_ID}"
INPUT_PATH="${MEMORY_PATH}/${INPUT_FILE}"
# Read data
PRODUCT_PACKAGE=$(jq -r '.productPackage' "${INPUT_PATH}")
MODULE_PACKAGE=$(jq -r '.modulePackage' "${INPUT_PATH}")
# Agent receives parameters
OUTPUT_FILE="phase-02-scaffolding.json"
# Get project root and construct absolute paths
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
MEMORY_PATH="${PROJECT_ROOT}/.claude/.localmemory/${WORKFLOW}-${MODULE_ID}"
OUTPUT_PATH="${MEMORY_PATH}/${OUTPUT_FILE}"
# Ensure directory exists
mkdir -p "${MEMORY_PATH}"
# Write data
cat > "${OUTPUT_PATH}" <<EOF
{
"phase": 2,
"name": "Module Scaffolding",
"status": "completed",
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
...
}
EOF
## Responsibilities
- Create module structure for new modules
- Read from phase-01-discovery.json
- Write to phase-02-scaffolding.json
## Responsibilities
- Create module directory structure
- Read parameters from input file
- Validate generated structure
- Write results to output file
## Required Parameters
- workflow: Workflow type
- moduleId: Module identifier
- inputFile: File containing parameters
- outputFile: File to write results
## Input File Structure
Expected fields in input file:
- productPackage: Product package name
- modulePackage: Module package name
- serviceName: Service name
### Phase 2: Module Scaffolding
**Agent:** @module-scaffolder
**Invocation:**
```bash
@module-scaffolder
Parameters:
workflow: create-module
moduleId: github-github
inputFile: phase-01-discovery.json
outputFile: phase-02-scaffolding.json
### Multiple Workflows Using Same Agent
**Create Module Workflow:**
```bash
@api-architect
Parameters:
workflow: create-module
moduleId: github-github
inputFile: phase-01-discovery.json
outputFile: phase-03-api-spec.json
Add Operation Workflow:
@api-architect
Parameters:
workflow: add-operation
moduleId: github-github
inputFile: operation-spec.json
outputFile: updated-api-spec.json
Same agent, different parameters!
Workflows specify exact file names based on their phase structure:
Create Module:
phase-01-discovery.jsonphase-02-scaffolding.jsonphase-03-api-spec.jsonAdd Operation:
operation-definition.jsonapi-spec-update.jsonimplementation-plan.jsonUpdate Module:
operations-list.jsonupdate-plan.jsonAgents should be flexible about input structure:
// Agent reads what it needs
const productPackage = input.productPackage;
const modulePackage = input.modulePackage;
// If field doesn't exist, agent reports error
if (!productPackage) {
throw new Error("Required field 'productPackage' missing from input file");
}
Workflows are responsible for:
Agents are responsible for:
✅ Reusability: Same agent works across multiple workflows ✅ Testability: Agents can be tested independently with different parameters ✅ Maintainability: Agent changes don't affect workflow structure ✅ Flexibility: New workflows can use existing agents ✅ Clarity: Clear separation of concerns
# BAD
if [ "$WORKFLOW" == "create-module" ]; then
# Special logic for create
fi
Agents should not have workflow-specific logic. If needed, workflows should pass different parameters.
# BAD - Relative path
INPUT=".claude/.localmemory/create-module-${MODULE_ID}/phase-01-discovery.json"
# BAD - Hardcoded workflow
INPUT="${PROJECT_ROOT}/.claude/.localmemory/create-module-${MODULE_ID}/phase-01-discovery.json"
# GOOD - Absolute path with parameters
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
INPUT="${PROJECT_ROOT}/.claude/.localmemory/${WORKFLOW}-${MODULE_ID}/${INPUT_FILE}"
Always construct absolute paths from parameters.
# BAD
echo '{"phase": 2, ...}'
Extract phase info from parameters or workflow context if needed.
**File:** `.claude/.localmemory/create-{module-id}/phase-02-scaffolding.json`
Read from: `.claude/.localmemory/create-{module-id}/phase-01-discovery.json`
**Input File:** Specified by workflow (e.g., phase-01-discovery.json)
**Output File:** Specified by workflow (e.g., phase-02-scaffolding.json)
**Example Paths:**
- Input: `.claude/.localmemory/{workflow}-{moduleId}/{inputFile}`
- Output: `.claude/.localmemory/{workflow}-{moduleId}/{outputFile}`