/shub-workflow-toolkit:shub-workflow-diagramsfrom shub-workflow-toolkit
Generates architecture diagrams for shub-workflow projects: pipeline/workflow diagrams with swimlane stages and UML class hierarchy diagrams. Uses Graphviz and a plain-data model for version-controllable, reproducible diagrams.
Ships in shub-workflow-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two kinds, one visual family:
| Kind | What it shows | How it is laid out |
|---|---|---|
| Pipeline / workflow | the stages of a workflow as banded containers — jobs inside, a Role box per band, storages between them | by you, on a grid; Graphviz only routes the edges |
| Class hierarchy | the project's script classes as UML boxes, base above subclass | by Graphviz (dot) — a tree is what it is good at |
Both are generated from an editable model, never hand-drawn: the diagram is code, lives next to
the project, and is re-rendered when the architecture changes. Do not introduce a .drawio (or any
other binary editor source) — a diagram nobody can diff is a diagram that goes stale.
A diagram asserts how the system works, so get the architecture from the project itself, in this order: its knowledge-base skill if it has one, then its README, then the code. Read the scheduler and the crawl managers to learn how many jobs of each component actually run — that is the detail diagrams get wrong most often (one script can be scheduled as one rotating job, or as one job per source).
When what you are asked to draw disagrees with the code — a component that is configured but disabled, a box per source where the code schedules one shared job — draw what was asked and say so in one line. The asker usually knows something the code does not show; silently "correcting" them produces a diagram neither of you trusts.
<project>/diagrams/. Never edit it — picking up a fix later must stay a re-copy.<project>/diagrams/workflow_gen.py, starting from
examples/workflow_gen.py. It is plain data: stages, the cells in
each, the edges between them. Vocabulary: references/model-reference.md.
For a class diagram, copy examples/class_hierarchy_gen.py
instead — it is self-contained and needs no engine — and follow the shared conventions in
references/class-hierarchy.md: which classes go in, what a box
lists, the six fixed categories, solid vs dashed edges. Its render also checks the edges against
the bases declared in the code and fails on any drift, so fix the model until it passes.python3 diagrams/workflow_gen.py. It writes the .dot beside the generator and the
PNG where the README references it.Set by diagram_engine.py; change it there only if the whole family should change.
ORIENTATION = "horizontal"). Vertical still works and is a one-word
change, but every project here is laid out horizontally.thin (control / naming), thick (ordinary data flow),
dashed (fan-out), bus (one wide arrow standing for a whole band's traffic), trunk (wider
still: where the bulk of the bytes go)..dot or the PNG. Both are build products; the next render discards the
edit. If the shape is wrong, the model is wrong.pos per node
and render with neato -n2 for exactly this reason — left to its own ranking, Graphviz reorders
bands and columns between runs for no visible reason. Do not "simplify" that away.Graphviz (neato and dot) on PATH. Nothing else — the engine is one file of standard library
Python, and the diagrams are a documentation tool, not part of the project's runtime dependencies.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub scrapinghub/shub-workflow --plugin shub-workflow-toolkit10 skills in this plugin
/scanjobs-programsUse for help using shub_workflow's scanjobs tool — scanning ScrapyCloud jobs to extract and plot data from stats, logs, items, spider args or job metadata. Also reach for it, instead of a hand-rolled job-listing script, to take a census of a spider's jobs over a time window: how many ended with each close_reason (e.g. memusage_exceeded / killed by oom), on which deployed version, with which units, alongside per-job stats such as memusage/max. Covers building a scanjobs command line (the stat/log/item/spider-arg/meta patterns, the postscript post-processor -c, the --plot mini-language, time windows, and output modes) and the predefined "programs" shortcut: the PROGRAMS dict in a project's scripts/scanjobs.py (a subclass of shub_workflow.utils.scanjobs.ScanJobs), invoked as `scanjobs.py -g <program> -v key:val`, including {var} placeholders and {{ }} escaping. Applies to any project whose scripts/scanjobs.py subclasses shub_workflow's ScanJobs./shub-workflow-architecturesUse when a developer wants help designing (or redesigning) the architecture of a shub-workflow based Scrapy Cloud project — "help me design the architecture for this project", "how should I structure the crawl managers / consumers / delivery", "which components do I need", "how do I feed my spiders from a frontier", "how do I scale this crawl", "should I use a graph manager", or when migrating a project away from a central graph manager or from spiders that read/write the frontier (Frontera). Runs an INTERACTIVE design session: interviews the developer in short rounds to uncover the requirements they haven't stated yet, maps them to the independent-agents + role-separation architecture (or to a graph manager where a short ordered sequence fits), writes a design document with roles, storage contracts, scheduling and scale knobs, checks it against known pitfalls, and then scaffolds the script skeletons for the chosen roles. Covers seeds vs url frontiers, the post-crawl data chain, downloads, keep-alive scheduling, back-pressure and recrawling./shub-workflow-crawl-managersUse when building, updating, fixing, or understanding a shub-workflow crawl manager — a script that schedules spider jobs on Scrapy Cloud and reacts to their outcomes, built on shub_workflow.crawl (CrawlManager / PeriodicCrawlManager / GeneratorCrawlManager / AsyncSchedulerCrawlManagerMixin) and WorkFlowManager. Covers choosing the base class, the set_parameters_gen() generator pattern, the outcome/retry/throttling hooks, async concurrent scheduling, and the name/flow-id/loop-mode rules. Use for any crawl-manager script in any project that subclasses these classes (directly or via a project base mixin)./shub-workflow-fshelperUse when reading, writing, listing, copying, moving, or deleting files through shub-workflow's cloud-agnostic filesystem layer — the `shub_workflow.utils.futils` module and its `FSHelper` class (the recommended one; `S3Helper` is its deprecated backward-compatibility base) — i.e. any code that touches `s3://`, `gs://`, or local paths the same way, needs AWS role-assumed (STS) credentials, or must list/download deliveries in a bucket. Covers the prefix-based dispatch, module functions vs. the helper class, credential/role handling, the three listing variants (`list_folder` vs `list_path` vs recursive), `op_kwargs`/ACLs, and the install extras. Reach for it whenever you see `from shub_workflow.utils.futils import ...`, an `FSHelper`, or any project-local factory that returns one (a `build_fshelper()`-style wrapper, `self.fshelper`) — its API is NOT guessable and not discoverable by `dir()`, so check here before calling anything on it./shub-workflow-graph-managersUse when building, updating, fixing, or understanding a shub-workflow graph manager — a script that runs an arbitrary DAG of tasks (spiders and scripts, including crawl managers and deliver scripts) on Scrapy Cloud with dependencies, built on shub_workflow.graph (GraphManager + Task / SpiderTask) and WorkFlowManager. Covers configure_workflow(), Task vs SpiderTask, dependency linking (add_next_task / add_wait_for), the on_finish/retry routing, resources, parallelization, and the start directives. Use for any graph-manager / flow-manager script that subclasses GraphManager (directly or via a project base mixin)./shub-workflow-hcfUse when working with a ScrapyCloud Hubstorage Crawl Frontier (HCF) from a shub-workflow project — running or extending the standalone frontier tool `shub_workflow.utils.hcf.FrontierTool` (list slots, count, dump, add seeds, delete batches or slots, move a slot into another), installing the `with-hcf-backend` extra, building a seeds crawl manager on the ready-made `shub_workflow.utils.hcf.HCFSeedsCrawlManager` (ENABLED_SPIDERS config, split slots, hooks), or writing crawl-manager / consumer code that reads seeds from a frontier slot or writes new seeds into it through `hcf_backend`'s `HCFManager`. Covers the HCF semantics that bite (per-slot fingerprint memory, single writer per slot, read does not remove), the tool's commands and extension points, and the read → delete → schedule and add → flush seed patterns.Other plugins' skills for the same job