design-patterns
Use PocketFlow to design LLM apps and agentic workflows with workflows, agents, RAG, map-reduce, structured output, multi-agent queues, and service/background patterns.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- design-patterns
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use PocketFlow to design LLM apps and agentic workflows with workflows, agents, RAG, map-reduce, structured output, multi-agent queues, and service/background patterns.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/agentic-coding-guide.md3.8 KB
- 参考文档references/cookbook-map.md3.5 KB
- 参考文档references/pattern-recipes.md4.6 KB
- 参考文档references/troubleshooting.md2.9 KB
- 脚本scripts/design_pattern_templates.py4.5 KB
03 SKILL.md 正文
PocketFlow Design Patterns
Use this sub-skill when the user wants to turn a task into a PocketFlow application design rather than debug a single node or utility function.
What this sub-skill covers
- Workflow decomposition for article-writing, extraction, planning, and approval flows.
- Agent decision loops and tool/action routing.
- RAG pipelines with offline indexing and online retrieval.
- Map-reduce style document or record processing.
- Structured output with validation-friendly prompts.
- Multi-agent or message-queue style coordination.
- FastAPI/Streamlit/Gradio-style service and background job shapes when they are part of the PocketFlow app structure.
- Cookbook-derived pattern selection and dependency caveats.
What to read first
Typical user requests
- "How should I structure this PocketFlow app?"
- "Should I use workflow, agent, or RAG?"
- "How do I add a review/retry loop?"
- "How do I process many docs or files?"
- "How do I design a service-backed or background-job PocketFlow app?"
Route map
| Need | Read |
|---|---|
| Pattern choice and node-level recipe shape | references/pattern-recipes.md |
| Docs-first process and project skeleton | references/agentic-coding-guide.md |
| Cookbook-style task matching | references/cookbook-map.md |
| Architectural failure modes and repair steps | references/troubleshooting.md |
| Safe local skeleton output | scripts/design_pattern_templates.py |
Design principles
- Start with the smallest useful graph.
- Put schema and task state into the shared store.
- Keep
exec()focused on compute and utility calls. - Use
post()to write results and choose the next action. - Add validation on outputs that an LLM may produce in an unreliable format.
- Prefer explicit recipes over clever, over-general node abstractions.
Boundaries
- Do not use this sub-skill for core runtime signatures or retry semantics; read
core-abstractioninstead. - Do not use this sub-skill to implement provider-specific LLM wrappers, vector stores, tracing clients, or audio functions; read
utilitiesinstead. - Do not bundle credentialed or network-heavy cookbook scripts. Distill them into safe reusable recipes and note optional dependencies.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).