技能意向合同
- 作者仓库星标 3,406
- 作者仓库 claude-octopus
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @nyldn · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:捕捉意图
在工作流程中提出 3 个澄清问题后,提示用户定义:如果用户选择“让我描述一下”,则随后显示有关其自定义目标的文本提示。
第2步:编写意向合同文件
使用写入工具创建`.claude/session-intent.md`:
第三步:执行时参考
在整个工作流程中,定期阅读`.claude/session-intent.md`以: 与用户目标保持一致 做出与边界一致的决策 牢记利益相关者 在关键决策点,明确说明:
第 4 步:最后验证
工作流程完成后,阅读`.claude/session-intent.md`并验证: 验证过程:阅读意向合同 检查每个成功标准:✓ 满足 - 解释如何实现
第 5 步:更新意向合同状态
更新`.claude/session-intent.md`中的`Status`字段: `active` → 工作流程正在进行中 `validating` → 根据标准进行检查 `completed` → 满足所有标准,遵守边界 `incomplete` → 未满足某些标准,发现差距
> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex.
> Cross-reference commands use installed skill names in Codex rather than `/octo:*` slash commands.
> Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it.
> For host tool equivalents, see `skills/blocks/codex-host-adapter.md`.
# Intent Contract System
## Purpose
The intent contract creates a **persistent record of user intent** that:
- Captures what the user is trying to accomplish
- Defines success criteria upfront
- Establishes boundaries and constraints
- Travels through the entire workflow
- Validates final outputs against original intent
This closes the loop between intention and delivery.
## Intent Contract Structure
The intent contract is stored in `.claude/session-intent.md` and follows this format:
```markdown
# Intent Contract
**Created**: [ISO timestamp]
**Workflow**: [discover/embrace/review/etc.]
**Status**: [active/validating/completed]
## Job Statement
What the user is trying to accomplish (JTBD framework).
[User's goal in plain language]
## Success Criteria
### Good Enough
- [Minimum viable success criterion 1]
- [Minimum viable success criterion 2]
### Exceptional
- [Excellence criterion 1]
- [Excellence criterion 2]
## Boundaries
What this should NOT be:
- [Boundary 1: What to avoid]
- [Boundary 2: What's out of scope]
## Context & Constraints
**Stakeholders**: [Who needs this to work for them]
**Existing Assets**: [What to build on]
**Timeline**: [Time constraints if any]
**Technical Constraints**: [Platform, language, dependencies]
## Clarifying Context
[Any answers from the 3-question pattern]
## Validation Checklist
- [ ] Meets "good enough" criteria
- [ ] Respects all boundaries
- [ ] Works for all stakeholders
- [ ] Builds on existing assets appropriately
```
## Implementation Instructions
### When to Create Intent Contract
Create an intent contract when:
- User invokes a major workflow (`/octo:embrace`, `/octo:discover`, `/octo:plan`)
- User explicitly asks to "plan" or "set goals" for a task
- A workflow requires multiple phases and validation
**Do NOT create for:**
- Quick, single-action commands
- Simple file reads or searches
- Conversational questions
### Step 1: Capture Intent
After asking the 3 clarifying questions in a workflow, prompt the user to define:
```javascript
AskUserQuestion({
questions: [
{
question: "What are you ultimately trying to accomplish?",
header: "Goal",
multiSelect: false,
options: [
{label: "Let me describe it", description: "I'll write my own goal statement"},
{label: "Make a decision", description: "Choose between options"},
{label: "Create deliverable", description: "Build something specific"},
{label: "Understand a problem", description: "Research and learn"}
]
},
{
question: "What defines success for this?",
header: "Success",
multiSelect: true,
options: [
{label: "Clear recommendation", description: "Know what to do next"},
{label: "Working implementation", description: "Code that functions"},
{label: "Team alignment", description: "Everyone understands"},
{label: "Problem solved", description: "Issue is resolved"}
]
},
{
question: "What should this NOT be or do?",
header: "Boundaries",
multiSelect: true,
options: [
{label: "Over-engineered", description: "Keep it simple"},
{label: "Incomplete", description: "Must be production-ready"},
{label: "Disconnected", description: "Must fit our architecture"},
{label: "Risky", description: "Avoid experimental approaches"}
]
}
]
})
```
If user selects "Let me describe it", follow up with a text prompt for their custom goal.
### Step 2: Write Intent Contract File
Use the Write tool to create `.claude/session-intent.md`:
```bash
cat > .claude/session-intent.md <<EOF
# Intent Contract
**Created**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
**Workflow**: ${WORKFLOW_NAME}
**Status**: active
## Job Statement
${USER_GOAL}
## Success Criteria
### Good Enough
${MIN_SUCCESS_CRITERIA}
### Exceptional
${EXCEPTIONAL_CRITERIA}
## Boundaries
What this should NOT be:
${BOUNDARIES}
## Context & Constraints
**Stakeholders**: ${STAKEHOLDERS}
**Timeline**: ${TIMELINE}
## Clarifying Context
${THREE_QUESTION_ANSWERS}
## Validation Checklist
- [ ] Meets "good enough" criteria
- [ ] Respects all boundaries
- [ ] Works for all stakeholders
EOF
```
### Step 3: Reference During Execution
Throughout the workflow, periodically read `.claude/session-intent.md` to:
- Stay aligned with user goals
- Make decisions consistent with boundaries
- Keep stakeholders in mind
At key decision points, explicitly say:
```
Checking against intent contract: [reference specific criterion]
```
### Step 4: Validate at End
When the workflow completes, read `.claude/session-intent.md` and validate:
**Validation Process:**
1. **Read the intent contract**
2. **Check each success criterion:**
- ✓ Met - explain how
- ✗ Not met - explain why and what's needed
- ~ Partially met - explain gaps
3. **Check boundaries:**
- ✓ Respected - confirm
- ✗ Violated - explain what happened
4. **Generate validation report:**
```markdown
# Validation Report
## Success Criteria Check
### Good Enough Criteria
- [✓] Criterion 1: [How it was met]
- [✗] Criterion 2: [Why not met, what's needed]
### Exceptional Criteria
- [~] Criterion 1: [Partial progress explanation]
## Boundary Check
All boundaries respected: [Yes/No]
- Boundary 1: [✓/✗] [Explanation]
## Gaps & Next Steps
[If any criteria not met, list concrete next steps]
## Overall Assessment
[Summary: Does this fulfill the original intent?]
```
5. **Present to user:**
- Show the validation report
- Ask if they want to address any gaps
- Update intent contract status to "completed" or "validating"
### Step 5: Update Intent Contract Status
Update the `Status` field in `.claude/session-intent.md`:
- `active` → workflow in progress
- `validating` → checking against criteria
- `completed` → all criteria met, boundaries respected
- `incomplete` → some criteria not met, gaps identified
## Integration with Workflows
### Embrace Workflow
```
1. Ask 3 clarifying questions (scope, focus, autonomy)
2. Create intent contract
3. DISCOVER phase (reference intent)
4. DEFINE phase (reference intent)
5. DEVELOP phase (reference intent)
6. DELIVER phase (reference intent)
7. Validate against intent contract
8. Present validation report
```
### Discover Workflow
```
1. Ask 3 clarifying questions (depth, focus, output)
2. Create intent contract
3. Execute multi-provider research
4. Synthesize findings
5. Validate against intent contract
6. Present validation report
```
### Plan Workflow (Future)
```
1. Capture comprehensive intent
2. Create intent contract
3. Route to appropriate workflows
4. Execute custom sequence
5. Validate against intent contract
6. Present validation report
```
## Example Intent Contract
```markdown
# Intent Contract
**Created**: 2026-01-21T15:30:00Z
**Workflow**: embrace
**Status**: active
## Job Statement
Build a user authentication system that our team can implement and maintain.
## Success Criteria
### Good Enough
- Team understands what to build
- Clear technical approach selected
- Security considerations documented
- Implementation plan with steps
### Exceptional
- Multiple authentication methods evaluated
- Security audit performed
- Code examples provided
- Integration tests included
## Boundaries
What this should NOT be:
- Over-engineered with unnecessary features
- Disconnected from our existing Node.js/Express stack
- Experimental or unproven technologies
## Context & Constraints
**Stakeholders**: Development team (5 engineers), Product manager
**Existing Assets**: Express.js API, PostgreSQL database
**Timeline**: Need to start implementation next sprint
**Technical Constraints**: Must work with Express.js, PostgreSQL
## Clarifying Context
**Scope**: Medium feature (multiple components)
**Focus Areas**: Security, Architecture design
**Autonomy**: Supervised (review after each phase)
## Validation Checklist
- [ ] Meets "good enough" criteria
- [ ] Respects all boundaries
- [ ] Works for all stakeholders
- [ ] Builds on existing assets appropriately
```
## Benefits
**For Users:**
- Clear expectations set upfront
- No forgotten requirements
- Validation against original goals
- Closed-loop accountability
**For Workflows:**
- Clear success criteria to optimize for
- Boundaries to constrain solutions
- Context for better decisions
- Validation framework built-in
**Ready to use!** Workflows can now create and validate against persistent intent contracts.
章节与文件索引
按说明文件中的顺序排列。
目的
意向合同结构
何时创建意向合同
第 1 步:捕捉意图
第2步:编写意向合同文件
文件/命令 -> /octo:* · skills/blocks/codex-host-adapter.md · .claude/session-intent.md · /octo:embrace · /octo:discover · /octo:plan · Status · active
内容校验值 -> f35fc7ca8b05
当前原文的自动摘译,尚未人工审校。
目的
意图契约创建用户意图的持久记录: 捕获用户试图完成的任务 预先定义成功标准 建立边界和约束 贯穿整个工作流程
意向合同结构
意向合约存储在
.claude/session-intent.md中,并遵循以下格式:何时创建意向合同
在以下情况下创建意向合同: 用户调用主要工作流程(
/octo:embrace、/octo:discover、/octo:plan) 用户明确要求为任务“计划”或“设定目标” 工作流程需要多个阶段和验证 请勿创建: