/closedloop-core:prd-dependency-graphfrom closedloop-core
Builds an interactive HTML dependency graph of ClosedLoop tickets from BLOCKS links. Hover highlights blockers (purple) and dependents (teal); click pins the full upstream/downstream chain. Supports PRD, ISS, or PRO scopes.
Ships in closedloop-core. 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; scripts run unread.
Turns a scope's tickets and their BLOCKS links into an interactive HTML graph. Two scripts do all the work, so every run is deterministic and every link is drawn:
scripts/refresh_server.py reads the ClosedLoop REST API, builds the graph data, and writes the page. It is also the local helper behind the refresh button.scripts/render_graph.py draws the graph, and embeds the graph's config in it.Your job is to pick the scope and options, run them, name the columns, and check the result.
PRD-751, ISS-6251): its PRODUCES children. A document with no ticket children (for example a single ticket) graphs itself and its neighbours.PRO-67): every ticket in the project.
The graph looks the same either way.~/Desktop/<slug-lowercase>-dependency-graph.html.all for the whole chain.outside_blockers_depth layers (default 1; "all" follows the chain to its roots).Create the graph. The API key comes from CLOSEDLOOP_API_KEY, and a login shell is used as a fallback, so an export in ~/.zprofile works. The helper asks the ClosedLoop API whose key it is and highlights that person's tickets as "yours", so there is no name to pass.
python3 scripts/refresh_server.py --new PRD-751 -o ~/Desktop/prd-751-dependency-graph.html
<!-- depgraph:<graph-id>:start --> and <!-- depgraph:<graph-id>:end --> where the graph belongs (the graph id defaults to the slug in lowercase), then:
python3 scripts/refresh_server.py --new PRD-751 --embed-into <report.html>
--outside-depth all (or a number) follows outside blockers further.--include-plans adds implementation plans.--graph-id names the graph if the report already holds one with the default id.--me <first name> is only a fallback for when the API lookup fails.It fetches everything, writes the page with the graph's config inside it, and prints the ticket and link counts and whose tickets are highlighted. Nothing is saved outside the page.
Name the columns. Run python3 scripts/render_graph.py <page.html> --print-columns (add --graph <graph-id> when a report holds several graphs).
column_labels entry for each, for example "foundations and design", "components and APIs", "adoption", "retirement".Tidy labels. Each ticket's label is derived from its title, with prefixes like [P751-3] stripped and the text cut to about 28 characters. Shorten any that read badly to 2 to 4 words. Keep the full title in title, which is shown as a tooltip. Labels and columns are kept across refreshes.
Apply the edits. Export the page's config, edit it, and refresh the page from it:
python3 scripts/refresh_server.py --export-config <page.html> > /tmp/graph.json
# edit column_labels and node labels in /tmp/graph.json
python3 scripts/refresh_server.py --once <page.html> --apply-config /tmp/graph.json
--once <page.html> on its own refreshes the page in place from the API and prints what changed. For a graph made before pages carried their config, edit ~/.local/share/prd-dependency-graph/<graph-id>.json and run --once <graph-id> instead (see "Older graphs").
Verify.
node scripts/check_graph.cjs <file.html> <a ticket with many links> <screenshot.png>. It works on a copy of the file and confirms there are no script errors, hover highlights exactly the ticket's incoming and outgoing links, click pins the chain, Esc clears, zoom changes the graph size without disturbing a pinned chain, a refresh from a file sends the file's path and reloads with the change dialog and the same zoom, a refresh of a page served from this machine swaps in place and says no file changed, only one toolbar menu is open at a time, Save Image downloads a PNG, and Copy Image puts a PNG on the clipboard. It never calls ClosedLoop. It needs playwright-core and Chrome; set PLAYWRIGHT_CORE and CHROME_PATH if the defaults do not exist. Look at the screenshot.Report back with:
prd-graph-helper starts it again after a reboot;The graph's top-right corner has zoom controls, a gear (options), and a refresh icon. The gear and refresh icon need the local helper running.
--new and --once start the helper in the background when it is not running, and replace a running helper from an older installed release of this skill (for example after a plugin update), from a repository checkout, or whose install was removed. --ensure does only that.refresh_server.py --ensure --take-over from it: that replaces the running helper and leaves the launcher unchanged, so the next prd-graph-helper --ensure or a newer release puts the installed helper back. A running helper whose versioned plugin cache is removed keeps using its renderer already in memory and writes one upgrade hint to the log instead of failing refreshes. The helper's log is ~/.local/share/prd-dependency-graph/helper.log.prd-graph-helper. Runs of an installed release write that launcher to ~/.local/bin/prd-graph-helper, never replacing one written by a newer release. The launcher resolves the newest usable closedloop-core cache in Codex or Claude at execution time and falls back to the install that wrote it, so the command survives plugin updates even though installed paths change with each version. The page's "helper not running" dialog shows prd-graph-helper, or ~/.local/bin/prd-graph-helper when that folder is not on PATH. A file already at that path that the skill did not write is left alone. If an older helper is running, the dialog says it is out of date and shows prd-graph-helper --ensure, which replaces it.127.0.0.1:8765 only (the graph's port)./v2/refresh, and, when it was opened from a file, the file's own path;column overrides and column_labels, and rewrites only that graph's block in the file;http://localhost): the page sends its config instead of a path, the helper sends the new graph back, the page swaps it in place, and the dialog says only that view was updated and no file on disk changed. Pages on any other website cannot refresh.outside_blockers_depth ("all" or 1) in the page. If the helper is not running, the checkbox flips back and a dialog explains. Add future options to this menu.render_graph.py on every refresh while that install exists. If a plugin update removes the install underneath a running helper, it keeps using the loaded renderer until prd-graph-helper --ensure replaces it. Changes to refresh_server.py in the same install need a helper restart (stop it, then --ensure); a helper from an older release or a checkout is replaced by the next --new, --once or --ensure from a newer installed release.--once <page.html> refreshes a page or report from the terminal without the server (--graph <graph-id> picks one graph in a report). --once <graph-id> refreshes an older graph from its config file.--export-config <page.html> prints the config a page carries.--port changes the port of the helper and of a new graph.column_labels and refresh again.A page, or a report with embedded graphs, can be copied to any machine and refreshed in place there:
prd-graph-helper) and their own CLOSEDLOOP_API_KEY with access to the scope. They open the file in a browser and click refresh; the helper rewrites their copy wherever they saved it.Graphs made before pages carried their config have a config in ~/.local/share/prd-dependency-graph/<graph-id>.json, with me, a per-graph token and the absolute outputs paths it rewrites. They keep working:
/refresh?graph=<graph-id>&token=<token>), and the helper still answers it;--once <graph-id> still refreshes from the config;column_labels are edited there;me is used only when that lookup fails.Deleting the config makes the page refresh from its own embedded config.
The helper listens on 127.0.0.1, and any website open in the browser can send it requests. Pages no longer carry a per-graph token, so the helper protects itself as follows. tools/python/test_prd_dependency_graph_security.py pins each rule.
{ok, written, refresh_id}: the new graph goes into the file, and only the page itself, read from disk, can see it. A website cannot read a file:// page. The graph is sent back only to pages served from this machine (http://localhost, 127.0.0.1, [::1]) and to local programs that send no Origin, which could read the files and the key anyway. A request with Origin null (a file page, or a sandboxed frame on any website) never gets ticket data, and any other origin is refused. Error messages carry no ticket data. The old token endpoint answers only with the token, which is never in a page made by this version. The one thing a website can learn is whether a file at a path it guesses holds a given graph.GET /health answers any request that carries an Origin, null and pages from this machine included, with only {ok, protocol}, which is all a page needs to tell an out-of-date helper from a missing one. The helper's script path and pid, which --ensure uses to recognize and replace a helper from an older install, go only to requests with no Origin addressed to 127.0.0.1, localhost or [::1]; a page reached through DNS rebinding sends no Origin on a GET, but it names its own host. A refresh from a file page answers without the file's path, and errors name a file only as the request gave it, never a symlink's target..html or .htm, before and after resolving symlinks, and that is an existing regular file owned by the user, at most 64 MB, with this graph's depgraph markers and an embedded config naming the requested scope. Only the text between those markers is replaced, atomically, and not if the file changed during the refresh.fetch never reaches a refresh. The same file or graph cannot be refreshed again within 3 seconds, at most two refreshes run at once, and request bodies are capped at 4 MB.CLOSEDLOOP_API_KEY or a login shell, is never written to any file, and is only sent to https://api.closedloop.ai. A page cannot redirect it: an API base in a page's config is ignored, and only a local older config can set one.https://app.closedloop.ai, and every value is type-checked and length-capped before it is used or drawn.Each graph block carries its config in <template class="dg-config" data-dg-graph="<graph-id>">, as HTML-escaped JSON, between the graph's depgraph markers. A <template> is never run, so a page with an older script cannot execute it. --export-config prints it:
{
"version": 2,
"title": "PRD-751 dependency graph",
"subtitle": "Individual Artifact Four-Tab Shell. Live BLOCKS links from ClosedLoop.",
"generated_at": "2026-09-24 13:43",
"column_labels": ["foundations and design", "components and APIs", "adoption"],
"nodes": [
{
"id": "ISS-10797",
"label": "Branch adoption",
"title": "[P751-9] Adopt the shared shell on Branch detail...",
"owner": "Daniel",
"status": "BLOCKED",
"url": "https://app.closedloop.ai/closedloop-ai/issues/ISS-10797",
"external": false,
"column": null
}
],
"edges": [
{"from": "ISS-10790", "to": "ISS-10797"}
],
"produces": [],
"refresh": {
"graph_id": "prd-751",
"scope": "PRD-751",
"port": 8765,
"app_issue_base": "https://app.closedloop.ai/closedloop-ai/issues",
"outside_blockers_depth": 1
},
"last_refresh": {"id": "<random>", "summary": "Refreshed ...", "changes": []}
}
from / to: from blocks to.produces: optional list of {"from", "to"} PRODUCES links from the scope document (a node with "root": true) to its tickets, drawn dotted.owner: the assignee's first name, or "unassigned". A node whose owner equals the viewer's first name is highlighted as theirs.status: the ClosedLoop status. BLOCKED, TRIAGE/BACKLOG and DONE get their own colors. The viewer's own BLOCKED tickets get a red border.column: optional; it overrides the automatic column.scope: a document or project slug. Older configs use prd, which still works.outside_blockers_depth: a number (0 turns outside blockers off) or "all". include_plans appears when plans are included.last_refresh: what the last refresh changed; a page reloaded by a refresh shows it in the change dialog.me. Those belong to one machine or person.render_graph.py also renders a hand-written JSON: -o page.html, --fragment -o frag.html, or --embed-into (which needs refresh.graph_id). A JSON with no refresh.graph_id and refresh.scope has no refresh button. In a hand-written JSON, "me" names whose tickets are highlighted and "mine": true marks a node as theirs; neither is carried into a page's config.examples/prd-751.json.<title>.png, and Copy Image, which puts the PNG on the clipboard for pasting into Slack or a doc. The image is the whole graph with its legend, as currently shown (a pinned chain stays highlighted), at 2x in the viewer's light or dark colors. The status line confirms each; a failure opens a dialog. It works without the helper."unassigned", not as a person.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub closedloop-ai/claude-plugins --plugin closedloop-core12 skills in this plugin
/closedloop-intelClosedLoop ticket + codebase intelligence over a shared remote instance. Use PROACTIVELY for questions about ticket scope overlap or duplicate work ("do these tickets overlap", "is someone already doing this", "is this a duplicate"), blast radius ("if I change this file or symbol, what breaks", "which tickets touch this code", "what depends on this module"), ticket lookup by keyword or slug, ticket lineage (which plan produced which issue, branches and PRs for a ticket), and aggregate rollups ("what shipped last week", "what is in progress per project", "what is stale"). Answers with cited evidence (ticket slugs, file paths, graph facts) using the closedloop-graph MCP server. Read-only./decision-tableUse when the user wants a code-grounded decision table for current behavior, wants to compare current behavior against a plan or work item, or needs a control-flow artifact for recovery, retry, finalization, validation, state-machine, or review-heavy edge cases./erd-diagramGenerate or update an interactive ERD (entity relationship diagram) as a single offline HTML file for a Postgres repository, built only from the repo's schema code (a Prisma schema, a SQL schema dump, or a folder of SQL migrations; other ORMs through a model the agent writes from the code). Two styles, canvas-sidebar (one pannable canvas of every table with a table list) and schema-explorer (overview, focused table view, per-domain diagrams). Use when the user asks for an ERD, a database or schema diagram, a map of tables and relationships, or to refresh an existing ERD file.Other plugins' skills for the same job