xdrs-core 0.44.0 → 0.46.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 (31) hide show
  1. package/.xdrs/_core/adrs/index.md +3 -0
  2. package/.xdrs/_core/adrs/principles/001-xdrs-standards.md +7 -4
  3. package/.xdrs/_core/adrs/principles/002-policy-standards.md +1 -1
  4. package/.xdrs/_core/adrs/principles/003-skill-standards.md +1 -2
  5. package/.xdrs/_core/adrs/principles/004-article-standards.md +1 -2
  6. package/.xdrs/_core/adrs/principles/006-research-standards.md +6 -5
  7. package/.xdrs/_core/adrs/principles/007-plan-standards.md +1 -1
  8. package/.xdrs/_core/adrs/principles/009-presentation-standards.md +2 -1
  9. package/.xdrs/_core/adrs/principles/010-scope-governance.md +64 -16
  10. package/.xdrs/_core/adrs/principles/019-compiled-scope-type.md +117 -0
  11. package/.xdrs/_core/adrs/principles/020-media-and-asset-standards.md +48 -0
  12. package/.xdrs/_core/adrs/principles/articles/.assets/001-xdrs-overview.svg +258 -0
  13. package/.xdrs/_core/adrs/principles/articles/001-xdrs-overview.md +2 -0
  14. package/.xdrs/_core/adrs/principles/skills/.assets/lint-verification.md +12 -0
  15. package/.xdrs/_core/adrs/principles/skills/.assets/meta-policy-compliance.md +12 -0
  16. package/.xdrs/_core/adrs/principles/skills/.assets/prerequisites-gate.md +19 -0
  17. package/.xdrs/_core/adrs/principles/skills/.assets/scope-placement.md +47 -0
  18. package/.xdrs/_core/adrs/principles/skills/.assets/scope-selection.md +25 -0
  19. package/.xdrs/_core/adrs/principles/skills/001-review/SKILL.md +7 -1
  20. package/.xdrs/_core/adrs/principles/skills/002-write-policy/SKILL.md +8 -24
  21. package/.xdrs/_core/adrs/principles/skills/003-write-skill/SKILL.md +8 -19
  22. package/.xdrs/_core/adrs/principles/skills/004-write-article/SKILL.md +6 -16
  23. package/.xdrs/_core/adrs/principles/skills/005-write-research/SKILL.md +7 -18
  24. package/.xdrs/_core/adrs/principles/skills/006-write-plan/SKILL.md +7 -18
  25. package/.xdrs/_core/adrs/principles/skills/007-write-presentation/SKILL.md +4 -15
  26. package/.xdrs/_core/adrs/principles/skills/008-write-xdrs-doc/SKILL.md +1 -8
  27. package/.xdrs/_core/adrs/principles/skills/009-compile-scope/SKILL.md +121 -0
  28. package/README.md +15 -2
  29. package/lib/lint.js +160 -47
  30. package/lib/lint.test.js +659 -41
  31. package/package.json +1 -1
