Tools for working with Opportunity Solution Tree structures and other product management and strategy frameworks
Get a list of commands: bun run src/index.ts --help
Space names (e.g. personal, politics) are resolved via a config file - $SCTX_CONFIG, $XDG_CONFIG_HOME/structured-context/config.json, --config <file> param, or ./config.json
A Claude Code plugin lives at plugin/. It includes skills, commands and hooks used when working with collections of Obsidian markdown content (aka a space) in a vault.
There are several places that need reviewing and updating with any new feature or change added:
- README.md - documentation, also displayed with
sctx readmecommand - AGENTS.md - this file
- docs/* - includes architecture, concepts etc
- plugin/* - skills, commands, hooks, and scripts; update any affected parts
This project validates data in markdown files against a JSON schema representing knowledge bases, and product and strategy frameworks, including Opportunity Solution Trees.
Before starting new work, review docs/concepts.md for canonical terminology. Use and maintain the definitions there as the source of truth when naming things in code, tests, comments, and documentation.
- config — JSON5 file with spaces registered
schemas/— Bundled default schema files (JSON5) using the structured-context schema dialect and top-level$metadata. Files starting with_are "partials" (fragments for$ref).src/metadata-contract.ts— Single source of truth for the$metadatacontractschemas/generated/_structured_context_schema_meta.json— Generated metaschema (generated on build or withbun run generate:schema-meta)
For most development only the main unit tests need re-running regularly.
bun run test— unit tests (fixtures intests/)bun run test:hook— unit test plugin hooks (hook-test/unit/) - hook development onlybun run test:hook:e2e— test plugin hooks in Claude Code (hook-test/) - hook development onlybun run test:smoke— smoke tests run against locally configured spaces - only use when changes could affect compatibility.
tsconfig.json— Main config for type-checking across all code - usebun run typechecktsconfig.build.json— Production build config (only compilessrc/todist/) - usebun run build
bun run src/index.ts dump <space>— Output parsed node data
Address issues related to change you made if a Stop hook reports them.