graph-os-authoring

graph-os-authoring is a skill for Claude Code from kouroshez/coding-os. It costs 122 tokens per session (3,450 once invoked), scanned A, original, Apache-2.0.

A set of rules for building and maintaining a knowledge graph: a structured map of code, documents, and their relationships. It covers extracting information, storing it in SQLite, searching it, and updating it safely.

In plain words
What is it for?
Use it when adding new kinds of code relationships, writing extractors, changing the SQLite storage layer, or modifying incremental reindexing.
Why use it?
It helps prevent duplicate or inconsistent graph data when the codebase changes. This keeps graph-based searches from returning misleading results.

Skill for Claude Code

Written for Claude Code: PostToolUse hook event.

Good fit Use it when adding new kinds of code relationships, writing extractors, changing the SQLite storage layer, or modifying incremental reindexing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kouroshez/coding-os/graph-os-authoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kouroshez/coding-os --skill graph-os-authoring
Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for graph-os-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/kouroshez/coding-os/graph-os-authoring/github.svg)](https://agentmods.dev/skills/kouroshez/coding-os/graph-os-authoring)
Your own site
<a href="https://agentmods.dev/skills/kouroshez/coding-os/graph-os-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/graph-os-authoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for graph-os-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/graph-os-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/graph-os-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00122 $0.03450
Opus 5.5 $0.00049 $0.01380
Sonnet 5.5 $0.00024 $0.00690
Haiku 4.5 $0.00012 $0.00345

Measured 1mo ago against content hash 433c611adc51, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

graph-os-authoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/new_extractor.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/templates/meta/skills/graph-os-authoring/SKILL.md · 281 lines

How it starts

The opening of the file, as written. The whole thing — 281 lines — stays where its author put it; the contents beside it link to each section on GitHub.

graph-os-authoring

Purpose: The graph is the third retrieval layer. Authoring it correctly — idempotent extraction, backend-neutral query layer, honest confidence scores — is what makes cos_graph_* tools faster + more accurate than grep. Getting any one of those wrong corrupts the graph silently, and the agent starts trusting hallucinations.

Read when: editing files matching:

  • src/core/graph_os/backends/*.py — SQLite (single backend today; Kuzu retired 2026-05-18 after benchmark showed SQLite p99 < 30 ms on 5-hop @ 1M nodes).
  • src/core/graph_os/extractors/*.py — Python AST / doc / config extractors.
  • src/core/graph_os/tools/*.py — the cos_graph_* MCP tools (also see mcp-tool-authoring).
  • src/core/graph_os/tools/reindex_dispatch.py — incremental reindex orchestration.
  • src/core/graph_os/types.py — node + edge type definitions (the contract).

Skip when: only querying the graph (use graph-explorer for that).

The Five Hard Contracts

1. UID scheme (immutable across rebuilds)

Every node has a uid that survives reindex. Scheme:

code:file:<path>
code:function:<path>::<name>
code:class:<path>::<name>
code:module:<dotted-name>
doc:file:<path>
doc:heading:<path>#<slug>:<level>
folder:<path>
config:<path>::<key>

Path is repo-relative, POSIX, no leading slash. Never include line numbers in uids — line numbers shift; uids must be stable.

When adding a new node type, extend the registry in src/core/graph_os/types.py and document the uid grammar there. The grammar IS the contract — agents reference uids in saved memories.

2. Idempotent extraction (keyed on uid)

Every extractor MUST be re-runnable. The contract: extracting the same file twice produces the same nodes + edges. Implementation:

def extract(file_path: Path) -> ExtractionResult:
    nodes = []
    edges = []
    for symbol in _walk_ast(file_path):
        nodes.append(GraphNode(
            uid=_make_uid(symbol),  # deterministic from file + symbol name
            kind="function",
            label=symbol.name,
            file_path=str(file_path),
            start_line=symbol.start,
            end_line=symbol.end,
            confidence=1.0,  # AST gives certainty
        ))
        for callee in symbol.callees:
            edges.append(GraphEdge(
                source_uid=nodes[-1].uid,
                target_uid=_resolve_callee_uid(callee, file_path),
                kind="calls",
                confidence=_calc_confidence(callee),  # see §3
            ))
    return ExtractionResult(nodes=nodes, edges=edges)

Read the full file on GitHub · 281 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines 433c611adc51
  2. 3mo ago First seen · 279 lines · 122 tokens per session scan A 4e320583f3ff

Subscribe to this mod's changes

graph-os-authoring is a skill published in the GitHub repository kouroshez/coding-os (7 stars, last pushed 4d ago), licensed Apache-2.0. It adds 122 tokens to every session and 3,450 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

graph-os-authoring compared with skills from other repositories

graph-os-authoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
graph-os-authoringkouroshez/coding-osSkill74d agoApache-2.0A122Claude Code
omnigraphModernRelay/omnigraphSkill3.4ktodayMITA107Claude Code, Codex
sql-root-cause-analysiszj-unicom-ai/UniEmployeeSkill920yesterdayMITA47Claude Code, Codex
fetch-dataagentscope-ai/QwenPaw-DataSkill212yesterdayApache-2.0A286Claude Code, Codex
dkg-importerOriginTrail/dkgSkill135yesterdayApache-2.0A87Claude Code, Codex
hugegraph-regression-testerapache/hugegraph-aiSkill1504d agoApache-2.0A54Codex
hugegraph-data-importerapache/hugegraph-aiSkill1504d agoApache-2.0A62Codex