@@ -0,0 +1,258 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- hand-coded SVG; to make editable in draw.io, import and re-export as Editable Vector -->
3
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
4
+ version="1.1" width="1650" height="980" viewBox="0 0 1650 980"
5
+ style="background-color:#ffffff;">
6
+ <defs>
7
+ <marker id="arr-p" viewBox="0 0 10 10" refX="9" refY="5"
8
+ markerWidth="6" markerHeight="6" orient="auto">
9
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#7c4dff"/>
10
+ </marker>
11
+ <marker id="arr-o" viewBox="0 0 10 10" refX="9" refY="5"
12
+ markerWidth="6" markerHeight="6" orient="auto">
13
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#e67e22"/>
14
+ </marker>
15
+ </defs>
16
+
17
+ <!-- ===== TITLE ===== -->
18
+ <text x="825" y="42" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
19
+ font-size="24" font-weight="bold" fill="#1a1a2e">XDRS — eXtensible Decision Record System</text>
20
+ <text x="825" y="66" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
21
+ font-size="13" fill="#555">A framework to structure, compile and distribute decision records so that AI agents and humans can reliably find and use them</text>
22
+
23
+ <!-- ===== SECTION A: DECISION TYPES ===== -->
24
+ <rect x="20" y="88" width="260" height="422" rx="8" fill="#f0f4ff" stroke="#4a6cf7" stroke-width="2"/>
25
+ <text x="150" y="112" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
26
+ font-size="14" font-weight="bold" fill="#4a6cf7">Decision Types</text>
27
+
28
+ <!-- ADR -->
29
+ <rect x="34" y="124" width="232" height="72" rx="6" fill="#dae8fc" stroke="#6c8ebf" stroke-width="1.5"/>
30
+ <text x="150" y="146" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">ADR</text>
31
+ <text x="150" y="163" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#333">Architectural Decision Records</text>
32
+ <text x="150" y="179" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#666">app · data · integration · platform · operations</text>
33
+
34
+ <!-- BDR -->
35
+ <rect x="34" y="208" width="232" height="72" rx="6" fill="#d5e8d4" stroke="#82b366" stroke-width="1.5"/>
36
+ <text x="150" y="230" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">BDR</text>
37
+ <text x="150" y="247" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#333">Business Decision Records</text>
38
+ <text x="150" y="263" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#666">product · marketing · finance · organization</text>
39
+
40
+ <!-- EDR -->
41
+ <rect x="34" y="292" width="232" height="72" rx="6" fill="#fff2cc" stroke="#d6b656" stroke-width="1.5"/>
42
+ <text x="150" y="314" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">EDR</text>
43
+ <text x="150" y="331" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#333">Engineering Decision Records</text>
44
+ <text x="150" y="347" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#666">infra · devops · observability · governance</text>
45
+
46
+ <!-- Policy ID note inside A -->
47
+ <rect x="34" y="382" width="232" height="114" rx="6" fill="#fafafa" stroke="#aaa" stroke-width="1" stroke-dasharray="4,3"/>
48
+ <text x="150" y="401" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="11" font-weight="bold" fill="#555">Policy ID Format</text>
49
+ <text x="44" y="420" font-family="Courier New,monospace" font-size="11" fill="#333">[scope]-[type]-policy-[number]</text>
50
+ <text x="44" y="440" font-family="Courier New,monospace" font-size="10" fill="#666">checkout-adr-policy-001</text>
51
+ <text x="44" y="456" font-family="Courier New,monospace" font-size="10" fill="#666">myorg-edr-policy-042</text>
52
+ <text x="44" y="472" font-family="Courier New,monospace" font-size="10" fill="#666">_core-adr-policy-016</text>
53
+ <text x="44" y="488" font-family="Courier New,monospace" font-size="10" fill="#666"> (sequential, never reused)</text>
54
+
55
+ <!-- Arrow A → B -->
56
+ <line x1="281" y1="299" x2="317" y2="299" stroke="#7c4dff" stroke-width="2" marker-end="url(#arr-p)"/>
57
+ <text x="299" y="291" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#7c4dff">decompose</text>
58
+ <text x="299" y="313" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#7c4dff">into</text>
59
+
60
+ <!-- ===== SECTION B: XDRS ELEMENTS ===== -->
61
+ <rect x="320" y="88" width="440" height="422" rx="8" fill="#f9f0ff" stroke="#7c4dff" stroke-width="2"/>
62
+ <text x="540" y="112" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
63
+ font-size="14" font-weight="bold" fill="#7c4dff">XDRS Document Elements</text>
64
+ <text x="540" y="129" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
65
+ font-size="11" fill="#888">Each decision record decomposes into specialized document types</text>
66
+
67
+ <!-- Policy element -->
68
+ <rect x="334" y="141" width="412" height="64" rx="6" fill="#e1d5f7" stroke="#7c4dff" stroke-width="1.5"/>
69
+ <text x="354" y="161" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">Policy — What must be followed</text>
70
+ <text x="354" y="178" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Rules, guardrails, core decisions. The source of truth.</text>
71
+ <text x="354" y="195" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Captured as ADR / BDR / EDR policy documents.</text>
72
+
73
+ <!-- Research element -->
74
+ <rect x="334" y="215" width="412" height="64" rx="6" fill="#dae8fc" stroke="#6c8ebf" stroke-width="1.5"/>
75
+ <text x="354" y="235" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">Research — Why the decision was made</text>
76
+ <text x="354" y="252" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Problem context, constraints, findings, option tradeoffs.</text>
77
+ <text x="354" y="269" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">One research may inform multiple downstream policies.</text>
78
+
79
+ <!-- Skills element -->
80
+ <rect x="334" y="289" width="412" height="64" rx="6" fill="#d5e8d4" stroke="#82b366" stroke-width="1.5"/>
81
+ <text x="354" y="309" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">Skills — How to implement</text>
82
+ <text x="354" y="326" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Step-by-step procedural guides for humans or AI agents.</text>
83
+ <text x="354" y="343" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Executable with verifiable outcomes.</text>
84
+
85
+ <!-- Articles element -->
86
+ <rect x="334" y="363" width="412" height="64" rx="6" fill="#fff2cc" stroke="#d6b656" stroke-width="1.5"/>
87
+ <text x="354" y="383" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">Articles — Overview / Views</text>
88
+ <text x="354" y="400" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Synthetic texts combining multiple policies and skills.</text>
89
+ <text x="354" y="417" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Never replace policies as source of truth.</text>
90
+
91
+ <!-- Plans element -->
92
+ <rect x="334" y="437" width="412" height="64" rx="6" fill="#f8cecc" stroke="#b85450" stroke-width="1.5"/>
93
+ <text x="354" y="457" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">Plans — When / How to roll out</text>
94
+ <text x="354" y="474" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Ephemeral execution docs. Deleted after implementation.</text>
95
+ <text x="354" y="491" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Lasting outputs become Policies, Skills, or Articles.</text>
96
+
97
+ <!-- Arrow B → C -->
98
+ <line x1="761" y1="299" x2="797" y2="299" stroke="#e67e22" stroke-width="2" marker-end="url(#arr-o)"/>
99
+ <text x="779" y="291" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#e67e22">organized</text>
100
+ <text x="779" y="313" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#e67e22">in</text>
101
+
102
+ <!-- ===== SECTION C: SCOPE SYSTEM ===== -->
103
+ <rect x="800" y="88" width="830" height="422" rx="8" fill="#fff8f0" stroke="#e67e22" stroke-width="2"/>
104
+ <text x="1215" y="112" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
105
+ font-size="14" font-weight="bold" fill="#e67e22">Scope System — Hierarchical Namespaces</text>
106
+ <text x="1215" y="129" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
107
+ font-size="11" fill="#888">Scopes organize decision ownership. Scopes listed later in root index.md override earlier ones.</text>
108
+
109
+ <!-- Precedence arrow (right side) -->
110
+ <line x1="1598" y1="480" x2="1598" y2="148" stroke="#e67e22" stroke-width="2" stroke-dasharray="4,3" marker-end="url(#arr-o)"/>
111
+ <text x="1598" y="314" text-anchor="middle" transform="rotate(-90,1598,314)"
112
+ font-family="Arial,Helvetica,sans-serif" font-size="11" font-weight="bold" fill="#e67e22">Precedence: later overrides earlier</text>
113
+
114
+ <!-- core -->
115
+ <rect x="814" y="141" width="770" height="58" rx="6" fill="#f8cecc" stroke="#b85450" stroke-width="1.5"/>
116
+ <text x="834" y="162" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">core (e.g. _core, myorg-core)</text>
117
+ <text x="834" y="179" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Meta-governance: authoring standards, scope-type definitions. No consumable policies.</text>
118
+
119
+ <!-- reference -->
120
+ <rect x="814" y="209" width="770" height="58" rx="6" fill="#fff2cc" stroke="#d6b656" stroke-width="1.5"/>
121
+ <text x="834" y="230" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">reference (e.g. security-ref-baseline)</text>
122
+ <text x="834" y="247" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Standards, regulations, reference models. Read-only adoptable material.</text>
123
+
124
+ <!-- platform -->
125
+ <rect x="814" y="277" width="770" height="58" rx="6" fill="#d5e8d4" stroke="#82b366" stroke-width="1.5"/>
126
+ <text x="834" y="298" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">platform (e.g. cloud-plat-infra)</text>
127
+ <text x="834" y="315" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Live services and infrastructure teams can consume. Documents operational capabilities.</text>
128
+
129
+ <!-- standard -->
130
+ <rect x="814" y="345" width="770" height="58" rx="6" fill="#dae8fc" stroke="#6c8ebf" stroke-width="1.5"/>
131
+ <text x="834" y="366" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">standard (e.g. checkout, mobile-app)</text>
132
+ <text x="834" y="383" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Business areas, products, teams. General-purpose scopes. Default type.</text>
133
+
134
+ <!-- _local -->
135
+ <rect x="814" y="413" width="770" height="58" rx="6" fill="#e1d5f7" stroke="#7c4dff" stroke-width="1.5"/>
136
+ <text x="834" y="434" font-family="Arial,Helvetica,sans-serif" font-size="13" font-weight="bold" fill="#1a1a2e">_local (reserved)</text>
137
+ <text x="834" y="451" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Workspace-local overrides. Never distributed. Highest precedence within workspace.</text>
138
+
139
+ <!-- ===== SECTION: FILE STRUCTURE ===== -->
140
+ <rect x="20" y="530" width="390" height="290" rx="8" fill="#f0fff4" stroke="#27ae60" stroke-width="2"/>
141
+ <text x="215" y="554" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
142
+ font-size="14" font-weight="bold" fill="#27ae60">Folder Structure</text>
143
+ <text x="38" y="578" font-family="Courier New,monospace" font-size="11" fill="#333">.xdrs/</text>
144
+ <text x="38" y="596" font-family="Courier New,monospace" font-size="11" fill="#333"> index.md ← root index (lists all scopes)</text>
145
+ <text x="38" y="614" font-family="Courier New,monospace" font-size="11" fill="#333"> [scope]/</text>
146
+ <text x="38" y="632" font-family="Courier New,monospace" font-size="11" fill="#333"> index.md ← scope overview + frontmatter</text>
147
+ <text x="38" y="650" font-family="Courier New,monospace" font-size="11" fill="#333"> [adrs|bdrs|edrs]/</text>
148
+ <text x="38" y="668" font-family="Courier New,monospace" font-size="11" fill="#333"> index.md ← type index</text>
149
+ <text x="38" y="686" font-family="Courier New,monospace" font-size="11" fill="#333"> [subject]/</text>
150
+ <text x="38" y="704" font-family="Courier New,monospace" font-size="11" fill="#333"> NNN-title.md ← Policy</text>
151
+ <text x="38" y="722" font-family="Courier New,monospace" font-size="11" fill="#333"> researches/ ← Research docs</text>
152
+ <text x="38" y="740" font-family="Courier New,monospace" font-size="11" fill="#333"> skills/ ← Skill packages</text>
153
+ <text x="38" y="758" font-family="Courier New,monospace" font-size="11" fill="#333"> articles/ ← Article docs</text>
154
+ <text x="38" y="776" font-family="Courier New,monospace" font-size="11" fill="#333"> plans/ ← Plan docs</text>
155
+ <text x="38" y="794" font-family="Courier New,monospace" font-size="11" fill="#333"> .assets/ ← Binary assets</text>
156
+
157
+ <!-- ===== SECTION: GOVERNANCE MECHANISMS ===== -->
158
+ <rect x="430" y="530" width="1200" height="290" rx="8" fill="#fffbf0" stroke="#f39c12" stroke-width="2"/>
159
+ <text x="1030" y="554" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
160
+ font-size="14" font-weight="bold" fill="#f39c12">Governance Mechanisms</text>
161
+
162
+ <!-- Gov 1 -->
163
+ <rect x="446" y="568" width="270" height="232" rx="6" fill="#fdebd0" stroke="#f39c12" stroke-width="1.5"/>
164
+ <text x="581" y="589" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">1. Scope-type standards</text>
165
+ <text x="461" y="609" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Policies in core-type scopes that</text>
166
+ <text x="461" y="625" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">define rules for ALL scopes of a</text>
167
+ <text x="461" y="641" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">given type.</text>
168
+ <text x="461" y="669" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">e.g. business-area-scope-type.md</text>
169
+ <text x="461" y="685" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">in ecomm-core applies to all</text>
170
+ <text x="461" y="701" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">business-area scopes</text>
171
+
172
+ <!-- Gov 2 -->
173
+ <rect x="732" y="568" width="270" height="232" rx="6" fill="#fdebd0" stroke="#f39c12" stroke-width="1.5"/>
174
+ <text x="867" y="589" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">2. follows: declaration</text>
175
+ <text x="747" y="609" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Scope explicitly declares which</text>
176
+ <text x="747" y="625" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">core-type scope standards apply.</text>
177
+ <text x="747" y="641" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Creates a mandatory governance</text>
178
+ <text x="747" y="657" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">relationship to that scope.</text>
179
+ <text x="747" y="685" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">e.g. checkout/index.md:</text>
180
+ <text x="747" y="701" font-family="Courier New,monospace" font-size="10" fill="#888">follows: ecomm-core</text>
181
+
182
+ <!-- Gov 3 -->
183
+ <rect x="1018" y="568" width="270" height="232" rx="6" fill="#fdebd0" stroke="#f39c12" stroke-width="1.5"/>
184
+ <text x="1153" y="589" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">3. Local meta-policies</text>
185
+ <text x="1033" y="609" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Files named NNN-core.md inside</text>
186
+ <text x="1033" y="625" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">a scope's principles/ directory.</text>
187
+ <text x="1033" y="641" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">Govern authoring within that</text>
188
+ <text x="1033" y="657" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">scope only.</text>
189
+ <text x="1033" y="685" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">Applied implicitly — no index</text>
190
+ <text x="1033" y="701" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">declaration needed.</text>
191
+
192
+ <!-- Gov 4 -->
193
+ <rect x="1304" y="568" width="310" height="232" rx="6" fill="#fdebd0" stroke="#f39c12" stroke-width="1.5"/>
194
+ <text x="1459" y="589" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">4. -core sibling scope</text>
195
+ <text x="1319" y="609" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">A separate scope directory of</text>
196
+ <text x="1319" y="625" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">scope-type: core for shared</text>
197
+ <text x="1319" y="641" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">meta-governance across a family</text>
198
+ <text x="1319" y="657" font-family="Arial,Helvetica,sans-serif" font-size="11" fill="#444">of governed scopes.</text>
199
+ <text x="1319" y="685" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">e.g. ecomm-core/ governs all</text>
200
+ <text x="1319" y="701" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">ecomm business-area scopes.</text>
201
+ <text x="1319" y="717" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#888">Distinct from local meta-policy.</text>
202
+
203
+ <!-- Precedence chain label -->
204
+ <text x="1030" y="742" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
205
+ font-size="11" font-weight="bold" fill="#f39c12">Precedence chain (lowest → highest):</text>
206
+ <text x="1030" y="760" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
207
+ font-size="11" fill="#555">1. Scope-type standards → 2. follows: standards → 3. Local meta-policies (all subordinate to _core structural rules)</text>
208
+ <text x="1030" y="778" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
209
+ font-size="11" fill="#555">When absent from workspace: companion scope is READ-ONLY. Governed scope declares follows: in its index.md.</text>
210
+
211
+ <!-- ===== DISTRIBUTION SECTION ===== -->
212
+ <rect x="20" y="840" width="1610" height="130" rx="8" fill="#f0f8ff" stroke="#2980b9" stroke-width="2"/>
213
+ <text x="825" y="864" text-anchor="middle" font-family="Arial,Helvetica,sans-serif"
214
+ font-size="14" font-weight="bold" fill="#2980b9">Distribution &amp; Usage — Versioned Packages</text>
215
+
216
+ <!-- Package -->
217
+ <rect x="36" y="876" width="240" height="80" rx="6" fill="#dae8fc" stroke="#6c8ebf" stroke-width="1.5"/>
218
+ <text x="156" y="896" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">Package</text>
219
+ <text x="156" y="912" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">Scopes are versioned npm</text>
220
+ <text x="156" y="926" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">distributions. Consumers install</text>
221
+ <text x="156" y="940" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">and extract them into workspace.</text>
222
+
223
+ <!-- Scope Composition -->
224
+ <rect x="296" y="876" width="240" height="80" rx="6" fill="#d5e8d4" stroke="#82b366" stroke-width="1.5"/>
225
+ <text x="416" y="896" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">Scope Composition</text>
226
+ <text x="416" y="912" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">Multiple scopes compose together.</text>
227
+ <text x="416" y="926" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">External scopes tracked in</text>
228
+ <text x="416" y="940" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">.filedist.lock as read-only.</text>
229
+
230
+ <!-- Linting -->
231
+ <rect x="556" y="876" width="240" height="80" rx="6" fill="#fff2cc" stroke="#d6b656" stroke-width="1.5"/>
232
+ <text x="676" y="896" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">Linting / Validation</text>
233
+ <text x="676" y="912" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">xdrs-core CLI validates structure,</text>
234
+ <text x="676" y="926" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">frontmatter, naming, index links,</text>
235
+ <text x="676" y="940" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">and scope governance compliance.</text>
236
+
237
+ <!-- AI Agents -->
238
+ <rect x="816" y="876" width="240" height="80" rx="6" fill="#e1d5f7" stroke="#7c4dff" stroke-width="1.5"/>
239
+ <text x="936" y="896" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">AI Agent Context</text>
240
+ <text x="936" y="912" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">AGENTS.md + XDRS structure gives</text>
241
+ <text x="936" y="926" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">AI agents reliable, scoped access</text>
242
+ <text x="936" y="940" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">to all decisions and skills.</text>
243
+
244
+ <!-- RAG -->
245
+ <rect x="1076" y="876" width="240" height="80" rx="6" fill="#f8cecc" stroke="#b85450" stroke-width="1.5"/>
246
+ <text x="1196" y="896" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">RAG / Web Publishing</text>
247
+ <text x="1196" y="912" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">Compiled corpus feeds RAG apps,</text>
248
+ <text x="1196" y="926" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">documentation sites, or knowledge</text>
249
+ <text x="1196" y="940" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">base systems.</text>
250
+
251
+ <!-- Extension Packages -->
252
+ <rect x="1336" y="876" width="280" height="80" rx="6" fill="#fdebd0" stroke="#f39c12" stroke-width="1.5"/>
253
+ <text x="1476" y="896" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="12" font-weight="bold" fill="#1a1a2e">Extension Packages</text>
254
+ <text x="1476" y="912" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">Teams build their own XDRS packages</text>
255
+ <text x="1476" y="926" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">extending xdrs-core with custom</text>
256
+ <text x="1476" y="940" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="10" fill="#444">scopes and governance rules.</text>
257
+
258
+ </svg>
@@ -8,6 +8,8 @@ the framework and links out to the authoritative Policy documents for full detai
8
8
 
