Agent skill

Add Node Type

by cartography-cncf in cartography-cncf/cartography

Define a new node schema under cartography/models/MODULENAME/, including required properties, sub-resource relationships, extra labels, conditional labels, scoped cleanup, and one-to-many transforms.

Apache-2.0Auto-check passed

Install Add Node Type

skills CLI
$ npx skills add cartography-cncf/cartography --skill add-node-type -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cartography-cncf/cartography add-node-type --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cartography-cncf/cartography.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/add-node-type .claude/skills/add-node-type && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-node-type
GitHub stars
4.1k
Token cost
~1.9k tokens
SKILL.md length
483 words
Files
2 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
Apache-2.0

At a glance

Define a new node schema under cartography/models/MODULENAME/, including required properties, sub-resource relationships, extra labels, conditional labels, scoped cleanup, and one-to-many transforms.

  • Works in 8 steps: Required properties → Schema with sub-resource relationship → Pick the right standard fields → …
  • The user asks to add a node type
  • SKILL.md covers Critical rules, Instructions, Common issues and References (load on demand)
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Add Node Type is an agent skill from cartography-cncf/cartography. Define a new node schema under cartography/models/MODULENAME/, including required properties, sub-resource relationships, extra labels, conditional labels, scoped cleanup, and one-to-many transforms. Use when the user asks to add a node type, model a new resource, configure extra Neo4j labels (Identity, Asset, UserAccount, Tenant), or wire scoped vs global cleanup.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/advanced-properties.md`).

It works with Neo4j. The repository describes itself as: Cartography is a Python tool that pulls infrastructure assets and their relationships into a Neo4j graph database. The licence is Apache-2.0.

When your agent uses it

  • The user asks to add a node type
  • Model a new resource
  • Configure extra Neo4j labels (Identity
  • Wire scoped vs global cleanup

Example prompts

  • “/add-node-type”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Required properties
  2. Schema with sub-resource relationship
  3. Pick the right standard fields
  4. Extra labels
  5. Decide on scoped_cleanup
  6. One-to-many
  7. Date handling
  8. Loading

What it can do on your machine

Read from SKILL.md and the folder at commit e4eda50. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Node Type loads about 1.9k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 483 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cartography-cncf/cartography at commit e4eda50, republished under its Apache-2.0 licence (© cartography-cncf). 483 words, ~1,897 tokens.

Download SKILL.mdSave it as .claude/skills/add-node-type/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
add-node-type
description
Define a new node schema under cartography/models/MODULE_NAME/, including required properties, sub-resource relationships, extra labels, conditional labels, scoped cleanup, and one-to-many transforms. Use when the user asks to add a node type, model a new resource, configure extra Neo4j labels (Identity, Asset, UserAccount, Tenant), or wire scoped vs global cleanup.

add-node-type

Add a new CartographyNodeSchema (and its CartographyNodeProperties) to a Cartography module. This skill assumes the surrounding module already exists; for end-to-end module creation, see the create-module skill.

Critical rules

  1. @dataclass(frozen=True) everywhere, with type annotations on every field (x: PropertyRef = PropertyRef("x")). A missing annotation triggers PropertyRef validation failed.
  2. Only the standard schema fields are recognised. Custom fields on CartographyNodeSchema / CartographyRelSchema subclasses are silently ignored — see "Standard fields" below.
  3. sub_resource_relationship always points to a tenant-like node (AWSAccount, AzureSubscription, GCPProject, GitHubOrganization, your <Service>Tenant).
  4. scoped_cleanup defaults to True. Override to False only for genuinely global data (CVE feeds, public threat intel, public DNS).

Instructions

Step 1 — Required properties

Every node type needs at least:

python
@dataclass(frozen=True)
class YourNodeProperties(CartographyNodeProperties):
    id: PropertyRef = PropertyRef("id")                                       # REQUIRED
    lastupdated: PropertyRef = PropertyRef("lastupdated", set_in_kwargs=True) # REQUIRED
    # business properties...

PropertyRef parameters:

  • First arg: per-record dict key, or kwarg name when set_in_kwargs=True.
  • extra_index=True — add a database index for query performance.
  • set_in_kwargs=True — value comes from load(..., KWARG=...), not the per-record dict.
  • one_to_many=True — value is a list; expand to many edges (see "One-to-many" below).
Step 2 — Schema with sub-resource relationship
python
@dataclass(frozen=True)
class YourServiceUserSchema(CartographyNodeSchema):
    label: str = "YourServiceUser"
    properties: YourServiceUserNodeProperties = YourServiceUserNodeProperties()
    sub_resource_relationship: YourServiceTenantToUserRel = YourServiceTenantToUserRel()
    other_relationships: OtherRelationships = OtherRelationships([
        YourServiceUserToHumanRel(),
    ])
Step 3 — Pick the right standard fields

CartographyNodeSchema standard fields:

FieldTypeRequiredNotes
labelstrYesNeo4j node label
propertiesCartographyNodeProperties subclassYes
sub_resource_relationshipCartographyRelSchema subclassYesTenant-like target. None only if scoped_cleanup=False.
other_relationshipsOtherRelationshipsNoAdditional business relationships
extra_node_labelsExtraNodeLabelsNoAdditional Neo4j labels (e.g. Identity, UserAccount)
scoped_cleanupboolNoDefaults to True. Almost never override.

CartographyRelSchema standard fields: target_node_label, target_node_matcher, direction, rel_label, properties. Custom fields do nothing — handle conditional behaviour in transform() by setting fields to None or filtering before load().

Step 4 — Extra labels

Add additional Neo4j labels by importing reusable uppercase constants and wrapping them in ExtraNodeLabels:

python
from cartography.models.core.nodes import ExtraNodeLabels
from cartography.models.ontology.labels import USER_ACCOUNT

extra_node_labels: ExtraNodeLabels = ExtraNodeLabels([USER_ACCOUNT])

Produces (:YourServiceUser:UserAccount). ExtraNodeLabel is one immutable value type, not a base class for one subclass per label. Label definitions are exported uppercase constants; their description fields are metadata for introspection and generated documentation. Do not rely on class docstrings. ExtraNodeLabels stores the supplied labels as an immutable tuple.

For ontology-driven labels (UserAccount, Tenant, Database, ...) see the enrich-ontology skill.

Show full SKILL.md (160 more words)Show less
Step 5 — Decide on scoped_cleanup

Default behaviour scoped_cleanup=True is correct for almost everything: user accounts, infrastructure resources, application assets — anything scoped to a tenant.

Override to False only for genuinely global data with no tenant:

python
@dataclass(frozen=True)
class VulnerabilitySchema(CartographyNodeSchema):
    label: str = "Vulnerability"
    properties: VulnerabilityNodeProperties = VulnerabilityNodeProperties()
    sub_resource_relationship: None = None
    scoped_cleanup: bool = False

Examples that justify scoped_cleanup=False: CVE databases, threat intel feeds, public certificate transparency logs, global DNS / domain info.

Step 6 — One-to-many

When one source record points to many targets, flatten the IDs in transform() and use one_to_many=True on the relationship matcher:

python
# transform
def transform_route_tables(route_tables):
    out = []
    for rt in route_tables:
        out.append({
            "id": rt["RouteTableId"],
            "subnet_ids": [a["SubnetId"] for a in rt.get("Associations", []) if "SubnetId" in a],
        })
    return out


# relationship
@dataclass(frozen=True)
class RouteTableToSubnetRel(CartographyRelSchema):
    target_node_label: str = "AWSEC2Subnet"
    target_node_matcher: TargetNodeMatcher = make_target_node_matcher({
        "subnet_id": PropertyRef("subnet_ids", one_to_many=True),
    })
    direction: LinkDirection = LinkDirection.OUTWARD
    rel_label: str = "ASSOCIATED_WITH"
    properties: RouteTableToSubnetRelProperties = RouteTableToSubnetRelProperties()
Step 7 — Date handling

Neo4j 4+ supports native datetimes and ISO 8601 strings. Pass values through directly — do not convert to epoch milliseconds.

python
# DO
"created_at": user_data.get("created_at")

# DON'T
"created_at": int(dt_parse.parse(user_data["created_at"]).timestamp() * 1000)
Step 8 — Loading
python
from cartography.client.core.tx import load

load(neo4j_session, YourServiceTenantSchema(), [{"id": tenant_id}], lastupdated=update_tag)
load(
    neo4j_session,
    YourServiceUserSchema(),
    data,
    lastupdated=update_tag,
    TENANT_ID=tenant_id,
)

Common issues

  • PropertyRef validation failed — missing frozen=True or missing type annotation.
  • Custom field on a Schema is "ignored" — only standard fields are recognised.
  • Cleanup deleting too much / too little — verify scoped_cleanup and common_job_parameters["TENANT_ID"].

For the full troubleshooting list, see the troubleshooting skill.

References (load on demand)

  • references/advanced-properties.md — conditional labels (ECR images / attestations), MatchLink targets, deeper sub-resource rationale, ECS example.

© cartography-cncf, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/add-node-type of cartography-cncf/cartography.

  • SKILL.md
  • references/advanced-properties.md

Open the folder on GitHubat commit e4eda50

Compare with similar skills

Add Node Type next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Node Type compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Node Type this skillcartography-cncf/cartography4.1k—~1.9kAutomated safety check: PassApache-2.0
Cognee Docker Setuptopoteretes/cognee32k1 repos~901Automated safety check: NotesApache-2.0
CodegraphcontextCodeGraphContext/CodeGraphContext4.2k—~675Automated safety check: NotesMIT
Add Partial Reconsamugit83/redamon2.9k—~1.1kAutomated safety check: PassMIT
Project Orchestratorthis-rs/project-orchestrator140—~2.6kAutomated safety check: PassCustom licence
Anylineanylineorg/anyline346—~1.3kAutomated safety check: PassApache-2.0

Similar skills

  • Cognee Docker Setup

    topoteretes/cognee

    Runs the Cognee AI memory platform in Docker, from a one-file prebuilt image to a full compose stack with UI, MCP server, Postgres and Neo4j.

    32k GitHub starsUsed in 1 repo~901 tokens
    DevOps & CloudAuto-check: notes
  • Codegraphcontext

    CodeGraphContext/CodeGraphContext

    Use CodeGraphContext (CGC) to index a repo into a graph DB and query it via CLI or MCP.

    4.2k GitHub stars~675 tokensUpdated 8 days ago
    Agent WorkflowsAuto-check: notes
  • Add Partial Recon

    samugit83/redamon

    Adding partial-recon support for a tool: running a single pipeline phase on demand from the workflow graph, reading its inputs from the existing Neo4j graph and merging results back.

    2.9k GitHub stars~1.1k tokensUpdated 2 days ago
    SecurityAuto-check passed
  • Project Orchestrator

    this-rs/project-orchestrator

    AI agent orchestrator with Neo4j knowledge graph, Meilisearch search, and Tree-sitter parsing.

    140 GitHub stars~2.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Anyline

    anylineorg/anyline

    AnyLine数据库操作开发规范,涵盖动态数据源注册切换注销、DDL动态建表改表、DML增删改与事务管理、DQL动态查询与聚合统计、元数据管理、查询结果集的聚合、过滤、格式转换等数学计算,AnyLine方法内部会自动适配100+数据库方言,调用方法时忽略不同数据库差异。

    346 GitHub stars~1.3k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Install and Run Cognee

    topoteretes/cognee

    Installs the cognee AI memory library in a Python environment, sets the LLM key and gets a first remember and recall script running with the Python SDK.

    32k GitHub stars~1k tokensUpdated today
    Agent WorkflowsAuto-check: notes

More from cartography-cncf/cartography

All 11 skills in this repo
  • Add Relationship

    cartography-cncf/cartography

    Define a CartographyRelSchema (standard relationship), one-to-many edge, or MatchLink connecting existing nodes.

    4.1k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Analysis Jobs

    cartography-cncf/cartography

    Add a post-ingestion typed analysis job to a Cartography module to enrich the graph after sync.

    4.1k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Create Module

    cartography-cncf/cartography

    Author a new Cartography intel module end-to-end (entry point, sync GET/TRANSFORM/LOAD/CLEANUP, declarative data model, integration test, schema docs).

    4.1k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Create Rule

    cartography-cncf/cartography

    Author a Cartography security rule (one or more Cypher Facts plus a Pydantic Finding output model) under cartography/rules/data/rules/.

    4.1k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Enrich Ontology

    cartography-cncf/cartography

    Map a Cartography node into the Ontology system using semantic labels (UserAccount, DeviceInstance, Tenant, Database, ObjectStorage, FileStorage) or canonical nodes (User, Device).

    4.1k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Promote Ontology Relationship

    cartography-cncf/cartography

    Promote provider-specific relationships to a canonical cross-provider ontology edge using the WORKLOADPARENT pattern (a parallel CartographyRelSchema with the canonical rellabel, the old edge kept…

    4.1k GitHub stars~3.6k tokensUpdated today
    Auto-check passed

Works with

Questions about Add Node Type

What does Add Node Type do?

Define a new node schema under cartography/models/MODULENAME/, including required properties, sub-resource relationships, extra labels, conditional labels, scoped cleanup, and one-to-many transforms. Add Node Type is an agent skill from cartography-cncf/cartography. Define a new node schema under cartography/models/MODULENAME/, including required properties, sub-resource relationships, extra labels, conditional labels, scoped cleanup, and one-to-many transforms.

When should I use Add Node Type?

Add Node Type fits situations like: the user asks to add a node type; model a new resource; configure extra Neo4j labels (Identity; wire scoped vs global cleanup.

How do I install Add Node Type in Claude Code?

Run `npx skills add cartography-cncf/cartography --skill add-node-type -a claude-code`. Or copy the skill folder (.agents/skills/add-node-type in cartography-cncf/cartography) into .claude/skills/add-node-type in your project. Claude Code loads it when a task matches its description.

How do I install Add Node Type in Codex?

Run `npx skills add cartography-cncf/cartography --skill add-node-type -a codex`. Or copy the skill folder (.agents/skills/add-node-type in cartography-cncf/cartography) into .agents/skills/add-node-type in your project. Codex loads it when a task matches its description.

Can I use Add Node Type in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cartography-cncf/cartography --skill add-node-type -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-node-type, .gemini/skills/add-node-type, .github/skills/add-node-type and .opencode/skills/add-node-type in your project.

What does Add Node Type need to run?

SKILL.md names no scripts, command-line tools or credentials: Add Node Type is instructions for the agent only. Our summary lists: Python 3.

Does Add Node Type access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Node Type safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Node Type use?

Add Node Type is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Node Type use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Add Node Type?

Skills that share tags, products or a category with Add Node Type: Cognee Docker Setup (topoteretes/cognee, 32k stars), Codegraphcontext (CodeGraphContext/CodeGraphContext, 4.2k stars), Add Partial Recon (samugit83/redamon, 2.9k stars) and Project Orchestrator (this-rs/project-orchestrator, 140 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Node Type?

cartography-cncf (a GitHub organization) maintains it in cartography-cncf/cartography, which has 4,120 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 7, 2026.

Source: cartography-cncf/cartography on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.