# VL-Workflow-Engine — CLAUDE.md

> VL Workflow Engine: JS port of the Go workflow executor (spec v3.16)
> Called by: VL-Code, VLClaw, VLClaude, and other VL ecosystem tools
> Version: see `package.json`

---

## Code Sovereignty (Charter Article 14 — MUST FOLLOW)
- **本 Claude 只写 VL-Workflow-Engine 代码** (`~/Documents/VL-Workflow-Engine/`)
- **可读** VL-Code、VLClaw、VLClaude 的文件（了解接口、调试）
- **不可写/编辑** VL-Code、VLClaw 或 VLClaude 的任何代码文件
- **跨项目接口变更**: 改自己的代码 → 更新 Shared Contracts → 对方自行实现
- 完整规则: Charter v2.3.0 Article 14

## Project Structure

```
VL-Workflow-Engine/
├── index.js          ← main entry, re-exports
├── package.json      ← name: vl-workflow-engine, v0.6.0
├── API.md            ← API documentation
├── lib/
│   ├── engine.js     ← core workflow engine
│   ├── executor.js   ← node executor
│   ├── expression.js ← expression evaluator
│   ├── parallel.js   ← parallel execution support
│   ├── registry.js   ← node type registry
│   └── types.js      ← type definitions
├── ui/
│   ├── workflow-editor.html ← canonical DAG visualizer (Spec 3.16)
│   └── INTEGRATION.md      ← integration guide for consumers
└── test/
    └── run.js        ← test runner
```

## Key Facts
- Pure JS, no external dependencies
- Implements VL Workflow Spec v3.16 (DocCenter path 3)
- Exports: `./engine`, `./expression`, `./types`
- This is a **library** — it does not run standalone; it is imported by VL-Code, VLClaw, etc.

## Development Rules
- Run tests: `node test/run.js`
- Keep zero external dependencies unless absolutely necessary
- Any API change must be backward-compatible or coordinated with consumers (VL-Code, VLClaw, VLClaude)
- Follow the Workflow Spec strictly — do not invent non-spec node types or behaviors