9
9
  ## Content
10
10
 
11
+ ![XDRS Overview Diagram](.assets/001-xdrs-overview.svg)
12
+
11
13
  ### What the central elements are
12
14
 
13
15
  The XDRS framework is built around a small set of artifact types that play different roles in the
@@ -0,0 +1,12 @@
1
+ # XDRS Lint Verification
2
+
3
+ This module is shared across all XDRS writing skills. Run these steps after all files have been written.
4
+
5
+ ---
6
+
7
+ 1. Run the CLI lint utility from the repository root:
8
+ ```
9
+ npx -y xdrs-core@latest lint
10
+ ```
11
+ 2. Fix all reported errors before considering the task complete.
12
+ 3. Review warnings; fix straightforward ones and note intentional deviations explicitly.
@@ -0,0 +1,12 @@
1
+ # XDRS Meta-Policy Compliance Check
2
+
3
+ This module is shared across XDRS writing skills. Read and execute every check during the final review of a document.
4
+
5
+ Substitute `[DOCUMENT]` with the appropriate noun for the calling skill: `policy`, `skill`, `article`, `research`, or `plan`.
6
+
7
+ ---
8
+
9
+ **Meta-policy compliance**: Check the target scope's `index.md` for a `follows` frontmatter field. `_core` Policies always apply to all scopes. If `follows` lists additional core scope names (e.g., `follows: [myarea-core]`), verify that each listed scope directory exists in the workspace (e.g., `.xdrs/[scope-name]/index.md`). If any listed scope is missing, STOP immediately and tell the user: "Scope `[scope-name]` is listed in `follows` but not found in the workspace. Install it before proceeding." Once all `follows` scopes are confirmed present, verify the [DOCUMENT] satisfies all requirements from those Policies. Scopes are applied in order; last-listed scope in `follows` takes precedence when the same topic is covered by multiple scopes.
10
+
11
+ - **Scope-type standards:** Read the target scope's `scope-type`. Normalise the value to a list: split on commas and trim whitespace (`scope-type: typeA, typeB` becomes `[typeA, typeB]`). For **each** type in the list, search the `[type]/principles/` directories of all `core`-type scopes for a file ending in `{scope-type}-scope-type.md`. If found, also load all companion files (`{scope-type}-scope-type-{qualifier}.md`) from the **same directory** and apply their rules as additional requirements. Resolve any `NN-parent-scope-type` rule transitively from the primary file. See `_core-adr-policy-010` rules 22 and 24.
12
+ - **Scope-local standards:** Scan the target scope's own `[type]/principles/` directories for all files whose filename title starts with `core` (i.e., `NNN-core.md` or `NNN-core-{qualifier}.md`), excluding scope-type definition files (whose title ends with `-scope-type`). If any are found, apply ALL of them as mandatory requirements; they override scope-type standards on conflict. See `_core-adr-policy-010` rules 23 and 24.
@@ -0,0 +1,19 @@
1
+ # XDRS Prerequisites Gate
2
+
3
+ This module is shared across all XDRS writing skills. Read these instructions in full and execute every check before proceeding with any authoring task.
4
+
5
+ Substitute `[DOCUMENT TYPE]` with the appropriate noun for the calling skill: `policy`, `skill`, `article`, `research`, `plan`, `presentation`, or `document`.
6
+
7
+ ---
8
+
9
+ Read the confirmed scope's `index.md` frontmatter and perform ALL of the following checks. If ANY check fails, output a FAIL result immediately and do not proceed:
10
+
11
+ - **Follows scopes:** If the scope declares `follows:` entries (e.g., `follows: myarea-core, shared-standards`), verify that each listed scope directory exists in the workspace AND contains an accessible `index.md` (e.g., `.xdrs/[scope-name]/index.md`). If any listed scope is missing or unreadable, output: `FAIL — Cannot proceed: scope \`[scope-name]\` is listed in \`follows\` but its policies are not present in the workspace. Install it before authoring documents in this scope, as the governance constraints cannot be verified.`
12
+ - **Extends scopes:** If the scope declares `extends:` entries, verify that each listed scope directory exists in the workspace AND contains an accessible `index.md`. If any listed scope is missing or unreadable, output: `FAIL — Cannot proceed: scope \`[scope-name]\` is listed in \`extends\` but its policies are not present in the workspace. Install it before authoring documents in this scope, as inherited policies cannot be verified.`
13
+ - **Local meta-policies:** Scan the target scope's `[type]/principles/` directories for all files whose filename title starts with `core` (i.e., `NNN-core.md` or `NNN-core-{qualifier}.md`), excluding scope-type definition files. If any are found but cannot be read, output: `FAIL — Cannot proceed: local meta-policy \`[filename]\` exists in scope \`[scope-name]\` but could not be read. Without it, the [DOCUMENT TYPE] cannot be authored in full compliance with the scope's governance.` Zero matches is valid.
14
+ - **Scope-type:** Read the scope's `scope-type` from its `index.md`. Normalise the value to a list: split on commas and trim whitespace (`scope-type: typeA, typeB` becomes `[typeA, typeB]`). For **each** type in the list, search the `[type]/principles/` directories of all `core`-type scopes in the workspace for a file whose name ends with `{scope-type}-scope-type.md`. If the scope declares any `scope-type` elements but no matching file is found for ANY of them, output: `FAIL — Cannot proceed: scope \`[scope-name]\` declares \`scope-type: [scope-type]\` but no \`[scope-type]-scope-type.md\` policy exists in any \`core\`-type scope in the workspace. The scope is READ-ONLY; install the scope-type governance before authoring documents in this scope.`
15
+ - **Rationale:** Authoring a document without all mandatory governance layers loaded risks producing content that silently violates scope policies. Every governance layer MUST be present before writing begins.
16
+
17
+ Once all prerequisites pass, load ALL scope-type governance (see `_core-adr-policy-010` rule 22): for each declared type, resolve its full ancestor chain (primary, companions alphabetically, parent chain). Deduplicate keeping first occurrence. Then run conflict detection using the shared module at `.xdrs/_core/adrs/principles/skills/.assets/conflict-detection.md` across all loaded governance layers. Halt if undeclared structural conflicts are found (see `_core-adr-policy-010` rules 24 and 26).
18
+
19
+ If the scope declares `extends:` entries (and the extends check above passed), load the inherited **policy documents** (decision records only — not skills, articles, research, or plans) from the full `extends:` chain using depth-first resolution (see `_core-adr-policy-010` rule 33): for each extends entry in declaration order, recursively resolve that scope's own `extends:` chain, then append the scope's own policies. Deduplicate keeping first occurrence. The extending scope's own policies always take precedence over all inherited ones. Apply the resolved policy set as additional context when authoring or reviewing [DOCUMENT TYPE] documents in this scope.
@@ -0,0 +1,47 @@
1
+ # XDRS Scope Placement Analysis
2
+
3
+ This module is shared across XDRS writing skills. Run this analysis **before** the prerequisites gate to determine and confirm the target scope for the document being authored.
4
+
5
+ ---
6
+
7
+ ## Step A — Check User-Stated Scope
8
+
9
+ If the user explicitly named a target scope in their request, note it as the proposed scope and proceed to Step C for validation. Do not skip validation even when a scope is stated — the content must match the scope's purpose.
10
+
11
+ If no scope was stated, proceed to Step B.
12
+
13
+ ## Step B — Analyze Content Nature
14
+
15
+ Determine the appropriate scope-type by matching the content being authored to one of the types below. A scope may declare multiple types (`scope-type: typeA, typeB`); a scope is a candidate if ANY of its declared types match.
16
+
17
+ | Content nature | Scope-type | Reference policy |
18
+ |---|---|---|
19
+ | Authoring standards, writing templates, or governance rules intended to be shared across **multiple related scopes** | `core` | ADR-011 |
20
+ | Industry standards, compliance frameworks, reference architectures, or canonical blueprints to be adopted or adapted | `reference` | ADR-012 |
21
+ | Live services, active shared platforms, or existing infrastructure that can be consumed directly | `platform` | ADR-013 |
22
+ | Business area, product line, team, or general architectural/engineering decision | `standard` | ADR-014 |
23
+
24
+ **Special case — local meta-policy**: If the content is governance or authoring standards that apply to **only one** target scope (not shared across multiple), the correct placement is a **local meta-policy file** (`NNN-core.md`) inside that scope's `[type]/principles/` directory, NOT a new scope. Recommend this option clearly and ask the user to confirm before continuing.
25
+
26
+ ## Step C — Enumerate and Rank Workspace Scopes
27
+
28
+ 1. Read `.xdrs/index.md` to list all declared scopes.
29
+ 2. For each scope whose `scope-type` matches the type identified in Step A or B (match if ANY of a scope's declared types fit), read its `index.md` and assess the following signals, in order of weight:
30
+ - **Primary**: Does `apply-to` or `description` describe a domain that covers this content?
31
+ - **Secondary**: Does the scope's `follows:` chain declare a governance relationship relevant to this content area?
32
+ - **Tertiary**: Does the scope contain local meta-policies (`NNN-core.md` files in `[type]/principles/`) that indicate it already governs this type of content?
33
+ 3. Rank all matching scopes from most to least relevant. Select the highest-ranked scope as the recommendation.
34
+ 4. If `_local` is the only scope in the workspace, recommend it as the default.
35
+
36
+ ## Step D — Handle Mismatches and Gaps
37
+
38
+ - **Mismatch (user-stated scope)**: If the proposed scope from Step A has a `scope-type` that does not match the content nature identified in Step B, explain the mismatch with a clear rationale and ask the user to confirm the choice or select an alternative scope.
39
+ - **No existing scope fits**: Recommend creating a new scope and provide naming guidance per scope-type:
40
+ - `core`: name MUST contain `core`; `-core` suffix preferred (e.g., `myarea-core`)
41
+ - `reference`: `{domain}-ref-{name}` pattern (e.g., `security-ref-iso27001`)
42
+ - `platform`: `{domain}-plat-{name}` pattern (e.g., `infra-plat-aws`)
43
+ - `standard`: any valid lowercase scope name (no special pattern required)
44
+
45
+ ## Step E — Confirm with User
46
+
47
+ Present the recommended scope (or the proposed scope from Step A with any mismatch notes) and confirm with the user before proceeding to the prerequisites gate. Once confirmed, the scope is locked for the rest of the authoring workflow.
@@ -0,0 +1,25 @@
1
+ # XDRS Scope and Type Selection
2
+
3
+ This module is shared across XDRS writing skills. Read and apply these instructions when selecting scope and type for a new document.
4
+
5
+ ---
6
+
7
+ ## Scope
8
+
9
+ The scope was determined and confirmed in Phase 0 (scope placement analysis). Carry it forward. As a final safety check, verify the scope is not external:
10
+
11
+ - Check the workspace root `.filedist.lock` file. If any file under `.xdrs/[scope]/` appears in `.filedist.lock`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
12
+
13
+ ## Type
14
+
15
+ Choose exactly one based on the nature of the decision:
16
+
17
+ - **BDR**: business process, product policy, strategic rule, operational procedure
18
+ - **ADR**: system context, integration pattern, overarching architectural choice
19
+ - **EDR**: specific tool/library, coding practice, testing strategy, project structure, pipelines
20
+
21
+ When type cannot be confidently inferred, ask the user a clarifying question before proceeding. Ask one question at a time and wait for the answer.
22
+
23
+ ## Subject
24
+
25
+ MUST read `_core-adr-policy-016` (`.xdrs/_core/adrs/principles/016-policy-subjects.md`) in full before choosing. That document defines all allowed subjects per type with full descriptions, examples, and disambiguation tiebreakers. Do not rely on summaries or prior knowledge — always read the policy and select the subject that best matches the topic according to its definitions.
@@ -30,13 +30,15 @@ Performs a structured review of code changes or files against the Policies in th
30
30
  - Check `valid-from:` first. If a date is present and has not yet been reached, the decision SHOULD be adopted for new implementations but is not enforced during reviews.
31
31
  - Check `apply-to:` second. Keep only Policies whose stated scope fits the files, systems, or workflows under review.
32
32
  - Check the decision text itself last for additional boundaries or exceptions that metadata does not encode.
33
- 2. **Prerequisites gate — MUST complete before any review work:** For each scope containing files under review, read its `index.md` frontmatter and check for a `follows` field. `_core` Policies always apply to all scopes. Perform ALL of the following checks before proceeding; if ANY check fails, output a FAIL result immediately and do not continue the review:
33
+ 2. **Prerequisites gate — MUST complete before any review work:** For each scope containing files under review, read its `index.md` frontmatter and check for `follows` and `extends` fields. `_core` Policies always apply to all scopes. Perform ALL of the following checks before proceeding; if ANY check fails, output a FAIL result immediately and do not continue the review:
34
34
  - **Follows scopes:** If the scope declares `follows:` entries (e.g., `follows: myarea-core, shared-standards`), verify that each listed scope directory exists in the workspace AND contains an accessible `index.md` (e.g., `.xdrs/[scope-name]/index.md`). If any listed scope is missing or its index is unreadable, output: `FAIL — Review cannot proceed: scope \`[scope-name]\` is listed in \`follows\` but its policies are not present in the workspace. Install it before reviewing, as compliance with its governance cannot be verified.`
35
+ - **Extends scopes:** If the scope declares `extends:` entries, verify that each listed scope directory exists in the workspace AND contains an accessible `index.md`. If any listed scope is missing or its index is unreadable, output: `FAIL — Review cannot proceed: scope \`[scope-name]\` is listed in \`extends\` but its policies are not present in the workspace. Install it before reviewing, as inherited policies cannot be verified.`
35
36
  - **Local meta-policies:** Scan the scope's `[type]/principles/` directories for all files whose filename title starts with `core` (i.e., `NNN-core.md` or `NNN-core-{qualifier}.md`), excluding scope-type definition files. If any are found but cannot be read, output: `FAIL — Review cannot proceed: local meta-policy \`[filename]\` exists in scope \`[scope-name]\` but could not be read. Without it, full compliance cannot be verified.` Zero matches is valid — absence of local meta-policies is not an error.
36
37
  - **Rationale:** A review that silently omits mandatory governance layers produces false PASS results. Every governance layer declared by the scope MUST be loaded and applied; if any layer is inaccessible, the review result is unreliable and MUST be rejected.
37
38
  - **Scope-type:** Read the scope's `scope-type` from its `index.md`. Normalise the value to a list: split on commas and trim whitespace (`scope-type: typeA, typeB` becomes `[typeA, typeB]`). For **each** type in the list, search the `[type]/principles/` directories of all `core`-type scopes in the workspace for a file whose name ends with `{scope-type}-scope-type.md`. If the scope declares any `scope-type` elements but no matching file is found for ANY of them, output: `FAIL — Review cannot proceed: scope \`[scope-name]\` declares \`scope-type: [scope-type]\` but no \`[scope-type]-scope-type.md\` policy exists in any \`core\`-type scope in the workspace. The scope is READ-ONLY; install the scope-type governance before reviewing.`
38
39
  - Once all prerequisites pass, load the `follows` scopes' Policies and apply them as mandatory governance. Last-listed scope in `follows` takes precedence when the same topic is addressed by multiple scopes.
39
40
  - **Scope-type standards (application):** For each declared scope-type (single or comma-separated list), resolve its full ancestor chain (see `_core-adr-policy-010` rule 22): load the primary `{scope-type}-scope-type.md`, load all companion files (`{scope-type}-scope-type-{qualifier}.md`) alphabetically, then follow `NN-parent-scope-type` rules transitively until no more parents are declared. Stop on cycles. Concatenate all resolved chains in declaration order and deduplicate keeping first occurrence. Apply all policies from the deduplicated list as mandatory conventions. Then run conflict detection using the shared module at `.xdrs/_core/adrs/principles/skills/.assets/conflict-detection.md` across all loaded governance layers. See `_core-adr-policy-010` rules 22, 24, and 26 for the full application model.
41
+ - **Extends chain loading (policy documents only):** If the scope declares `extends:` entries (and the extends check above passed), load the inherited policy documents depth-first (see `_core-adr-policy-010` rule 33). For each extends entry in declaration order, recursively resolve that scope's own `extends:` chain, then append its policies. Deduplicate keeping first occurrence. The reviewing scope's own policies take precedence over all inherited policies. Apply the resolved extended policy set as additional context during the review — inherited policies MUST be evaluated for compliance just as if they were authored in this scope.
40
42
  - **Local meta-policies (policy documents only):** Apply all found local meta-policy files as mandatory conventions when reviewing policy documents in the scope. Local meta-policies take highest precedence in the chain. See `_core-adr-policy-010` rules 23, 24, and 26.
41
43
  3. Filter relevance based on file types, domains, and architectural patterns in scope.
42
44
 
@@ -47,6 +49,10 @@ Performs a structured review of code changes or files against the Policies in th
47
49
  - Classify as ERROR (mandatory) or WARNING (advisory).
48
50
  - Include: location, description, Policy reference (file + line), suggestion.
49
51
  - **Normative language check (Policy documents only):** For every Policy document in scope, verify that normative statements use uppercase BCP 14 keywords as required by `_core-adr-policy-001`. Flag as ERROR when a lowercase `must`, `must not`, `always`, or `never` is used in a normative requirement context (Details or Decision Outcome sections). Flag as WARNING when lowercase `should`, `should not`, `recommended`, `advised`, `may`, `possibly`, or `optionally` appear in a normative or permissive context where the uppercase form is expected. Context sections and question statements are exempt.
52
+ - **Extends chain conflict check:** If the reviewed scope has an `extends:` field, check for undeclared semantic conflicts in the following combinations (use AI judgment; report as ERROR citing `[_core-adr-policy-010.34-extends-conflict-declaration]` for each undeclared conflict found):
53
+ - Between the reviewing scope's own policies and policies from any extended scope (where the same topic is addressed differently and no `## Conflicts` section declares the override).
54
+ - Between two or more extended scopes that address the same topic differently without documented resolution.
55
+ - Between extended scopes' policies and the policies of **all scopes that appear after the reviewed scope in the root index** (those scopes have higher root-index precedence and silently override the inherited policy set for non-extends consumers; if no `## Conflicts` section exists in the later-listed scope's policy to acknowledge the inherited policy it overrides, flag as ERROR).
50
56
  2. Reduce false positives:
