用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/digi4care/opencode-mastery --skill advanced-skill命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Persistent memory system with .memory.md, compaction, and cross-project sync
Analyzes sessions using ACE framework to generate prompt improvement suggestions focused on durable patterns.
Database technology selection and architecture - choose between SQL vs NoSQL, PostgreSQL vs MySQL vs MongoDB, scaling strategies, migration planning. Use for database DECISIONS. For PostgreSQL implementation use postgresql skill.
正在显示 SKILL.md
基于 SOC 职业分类
| name | advanced-skill |
| description | Full workflow orchestration with config-driven routing and phase-based execution |
This example demonstrates a complete workflow orchestration system with:
This is a Tier 3 advanced example showing:
skills/advanced/
├── SKILL.md # This file
├── config/
│ └── workflow-config.json # Configuration for workflow
├── router.sh # Main router (parsing, validation, delegation)
└── scripts/
├── phase-init.sh # Phase 1: Initialization
├── phase-validate.sh # Phase 2: Validation
├── phase-execute.sh # Phase 3: Execution
└── phase-finalize.sh # Phase 4: Finalization
Run the complete workflow:
./router.sh
Run specific phases only:
./router.sh --phase init
./router.sh --phase execute
Override default configuration:
./router.sh --mode production --verbose
Run with interactive prompts:
./router.sh --interactive
router.sh)Purpose: Central orchestration point
Responsibilities:
Pattern: Router pattern with validation and delegation
config/workflow-config.json)Purpose: Control workflow behavior without code changes
Key Settings:
Pattern: Configuration-driven behavior
scripts/phase-*.sh)Purpose: Execute specific workflow phases
Four Phases:
| Phase | Script | Purpose |
|---|---|---|
| 1 | phase-init.sh | Initialize environment, load dependencies |
| 2 | phase-validate.sh | Validate inputs, check prerequisites |
| 3 | phase-execute.sh | Execute main business logic |
| 4 | phase-finalize.sh | Cleanup, generate reports, save results |
Pattern: Single Responsibility - each phase does one thing
This example uses sequential execution:
Init → Validate → Execute → Finalize
Each phase completes before the next starts. If any phase fails, the workflow stops.
The router can skip phases based on configuration:
# Skip validation in quick mode
./router.sh --mode quick
Phase scripts can be modified to run in parallel:
# Run init and validate in parallel
./router.sh --parallel
The router uses POSIX-compliant argument parsing:
while [[ $# -gt 0 ]]; do
case $1 in
--phase)
PHASE="$2"
shift 2
;;
--mode)
MODE="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
The router reads configuration using jq:
MODE=$(jq -r '.mode' config/workflow-config.json)
VERBOSE=$(jq -r '.verbose' config/workflow-config.json)
The router delegates to phase scripts:
case $PHASE in
init)
bash scripts/phase-init.sh
;;
validate)
bash scripts/phase-validate.sh
;;
*)
bash scripts/phase-*.sh
;;
esac
Each phase returns exit codes:
# In router.sh
bash scripts/phase-validate.sh
if [[ $? -ne 0 ]]; then
echo "Validation failed"
exit 1
fi
workflow-config.json{
"mode": "development",
"verbose": false,
"phases": {
"timeout": 300,
"parallel": false
},
"output": {
"path": "./output",
"format": "json"
}
}
Fields:
mode: Execution mode (development|staging|production)verbose: Enable detailed loggingphases.timeout: Maximum seconds per phasephases.parallel: Run phases in paralleloutput.path: Directory for output filesoutput.format: Output format (json|yaml|csv)After studying this example, you should understand:
Workflow Orchestration
Configuration Management
Router Pattern
Modular Design
Error Handling
scripts/phase-<name>.shModify the router script to change execution order:
# Current: init → validate → execute → finalize
# Custom: validate → init → execute → finalize
Use read for interactive input:
read -p "Enter your name: " NAME
echo "Hello, $NAME!"
After mastering this advanced example, explore:
This pattern works well for:
This advanced example demonstrates a complete, production-ready workflow orchestration system with:
✅ Config-driven behavior ✅ Dynamic routing ✅ Phase-based execution ✅ Validation layer ✅ Modular design ✅ Error handling
Use this as a template for building your own complex workflows in OpenCode skills.