@millstone/synapse-schemas 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +71 -0
  2. package/body-grammars/adr.body-grammar.json +46 -0
  3. package/body-grammars/agreement.body-grammar.json +86 -0
  4. package/body-grammars/capability.body-grammar.json +73 -0
  5. package/body-grammars/meeting.body-grammar.json +93 -0
  6. package/body-grammars/policy.body-grammar.json +58 -0
  7. package/body-grammars/prd.body-grammar.json +220 -0
  8. package/body-grammars/process.body-grammar.json +107 -0
  9. package/body-grammars/reference.body-grammar.json +16 -0
  10. package/body-grammars/runbook.body-grammar.json +77 -0
  11. package/body-grammars/scorecard.body-grammar.json +68 -0
  12. package/body-grammars/sop.body-grammar.json +75 -0
  13. package/body-grammars/sow.body-grammar.json +189 -0
  14. package/body-grammars/standard.body-grammar.json +54 -0
  15. package/body-grammars/system.body-grammar.json +79 -0
  16. package/body-grammars/tdd.body-grammar.json +176 -0
  17. package/frontmatter/adr.schema.json +30 -0
  18. package/frontmatter/agreement.schema.json +191 -0
  19. package/frontmatter/base.schema.json +79 -0
  20. package/frontmatter/capability.schema.json +25 -0
  21. package/frontmatter/meeting.schema.json +52 -0
  22. package/frontmatter/policy.schema.json +25 -0
  23. package/frontmatter/prd.schema.json +37 -0
  24. package/frontmatter/process.schema.json +49 -0
  25. package/frontmatter/reference.schema.json +77 -0
  26. package/frontmatter/runbook.schema.json +19 -0
  27. package/frontmatter/scorecard.schema.json +176 -0
  28. package/frontmatter/sop.schema.json +42 -0
  29. package/frontmatter/sow.schema.json +35 -0
  30. package/frontmatter/standard.schema.json +31 -0
  31. package/frontmatter/system.schema.json +51 -0
  32. package/frontmatter/tdd.schema.json +25 -0
  33. package/index.js +9 -0
  34. package/package.json +34 -0
  35. package/plugins/marketplace.schema.json +126 -0
  36. package/plugins/plugin.schema.json +60 -0
