From ccc56ce144d9cdb4c8768c959c2cdcc44a3075c1 Mon Sep 17 00:00:00 2001 From: Roger Barnes Date: Tue, 1 Dec 2026 01:02:26 +1100 Subject: [PATCH] Inject spaces, schemas, and CLI help dynamically in skill --- plugin/.claude-plugin/plugin.json | 2 +- plugin/skills/structured-context/SKILL.md | 63 ++++++++--------------- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index b02bf88..8c2d58f 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "structured-context", - "version": "0.27.4", + "version": "0.27.5", "description": "Structured content authoring for Obsidian — automatic validation hooks, slash commands, and agent skills to keep markdown files compliant with your schema.", "homepage": "https://github.com/mindsocket/structured-context", "repository": "https://github.com/mindsocket/structured-context", diff --git a/plugin/skills/structured-context/SKILL.md b/plugin/skills/structured-context/SKILL.md index a734f78..a21e032 100644 --- a/plugin/skills/structured-context/SKILL.md +++ b/plugin/skills/structured-context/SKILL.md @@ -13,63 +13,42 @@ Rules are JSONata expressions, semantic rules evaluated by a model provider (onl ## Version compatibility -Before starting work, verify `sctx` is installed and check the version: - -!`sctx --version` +!`sctx --version 2>&1 || true` The plugin version is listed in `plugin/.claude-plugin/plugin.json`. A match on **minor version** (e.g. both `0.9.*`) indicates compatibility. If the installed `sctx` minor version differs from the plugin minor version, warn the user — behaviour may differ from what the skill describes. -If not installed, run `bun install -g structured-context` +If not installed, run `bun install -g structured-context`. -## Config +## Current environment -**Always read the config first** with `sctx spaces`: it shows the config in use, its spaces and any problems, each with a -code (see `references/troubleshooting.md`). Config files are JSON5 (comments and trailing commas allowed), so strict -JSON tools (`jq`, `json.load`) will fail on them; verify edits with `sctx spaces`. `sctx docs config` covers -config discovery and `sctx spaces add`. If there is no config yet, use the setup-space skill. +### Configured spaces -## Orientation +!`sctx spaces 2>&1 || true` -Before working with a space, use these to understand what's configured: +Config files are JSON5 (comments and trailing commas allowed), so strict JSON tools (`jq`, `json.load`) will fail on them; verify edits with `sctx spaces`. See `references/troubleshooting.md` for problem codes, or `sctx docs config` for discovery and `sctx spaces add`. Pass `--config ` to any command when working with a different config file. -```bash -sctx spaces --config # per-space: path, schema, fieldMap, templates, miro -sctx schemas list --config # list available schemas by name -sctx schemas show --space --config # entity types, properties, rules, enums + registry -sctx schemas show # inspect a bundled partial (e.g. _sctx_base.json) -sctx docs # full README -sctx docs config # plugin config reference (fieldMap, typeInference, etc.) -sctx docs concepts # terminology reference -sctx docs semantic-rules # semantic rule reference -sctx providers --config # model providers for --semantic -``` +### Available schemas + +!`sctx schemas list 2>&1 || true` -`spaces` is the starting point — it shows each space as a block with its schema name, `fieldMap` -mappings (if any), template config, and whether Miro is configured. +## Orientation -`schemas list` shows all available schema names — use this first to discover what schemas exist before inspecting one. +Inspect the schema or docs for the space you are working on: -`schemas show --space` is the primary schema tool — it lists entity types and their properties (required marked with `*`), the hierarchy, **adjacent relationships**, all rules with descriptions, definitions with enum values, and the loaded schema registry. **Run this before authoring content or writing rules** to ensure you use the correct field names and types. The registry section -at the bottom shows which bundled and local partials are in scope for `$ref` targets. +```bash +sctx schemas show --space # entity types, properties, rules, enums + registry +sctx schemas show # inspect a bundled partial (e.g. _sctx_base.json) +sctx docs [topic] # README, or topic: concepts, config, schema, rules, semantic-rules +sctx providers # model providers for --semantic +``` -`schemas show ` (e.g. `_sctx_base.json`) reveals available definitions in bundled -partials. +**Run `sctx schemas show --space ` before authoring content or writing rules** to get the exact field names, required properties, hierarchy, adjacent relationships, rules, and `$ref` registry. -## Commands for working with spaces +## Commands -``` -validate Validate space content against schema (--watch for live) -validate-file Validate one file within its space (after a single-file edit) -show Output the node hierarchy -dump Output parsed node data as JSON -diagram Generate Mermaid diagram (--output ) -render Render a space in a given format -miro-sync Sync to Miro board (requires MIRO_TOKEN env var + miro plugin config with boardId) -template-sync Sync Obsidian templates from schema examples -plugins List available plugins -``` +!`sctx --help 2>&1 || true` -All commands except `validate-file` require a registered space name. Run `sctx --help` or `sctx --help` for flags. +All space commands except `validate-file` take a registered space name. Run `sctx --help` for flags. `miro-sync` requires `MIRO_TOKEN` and a Miro plugin config with `boardId`. ### When to run `--semantic`