51
57
  - Evaluate ERROR findings for mandatory language in the Policy ("must", "always", "never", "required", "mandatory"). Drop or downgrade to WARNING if the language is advisory ("should", "recommended", "advised").
52
58
  - Remove findings unrelated to actual changes.
@@ -14,16 +14,10 @@ Guides the creation of a well-structured Policy by following the standards in `_
14
14
 
15
15
  ## Instructions
16
16
 
17
- ### Phase 0: Prerequisites Gate — MUST complete before writing
17
+ ### Phase 0: Scope Placement and Prerequisites Gate — MUST complete before writing
18
18
 
19
- Identify the target scope from the user's request; use `_local` if none is specified. Read the scope's `index.md` frontmatter and perform ALL of the following checks. If ANY check fails, output a FAIL result immediately and do not proceed:
20
-
21
- - **Follows scopes:** If the scope declares `follows:` entries (e.g., `follows: myarea-core, shared-standards`), verify that each listed scope directory exists in the workspace AND contains an accessible `index.md` (e.g., `.xdrs/[scope-name]/index.md`). If any listed scope is missing or unreadable, output: `FAIL — Cannot proceed: scope \`[scope-name]\` is listed in \`follows\` but its policies are not present in the workspace. Install it before authoring documents in this scope, as the governance constraints cannot be verified.`
22
- - **Local meta-policies:** Scan the target scope's `[type]/principles/` directories for all files whose filename title starts with `core` (i.e., `NNN-core.md` or `NNN-core-{qualifier}.md`), excluding scope-type definition files. If any are found but cannot be read, output: `FAIL — Cannot proceed: local meta-policy \`[filename]\` exists in scope \`[scope-name]\` but could not be read. Without it, the policy cannot be authored in full compliance with the scope's governance.` Zero matches is valid.
23
- - **Scope-type:** Read the scope's `scope-type` from its `index.md`. Normalise the value to a list: split on commas and trim whitespace (`scope-type: typeA, typeB` becomes `[typeA, typeB]`). For **each** type in the list, search the `[type]/principles/` directories of all `core`-type scopes in the workspace for a file whose name ends with `{scope-type}-scope-type.md`. If the scope declares any `scope-type` elements but no matching file is found for ANY of them, output: `FAIL — Cannot proceed: scope \`[scope-name]\` declares \`scope-type: [scope-type]\` but no \`[scope-type]-scope-type.md\` policy exists in any \`core\`-type scope in the workspace. The scope is READ-ONLY; install the scope-type governance before authoring documents in this scope.`
24
- - **Rationale:** Authoring a document without all mandatory governance layers loaded risks producing content that silently violates scope policies. Every governance layer MUST be present before writing begins.
25
-
26
- Once all prerequisites pass, load ALL scope-type governance (see `_core-adr-policy-010` rule 22): for each declared type, resolve its full ancestor chain (primary, companions alphabetically, parent chain). Deduplicate keeping first occurrence. Then run conflict detection using the shared module at `.xdrs/_core/adrs/principles/skills/.assets/conflict-detection.md` across all loaded governance layers. Halt if undeclared structural conflicts are found (see `_core-adr-policy-010` rules 24 and 26).
19
+ 1. Run the scope placement analysis from the shared module at `.xdrs/_core/adrs/principles/skills/.assets/scope-placement.md` to determine and confirm the target scope.
20
+ 2. Once the scope is confirmed, run the prerequisites gate from the shared module at `.xdrs/_core/adrs/principles/skills/.assets/prerequisites-gate.md`. Substitute `[DOCUMENT TYPE]` with `policy`.
27
21
 
