本文へ移動
cccskills
無料GitHub で公開

knowledge-graph

Build, update, and query a persistent project knowledge graph from skills, memory, docs, and code structure — stdlib Python only, no external tools. Dual-mode: skill-library (agent-loom) or application (any consumer repo). Load when the user asks for a knowledge graph, project map, skill relationships, query the graph, update the graph, or trace how components connect. Auto-runs on memory-handoff and project-setup bootstrap. Also triggers on "build the graph", "what connects to X", "map this project".

インストール方法を見る

含まれるファイル(8)

  • SKILL.md7.5 KB
  • references/examples.md1.9 KB
  • references/integration.md2.4 KB
  • references/schema.md2.7 KB
  • scripts/build_graph.py35.5 KB
  • scripts/graph_health.py4.5 KB
  • scripts/query_graph.py8.2 KB
  • scripts/validate_application_mode.py4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Knowledge Graph

You maintain a queryable project graph at docs/knowledge-graph/. Stdlib Python only — no Graphify, no pip deps, no external URLs in outputs.

Deployment Context

HostModeTypical use
agent-loom (skill library)skill-libraryMap skill invoke chains, memory, handoffs
Any consumer projectapplicationMap modules, docs, memory for GRAPHIFY-style project management

Mode auto-detects from authoritative skill-library files: docs/skill-graph.md and docs/SKILL-INDEX.md → skill-library label; otherwise application. Both modes always perform a repo-wide scan — skills, all application source (any path), packages, config, docs, memory, directories. Never skills-only.

Hard Rules

  • Full repo, always. build_graph.py walks the entire repository for source files. .agents/skills/ is indexed as skills, not skipped — but application code in packages/, artifacts/, lib/, etc. must appear as module nodes.
  • Query before rebuild. Relational questions → query_graph.py first.
  • Authoritative > inferred. invokes from docs/skill-graph.md + SKILL-INDEX.md Calls: lines are authoritative; references edges are hypotheses.
  • Shrink guard. No --force unless user confirms or graph is corrupt.
  • Handoff sync. Every memory-handoff → --incremental build.
  • No secrets. Skip .env, credentials, tokens by path name.

Common Rationalizations

ExcuseReality
"I'll just grep"Grep misses invoke chains and handoff lineage. Query the graph.
"Graph is stale, full rebuild"Try --incremental first; authoritative sources may be unchanged.
"INFERRED edge = fact"Read source_file / provenance before acting.
"Skip graph on handoff"Next agent loses relational context.
"Need Graphify pip package"Native stdlib scripts; patterns only, no install.
"Only for agent-loom"Bootstrap in every project via project-setup.
"Many skills = skills-only graph"Wrong — repo-wide scan always runs; read build stdout Why: line.

Workflow

Step 1 — Check existing graph

Read GRAPH_INDEX.md and GRAPH_REPORT.md when present.

Step 2 — Build or update

python3 .agents/skills/knowledge-graph/scripts/build_graph.py              # full repo scan
python3 .agents/skills/knowledge-graph/scripts/build_graph.py --incremental  # handoff/default
python3 .agents/skills/knowledge-graph/scripts/build_graph.py --force       # override shrink guard
python3 .agents/skills/knowledge-graph/scripts/build_graph.py --strict      # fail if source on disk but 0 modules

Stdout always prints: auto mode label, why that label was chosen, and scan layers (skills, code dirs, docs, memory). Read it before assuming skills-only — both modes scan the full repository.

Step 3 — Query

python3 .agents/skills/knowledge-graph/scripts/query_graph.py query "memory handoff connections"
python3 .agents/skills/knowledge-graph/scripts/query_graph.py path memory-handoff knowledge-graph
python3 .agents/skills/knowledge-graph/scripts/query_graph.py explain validate-skills

Cite path, confidence, and provenance for every hit. routing_note in JSON output confirms authoritative-first ordering — prefer invokes edges from skill-graph.md over INFERRED heuristics when choosing skills.

Step 4 — Health audit (optional / validate-skills hook)

python3 .agents/skills/knowledge-graph/scripts/graph_health.py

Step 5 — Report

Summarize: mode, node/edge counts, authoritative vs inferred ratio, hub nodes, communities, top query results.


Handoff Hook (mandatory for memory-handoff)

After appending to agent-handoffs.md:

python3 .agents/skills/knowledge-graph/scripts/build_graph.py --incremental

If build fails, note in handoff ### Graph — do not block save.


Output Format

## Knowledge graph — [full | incremental | query | health]

Mode: [skill-library | application]
Stats: [N] nodes, [E] edges ([A] authoritative invokes)
Hub nodes: [top 3]
Query: "[question]" → [matches with confidence tags]
Files: graph.json, call-graph.json, GRAPH_INDEX.md, GRAPH_REPORT.md

Verification

  • graph.json, GRAPH_INDEX.md, GRAPH_REPORT.md exist under docs/knowledge-graph/
  • Build stdout shows repo-wide source layer (not skills-only)
  • Consumer repos with code have module nodes in graph.json stats
  • call-graph.json present when mode=skill-library
  • Shrink guard respected (or --force approved)
  • Query results cite path + confidence + provenance
  • Handoff hook ran --incremental when invoked from memory-handoff
  • No secrets or external URLs in graph artifacts

