add-relationship
Skill by cartography-cncf
Adds relationships between Cartography graph nodes, including standard edges, one-to-many edges and MatchLinks. Written for developers building Cartography intel modules.
Install add-relationship
Built from the published package, never by AI.
git clone --depth 1 https://github.com/cartography-cncf/cartography /tmp/cartography && mkdir -p ~/.claude/skills && cp -r /tmp/cartography/.agents/skills/add-relationship ~/.claude/skills/add-relationshipRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/cartography-cncf/cartography /tmp/cartography && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/cartography/.agents/skills/add-relationship ~/.gemini/antigravity-cli/skills/add-relationshipAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The add-relationship skill guides an AI assistant through adding a relationship between Cartography nodes. It covers three options: a standard relationship defined on a node schema, a one-to-many edge set with PropertyRef and one_to_many=True, and a MatchLink that connects two existing nodes. The skill says to prefer standard relationships, since MatchLinks add extra MATCH reads.
It also covers the MatchLink schema, loading with load_matchlinks(), and cleanup using GraphJob.from_node_schema() and GraphJob.from_matchlink(). It is for developers writing Cartography intel modules who need to link nodes, share a node across modules, or model a composite node from two sources. The skill includes reference notes on MatchLink performance, rich properties, and multi-module patterns.
Written from the project's SKILL.md and checked against it.
What it can do
- Standard relationshipDefines a CartographyRelSchema attached through other_relationships or sub_resource_relationship.
- Edge directionChooses LinkDirection.OUTWARD or LinkDirection.INWARD for a relationship.
- One-to-many edgesCreates one edge per ID in a list using PropertyRef with one_to_many=True.
- MatchLink schemaConnects two existing node types with relationship properties for rich metadata.
- Load MatchLinksLoads MatchLink data with load_matchlinks() and lastupdated and sub-resource parameters.
- Cleanup jobsRuns GraphJob.from_node_schema() and GraphJob.from_matchlink() to remove stale relationships.
What you need
- Cartography
- Python
- Neo4j
Try asking
- Add a standard relationship from my Cartography tenant node to users
- Model a one-to-many ASSOCIATED_WITH edge from route tables to subnets
- Write a MatchLink that connects AWS roles to SSO users with cleanup
Good to know
- MatchLinks have a real performance cost because of extra MATCH reads.
- Both source and target nodes must already exist before load_matchlinks() runs.
- Use MatchLinks sparingly and only when the source data or metadata requires them.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/add-relationship/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
references/matchlinks.md6 KB -
references/multi-module-patterns.md3 KB
Alternatives to add-relationship
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
add-relationship: common questions
Should I use a MatchLink or a standard relationship?
Prefer standard relationships in node schemas. Use a MatchLink only when the data comes from a separate source connecting two existing node types, or when it needs rich metadata.
Why is my Cartography relationship not created?
The target node probably did not exist when the relationship was loaded. Load parent nodes first.
What cleanup is needed for relationships?
Always implement cleanup. Standard relationships use GraphJob.from_node_schema(), and MatchLinks use GraphJob.from_matchlink().
How do I install add-relationship?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is add-relationship free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is add-relationship safe to use?
It scores 84 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to add-relationship?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