28
22
  ### Phase 1: Understand the Decision
29
23
 
@@ -45,10 +39,7 @@ Consult `001-xdrs-standards` while making each choice in this phase. The summari
45
39
  - **ADR**: system context, integration pattern, overarching architectural choice
46
40
  - **EDR**: specific tool/library, coding practice, testing strategy, project structure
47
41
 
48
- **Scope** — use `_local` unless the user explicitly names another scope.
49
- - If the user names a scope other than `_local`, check the workspace root `.filedist.lock` file. If any file under `.xdrs/[scope]/` appears in `.filedist.lock`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
50
-
51
- **Subject** — MUST read `_core-adr-policy-016` ([016-policy-subjects.md](../../016-policy-subjects.md)) in full before choosing. That document defines all allowed subjects per type with full descriptions, examples, and disambiguation tiebreakers. Do not rely on summaries or prior knowledge of the subject list — always read the policy and select the subject that best matches the decision topic according to its definitions.
42
+ **Scope** — confirmed in Phase 0. Follow the external-scope validation and subject selection guidance in `.xdrs/_core/adrs/principles/skills/.assets/scope-selection.md`.
52
43
 
53
44
  When type, scope, or subject cannot be confidently inferred, ask the user a clarifying question before proceeding. Ask one question at a time and wait for the answer; follow up if the response introduces new ambiguity.
