Skip to content

Commit 66d56b9

Browse files
authored
Enhance README with usage and configuration details
1 parent 6932a77 commit 66d56b9

1 file changed

Lines changed: 58 additions & 19 deletions

File tree

README.md

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,58 @@
11
# structured-context
22

3-
Tools for working with Opportunity Solution Tree structures and other product management and strategy frameworks
3+
Keep your content clean and your thinking clear.
4+
5+
`structured-context` provides assistive tools for working with structured content, including knowledge wikis (a la [Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)), product/strategy frameworks (like [Teresa Torres' Opportunity Solution Trees](https://www.producttalk.org/opportunity-solution-trees/) and [Martin et al's strategy cascade](https://rogerlmartin.com/thought-pillars/strategy), and more. Great for flat sets of documents, hierarchical or layered context trees, or any kind of knowledge graph.
6+
7+
Assign a schema to your markdown content to give humans and AI agents consistent structure and content guidelines.
8+
9+
In Claude Code:
10+
```
11+
❯ Use /structured-context to configure 'my-research' as a knowledge wiki, then organise it
12+
13+
⏺ Skill(structured-context)
14+
⎿  Successfully loaded skill
15+
16+
...
17+
18+
```
19+
20+
Command line tools:
21+
```
22+
> sctx validate strategy
23+
24+
Space Validation Results
25+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26+
Content and structure
27+
Valid 16
28+
Schema validation errors 0
29+
Broken links 1
30+
Duplicate keys 0
31+
Rule violations 2
32+
Hierarchy violations 0
33+
Orphans (hierarchy nodes - no parent) 1
34+
Ignored during parsing 0
35+
36+
Orphans (hierarchy nodes - no parent):
37+
Solution looking for a problem.md
38+
39+
Broken links:
40+
Steal underpants.md: [[Gnome goals]] → Link target "Gnome goals" in field "related" not found
41+
42+
Rule violations:
43+
workflow (1):
44+
Build Death Star.md: Opportunities should contribute to at least one Outcome
45+
46+
best-practice (1):
47+
High tech juice press.md: Explore multiple candidate solutions (aim for at least three) for an active target opportunity
48+
```
449

550
## Installation
651

752
Requires [Bun](https://bun.sh) runtime.
853

54+
Install globally (recommended):
55+
956
```bash
1057
bun install -g structured-context
1158
```
@@ -18,10 +65,11 @@ bunx structured-context validate <space>
1865

1966
## Setup for AI Agents
2067

21-
A Claude Code plugin is included at `plugin/`. It provides validation hooks, slash commands, and agent skills. Install it with:
68+
Claude Code plugin, providing validation hooks, slash commands, and agent skills. Install it with:
2269

2370
```
24-
claude plugin install mindsocket/structured-context
71+
claude plugin marketplace add mindsocket/structured-context
72+
claude plugin install structured-context
2573
```
2674

2775
Skills can also be installed standalone without the plugin:
@@ -38,31 +86,24 @@ See [docs/concepts.md](docs/concepts.md) for the full terminology reference, inc
3886

3987
`structured-context` looks for its config file in this order:
4088

41-
1. `$SCTX_CONFIG` — explicit path override
42-
2. `~/.config/structured-context/config.json` (or `$XDG_CONFIG_HOME/structured-context/config.json`)
43-
3. `./config.json` in the current working directory
89+
1. `--config` command line argument
90+
2. `$SCTX_CONFIG` env var
91+
3. `~/.config/structured-context/config.json` (or `$XDG_CONFIG_HOME/structured-context/config.json`)
92+
4. `./config.json` in the current working directory
4493

45-
See `config.example.json` for the full structure. The config maps space names to paths, with optional Miro integration fields and global defaults. Paths in config files are resolved relative to the config file.
94+
See `config.example.json` for the full structure. The config maps space names to paths, with optional additional configuration options for parsing and integrations. Paths in config files are resolved relative to the config file.
4695

4796
**Including spaces from other configs:** Use `includeSpacesFrom` to import space definitions from other config files. This is useful for aggregating spaces from multiple projects into a central config, reducing the need to specify `--config` on CLI commands. Duplicate space names are not allowed.
4897

4998
**Plugins and markdown plugin config:** See `sctx docs config` for the full reference including `fieldMap`, `typeInference`, `templateDir`, filter views, and plugin loading rules.
5099

51-
### Spaces
52-
53-
A space is a named directory or single file registered in the config. Spaces let you reference content by name instead of path:
54-
55-
```bash
56-
sctx validate ProductX
57-
```
58-
59100
### Schemas
60101

61102
Schemas define the structure and rules for the entities in a space, allowing customisation and extension to different models.
62103

63-
Two schemas (`general` and `strict_ost`) are included. The general schema combines a basic vision/mission/goals hierarchy with a hierarchy loosely based on Opportunity Solution Trees. It is intentionally flexible to support rapid initial adoption. The strict OST schema has a narrower scope, and reflects Teresa Torres' specific recommendations for Opportunity Solution Trees more closely.
104+
Several schemas (`strict_ost`, `knowledge_wiki` and `general`) are included. The general (strategy) schema combines a basic vision/mission/goals hierarchy with a hierarchy loosely based on Opportunity Solution Trees. It is intentionally flexible to support rapid initial adoption. The strict OST schema has a narrower scope, and reflects Teresa Torres' specific recommendations for Opportunity Solution Trees more closely. The knowledge wiki schema defines a flatter set of types used for knowledge bases.
64105

65-
sctx schemas use a metaschema based on JSON Schema Draft-07 that adds a top-level `$metadata` block:
106+
structured-context schemas use a metaschema based on JSON Schema Draft-07 that adds a top-level `$metadata` block:
66107

67108
```json5
68109
"$metadata": {
@@ -91,8 +132,6 @@ sctx schemas use a metaschema based on JSON Schema Draft-07 that adds a top-leve
91132
}
92133
```
93134

94-
Rules are a flat array (`rules[]`) with per-rule `category`.
95-
96135
Schema hierarchy levels support DAG (multi-parent) relationships via configurable edge fields. Each entry in `$metadata.hierarchy.levels` can be a plain type name string (defaults to `parent` field on child nodes) or an object:
97136

98137
```json5

0 commit comments

Comments
 (0)