add_concept
Create a Markdown ontology node when code analysis surfaces a new capability, element, or project. Warns on duplicate slugs and near-duplicate titles, then returns next maintenance actions.
Instructions
Create a new ontology node (.md file). Call when an AI agent finds a new capability / element / project from code analysis. Throws if the slug already exists — use patch_concept in that case. The frontmatter is normalized per kind (project gets domains/capabilities/elements empty arrays; capability gets elements: []; capability/element should also set domain: so the tree has a parent — missing extras come back as warnings in the response, not as an error. If another node already has the same title, a near-duplicate warning is included too — prefer patch_concept on the existing node over forking a duplicate. Successful writes return compact postWriteMaintenance (maintenance_plan) with count-safe byPhase / bySeverity / byKind queue buckets, action score, executable proposedAction, and current-page nextExecutableAction / nextReviewAction pointers so agents can immediately see graph cleanup / relation suggestions after the new node lands. For bulk creation (e.g. bootstrap flow with 5+ nodes) use add_concepts({concepts: [...]}) (batch, max 50, partial result) — saves K-1 round-trips. When kind is element: an element names a CONCEPT a capability uses (e.g. "jwt-token"), not a file. If your title is a bare path or ends in a source extension, you are describing evidence, not the concept — rename title to the role and put the path in path:, or if 3+ siblings under the same parent already look like this, call get_concept on the parent and consider patch_concept on an existing sibling instead of adding another file-mirror node. The same rule binds the slug: flat under the kind folder (elements/<role-name>), never a code path (elements/src/views/home is rejected) — path-style slugs collide the moment two files share a basename and the graph silently merges distinct nodes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Markdown body (optional). When omitted a kind-specific starter body is written so the file is self-explanatory in the editor. | |
| kind | Yes | project / domain / capability / element / document. (vault-readme is reserved for the auto-generated README.md and should not be set by agents.) | |
| path | No | One canonical implementation entrypoint for a capability or element (repo-relative file or directory). Preserved as evidence and checked by validate_vault path drift. | |
| slug | Yes | Vault-relative slug (omit the .md extension), flat under the kind folder — e.g. "elements/jwt-token", "capabilities/token-issue". A slug is the node's name, never a code path: "elements/src/views/home" is rejected (put the file location in path: instead). | |
| title | Yes | Display title for the node. | |
| domain | No | Parent domain slug. Strongly expected for kind=capability and kind=element — without it the node floats orphaned in the tree. | |
| labels | No | Per-locale display names, e.g. { "ko": "결제", "en": "Payments" }. Written as `display_ko` / `display_en` frontmatter keys; `title` stays the single source for search/matching. Fill BOTH locales the vault serves — a single-locale entry comes back as a warning. | |
| elements | No | Element slugs this node uses (project / capability). | |
| capabilities | No | Capability slugs this node owns (project / domain). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| slug | Yes | ||
| changed | Yes | ||
| filePath | Yes | ||
| warnings | No | ||
| postWriteMaintenance | No | Compact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write. |