@@ -0,0 +1,77 @@
1
+ {
2
+ "$id": "reference.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "reference"
13
+ },
14
+ "title": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "description": "Title of the reference document"
18
+ },
19
+ "summary": {
20
+ "type": "string",
21
+ "description": "Brief description or excerpt"
22
+ },
23
+ "status": {
24
+ "type": "string",
25
+ "enum": ["draft", "published", "archived"],
26
+ "description": "Status of the reference document"
27
+ },
28
+ "upstream_url": {
29
+ "type": "string",
30
+ "format": "uri",
31
+ "description": "Source URL where this reference content originates"
32
+ },
33
+ "source_prefix": {
34
+ "type": "string",
35
+ "pattern": "^[a-z0-9-]+$",
36
+ "description": "Manual override for source prefix in filename (e.g., 'claude-code', 'dora'). Only needed if automatic extraction from upstream_url fails or needs customization."
37
+ },
38
+ "last_synced": {
39
+ "type": "string",
40
+ "format": "date-time",
41
+ "description": "Timestamp of when content was last synchronized from upstream"
42
+ },
43
+ "attribution": {
44
+ "type": "string",
45
+ "minLength": 1,
46
+ "description": "Original author or organization"
47
+ },
48
+ "license": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "description": "License under which the upstream content is distributed"
52
+ },
53
+ "upstream_version": {
54
+ "type": "string",
55
+ "description": "Version or commit hash from upstream source (optional)"
56
+ },
57
+ "category": {
58
+ "type": "string",
59
+ "enum": [
60
+ "documentation",
61
+ "api-reference",
62
+ "blog-post",
63
+ "standard",
64
+ "specification",
65
+ "tutorial",
66
+ "other"
67
+ ],
68
+ "description": "Category of external reference"
69
+ }
70
+ },
71
+ "required": [
72
+ "type",
73
+ "upstream_url",
74
+ "last_synced"
75
+ ],
76
+ "additionalProperties": false
77
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$id": "runbook.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "runbook"
13
+ }
14
+ },
15
+ "required": [
16
+ "type"
17
+ ],
18
+ "additionalProperties": false
19
+ }
@@ -0,0 +1,176 @@
1
+ {
2
+ "$id": "scorecard.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "scorecard"
13
+ },
14
+ "dimensions": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "properties": {
19
+ "name": {
20
+ "type": "string",
21
+ "minLength": 1
22
+ },
23
+ "weight": {
24
+ "type": "number",
25
+ "minimum": 0,
26
+ "maximum": 1
27
+ },
28
+ "rating": {
29
+ "type": "number",
30
+ "minimum": 0,
31
+ "maximum": 5
32
+ },
33
+ "evidence": {
34
+ "type": "string"
35
+ },
36
+ "notes": {
37
+ "type": "string"
38
+ }
39
+ },
40
+ "required": [
41
+ "name"
42
+ ]
43
+ },
44
+ "minItems": 1
45
+ },
46
+ "weighted_total": {
47
+ "type": "number",
48
+ "minimum": 0
49
+ },
50
+ "overall_summary": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ },
54
+ "strengths": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string"
58
+ }
59
+ },
60
+ "top_risks": {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "string"
64
+ }
65
+ },
66
+ "recommendation": {
67
+ "type": "string",
68
+ "enum": [
69
+ "Proceed",
70
+ "Proceed with conditions",
71
+ "Do not proceed"
72
+ ]
73
+ },
74
+ "metrics": {
75
+ "type": "object",
76
+ "additionalProperties": {
77
+ "type": "string"
78
+ }
79
+ },
80
+ "risks": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "object",
84
+ "properties": {
85
+ "risk": {
86
+ "type": "string"
87
+ },
88
+ "severity": {
89
+ "type": "string",
90
+ "enum": [
91
+ "H",
92
+ "M",
93
+ "L"
94
+ ]
95
+ },
96
+ "likelihood": {
97
+ "type": "string",
98
+ "enum": [
99
+ "H",
100
+ "M",
101
+ "L"
102
+ ]
103
+ },
104
+ "owner": {
105
+ "type": "string"
106
+ },
107
+ "mitigation": {
108
+ "type": "string"
109
+ },
110
+ "due_date": {
111
+ "type": "string"
112
+ },
113
+ "status": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "required": [
118
+ "risk",
119
+ "severity",
120
+ "likelihood"
121
+ ]
122
+ }
123
+ },
124
+ "action_plan": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "object",
128
+ "properties": {
129
+ "initiative": {
130
+ "type": "string"
131
+ },
132
+ "impact": {
133
+ "type": "string",
134
+ "enum": [
135
+ "H",
136
+ "M",
137
+ "L"
138
+ ]
139
+ },
140
+ "effort": {
141
+ "type": "string",
142
+ "enum": [
143
+ "H",
144
+ "M",
145
+ "L"
146
+ ]
147
+ },
148
+ "owner": {
149
+ "type": "string"
150
+ },
151
+ "milestones": {
152
+ "type": "string"
153
+ },
154
+ "dependencies": {
155
+ "type": "string"
156
+ }
157
+ },
158
+ "required": [
159
+ "initiative"
160
+ ]
161
+ }
162
+ },
163
+ "related_docs": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "string"
167
+ }
168
+ }
169
+ },
170
+ "required": [
171
+ "type",
172
+ "dimensions",
173
+ "overall_summary"
174
+ ],
175
+ "additionalProperties": false
176
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$id": "sop.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "sop"
13
+ },
14
+ "related_process": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "related_prds": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "related_standards": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "related_systems": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "string"
34
+ }
35
+ }
36
+ },
37
+ "required": [
38
+ "type",
39
+ "related_process"
40
+ ],
41
+ "additionalProperties": false
42
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "sow.schema.json",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "title": "Statement of Work Schema",
10
+ "type": "object",
11
+ "required": [
12
+ "type"
13
+ ],
14
+ "properties": {
15
+ "type": {
16
+ "const": "sow"
17
+ },
18
+ "related_prds": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "related_tdds": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "agreement_date": {
31
+ "type": "string"
32
+ }
33
+ },
34
+ "additionalProperties": false
35
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$id": "standard.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "standard"
13
+ },
14
+ "related_policies": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "string"
18
+ }
19
+ },
20
+ "related_systems": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "string"
24
+ }
25
+ }
26
+ },
27
+ "required": [
28
+ "type"
29
+ ],
30
+ "additionalProperties": false
31
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$id": "system.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "system"
13
+ },
14
+ "owner_team": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "repos": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string",
22
+ "minLength": 1
23
+ }
24
+ },
25
+ "runtime": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "sla": {
30
+ "type": "string"
31
+ },
32
+ "dependencies": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ }
37
+ },
38
+ "runbooks": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ }
44
+ },
45
+ "required": [
46
+ "type",
47
+ "owner_team",
48
+ "runtime"
49
+ ],
50
+ "additionalProperties": false
51
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "tdd.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "allOf": [
5
+ {
6
+ "$ref": "base.schema.json"
7
+ }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "type": {
12
+ "const": "tdd"
13
+ },
14
+ "related_adrs": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "string"
18
+ }
19
+ }
20
+ },
21
+ "required": [
22
+ "type"
23
+ ],
24
+ "additionalProperties": false
25
+ }
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import { fileURLToPath } from 'url';
2
+ import { dirname, join } from 'path';
3
+
4
+ const __dirname = dirname(fileURLToPath(import.meta.url));
5
+
6
+ export function getSchemaDir() { return __dirname; }
7
+ export function getFrontmatterSchemaDir() { return join(__dirname, 'frontmatter'); }
8
+ export function getBodyGrammarDir() { return join(__dirname, 'body-grammars'); }
9
+ export function getPluginSchemaDir() { return join(__dirname, 'plugins'); }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@millstone/synapse-schemas",
3
+ "version": "0.1.0",
4
+ "description": "JSON Schema definitions for Synapse documentation framework",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./frontmatter/*": "./frontmatter/*",
10
+ "./body-grammars/*": "./body-grammars/*",
11
+ "./plugins/*": "./plugins/*",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "files": [
15
+ "frontmatter/**/*.json",
16
+ "body-grammars/**/*",
17
+ "plugins/**/*.json",
18
+ "index.js",
19
+ "README.md"
20
+ ],
21
+ "publishConfig": { "access": "public" },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/millstonehq/synapse.git",
25
+ "directory": "packages/schemas"
26
+ },
27
+ "homepage": "https://github.com/millstonehq/synapse#readme",
28
+ "bugs": {
29
+ "url": "https://github.com/millstonehq/synapse/issues"
30
+ },
31
+ "keywords": ["synapse", "schemas", "json-schema", "documentation", "validation"],
32
+ "engines": { "node": ">=20.0.0" },
33
+ "license": "MIT"
34
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "$id": "marketplace.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "Claude Code Plugin Marketplace Schema",
5
+ "description": "Schema for validating Claude Code plugin marketplace manifests",
6
+ "type": "object",
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string",
10
+ "format": "uri"
11
+ },
12
+ "name": {
13
+ "type": "string",
14
+ "pattern": "^[a-z0-9-]+$",
15
+ "minLength": 1,
16
+ "description": "Marketplace name in kebab-case"
17
+ },
18
+ "owner": {
19
+ "type": "object",
20
+ "properties": {
21
+ "name": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ }
25
+ },
26
+ "required": ["name"],
27
+ "additionalProperties": false
28
+ },
29
+ "version": {
30
+ "type": "string",
31
+ "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?$",
32
+ "description": "Semver version string"
33
+ },
34
+ "description": {
35
+ "type": "string",
36
+ "minLength": 10,
37
+ "maxLength": 500,
38
+ "description": "Brief description of the marketplace"
39
+ },
40
+ "repository": {
41
+ "type": "object",
42
+ "properties": {
43
+ "type": {
44
+ "type": "string",
45
+ "enum": ["git"]
46
+ },
47
+ "url": {
48
+ "type": "string",
49
+ "format": "uri"
50
+ }
51
+ },
52
+ "required": ["type", "url"],
53
+ "additionalProperties": false
54
+ },
55
+ "plugins": {
56
+ "type": "array",
57
+ "minItems": 1,
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "name": {
62
+ "type": "string",
63
+ "pattern": "^[a-z0-9-]+$",
64
+ "minLength": 1,
65
+ "description": "Plugin name in kebab-case"
66
+ },
67
+ "description": {
68
+ "type": "string",
69
+ "minLength": 10,
70
+ "maxLength": 500
71
+ },
72
+ "source": {
73
+ "type": "string",
74
+ "pattern": "^\\./",
75
+ "description": "Relative path to plugin directory, must start with ./"
76
+ },
77
+ "tags": {
78
+ "type": "array",
79
+ "items": {
80
+ "type": "string",
81
+ "pattern": "^[a-z0-9-]+$"
82
+ },
83
+ "minItems": 1,
84
+ "uniqueItems": true
85
+ }
86
+ },
87
+ "required": ["name", "description", "source", "tags"],
88
+ "additionalProperties": false
89
+ }
90
+ },
91
+ "maintainers": {
92
+ "type": "array",
93
+ "minItems": 1,
94
+ "items": {
95
+ "type": "object",
96
+ "properties": {
97
+ "name": {
98
+ "type": "string",
99
+ "minLength": 1
100
+ },
101
+ "email": {
102
+ "type": "string",
103
+ "format": "email"
104
+ }
105
+ },
106
+ "required": ["name"],
107
+ "additionalProperties": false
108
+ }
109
+ },
110
+ "license": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "description": "SPDX license identifier or custom license name"
114
+ }
115
+ },
116
+ "required": [
117
+ "name",
118
+ "owner",
119
+ "version",
120
+ "description",
121
+ "repository",
122
+ "plugins",
123
+ "license"
124
+ ],
125
+ "additionalProperties": false
126
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$id": "plugin.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "Claude Code Plugin Schema",
5
+ "description": "Schema for validating individual Claude Code plugin manifests",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "pattern": "^[a-z0-9-]+$",
11
+ "minLength": 1,
12
+ "description": "Plugin name in kebab-case, must match marketplace entry"
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?$",
17
+ "description": "Semver version string"
18
+ },
19
+ "description": {
20
+ "type": "string",
21
+ "minLength": 10,
22
+ "maxLength": 500,
23
+ "description": "Brief description of the plugin's capabilities"
24
+ },
25
+ "author": {
26
+ "type": "object",
27
+ "properties": {
28
+ "name": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "email": {
33
+ "type": "string",
34
+ "format": "email"
35
+ }
36
+ },
37
+ "required": ["name"],
38
+ "additionalProperties": false
39
+ },
40
+ "repository": {
41
+ "type": "string",
42
+ "format": "uri",
43
+ "description": "Repository URL as string"
44
+ },
45
+ "license": {
46
+ "type": "string",
47
+ "minLength": 1,
48
+ "description": "SPDX license identifier or custom license name"
49
+ }
50
+ },
51
+ "required": [
52
+ "name",
53
+ "version",
54
+ "description",
55
+ "author",
56
+ "repository",
57
+ "license"
58
+ ],
59
+ "additionalProperties": false
60
+ }