关于 skill-upgrader
用于将 SKILL.md 升级为 Decision Theory v5 Hybrid 格式的元技能。它借助 4 个并行 Agent,从规划、强化学习、模态逻辑和验证角度分析技能,并查询 Ragie 索引书籍。
主要功能
- 01四个 Agent 并行分析
- 02查询 Ragie 索引书籍
- 03通过黑板协作
- 04生成 Decision Theory v5 Hybrid 格式
- 05生成验证报告
适用场景
- 01将现有技能改写为 v5 Hybrid 格式
- 02梳理技能的状态、动作和转移
- 03检查技能约束与安全属性
- 04生成升级记录和验证报告
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ parcadei/ continuous-claude-v3 --skill skill-upgrader安装后在 Claude Code 中输入/skill-upgrader确认已加载。
详细介绍
技能升级器
一种元技能,使用 4 个由 Ragie 支持的并行 Agent,将任意 SKILL.md 升级为 Decision Theory v5 Hybrid 格式。
使用时机
- “将此技能升级到 v5”
- “使用决策理论形式化此技能”
- “为此技能添加 MDP 结构”
- “对 X 应用 skill-upgrader”
前置条件
Ragie RAG 已索引以下书籍:
- decision-theory 分区:LaValle Planning Algorithms、Sutton & Barto RL
- modal-logic 分区:Blackburn Modal Logic、Huth & Ryan Logic in CS
工作流
步骤 1:设置会话
SESSION=$(date +%Y%m%d-%H%M%S)-upgrade-{skill_name}
mkdir -p thoughts/skill-builds/${SESSION}
步骤 2:初始化黑板
创建 thoughts/skill-builds/{session}/00-blackboard.md:
# Skill Upgrade: {skill_name}
Started: {timestamp}
## Input Skill
{path_to_skill}
## Target Format
Decision Theory v5 Hybrid
## Agent Findings
(Agents append below)
---
步骤 3:并行启动 4 个 Agent
使用 Task 工具同时启动全部 4 个 Agent。每个 Agent:
- 读取输入技能
- 在 Ragie 中查询指定书籍
- 将发现结果追加到黑板
Agent 1:LaValle 规划器
书籍: LaValle 的《Planning Algorithms》(decision-theory 分区) 重点: 状态、动作、转移
Task(
subagent_type="general-purpose",
prompt="""
INPUT SKILL: {path}
BLACKBOARD: thoughts/skill-builds/{session}/00-blackboard.md
YOUR BOOK: LaValle's "Planning Algorithms" in Ragie partition 'decision-theory'
TASK: Identify MDP structure in the skill.
Query Ragie:
```bash
uv run python scripts/ragie_query.py -q "MDP state space definition" -p decision-theory
uv run python scripts/ragie_query.py -q "action space sequential decisions" -p decision-theory
uv run python scripts/ragie_query.py -q "POMDP partial observability" -p decision-theory
读取输入技能并回答:
- 什么是状态?(阶段、模式、跟踪的信息)
- 什么是动作?(Agent 在每种状态下可以做什么)
- 转移如何运作?(确定性还是随机性)
- 这是 POMDP 还是完全可观测?
写入黑板章节:## Agent 1: States, Actions & Transitions
用通俗英语撰写,并引用 LaValle 的章节。 """ )
---
## Agent 2: Sutton & Barto Optimizer
**Book:** Sutton & Barto's "Reinforcement Learning" (decision-theory partition)
**Focus:** Policy, Termination, Value
**Depends on:** Agent 1
Task( subagent_type="general-purpose", prompt=""" INPUT SKILL: {path} BLACKBOARD: thoughts/skill-builds/{session}/00-blackboard.md
YOUR BOOK: Sutton & Barto's "Reinforcement Learning" in Ragie partition 'decision-theory'
WAIT: Read Agent 1's findings from blackboard first.
TASK: Design policy and termination conditions.
Query Ragie:
uv run python scripts/ragie_query.py -q "policy deterministic stochastic" -p decision-theory
uv run python scripts/ragie_query.py -q "episodic termination conditions" -p decision-theory
uv run python scripts/ragie_query.py -q "reward function design" -p decision-theory
Using Agent 1's states and actions, answer:
- What's the POLICY? (state → action rules)
- When does it END? (terminal states, success/failure)
- What are REWARDS? (goals +, costs -)
- Which states are HIGH/LOW value?
WRITE to blackboard section: ## Agent 2: Policy & Values
Format as plain English with Sutton & Barto section citations. """ )
---
## Agent 3: Blackburn Modal Logician
**Book:** Blackburn's "Modal Logic" (modal-logic partition)
**Focus:** Constraints (temporal, epistemic, deontic)
Task( subagent_type="general-purpose", prompt=""" INPUT SKILL: {path} BLACKBOARD: thoughts/skill-builds/{session}/00-blackboard.md
YOUR BOOK: Blackburn's "Modal Logic" in Ragie partition 'modal-logic'
TASK: Extract constraints from the skill.
Query Ragie:
uv run python scripts/ragie_query.py -q "temporal logic LTL operators" -p modal-logic
uv run python scripts/ragie_query.py -q "epistemic logic knowledge" -p modal-logic
uv run python scripts/ragie_query.py -q "deontic logic obligations" -p modal-logic
Read the input skill and identify:
- TEMPORAL: "must do X before Y" → □, ◇, U
- EPISTEMIC: "must know X" → K operator
- DEONTIC: "must/forbidden/may" → O, F, P
- DYNAMIC: "action causes effect" → [action]
WRITE to blackboard section: ## Agent 3: Constraints
For each constraint:
- Plain English description
- Modal logic notation
- Why it matters
- Blackburn chapter citation """ )
---
## Agent 4: Huth & Ryan Verifier
**Book:** Huth & Ryan's "Logic in Computer Science" (modal-logic partition)
**Focus:** Validation, Safety, Liveness
**Depends on:** Agents 1-3
Task( subagent_type="general-purpose", prompt=""" INPUT SKILL: {path} BLACKBOARD: thoughts/skill-builds/{session}/00-blackboard.md
YOUR BOOK: Huth & Ryan's "Logic in Computer Science" in Ragie partition 'modal-logic'
WAIT: Read Agents 1-3 findings from blackboard first.
TASK: Verify consistency and completeness.
Query Ragie:
uv run python scripts/ragie_query.py -q "safety properties verification" -p modal-logic
uv run python scripts/ragie_query.py -q "liveness properties eventually" -p modal-logic
uv run python scripts/ragie_query.py -q "model checking CTL" -p modal-logic
Check:
- SAFETY: What bad things never happen? □¬(bad)
- LIVENESS: What good things eventually happen? ◇(good)
- CONSISTENCY: Any contradictions between agents?
- COMPLETENESS: Any gaps in coverage?
WRITE to blackboard section: ## Agent 4: Verification
Report with ✓/✗ for each property. Overall verdict: PASS or NEEDS_WORK Huth & Ryan section citations. """ )
---
## Step 4: Synthesize Final Skill
After all agents complete, read the blackboard and create:
**Output:** `thoughts/skill-builds/{session}/SKILL-upgraded.md`
Use v5 Hybrid template:
```yaml
---
name: {original_name}
description: {original_description}
version: 5.1-hybrid
---
# Option: {name}
## Initiation (I)
[From original + Agent 1 state analysis]
## Observation Space (Y)
[From Agent 1 POMDP analysis]
## Action Space (U)
[From Agent 1 actions]
## Policy (pi)
[From Agent 2 state→action rules]
## Termination (beta)
[From Agent 2 episode structure]
## Q-Heuristics
[From Agent 2 value guidance]
## Constraints
[From Agent 3 modal logic]
## Verification
[From Agent 4 safety/liveness]
使用示例
User: "Upgrade .claude/skills/implement_plan/SKILL.md to v5 Hybrid"
Claude:
1. Creates session directory
2. Initializes blackboard
3. Launches 4 agents in parallel (Task tool)
4. Waits for completion
5. Reads blackboard
6. Synthesizes upgraded skill
7. Reports: "Upgraded skill at thoughts/skill-builds/.../SKILL-upgraded.md"
Ragie 查询参考
# Decision theory partition
uv run python scripts/ragie_query.py -q "your question" -p decision-theory
# Modal logic partition
uv run python scripts/ragie_query.py -q "your question" -p modal-logic
# With reranking for better results
uv run python scripts/ragie_query.py -q "your question" -p decision-theory --rerank
创建的文件
升级后:
thoughts/skill-builds/{session}/
├── 00-blackboard.md # Agent collaboration
├── SKILL-upgraded.md # Final v5 Hybrid skill
└── validation-report.md # Agent 4 verification