xdrs-core 0.27.1 → 0.28.1
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.
- package/.filedist-package.yml +3 -1
- package/.xdrs/_core/adrs/index.md +1 -0
- package/.xdrs/_core/adrs/principles/001-xdrs-core.md +1 -1
- package/.xdrs/_core/adrs/principles/008-xdr-standards-structured.md +12 -12
- package/.xdrs/_core/adrs/principles/articles/.assets/001-xdrs-overview-slides.md +234 -0
- package/.xdrs/_core/adrs/principles/articles/001-xdrs-overview.md +2 -1
- package/.xdrs/_core/adrs/principles/skills/002-write-policy/SKILL.md +2 -2
- package/.xdrs/_core/adrs/principles/skills/003-write-skill/SKILL.md +2 -4
- package/.xdrs/_core/adrs/principles/skills/004-write-article/SKILL.md +2 -4
- package/.xdrs/_core/adrs/principles/skills/005-write-research/SKILL.md +2 -3
- package/.xdrs/_core/adrs/principles/skills/006-write-plan/SKILL.md +2 -2
- package/.xdrs/_core/adrs/principles/skills/008-write-xdrs-doc/SKILL.md +46 -0
- package/README.md +1 -1
- package/lib/lint.js +3 -3
- package/lib/lint.test.js +2 -2
- package/package.json +1 -1
package/.filedist-package.yml
CHANGED
|
@@ -27,6 +27,7 @@ Step-by-step procedural guides for humans and AI agents.
|
|
|
27
27
|
- [_core-adr-skill-005-write-research](principles/skills/005-write-research/SKILL.md) - **Write Research** — create a new research document
|
|
28
28
|
- [_core-adr-skill-006-write-plan](principles/skills/006-write-plan/SKILL.md) - **Write Plan** — create a new plan document
|
|
29
29
|
- [_core-adr-skill-007-write-presentation](principles/skills/007-write-presentation/SKILL.md) - **Write Presentation** — create Marp slide presentations for XDRS documents
|
|
30
|
+
- [_core-adr-skill-008-write-xdrs-doc](principles/skills/008-write-xdrs-doc/SKILL.md) - **Write XDRS Doc** — router skill; infers document type and delegates to the appropriate authoring skill
|
|
30
31
|
|
|
31
32
|
## Articles
|
|
32
33
|
|
|
@@ -40,7 +40,7 @@ Policies can be of different kinds, depending on the nature of the decision:
|
|
|
40
40
|
`[xdrs-root]/[scope]/[type]/[subject]/[number]-[short-title].md`
|
|
41
41
|
where `[xdrs-root]` is the XDRS root folder (default: `.xdrs/`).
|
|
42
42
|
- ALWAYS ignore symlinks paths. NEVER create or update documents inside symlinked folders.
|
|
43
|
-
- **Files listed in `.filedist` are external XDRs.** A file whose path appears in the workspace root `.filedist` file was distributed from an external source repository. It must NEVER be modified locally. To change it, submit the change to the source repository and re-extract the updated package. The `.filedist` format is one entry per line: `<relative-path>|<package>|<version>`. A scope is considered external when any of its files appear in `.filedist`, and tools (such as `xdrs-core lint`) will skip external scopes by default. The `.filedist` file can also be used to detect which files changed when bumping an external scope to a newer version: compare the version field in `.filedist` entries before and after the upgrade and diff the affected paths to understand what decisions were added, updated, or removed.
|
|
43
|
+
- **Files listed in `.filedist.lock` are external XDRs.** A file whose path appears in the workspace root `.filedist.lock` file was distributed from an external source repository. It must NEVER be modified locally. To change it, submit the change to the source repository and re-extract the updated package. The `.filedist.lock` format is one entry per line: `<relative-path>|<package>|<version>`. A scope is considered external when any of its files appear in `.filedist.lock`, and tools (such as `xdrs-core lint`) will skip external scopes by default. The `.filedist.lock` file can also be used to detect which files changed when bumping an external scope to a newer version: compare the version field in `.filedist.lock` entries before and after the upgrade and diff the affected paths to understand what decisions were added, updated, or removed.
|
|
44
44
|
- Optional supporting artifacts under the same subject:
|
|
45
45
|
- `[xdrs-root]/[scope]/[type]/[subject]/researches/[number]-[short-title].md`
|
|
46
46
|
- `[xdrs-root]/[scope]/[type]/[subject]/skills/[number]-[skill-name]/SKILL.md`
|
|
@@ -17,7 +17,7 @@ Question: How should a Policy document expose strong or individually referenceab
|
|
|
17
17
|
|
|
18
18
|
**Numbered rule blocks inside Details with a canonical citation syntax**
|
|
19
19
|
|
|
20
|
-
When a Policy document defines strong rules or policies that
|
|
20
|
+
When a Policy document defines strong rules or policies that must be stated explicitly, or when documents and skills need to cite individual rules precisely, each rule must be placed inside `### Details` as a numbered heading block. Referencing documents and skills must cite rules using the canonical dot-notation identifier.
|
|
21
21
|
|
|
22
22
|
### Details
|
|
23
23
|
|
|
@@ -28,11 +28,11 @@ Use this format when the decision defines strong rules or policies that must be
|
|
|
28
28
|
Each numbered rule must be written as:
|
|
29
29
|
|
|
30
30
|
```markdown
|
|
31
|
-
#### [NN]-[short
|
|
31
|
+
#### [NN]-[short-rule-title-in-mandatory-advisory-language-in-kebab-case-<12-words]
|
|
32
32
|
[Body using mandatory or advisory language as defined in _core-adr-policy-001. State the requirement and the situations in which it must or should be followed. Under 500 words.]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Where `NN` is a two-digit zero-padded sequence number (e.g. `01`, `02`, `12`). Numbers must be unique within the document and must never be reused after a rule is removed.
|
|
35
|
+
Where `NN` is a two-digit zero-padded sequence number (e.g. `01`, `02`, `12`). Numbers must be unique within the document and must never be reused after a rule is removed. The short descriptive title must be in kebab-case (lowercase words separated by hyphens, no spaces or uppercase letters) and express the rule summary contents (e.g.: "43-code-must-be-linted", "12-use-standard-file-structure", "02-log-all-errors-to-mlflow")
|
|
36
36
|
|
|
37
37
|
Rule bodies must use the mandatory or advisory language terms defined in `_core-adr-policy-001`:
|
|
38
38
|
|
|
@@ -44,31 +44,31 @@ Rule bodies must use the mandatory or advisory language terms defined in `_core-
|
|
|
44
44
|
When another document or skill cites a specific rule, it must use the following dot-notation:
|
|
45
45
|
|
|
46
46
|
```
|
|
47
|
-
policy-name.
|
|
47
|
+
policy-name.NN-short-rule-title-in-kebab-case
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Examples:
|
|
51
51
|
|
|
52
|
-
- `_core-adr-policy-008-policy-standards-structured.
|
|
53
|
-
- `_local-bdr-policy-003-data-retention-policy.
|
|
52
|
+
- `_core-adr-policy-008-policy-standards-structured.01-always-use-numbered-rules-for-strong-or-referenceable-policies`
|
|
53
|
+
- `_local-bdr-policy-003-data-retention-policy.02-purge-schedule-for-pii`
|
|
54
54
|
|
|
55
|
-
The `policy-name` must match the `name` field in the frontmatter of the source document exactly. The rule identifier
|
|
55
|
+
The `policy-name` must match the `name` field in the frontmatter of the source document exactly. The rule identifier after the dot must match the heading text exactly, including the two-digit prefix.
|
|
56
56
|
|
|
57
|
-
#### 01-
|
|
57
|
+
#### 01-always-use-numbered-rules-for-strong-or-referenceable-policies
|
|
58
58
|
|
|
59
59
|
Numbered rule blocks must be added to a Policy when the decision defines strong rules or policies that must be stated explicitly as stable items, or when there is a clear need for other documents, skills, or agents to cite individual rules by identifier. Adding numbered rules only for cosmetic organization is not recommended. Standard Policy documents that do not define strong rule sets and are not expected to be cited at the rule level should follow `_core-adr-policy-002-policy-standards` without this structured format.
|
|
60
60
|
|
|
61
|
-
#### 02-
|
|
61
|
+
#### 02-rule-numbering-must-be-stable
|
|
62
62
|
|
|
63
63
|
Rule numbers must never be reused within the same document. When a rule is removed, its number becomes permanently retired for that document. Gaps in the sequence are expected and must not be filled by renumbering remaining rules, as existing citations depend on number stability.
|
|
64
64
|
|
|
65
|
-
#### 03-
|
|
65
|
+
#### 03-rule-body-must-use-normative-language
|
|
66
66
|
|
|
67
67
|
Every rule body must contain at least one mandatory or advisory language term as defined in `_core-adr-policy-001`. Rule bodies without normative language must not be published, as they fail to communicate whether compliance is required or recommended.
|
|
68
68
|
|
|
69
|
-
#### 04-
|
|
69
|
+
#### 04-citations-must-use-exact-identifiers
|
|
70
70
|
|
|
71
|
-
Documents and skills that cite a rule must use the exact dot-notation form: `policy-name.
|
|
71
|
+
Documents and skills that cite a rule must use the exact dot-notation form: `policy-name.NN-short-rule-title-in-kebab-case`. Prose paraphrases such as "see rule 3" or "the third rule in that Policy" must not be used as citations, because they are ambiguous and break when rules are reordered or reworded.
|
|
72
72
|
|
|
73
73
|
## Considered Options
|
|
74
74
|
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
marp: true
|
|
3
|
+
paginate: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# XDRS Framework
|
|
7
|
+
|
|
8
|
+
A structured system for capturing, organizing, and distributing architectural, business, and engineering decisions
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
|
|
14
|
+
Teams accumulate decisions across architecture, engineering, and business domains.
|
|
15
|
+
|
|
16
|
+
Without structure, decisions are:
|
|
17
|
+
- Buried in wikis, tickets, or chat threads
|
|
18
|
+
- Mixed with rationale, plans, and how-to guides
|
|
19
|
+
- Invisible to AI agents and future contributors
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Problem
|
|
24
|
+
|
|
25
|
+
A standard Decision Record combines too many concerns in one file:
|
|
26
|
+
|
|
27
|
+
| Concern | Job |
|
|
28
|
+
|---------|-----|
|
|
29
|
+
| Why we decided | Rationale / Research |
|
|
30
|
+
| What we decided | Policy (the rule) |
|
|
31
|
+
| How to implement it | Plan |
|
|
32
|
+
| How to apply it daily | Skill |
|
|
33
|
+
| Overview for readers | Article |
|
|
34
|
+
|
|
35
|
+
Mixing these makes decisions hard to search, update, and apply.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Solution: Separate Artifact Types
|
|
40
|
+
|
|
41
|
+
XDRS splits the concerns into focused, linkable documents:
|
|
42
|
+
|
|
43
|
+
- **Policy** — the authoritative decision (ADR / BDR / EDR)
|
|
44
|
+
- **Research** — exploration, options, evidence
|
|
45
|
+
- **Skill** — step-by-step execution procedure
|
|
46
|
+
- **Article** — synthetic overview linking multiple artifacts
|
|
47
|
+
- **Plan** — ephemeral execution plan, deleted after implementation
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Policies — the Source of Truth
|
|
52
|
+
|
|
53
|
+
The central artifact. Answers a concrete question and records the adopted direction.
|
|
54
|
+
|
|
55
|
+
Three types:
|
|
56
|
+
- **ADR** — architectural and technical decisions
|
|
57
|
+
- **BDR** — business and operational decisions
|
|
58
|
+
- **EDR** — engineering implementation decisions
|
|
59
|
+
|
|
60
|
+
If Research and a Policy disagree, **the Policy wins**.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Research
|
|
65
|
+
|
|
66
|
+
Captures exploration **before or around** a decision.
|
|
67
|
+
|
|
68
|
+
- Constraints, findings, options, pros, cons
|
|
69
|
+
- Supports elaboration and discussion — not a rule
|
|
70
|
+
- One Research document may inform multiple downstream Policies
|
|
71
|
+
- Lives beside the Policy in `researches/`
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Skills
|
|
76
|
+
|
|
77
|
+
Describe **how to execute** work under the constraints of a decision.
|
|
78
|
+
|
|
79
|
+
- Add procedural detail that Policies intentionally avoid
|
|
80
|
+
- Used by humans, AI agents, or both
|
|
81
|
+
- Task-based, end in a verifiable outcome
|
|
82
|
+
- Only mandatory when a Policy makes them mandatory
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Articles
|
|
87
|
+
|
|
88
|
+
Synthetic views that **explain a topic** across multiple Policies, Research, and Skills.
|
|
89
|
+
|
|
90
|
+
- Help readers understand the system without making new decisions
|
|
91
|
+
- Do not replace the source of truth
|
|
92
|
+
- Useful for onboarding and cross-cutting topics
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Plans
|
|
97
|
+
|
|
98
|
+
Describe a problem, proposed solution, and implementation approach.
|
|
99
|
+
|
|
100
|
+
- Clear start and end, well-defined scope
|
|
101
|
+
- **Ephemeral**: deleted after full implementation
|
|
102
|
+
- Lasting outputs are captured as Policies, Skills, or Articles
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## How They Differ at a Glance
|
|
107
|
+
|
|
108
|
+
| Artifact | Central question |
|
|
109
|
+
|----------|-----------------|
|
|
110
|
+
| Policy | What did we decide? |
|
|
111
|
+
| Research | What did we learn while evaluating options? |
|
|
112
|
+
| Skill | How do we carry out work under this decision? |
|
|
113
|
+
| Article | How do these artifacts fit together for a reader? |
|
|
114
|
+
| Plan | What are we going to do, why, and how? |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Lifecycle
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Explore → Decide → Execute → Explain → Distribute
|
|
122
|
+
Research Policy Skill Article Scopes / Indexes
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Research usually appears **before** a decision.
|
|
126
|
+
The Policy marks the **adopted outcome**.
|
|
127
|
+
Skills appear when the decision must be **executed repeatedly**.
|
|
128
|
+
Articles appear when the **ecosystem around the decision** needs explanation.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Folder Structure
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
.xdrs/
|
|
136
|
+
[scope]/
|
|
137
|
+
[type]/ # adrs | bdrs | edrs
|
|
138
|
+
[subject]/
|
|
139
|
+
[N]-[title].md ← Policy
|
|
140
|
+
researches/
|
|
141
|
+
skills/[N]-[name]/SKILL.md
|
|
142
|
+
articles/
|
|
143
|
+
plans/
|
|
144
|
+
.assets/ ← slides, diagrams
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- **Scope** — ownership domain (e.g. `_core`, `team-43`)
|
|
148
|
+
- **Type** — ADR / BDR / EDR
|
|
149
|
+
- **Subject** — topic category (e.g. `principles`, `application`)
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Scope Precedence
|
|
154
|
+
|
|
155
|
+
The root `.xdrs/index.md` lists all scope indexes.
|
|
156
|
+
|
|
157
|
+
Scopes listed **later override** those listed earlier.
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
_core ← base rules (broadest)
|
|
161
|
+
my-platform ← platform-specific overrides
|
|
162
|
+
_local ← project-specific overrides (narrowest)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Applying a Policy
|
|
168
|
+
|
|
169
|
+
Before treating a Policy as a rule, check in order:
|
|
170
|
+
|
|
171
|
+
1. **Valid** — is the policy active?
|
|
172
|
+
2. **Applied to** — does the current context match the scope?
|
|
173
|
+
3. **Decision text** — do the context and exceptions allow this case?
|
|
174
|
+
|
|
175
|
+
Only decisions that pass all three checks should be enforced.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Getting Started
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# 1. Install
|
|
183
|
+
npm install xdrs-core # or pnpm add xdrs-core
|
|
184
|
+
|
|
185
|
+
# 2. Bootstrap
|
|
186
|
+
npx xdrs-core
|
|
187
|
+
|
|
188
|
+
# 3. Start writing with your AI agent
|
|
189
|
+
# "Create an ADR about our decision to use Python for AI projects."
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
This creates `AGENTS.md` and `.xdrs/index.md` with the `_core` scope pre-loaded.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Extending XDRS
|
|
197
|
+
|
|
198
|
+
| Goal | Action |
|
|
199
|
+
|------|--------|
|
|
200
|
+
| New scope | Create `.xdrs/[scope]/[type]/index.md`, add to root index |
|
|
201
|
+
| New subject | Add subject folder under scope+type path |
|
|
202
|
+
| New research | Add `researches/[N]-[title].md` |
|
|
203
|
+
| New skill | Add `skills/[N]-[name]/SKILL.md` |
|
|
204
|
+
| Distribute a scope | Pack `.xdrs/[scope]/` and publish to an npm registry |
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Distributing Across Teams
|
|
209
|
+
|
|
210
|
+
- Pack `.xdrs/[scope]/` with `pnpm pack`
|
|
211
|
+
- Publish to public or internal npm registry
|
|
212
|
+
- Consumers install the package and run `npx xdrs-core extract`
|
|
213
|
+
- `filedist` tracks managed files; `_local` overrides are preserved
|
|
214
|
+
- Run `npx xdrs-core check` to verify files are in sync
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
# Summary
|
|
219
|
+
|
|
220
|
+
- XDRS separates concerns: Policy, Research, Skill, Article, Plan
|
|
221
|
+
- Policies are the source of truth; all other artifacts support them
|
|
222
|
+
- Scopes and indexes make decisions discoverable and overridable
|
|
223
|
+
- AI agents consult XDRS before every request via `AGENTS.md`
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
# References
|
|
228
|
+
|
|
229
|
+
- [XDRS Overview article](../001-xdrs-overview.md)
|
|
230
|
+
- [_core-adr-policy-001 - XDRS core](../../001-xdrs-core.md)
|
|
231
|
+
- [_core-adr-policy-002 - Policy standards](../../002-policy-standards.md)
|
|
232
|
+
- [_core-adr-policy-003 - Skill standards](../../003-skill-standards.md)
|
|
233
|
+
- [_core-adr-policy-004 - Article standards](../../004-article-standards.md)
|
|
234
|
+
- [_core-adr-policy-009 - Presentation standards](../../009-presentation-standards.md)
|
|
@@ -181,7 +181,7 @@ Follow [_core-adr-policy-001](../001-xdrs-core.md) and [_core-adr-policy-002](..
|
|
|
181
181
|
1. **Install** — add the scope package as a dependency and run `npx xdrs-core extract` (or
|
|
182
182
|
`pnpm exec xdrs-core extract`) to unpack XDRS files into `.xdrs/` in your workspace.
|
|
183
183
|
2. **Pins and upgrades** — update the npm dependency version to pull in the latest decisions
|
|
184
|
-
for a scope. The `filedist` mechanism tracks managed files in `.filedist` and keeps
|
|
184
|
+
for a scope. The `filedist` mechanism tracks managed files in `.filedist.lock` and keeps
|
|
185
185
|
`.xdrs/index.md` in `keepExisting` mode so local edits are preserved.
|
|
186
186
|
3. **Multi-scope** — list multiple scope packages as dependencies. Edit `.xdrs/index.md` to
|
|
187
187
|
add each scope's canonical index link; place more specific scopes below broader ones.
|
|
@@ -192,6 +192,7 @@ Follow [_core-adr-policy-001](../001-xdrs-core.md) and [_core-adr-policy-002](..
|
|
|
192
192
|
|
|
193
193
|
## References
|
|
194
194
|
|
|
195
|
+
- [Presentation slides](.assets/001-xdrs-overview-slides.md) - Marp slide deck overview of this article
|
|
195
196
|
- [_core-adr-policy-001](../001-xdrs-core.md) - XDRS elements: types, scopes, subjects, folder structure
|
|
196
197
|
- [_core-adr-policy-002](../002-policy-standards.md) - Policy document standards and mandatory template
|
|
197
198
|
- [_core-adr-policy-003](../003-skill-standards.md) - Skill standards and co-location rules
|
|
@@ -35,7 +35,7 @@ Consult `001-xdrs-core` while making each choice in this phase. The summaries be
|
|
|
35
35
|
- **EDR**: specific tool/library, coding practice, testing strategy, project structure
|
|
36
36
|
|
|
37
37
|
**Scope** — use `_local` unless the user explicitly names another scope.
|
|
38
|
-
- If the user names a scope other than `_local`, check the workspace root `.filedist` file. If any file under `.xdrs/[scope]/` appears in `.filedist`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
|
|
38
|
+
- 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.
|
|
39
39
|
|
|
40
40
|
**Subject** — pick one from the allowed list for the chosen type (from `001-xdrs-core`):
|
|
41
41
|
- ADR: `principles`, `application`, `data`, `integration`, `platform`, `controls`, `operations`
|
|
@@ -187,7 +187,7 @@ If any check fails, revise and re-run this phase before proceeding.
|
|
|
187
187
|
- MUST NOT create a Policy that duplicates a decision already captured in another Policy — extend or reference instead.
|
|
188
188
|
- MUST prefer links and short references over repeating the same decision content across related documents.
|
|
189
189
|
- MUST keep scope `_local` unless the user explicitly states otherwise.
|
|
190
|
-
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist`).
|
|
190
|
+
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist.lock`).
|
|
191
191
|
|
|
192
192
|
## References
|
|
193
193
|
|
|
@@ -36,7 +36,7 @@ Quick test:
|
|
|
36
36
|
- "How to execute a business process or policy?" → BDR
|
|
37
37
|
|
|
38
38
|
**Scope** — use `_local` unless the user explicitly names another scope.
|
|
39
|
-
- If the user names a scope other than `_local`, check the workspace root `.filedist` file. If any file under `.xdrs/[scope]/` appears in `.filedist`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
|
|
39
|
+
- 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.
|
|
40
40
|
|
|
41
41
|
**Subject** — pick the most specific match for the chosen type (required list per type is in `_core-adr-policy-001`):
|
|
42
42
|
- ADR subjects: `principles`, `application`, `data`, `integration`, `platform`, `controls`, `operations`
|
|
@@ -131,11 +131,9 @@ If any check fails, revise before continuing.
|
|
|
131
131
|
- MUST consult `001-xdrs-core` as the canonical source for every core element definition, especially type, scope, subject, numbering, naming, and placement.
|
|
132
132
|
- MUST NOT create a skill that duplicates an existing one — extend or reference it instead.
|
|
133
133
|
- MUST keep scope `_local` unless the user explicitly states otherwise.
|
|
134
|
-
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist`).
|
|
134
|
+
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist.lock`).
|
|
135
135
|
- MUST include a References section linking to `003-skill-standards`.
|
|
136
136
|
|
|
137
|
-
## Examples
|
|
138
|
-
|
|
139
137
|
**Input**: "Create a skill to help debug CI pipelines"
|
|
140
138
|
- Type: EDR (engineering workflow)
|
|
141
139
|
- Scope: `_local`
|
|
@@ -41,7 +41,7 @@ Do NOT proceed to Phase 1 until you have at minimum a clear **topic** and **audi
|
|
|
41
41
|
Consult `001-xdrs-core` while making each choice in this phase. The summaries below are orientation only; when any detail is unclear, the standard decides.
|
|
42
42
|
|
|
43
43
|
**Scope** — use `_local` unless the user explicitly names another scope.
|
|
44
|
-
- If the user names a scope other than `_local`, check the workspace root `.filedist` file. If any file under `.xdrs/[scope]/` appears in `.filedist`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
|
|
44
|
+
- 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.
|
|
45
45
|
|
|
46
46
|
**Type** — match the type of the XDRS elements the article primarily synthesizes (`adrs`, `bdrs`, or `edrs`).
|
|
47
47
|
If the topic spans multiple types, use `adrs`. Use the same rules as `002-write-policy` Phase 2:
|
|
@@ -140,11 +140,9 @@ Rules to apply while drafting:
|
|
|
140
140
|
- MUST consult `001-xdrs-core` as the canonical source for every core element definition, especially type, scope, subject, numbering, naming, and placement.
|
|
141
141
|
- MUST follow the article template and placement rules from `004-article-standards`.
|
|
142
142
|
- MUST keep scope `_local` unless the user explicitly states otherwise.
|
|
143
|
-
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist`).
|
|
143
|
+
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist.lock`).
|
|
144
144
|
- MUST defer to active and applicable Policies when article synthesis conflicts with them.
|
|
145
145
|
|
|
146
|
-
## References
|
|
147
|
-
|
|
148
146
|
- [_core-adr-policy-004 - Article standards](../../004-article-standards.md)
|
|
149
147
|
- [_core-adr-policy-006 - Research standards](../../006-research-standards.md)
|
|
150
148
|
- [_core-adr-policy-001 - XDRS core](../../001-xdrs-core.md)
|
|
@@ -36,7 +36,7 @@ If the answers from Phase 1 leave scope, type, or subject ambiguous, use `vscode
|
|
|
36
36
|
Consult `001-xdrs-core` while making each choice in this phase. The summaries below are orientation only; when any detail matters, the standard decides.
|
|
37
37
|
|
|
38
38
|
**Scope** — use `_local` unless the user explicitly names another scope.
|
|
39
|
-
- If the user names a scope other than `_local`, check the workspace root `.filedist` file. If any file under `.xdrs/[scope]/` appears in `.filedist`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
|
|
39
|
+
- 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.
|
|
40
40
|
|
|
41
41
|
**Type** — match the type of decision this research supports (`adrs`, `bdrs`, or `edrs`). Use the same rules as `002-write-policy` Phase 2:
|
|
42
42
|
- **BDR**: business process, product policy, strategic rule, operational procedure
|
|
@@ -278,6 +278,5 @@ If any check fails, revise before continuing.
|
|
|
278
278
|
- MUST consult `001-xdrs-core` as the canonical source for every core element definition, especially type, scope, subject, numbering, naming, and placement.
|
|
279
279
|
- MUST follow the research template and section-goal rules from `006-research-standards`.
|
|
280
280
|
- MUST keep scope `_local` unless the user explicitly states otherwise.
|
|
281
|
-
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist`).
|
|
281
|
+
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist.lock`).
|
|
282
282
|
- MUST keep the document as research rather than turning it into a final decision.
|
|
283
|
-
ing it into a final decision.
|
|
@@ -33,7 +33,7 @@ Guides the creation of a well-structured plan document by following `_core-adr-p
|
|
|
33
33
|
Consult `001-xdrs-core` while making each choice in this phase. The summaries below are orientation only; when any detail is unclear, the standard decides.
|
|
34
34
|
|
|
35
35
|
**Scope** — use `_local` unless the user explicitly names another scope.
|
|
36
|
-
- If the user names a scope other than `_local`, check the workspace root `.filedist` file. If any file under `.xdrs/[scope]/` appears in `.filedist`, the scope is external and new documents MUST NOT be created there. Inform the user and ask them to choose a non-external scope.
|
|
36
|
+
- 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.
|
|
37
37
|
|
|
38
38
|
**Type** — match the type of the Policies the plan primarily implements or relates to (`adrs`, `bdrs`, or `edrs`).
|
|
39
39
|
- **BDR**: business process, product policy, strategic rule, operational procedure
|
|
@@ -164,4 +164,4 @@ Rules to apply while drafting:
|
|
|
164
164
|
- MUST follow the plan template and section-goal rules from `007-plan-standards`.
|
|
165
165
|
- MUST consult `001-xdrs-core` as the canonical source for every core element definition, especially type, scope, subject, numbering, naming, and placement.
|
|
166
166
|
- MUST keep scope `_local` unless the user explicitly states otherwise.
|
|
167
|
-
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist`).
|
|
167
|
+
- MUST NOT create documents in external scopes (scopes whose files appear in the workspace root `.filedist.lock`).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: _core-adr-skill-008-write-xdrs-doc
|
|
3
|
+
description: >
|
|
4
|
+
Use when writing documents such as decisions, policies, skills, procedures, research, plans, articles, or presentations.
|
|
5
|
+
Activate this skill when the user asks to create or write any XDRS element.
|
|
6
|
+
metadata:
|
|
7
|
+
author: flaviostutz
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Routes the request to the appropriate XDRS authoring skill based on the type of document the user wants to create. Reads the target skill at runtime and follows its instructions in full.
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
### Phase 1: Infer Document Type
|
|
18
|
+
|
|
19
|
+
1. Infer the target document type from the user's request and context using the mapping below. Do not ask the user unless the type is genuinely ambiguous after reading the request.
|
|
20
|
+
- **Policy** (ADR/BDR/EDR) — user wants to record a decision, rule, standard, guideline, or architectural/business/engineering policy
|
|
21
|
+
- **Skill** — user wants to create an agent skill, SKILL.md, or reusable workflow instruction
|
|
22
|
+
- **Research** — user wants to produce a study, investigation, evidence-based analysis, or IMRAD-style document
|
|
23
|
+
- **Plan** — user wants to create an execution plan, project plan, roadmap, or milestone document
|
|
24
|
+
- **Article** — user wants to create a guide, overview, or synthetic document that combines multiple XDRS elements
|
|
25
|
+
- **Presentation** — user wants to create slides or a Marp deck for an existing XDRS document
|
|
26
|
+
|
|
27
|
+
2. If the type cannot be confidently inferred, ask the user one focused question: *"What type of XDRS document do you want to create — Policy, Skill, Research, Plan, Article, or Presentation?"* Wait for the answer before proceeding.
|
|
28
|
+
|
|
29
|
+
### Phase 2: Load and Follow Target Skill
|
|
30
|
+
|
|
31
|
+
Read the full content of the skill file for the inferred type, then follow all its phases and instructions exactly as if that skill had been activated directly.
|
|
32
|
+
|
|
33
|
+
| Document type | Skill file to read and follow |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Policy (ADR / BDR / EDR) | `.xdrs/_core/adrs/principles/skills/002-write-policy/SKILL.md` |
|
|
36
|
+
| Skill | `.xdrs/_core/adrs/principles/skills/003-write-skill/SKILL.md` |
|
|
37
|
+
| Article | `.xdrs/_core/adrs/principles/skills/004-write-article/SKILL.md` |
|
|
38
|
+
| Research | `.xdrs/_core/adrs/principles/skills/005-write-research/SKILL.md` |
|
|
39
|
+
| Plan | `.xdrs/_core/adrs/principles/skills/006-write-plan/SKILL.md` |
|
|
40
|
+
| Presentation | `.xdrs/_core/adrs/principles/skills/007-write-presentation/SKILL.md` |
|
|
41
|
+
|
|
42
|
+
### Constraints
|
|
43
|
+
|
|
44
|
+
- MUST read the full target SKILL.md before proceeding — do not rely on summaries or prior knowledge of the target skill.
|
|
45
|
+
- MUST follow all phases of the target skill from Phase 1 onward; do not skip any phase.
|
|
46
|
+
- MUST NOT create documents of a type not listed in the routing table above.
|
package/README.md
CHANGED
|
@@ -166,7 +166,7 @@ Multiple scope packages can be combined in the same workspace by listing them as
|
|
|
166
166
|
The published package exposes the `xdrs-core` CLI.
|
|
167
167
|
|
|
168
168
|
- Bootstrap or extract managed XDRS files with the existing `filedist`-backed commands such as `npx -y xdrs-core extract` and `npx -y xdrs-core check`.
|
|
169
|
-
- Lint a Policy tree with `npx -y xdrs-core lint .`. By default, scopes whose files are listed in the workspace root `.filedist` file are treated as external and skipped; use `--all` to include them.
|
|
169
|
+
- Lint a Policy tree with `npx -y xdrs-core lint .`. By default, scopes whose files are listed in the workspace root `.filedist.lock` file are treated as external and skipped; use `--all` to include them.
|
|
170
170
|
|
|
171
171
|
The `lint` command reads `./.xdrs/**` from the given workspace path and checks common consistency rules, including:
|
|
172
172
|
|
package/lib/lint.js
CHANGED
|
@@ -64,7 +64,7 @@ function printHelp() {
|
|
|
64
64
|
console.log('Usage: xdrs-core lint [options] [path]\n');
|
|
65
65
|
console.log('Lint the XDRS tree rooted at [path] when [path] contains an index.md, or at [path]/.xdrs by default.');
|
|
66
66
|
console.log('\nOptions:');
|
|
67
|
-
console.log(' --all Check all files, including files from external scopes distributed via .filedist (default: skip external scopes)');
|
|
67
|
+
console.log(' --all Check all files, including files from external scopes distributed via .filedist.lock (default: skip external scopes)');
|
|
68
68
|
console.log('\nAll other commands continue to be delegated to the bundled filedist CLI.');
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -991,7 +991,7 @@ function isExternalScopeLink(resolvedPath, xdrsRoot, externalScopes) {
|
|
|
991
991
|
if (parts.length === 0 || !parts[0]) return false;
|
|
992
992
|
const scopeName = parts[0];
|
|
993
993
|
|
|
994
|
-
// Treat as external if explicitly listed via .filedist OR if the scope directory
|
|
994
|
+
// Treat as external if explicitly listed via .filedist.lock OR if the scope directory
|
|
995
995
|
// doesn't exist locally (e.g. hasn't been extracted from an external package yet)
|
|
996
996
|
return externalScopes.has(scopeName) || !existsDirectory(path.join(xdrsRoot, scopeName));
|
|
997
997
|
}
|
|
@@ -1192,7 +1192,7 @@ function existsFile(filePath) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
|
|
1194
1194
|
function loadFiledist(repoRoot) {
|
|
1195
|
-
const filedistPath = path.join(repoRoot, '.filedist');
|
|
1195
|
+
const filedistPath = path.join(repoRoot, '.filedist.lock');
|
|
1196
1196
|
if (!existsFile(filedistPath)) {
|
|
1197
1197
|
return new Set();
|
|
1198
1198
|
}
|
package/lib/lint.test.js
CHANGED
|
@@ -91,7 +91,7 @@ test('skips external scopes by default and checks them when ignoreExternal is fa
|
|
|
91
91
|
'See [Missing](002-missing.md).',
|
|
92
92
|
''
|
|
93
93
|
].join('\n'),
|
|
94
|
-
'.filedist': '.xdrs/extscope/adrs/principles/001-ext.md|some-package|1.0.0\n',
|
|
94
|
+
'.filedist.lock': '.xdrs/extscope/adrs/principles/001-ext.md|some-package|1.0.0\n',
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
const defaultResult = lintWorkspace(workspaceRoot);
|
|
@@ -160,7 +160,7 @@ test('skips entire external scope when only some of its files are in filedist',
|
|
|
160
160
|
'See [Missing](003-missing.md).',
|
|
161
161
|
''
|
|
162
162
|
].join('\n'),
|
|
163
|
-
'.filedist': '.xdrs/extscope/adrs/principles/001-ext.md|some-package|1.0.0\n',
|
|
163
|
+
'.filedist.lock': '.xdrs/extscope/adrs/principles/001-ext.md|some-package|1.0.0\n',
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
const result = lintWorkspace(workspaceRoot);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xdrs-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "A framework to structure, compile and distribute Architectural (ADR), Business (BDR), and Engineering (EDR) decision records contents so that AI agents and humans can reliably find and use them with hierarchical scopes and controlled rollout in the format of distributable versioned packages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|