Red Flags

  • Full graph rebuild run before query_graph for relational ask
  • Inferred edges override authoritative Calls: from SKILL-INDEX
  • Repo walk skipped — partial graph presented as complete
  • graph.json stale versus latest handoff not rebuilt

Reference Files

  • references/schema.md — node/edge types, provenance priority
  • references/integration.md — producers/consumers, project-setup bootstrap
  • scripts/build_graph.py — full/incremental build
  • scripts/query_graph.py — query, path, explain
  • scripts/graph_health.py — dangling invokes, stale graph, orphan skills

File Output

Append to docs/skill-outputs/SKILL-OUTPUTS.md:

| YYYY-MM-DD HH:MM | knowledge-graph | docs/knowledge-graph/ | [N] nodes, [E] edges, mode=[mode] |

Examples

<examples> <example> <input>Build a knowledge graph for this project.</input> <output> Ran `build_graph.py` → mode=skill-library, 120 nodes, 412 edges (164 authoritative invokes). Hubs: universal-skill-creator, validate-skills, secure-skill. Saved to `docs/knowledge-graph/`. See `GRAPH_REPORT.md` for communities and suggested questions. </output> </example> <example> <input>How does memory-handoff connect to knowledge-graph?</input> <output> `query_graph.py path memory-handoff knowledge-graph` → 1 hop via `invokes` [EXTRACTED, provenance: memory-handoff/SKILL.md]. Neighbors: memory-capture, agent-handoffs [recorded_in]. </output> </example> </examples>

Prune Log

Last pruned: 2026-07-04

  • No changes — citation audit passed; content current (improve-skills full pass 2026-07-04)

Impact Report

Knowledge graph: [full/incremental/query/health]
Mode: [skill-library|application] | Nodes: [N] | Edges: [E]
Authoritative invokes: [A] | EXTRACTED: [E] | INFERRED: [I]
Shrink guard: [ok/refused/forced] | Handoff sync: [yes/no]
Consumers notified: [list or n/a]

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Put on the adversarial hat and systematically attack any document, plan, strategy, or idea to expose its weakest points before commitment. Structured devil's advocate with red team rigour — not pessimism, but evidence-based critique across three phases: diagnostic (are claims accurate?), creative (is the problem artificially constrained?), challenge (are solutions robust?). Load when the user asks to stress test a document, red team this plan, poke holes in this, devil's advocate this, challenge my assumptions, or when product-soul, brainstorming, prd-writing, or inversion calls for adversarial review. Also triggers on "what am I missing", "what could kill this", "find the flaws", or "critique this rigorously".

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Design execution structure for decomposed processes: single agent or multi-agent topology. Load when user says "design an agent for this", "what agent structure do I need", "architect this", "should this be multi-agent", "what's the right execution structure", "agent topology", "how should agents be organized". Takes process-decomposer output as primary input. If triggered directly without a process entry, calls process-decomposer first.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Internal skill. Called by setup-evaluation after a PASS. Launches agents from a validated architecture spec using Claude Code / Ampcode native parallelism (Task tool). Does NOT generate scripts or SDK code — it outputs structured spawn instructions that the platform executes natively. Never invoked directly by the user. Never launches without a setup-evaluation PASS.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Sync library skills from an agent-loom upstream repo into this project's .agents/skills while preserving project-local and forked skills. Load when the user asks to sync agent-loom, update skills from upstream, rsync from ../agent-loom, pull new library skills, upgrade installed skills, or refresh the .agents folder without losing custom project skills. Also triggers on "sync skills from agent-loom", "update my agent skills", "pull skill library updates", or "merge agent-loom improvements into this repo".

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Instrument a shipped product's AI agents with tracing and observability so you can see what they did, why outputs happened, and what each run cost. Plain-language primer plus free-tier-first backend selection (Langfuse, Phoenix, LangSmith, Braintrust) and OpenTelemetry/OpenInference instrumentation. Load when the user asks to add observability, add tracing, instrument my agents, see what my agent is doing in production, set up Langfuse or Phoenix or LangSmith, debug why my agent gave a bad answer, or track LLM cost per request. Also fires when agent-system-architecture or setup-evaluation requires an observability plan for an agent-chain product. NOT for tracing the coding agent itself — that is run-trace. Precondition for runtime-learning-loop.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Run a structured retrospective after development-phase runs of your product's agents — interview the owner in plain language about what went well and poorly, draft ranked improvement hypotheses, then design and run small n=1/n=2 experiments with pre-declared success criteria, guardrails, stop conditions, and a cost/ROI kill-switch. Load when the user says how did that run go, retro this run, the agent output was bad, what should we improve, draft hypotheses, run a small experiment, or after repeated dev runs of an agentic system produce uneven quality. Priority: output quality over performance over cost, each with diminishing-returns stops. NOT a product A/B test (experimentation), NOT coding-agent harness repair (harness-evolution), NOT production-scale learning (runtime-learning-loop).

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

dvy1987 のスキルをすべて見る

このスキルの問題を報告する