xiaohongshu
xiaohongshu
This skill should be used when the user asks about "entities", "relations", "architecture graph", "spec-driven development", "code annotations", "@graph anchors", mentions ".graph/" directory, asks to "add entity", "create relation", "verify sync", "check drift", discusses "code_refs", "architect...
Full skill instructions
Cartographer enables spec-driven development where architecture specifications in .graph/ define the source of truth for entities, relations, and code structure. The code follows the spec, not the other way around.
Entities are defined in .graph/entities/*.yaml:
name: User
description: Application user account
fields:
- name: id
type: uuid
primary: true
- name: email
type: string
unique: true
- name: name
type: string
relations:
- name: todos
entity: Todo
type: has_many
code_refs:
model:
anchor: "@graph:User.model"
schema:
anchor: "@graph:User.schema"
Key properties:
name: PascalCase entity identifierdescription: Human-readable purposefields: Typed fields with constraints (primary, unique, nullable)relations: Connections to other entitiescode_refs: Links to implementation code via anchorsRelations define how entities connect:
| Type | Description | Example |
|---|---|---|
has_many | One-to-many | User has_many Todos |
belongs_to | Many-to-one (inverse) | Todo belongs_to User |
has_one | One-to-one | User has_one Profile |
has_many_through | Many-to-many via junction | User has_many Categories through TodoCategories |
Code is linked to specs via anchor comments in source files:
// @graph:User.model
export interface User {
id: string;
email: string;
name: string;
}
// @end:User.model
Anchor syntax:
// @graph:EntityName.refType// @end:EntityName.refTypeWhen implementing or modifying code, always follow this workflow:
Before writing any code, read the entity YAML in .graph/entities/:
# Use /graph:entity command
/graph:entity User
Or read the file directly to understand:
Implement exactly what's specified:
Wrap implementations with @graph: comments:
// @graph:User.model
// Implementation here
// @end:User.model
Run /graph:check to validate that code matches spec.
| Command | Purpose |
|---|---|
/graph:check | Verify spec-code synchronization |
/graph:entity <name> | Query entity details |
/graph:impact <entity> | Analyze change impact |
The Cartographer MCP server provides these tools:
| Tool | Purpose |
|---|---|
scan | Analyze codebase, find anchors |
query | Get entity details |
validate | Check spec compliance |
impact | Analyze change dependencies |
get_relations | Fetch entity relations |
Always define in .graph/ before implementing:
1. Create/update .graph/entities/new-entity.yaml
2. Implement code with anchors
3. Run /graph:check
One anchor per logical unit:
model - Data structure/interfaceschema - Validation ruleshandler - API endpoint handlerrepository - Database access layerRun /graph:check after every modification to catch drift early.
Make entity connections explicit in both entities:
# user.yaml
relations:
- name: todos
entity: Todo
type: has_many
# todo.yaml
relations:
- name: user
entity: User
type: belongs_to
.graph/entities/new-entity.yaml with all fields/graph:check to verify/graph:check/graph:impact Entity.field first/graph:checkBefore modifying an entity:
/graph:impact User.email
This shows:
Common field types in entity definitions:
| Type | Description |
|---|---|
uuid | Universally unique identifier |
string | Text data |
integer | Whole numbers |
float | Decimal numbers |
boolean | True/false |
timestamp | Date and time |
date | Date only |
json | JSON object |
enum | Fixed set of values |
array | List of items |
If /graph:check reports missing anchors:
If code has an anchor but spec doesn't reference it:
If field types don't match:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience