skills/integrated-workflow/SKILL.md
# Integrated Workflow — End-to-End Formal Agent Development ## Overview This skill orchestrates the full formal development pipeline for multi-agent systems: **Define → Verify → Prove → Generate → Test** in a single guided session. Each phase invokes an existing skill, with automated handoff, error recovery, and a final session report summarizing all results. 各フェーズは既存のスキルを呼び出し、フェーズ間の自動ハンドオフ、エラー回復、 最終セッションレポートの生成を行います。 ## Trigger Conditions Activate this skill when the user says any of: - 「
npx skillsauth add kotaroyamame/formal-agent-contracts skills/integrated-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill orchestrates the full formal development pipeline for multi-agent systems: Define → Verify → Prove → Generate → Test in a single guided session.
Each phase invokes an existing skill, with automated handoff, error recovery, and a final session report summarizing all results.
各フェーズは既存のスキルを呼び出し、フェーズ間の自動ハンドオフ、エラー回復、 最終セッションレポートの生成を行います。
Activate this skill when the user says any of:
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 1.DEFINE │───>│ 2.VERIFY │───>│ 3.PROVE │───>│ 4.GENERATE│───>│ 5.TEST │
│ │ │ │ │ (optional)│ │ │ │ │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
.vdmsl PO list SMT results TS/Python Test
file + report + proofs code report
Greet the user and explain the integrated workflow briefly:
「統合ワークフロー」では、エージェントの契約定義から実装コード生成まで、 5つのフェーズを順番に実行します。途中でスキップや中断も可能です。
Gather session parameters:
.vdmsl file, or natural language spec (MD)?
.vdmsl file: skip to Phase 2 (Verify)import-natural-spec first to convert to VDM-SLInitialize session state (track mentally, no files needed):
agent_name: <name>
vdmsl_path: <to be determined>
target_lang: ts | py | both
smt_enabled: true | false
phases_completed: []
セッションパラメータを収集し、内部状態を初期化する。
Invoke: define-contract skill
.vdmsl file to the workspacedefine-contractスキルの対話フローに従い、自然言語→VDM-SL変換を実施する。
Handoff criteria → Phase 2:
.vdmsl file generated and savedError recovery:
formal-methods-guide inline, then returnPhase report:
📋 Phase 1 Complete: Contract Definition
- File: <agent_name>.vdmsl
- Types defined: <count>
- Functions: <count>
- Operations: <count>
- State variables: <count>
Invoke: verify-spec skill
.vdmsl file (syntax check → type check → PO generation)VDMJで構文チェック→型チェック→PO生成を実行し、各POを平易に解説する。
Handoff criteria → Phase 3:
Error recovery:
Phase report:
📋 Phase 2 Complete: Specification Verification
- Syntax check: ✅ PASSED
- Type check: ✅ PASSED
- Proof Obligations: <total_count>
- Critical: <count>
- Standard: <count>
- Info: <count>
Invoke: smt-verify skill
Skip condition: User chose smt_enabled: false in Phase 0, or Z3 is not available.
If skipped, proceed directly to Phase 4.
.smt2 fileunsat → ✅ Proved (obligation is guaranteed to hold)sat → ⚠️ Counterexample found (specification may have a flaw)unknown/timeout → ℹ️ Could not determine (may need manual review)各POをSMT-LIBに変換しZ3で検証。反例があれば仕様修正を提案する。
Handoff criteria → Phase 4:
Error recovery:
Phase report:
📋 Phase 3 Complete: SMT Automated Proving
- Total POs: <count>
- ✅ Proved: <count>
- ⚠️ Counterexample: <count>
- ℹ️ Unknown/Timeout: <count>
Invoke: generate-code skill
.vdmsl specificationgenerated/<agent_name>/
├── types.ts / types.py # Type definitions
├── contracts.ts / contracts.py # Validation functions
├── <agent_name>.ts / .py # Operation implementations
└── index.ts / __init__.py # Module exports
検証済み仕様からターゲット言語のコードを生成。ランタイム契約検証を含む。
Handoff criteria → Phase 5:
Error recovery:
// TODO: implement commentPhase report:
📋 Phase 4 Complete: Code Generation
- Target: <language(s)>
- Files generated: <count>
- Types: <count>
- Functions: <count>
- Operations: <count>
- Runtime contracts: pre=<count>, post=<count>, inv=<count>
Generate a smoke test file that exercises the generated code:
Run the smoke test:
npx tsx <test_file>.ts (or ts-node)python3 <test_file>.pyReport test results
生成コードの動作検証としてスモークテストを生成・実行する。
Completion criteria:
Error recovery:
Phase report:
📋 Phase 5 Complete: Smoke Test
- Tests run: <count>
- ✅ Passed: <count>
- ❌ Failed: <count>
After all phases complete (or when the user stops), generate a comprehensive session report.
See references/session-report-template.md for the full template.
全フェーズ完了後(またはユーザーが中断した時点で)、包括的なセッションレポートを生成する。
Summary format:
═══════════════════════════════════════════════════
Formal Agent Development — Session Report
Agent: <agent_name>
Date: <date>
═══════════════════════════════════════════════════
Phase 1 — Define: ✅ <agent_name>.vdmsl (<N> types, <M> operations)
Phase 2 — Verify: ✅ Syntax/Type OK, <N> POs generated
Phase 3 — Prove: ✅ <N>/<M> POs proved (or ⏭ Skipped)
Phase 4 — Generate: ✅ <lang> code generated (<N> files)
Phase 5 — Test: ✅ All <N> tests passed
Output files:
- Specification: <path>.vdmsl
- Generated code: generated/<agent_name>/
- Test results: generated/<agent_name>/test_<agent_name>.<ext>
═══════════════════════════════════════════════════
Users can control the workflow at any point:
| Command | Action | |---------|--------| | 「次へ」/ "next" | Proceed to next phase | | 「スキップ」/ "skip" | Skip current phase | | 「戻る」/ "back" | Return to previous phase | | 「やり直し」/ "redo" | Re-run current phase | | 「ここまで」/ "stop here" | End workflow, generate partial report | | 「状態を見せて」/ "status" | Show current phase and progress |
Users may enter the workflow at any phase:
import-natural-spec → Phase 1.vdmsl fileDetect the entry point from the user's request and session state.
ユーザーは任意のフェーズからワークフローに参加できる。
This skill acts as an orchestrator — it does not duplicate logic from other skills. Instead, it:
このスキルはオーケストレーターとして機能し、各フェーズの詳細は個別スキルに委譲する。
Reference the individual skill SKILL.md files for phase-specific details:
skills/import-natural-spec/SKILL.mdskills/define-contract/SKILL.mdskills/verify-spec/SKILL.mdskills/smt-verify/SKILL.mdskills/generate-code/SKILL.mdskills/export-human-spec/SKILL.mdskills/formal-methods-guide/SKILL.mdAfter the workflow completes, offer the user the option to generate a human-readable
specification document using export-human-spec. This is especially valuable when
stakeholders who don't read VDM-SL need to review the spec.
testing
VDM-SL仕様の型チェック、構文検証、証明責務生成を実行するスキル
testing
Convert VDM-SL proof obligations (POs) to SMT-LIB and verify them with the Z3 solver. Triggered by "prove POs", "verify with SMT", "check with Z3", "auto-verify proof obligations", "prove the spec is correct", or "find counterexamples". Also responds to Japanese: 「POを証明して」「SMTで検証して」「Z3で確認して」等。 Used as the next step after PO generation with verify-spec, or for end-to-end PO generation + SMT verification.
development
Orchestrate the full reverse engineering pipeline: Extract provisional spec from existing code, refine through dialogue to uncover the true spec, then reconcile code with the confirmed spec. Optionally connects to the forward pipeline (verify → prove → generate → test). Triggered by: "reverse workflow", "extract and refine spec from code", "formalize existing code", "reverse engineer the specification", 「リバースワークフローで」「既存コードから仕様を起こして」「コードの仕様を明確にしたい」 「このプロジェクトを形式仕様で整理したい」「既存コードをリバースエンジニアリングして」
testing
Refine a provisional VDM-SL specification through dialogue with the user, uncovering the true specification that exists in the user's mind. The provisional spec (from extract-spec) serves as a scaffold for questions. Triggered by: "refine the spec", "review the provisional spec", 「仕様を磨きたい」「仮仕様をレビューして」「コードの意図を確認したい」「仕様を確認して」