composable-primitives
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComposable Primitives Skill
可组合Agent原语Skill
Guide design of composable agentic primitives for flexible workflow creation.
指导设计用于灵活工作流创建的可组合Agent原语。
When to Use
适用场景
- Designing new agentic workflows
- Customizing SDLC for specific needs
- Mapping problem classes to primitives
- Building organization-specific compositions
- 设计新的Agent工作流
- 根据特定需求定制SDLC
- 将问题类别映射到原语
- 构建组织专属的组合方案
The Secret
核心秘诀
"The secret of tactical agentic coding is that it's not about the software developer lifecycle at all. It's about composable agentic primitives you can use to solve any engineering problem class."
"战术性Agent编码的秘诀根本不在于软件开发生命周期,而在于可组合的Agent原语——你可以用它们解决任何类型的工程问题。"
Core Primitives
核心原语
| Primitive | Purpose | Input | Output |
|---|---|---|---|
| Classify | Categorize input | Issue/task | Classification |
| Plan | Create implementation spec | Issue | Plan file |
| Build | Implement the plan | Plan file | Code changes |
| Test | Validate functionality | Code changes | Pass/fail |
| Review | Validate alignment | Spec + code | Issue list |
| Patch | Fix specific issues | Issue description | Targeted fix |
| Document | Generate documentation | Code changes | Doc files |
| Ship | Deploy to production | Validated code | Deployed state |
| Branch | Create isolated context | Classification | Branch name |
| Commit | Save checkpoint | Changes | Commit hash |
| Primitive | Purpose | Input | Output |
|---|---|---|---|
| Classify | 对输入进行分类 | 需求/任务 | 分类结果 |
| Plan | 创建实现规范 | 需求 | 计划文件 |
| Build | 执行计划实现 | 计划文件 | 代码变更 |
| Test | 验证功能有效性 | 代码变更 | 通过/失败 |
| Review | 验证一致性 | 规范+代码 | 问题列表 |
| Patch | 修复特定问题 | 问题描述 | 针对性修复 |
| Document | 生成文档 | 代码变更 | 文档文件 |
| Ship | 部署到生产环境 | 已验证代码 | 已部署状态 |
| Branch | 创建隔离上下文 | 分类结果 | 分支名称 |
| Commit | 保存检查点 | 变更内容 | 提交哈希值 |
Composition Workflow
组合工作流步骤
Step 1: Identify Problem Class
步骤1:确定问题类别
What type of work?
- Chore (simple, low risk)
- Bug (medium complexity, clear criteria)
- Feature (complex, full SDLC)
- Hotfix (urgent, minimal process)
- Documentation (content only)
工作类型属于哪一类?
- Chore(简单、低风险)
- Bug(中等复杂度、标准明确)
- Feature(复杂、完整SDLC)
- Hotfix(高优先级、流程最简)
- Documentation(仅内容创作)
Step 2: Select Primitives
步骤2:选择原语
Based on problem class, choose primitives:
| Problem Class | Primitives |
|---|---|
| Chore | Classify -> Build -> Test -> Ship |
| Bug | Classify -> Plan -> Build -> Test -> Review -> Ship |
| Feature | Full SDLC |
| Hotfix | Patch -> Test -> Ship |
| Documentation | Document -> Review -> Ship |
根据问题类别选择对应原语:
| 问题类别 | 原语组合 |
|---|---|
| Chore | Classify -> Build -> Test -> Ship |
| Bug | Classify -> Plan -> Build -> Test -> Review -> Ship |
| Feature | 完整SDLC流程 |
| Hotfix | Patch -> Test -> Ship |
| Documentation | Document -> Review -> Ship |
Step 3: Order by Dependencies
步骤3:按依赖关系排序
Ensure correct sequencing:
- Plan before Build (Build needs plan)
- Build before Test (Test needs code)
- Test before Ship (Ship needs validation)
确保正确的执行顺序:
- Plan需在Build之前(Build依赖计划文件)
- Build需在Test之前(Test依赖代码变更)
- Test需在Ship之前(Ship依赖验证结果)
Step 4: Add Validation Points
步骤4:添加验证节点
Where should failures stop the pipeline?
text
Plan -> Build -> [Test GATE] -> Review -> [Review GATE] -> Ship哪些环节需要设置失败拦截?
text
Plan -> Build -> [Test GATE] -> Review -> [Review GATE] -> ShipStep 5: Define Entry/Exit
步骤5:定义入口与出口
- Entry: What triggers this workflow?
- Exit: What signals completion?
- 入口:触发该工作流的条件是什么?
- 出口:标志工作流完成的信号是什么?
Standard Compositions
标准组合方案
Full SDLC
完整SDLC流程
text
Classify -> Plan -> Build -> Test -> Review -> Document -> Shiptext
Classify -> Plan -> Build -> Test -> Review -> Document -> ShipZTE (Zero-Touch)
ZTE(零接触)流程
text
Classify -> Plan -> Build -> Test -> Review -> Document -> Ship
| |
[GATE] [GATE]text
Classify -> Plan -> Build -> Test -> Review -> Document -> Ship
| |
[GATE] [GATE]Quick Fix
快速修复流程
text
Classify -> Patch -> Test -> Shiptext
Classify -> Patch -> Test -> ShipReview-Driven
评审驱动流程
text
Review -> Patch -> Test -> Shiptext
Review -> Patch -> Test -> ShipCustom Composition Design
自定义组合设计
Organization Factors
组织需考虑因素
Consider:
- Testing requirements (mandatory E2E?)
- Review processes (who reviews?)
- Documentation standards (auto-generated?)
- Deployment pipelines (manual approval?)
- Compliance needs (audit trails?)
需考量:
- 测试要求(是否强制端到端测试?)
- 评审流程(由谁负责评审?)
- 文档标准(是否自动生成?)
- 部署流水线(是否需要人工审批?)
- 合规需求(是否需要审计追踪?)
Example: Compliance-Heavy
示例:高合规要求场景
text
Classify -> Plan -> [Compliance Review] -> Build -> Test ->
[Security Scan] -> Review -> Document -> [Approval] -> Shiptext
Classify -> Plan -> [Compliance Review] -> Build -> Test ->
[Security Scan] -> Review -> Document -> [Approval] -> ShipExample: Rapid Iteration
示例:快速迭代场景
text
Build -> Test -> Ship (no planning for small changes)text
Build -> Test -> Ship (小型变更无需规划)Key Memory References
关键参考文档
- @composable-primitives.md - Detailed primitives documentation
- @template-engineering.md - Templates as primitive definitions
- @adw-anatomy.md - ADW as composition framework
- @composable-primitives.md - 原语详细文档
- @template-engineering.md - 作为原语定义的模板
- @adw-anatomy.md - 作为组合框架的ADW
Output Format
输出格式
Provide composition design:
markdown
undefined请按以下格式提供组合设计:
markdown
undefinedWorkflow Composition
工作流组合方案
Problem Class: {type}
Entry Trigger: {trigger}
Exit Criteria: {criteria}
问题类别: {type}
触发条件: {trigger}
完成标准: {criteria}
Primitives Selected
选定的原语
- Classify - Categorize the task
- Plan - Create implementation spec
- Build - Implement changes
- Test - Validate functionality
- Ship - Deploy to production
- Classify - 对任务进行分类
- Plan - 创建实现规范
- Build - 执行变更实现
- Test - 验证功能有效性
- Ship - 部署到生产环境
Composition Flow
组合流程
Classify -> Plan -> Build -> Test -> Ship
|
[GATE: Must pass]
```markdown
Classify -> Plan -> Build -> Test -> Ship
|
[GATE: 必须通过]
```markdownValidation Gates
验证节点
- After Test: Abort if tests fail
- After Review: Optional based on confidence
- 测试完成后:若测试失败则终止流程
- 评审完成后:可根据置信度选择是否跳过
Customizations
自定义调整
- [Organization-specific additions]
undefined- [组织专属的新增环节]
undefinedAnti-Patterns
反模式
- Rigid SDLC thinking (must do all steps)
- Over-composition (too many primitives)
- Under-composition (missing critical steps)
- Ignoring failure paths (no gates)
- One-size-fits-all (same for all problem classes)
- 僵化的SDLC思维(必须执行所有步骤)
- 过度组合(使用过多原语)
- 组合不足(遗漏关键步骤)
- 忽略失败路径(未设置验证节点)
- 一刀切方案(所有问题类别使用相同流程)
Version History
版本历史
- v1.0.0 (2025-12-26): Initial release
- v1.0.0 (2025-12-26): 初始版本
Last Updated
最后更新
Date: 2025-12-26
Model: claude-opus-4-5-20251101
日期: 2025-12-26
模型: claude-opus-4-5-20251101