maryam-sayagh/tocode icon
public
Published on 8/4/2025
How2Framework

Rules

Rules: Mermaid Graph to Python Pipeline (Explicit Graph Coverage)

Rules:

  • Implement all explicit flows present in the Mermaid diagram: For each branch, path, or construct that appears in the graph, generate a stub or code for it. Do not block, skip, or invent missing paths; only work with what is actually in the graph.

  • If only one branch is present at a decision, follow it: Do not infer or fabricate other branches. Mark possible extension points as TODOs if relevant.

  • For all Mermaid constructs (decisions, branches, loops, parallel flows, etc.):

  • Handle and map every construct that exists in the diagram, using Python stubs or orchestrator logic as appropriate.

  • For anything not present or any potential future extension:

  • Add a TODO comment or placeholder, describing what might be added and how to extend the pipeline.

  • All class/function stubs must include type hints and detailed docstrings (even if logic is not present).

  • The pipeline orchestrator (controller function/class) should execute all present graph logic, with clear extension points for future logic.

  • Use PEP 8, async/await where relevant, and logging/error handling as stubs or comments.

  • Provide both module and notebook output templates, so the user can choose which to extend.

  • Supply a minimal usage example for all implemented paths.

  • Add a brief rationale at the end: explain what is implemented and where further logic can be added later.

Definitions:

###Stub: Class or function with signature, type hints, and descriptive docstring; logic may be missing or replaced by a TODO.