54
45
 
@@ -67,7 +58,7 @@ Choose a title that clearly states the question this Policy answers, not the ans
67
58
 
68
59
  ### Phase 4: Research Related Policies
69
60
 
70
- 1. Read all existing Policies relevant to the topic across all scopes listed in the Policy root `index.md`.
61
+ 1. Read all existing Policies relevant to the topic across all scopes listed in the Policy root `index.md`. **Additionally**, if the target scope declares an `extends:` field in its `index.md`, resolve its full `extends:` chain depth-first (see `_core-adr-policy-010` rule 33) and treat all policy documents from those extended scopes as if they were authored in the target scope — they MUST be included in the research and conflict check just like policies written directly in the scope.
71
62
  2. Evaluate Policy metadata before treating any decision as a current constraint. All documents present in the collection are considered active. `valid-from:` determines the convergence date for adoption, `apply-to:` determines whether it fits the current topic, and the decision text defines any remaining boundaries. Treat out-of-window or out-of-scope Policies as background only when assessing overlaps and conflicts.
72
63
  3. Identify decisions that already address the topic (full or partial overlap).
73
64
  4. Note decisions that might conflict with the intended outcome.
@@ -151,7 +142,7 @@ Mandatory rules to apply while drafting:
151
142
  - Keep the decision itself authoritative in the Policy. Supporting artifacts may elaborate, but they should not restate the full decision when a short reference is enough.
152
143
  - Make clear when the decision applies and any important exception boundaries.
153
144
  - Keep exploratory option analysis in a related Research document when it would distract from the final decision text.
154
- - Prefer plain Markdown, tables, Mermaid.js (sequence, state, activity, entity diagrams), or ASCII art for simple structure, flow, layout, or relationship indications.
145
+ - For diagrams and non-Markdown assets, follow `_core-adr-policy-020`: prefer plain Markdown tables/lists first, then ASCII art for very simple cases, then Mermaid.js (sequence, state, activity, entity diagrams) for complex ones, then draw.io when Mermaid is insufficient — save as Editable Vector (File → Save As → Editable Vector) and store as `.svg` in the sibling `.assets/` folder.
155
146
  - If the Policy genuinely needs local images or supporting files, store them in `.xdrs/[scope]/[type]/[subject]/.assets/` and link them using a same-folder relative path (e.g., `.assets/image.png`).
156
147
  - Use relative paths for all links; never use absolute paths starting with `/`.
157
148
  - No emojis. Lowercase filenames.
@@ -169,9 +160,7 @@ Check every item before finalizing:
169
160
  5. **Redundancy**: Is the Policy the primary source for the decision itself, with related documents linked instead of duplicated wherever possible?
170
161
  6. **Conflicts section**: Is it present and filled if Phase 3 found any conflicts?
