Pflow

效率与工作流

by stackdump

Petri net tools for Claude: validate, simulate, analyze, generate code, compose nets, seal models, and generate full-stack apps from natural language. 18 MCP tools for Petri net workflows.

View Chinese version with editor review

Tools (22)

petri_analyze

Analyze a Petri net model for behavioral properties including reachability, deadlocks, liveness, boundedness, and element importance.

petri_application

Generate a complete full-stack application from an Application specification. This accepts the high-level Application DSL with entities, roles, pages, and workflows.

petri_code_to_flow

Convert source code into a formal Petri net model. Analyzes code structure (control flow, state machines, resource management, concurrency) and produces an executable, verifiable Petri net — not just a diagram.

petri_codegen

Generate executable code from a validated Petri net model. Produces event-sourced application code with state machine, events, and API handlers.

petri_compose

Compose multiple Petri net models into a CompositeNet with typed links between them. Validates that link endpoints reference valid places/transitions in the referenced schemas.

petri_diff

Compare two Petri net models and show structural differences. Reports added, removed, and modified places, transitions, arcs, roles, and access rules.

petri_docs

Generate markdown documentation from a Petri net model with mermaid diagrams for visualization. Useful for exploring and understanding models.

petri_extend

Modify an existing Petri net model by applying operations. Operations: add_place, add_transition, add_arc, add_event, add_event_field, add_binding, remove_place, remove_transition, remove_arc, remove_event, remove_binding. Returns the modified model.

petri_frontend

Generate a vanilla JavaScript ES modules frontend application from a Petri net model. Produces a Vite + ES modules project with API client, state display, and transition forms using plain JavaScript.

petri_help

Returns a recommended CLAUDE.md snippet for working with pflow Petri net models. Paste this into your project's CLAUDE.md to give Claude the context it needs to design and generate Petri net applications.

petri_jssdk

Generate a typed JS SDK (ES modules) from a Petri net model. Produces workflow.js, events.js, aggregate.js, permissions.js, test.js, and index.html that wrap pflow-engine.js for browser-first testing. Optionally preview a single file.

petri_migrate

Migrate a Petri net model from v1 (flat) to v2 (nested) schema format. V2 format separates the net definition from extensions like roles and views.

petri_preview

Preview a single generated file without full code generation. Use this to check specific files before committing to full generation. Available templates: main, workflow, events, aggregate, api, openapi, test, config, migrations, auth, middleware, permissions, views, navigation, admin, debug

petri_seal

Create a tamper-evident PetriNetSeal for a Petri net model. Computes a canonical SHA-256 hash and optionally verifies declared invariants via reachability analysis. Returns a JSON-LD seal document.

petri_simulate

Simulate firing transitions and see state changes. Returns detailed step-by-step state trace. Use this to verify workflow behavior before code generation.

petri_submit

Submit a Petri net model to the public catalog. Only core Petri net structure is accepted (places, transitions, arcs) — no extensions or code. Models are content-addressed and deduplicated by hash.

petri_validate

Validate a Petri net model for structural correctness. Checks for empty models, unconnected elements, and invalid arc references.

petri_verify

Verify a PetriNetSeal: recompute the model hash, check it matches the sealed CID, and re-verify all declared invariants via reachability analysis.

petri_visualize

Generate an SVG visualization of a Petri net model showing places, transitions, and arcs.

pflow_validate

Validate a Petri net model.json for common issues including dead workflows, missing initial tokens, invalid arcs, and entity/role consistency.

seal_list

List sealed Petri net models from the catalog. Returns catalog entries with metadata (name, type, CID, invariant summaries, tags). Optionally filter by net type, tag, or text query.

seal_search

Get the full PetriNetSeal document for a model by its @id or modelCID. Returns the complete seal with model, hash, invariants, and verification results.

Related MCP Servers

Filesystem

Read, write, and manage files and directories on your local filesystem.

82.9k
io.github.wonderwhy-er/desktop-commander

MCP server for terminal commands, file operations, and process management

5.8k
EdgarTools

Open-source SEC EDGAR toolkit — 11 tools, 7 prompts, every filing type. No API key required.

1.9k