Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
63 changes: 21 additions & 42 deletions plugin/skills/structured-context/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cfg>` to any command when working with a different config file.

```bash
sctx spaces --config <cfg> # per-space: path, schema, fieldMap, templates, miro
sctx schemas list --config <cfg> # list available schemas by name
sctx schemas show --space <name> --config <cfg> # entity types, properties, rules, enums + registry
sctx schemas show <filename> # 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 <cfg> # 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 <name> # entity types, properties, rules, enums + registry
sctx schemas show <filename> # 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 <filename>` (e.g. `_sctx_base.json`) reveals available definitions in bundled
partials.
**Run `sctx schemas show --space <name>` 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 <space> Validate space content against schema (--watch for live)
validate-file <path> Validate one file within its space (after a single-file edit)
show <space> Output the node hierarchy
dump <space> Output parsed node data as JSON
diagram <space> Generate Mermaid diagram (--output <file>)
render <space> <fmt> Render a space in a given format
miro-sync <space> Sync to Miro board (requires MIRO_TOKEN env var + miro plugin config with boardId)
template-sync <space> 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 <command> --help` for flags.
All space commands except `validate-file` take a registered space name. Run `sctx <command> --help` for flags. `miro-sync` requires `MIRO_TOKEN` and a Miro plugin config with `boardId`.

### When to run `--semantic`

Expand Down