171
162
  7. **Index entries**: Will the new Policy be added to `[scope]/[type]/index.md` and the Policy root `index.md`?
172
- 8. **Meta-policy compliance**: Check the target scope's `index.md` for a `follows` frontmatter field. `_core` Policies always apply to all scopes. If `follows` lists additional core scope names (e.g., `follows: [myarea-core]`), verify that each listed scope directory exists in the workspace (e.g., `.xdrs/[scope-name]/index.md`). If any listed scope is missing, STOP immediately and tell the user: "Scope `[scope-name]` is listed in `follows` but not found in the workspace. Install it before proceeding." Once all `follows` scopes are confirmed present, verify the document satisfies all requirements from those Policies. Scopes are applied in order; last-listed scope in `follows` takes precedence when the same topic is covered by multiple scopes.
173
- - **Scope-type standards:** Read the target scope's `scope-type`. Normalise the value to a list: split on commas and trim whitespace (`scope-type: typeA, typeB` becomes `[typeA, typeB]`). For **each** type in the list, search the `[type]/principles/` directories of all `core`-type scopes for a file ending in `{scope-type}-scope-type.md`. If found, also load all companion files (`{scope-type}-scope-type-{qualifier}.md`) from the **same directory** and apply their rules as additional requirements. Resolve any `NN-parent-scope-type` rule transitively from the primary file. See `_core-adr-policy-010` rules 22 and 24.
174
- - **Scope-local standards:** Scan the target scope's own `[type]/principles/` directories for all files whose filename title starts with `core` (i.e., `NNN-core.md` or `NNN-core-{qualifier}.md`), excluding scope-type definition files (whose title ends with `-scope-type`). If any are found, apply ALL of them as mandatory requirements; they override scope-type standards on conflict. See `_core-adr-policy-010` rules 23 and 24.
163
+ 8. **Meta-policy compliance**: Run the shared module at `.xdrs/_core/adrs/principles/skills/.assets/meta-policy-compliance.md`. Substitute `[DOCUMENT]` with `policy`.
175
164
 
176
165
  If any check fails, revise and re-run this phase before proceeding.
177
166
 
@@ -186,12 +175,7 @@ If any check fails, revise and re-run this phase before proceeding.
186
175
 
187
176
  ### Phase 9: Verify Package structure with Lint
188
177
 
189
- 1. Run the CLI lint utility from the repository root:
190
- ```
191
- npx -y xdrs-core@latest lint
192
- ```
193
- 2. Fix all reported errors before considering the task complete.
194
- 3. Review warnings; fix straightforward ones and note intentional deviations explicitly.
178
+ Follow the lint verification steps in `.xdrs/_core/adrs/principles/skills/.assets/lint-verification.md`.
195
179
 
196
180
  ### Constraints
197
181