xdrs-core 0.28.1 → 0.28.2
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/.xdrs/_core/adrs/principles/skills/002-write-policy/SKILL.md +1 -1
- package/.xdrs/_core/adrs/principles/skills/003-write-skill/SKILL.md +8 -0
- package/.xdrs/_core/adrs/principles/skills/004-write-article/SKILL.md +8 -0
- package/.xdrs/_core/adrs/principles/skills/005-write-research/SKILL.md +8 -0
- package/.xdrs/_core/adrs/principles/skills/006-write-plan/SKILL.md +1 -1
- package/.xdrs/_core/adrs/principles/skills/007-write-presentation/SKILL.md +1 -1
- package/.xdrs/index.md +2 -0
- package/lib/lint.js +4 -9
- package/lib/lint.test.js +31 -51
- package/package.json +2 -2
|
@@ -174,7 +174,7 @@ If any check fails, revise and re-run this phase before proceeding.
|
|
|
174
174
|
|
|
175
175
|
1. Run the CLI lint utility from the repository root:
|
|
176
176
|
```
|
|
177
|
-
npx -y xdrs-core lint
|
|
177
|
+
npx -y xdrs-core@latest lint
|
|
178
178
|
```
|
|
179
179
|
2. Fix all reported errors before considering the task complete.
|
|
180
180
|
3. Review warnings; fix straightforward ones and note intentional deviations explicitly.
|
|
@@ -125,6 +125,14 @@ If any check fails, revise before continuing.
|
|
|
125
125
|
```
|
|
126
126
|
3. Evaluate whether the scope index at `.xdrs/[scope]/index.md` should be updated to reflect the new skill. If the scope index does not exist, create it following article standards and the scope index rules in `_core-adr-policy-001`.
|
|
127
127
|
|
|
128
|
+
### Phase 7: Verify with Lint
|
|
129
|
+
|
|
130
|
+
1. Run the CLI lint utility from the repository root:
|
|
131
|
+
```
|
|
132
|
+
npx -y xdrs-core@latest lint
|
|
133
|
+
```
|
|
134
|
+
2. Fix all reported errors before considering the task complete.
|
|
135
|
+
|
|
128
136
|
### Constraints
|
|
129
137
|
|
|
130
138
|
- MUST follow the agentskills SKILL.md format from `003-skill-standards` exactly.
|
|
@@ -110,6 +110,14 @@ Rules to apply while drafting:
|
|
|
110
110
|
section.
|
|
111
111
|
4. Evaluate whether the scope index at `.xdrs/[scope]/index.md` should be updated to reflect the new article. If the scope index does not exist, create it following article standards and the scope index rules in `_core-adr-policy-001`.
|
|
112
112
|
|
|
113
|
+
### Phase 7: Verify with Lint
|
|
114
|
+
|
|
115
|
+
1. Run the CLI lint utility from the repository root:
|
|
116
|
+
```
|
|
117
|
+
npx -y xdrs-core@latest lint
|
|
118
|
+
```
|
|
119
|
+
2. Fix all reported errors before considering the task complete.
|
|
120
|
+
|
|
113
121
|
## Examples
|
|
114
122
|
|
|
115
123
|
**Input:** "Write an article about how skills work in this project."
|
|
@@ -247,6 +247,14 @@ If any check fails, revise before continuing.
|
|
|
247
247
|
3. Add back-references from the related Policy, article, or skill when the relationship is important for discovery.
|
|
248
248
|
4. Evaluate whether the scope index at `.xdrs/[scope]/index.md` should be updated to reflect the new research. If the scope index does not exist, create it following article standards and the scope index rules in `_core-adr-policy-001`.
|
|
249
249
|
|
|
250
|
+
### Phase 12: Verify with Lint
|
|
251
|
+
|
|
252
|
+
1. Run the CLI lint utility from the repository root:
|
|
253
|
+
```
|
|
254
|
+
npx -y xdrs-core@latest lint
|
|
255
|
+
```
|
|
256
|
+
2. Fix all reported errors before considering the task complete.
|
|
257
|
+
|
|
250
258
|
## Examples
|
|
251
259
|
|
|
252
260
|
**Input**: "Create research comparing package distribution options for our Policy scopes"
|
package/.xdrs/index.md
CHANGED
|
@@ -19,4 +19,6 @@ Defines how XDRS framework work
|
|
|
19
19
|
|
|
20
20
|
### _local (reserved)
|
|
21
21
|
|
|
22
|
+
_local scope is the default scope for new xdrs and might override other scope decisions. These decisions are local and are not supposed to be shared in other contexts.
|
|
23
|
+
|
|
22
24
|
Read _local scope index at `_local/index.md` when it exists.
|
package/lib/lint.js
CHANGED
|
@@ -791,12 +791,6 @@ function lintOrphanAssets(assetsDir, documentPaths, xdrsRoot, errors) {
|
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
-
if (assetTree.directories.length > 0 && assetTree.files.length <= 10) {
|
|
795
|
-
for (const directoryPath of assetTree.directories) {
|
|
796
|
-
errors.push(`.assets directory must be flat unless it already contains more than 10 files: ${toDisplayPath(directoryPath)}`);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
|
|
800
794
|
const repoRoot = path.dirname(xdrsRoot);
|
|
801
795
|
const referencedAssets = new Set();
|
|
802
796
|
|
|
@@ -844,9 +838,10 @@ function lintSlideFile(filePath, documentPaths, xdrsRoot, errors) {
|
|
|
844
838
|
if (!fm.present) {
|
|
845
839
|
errors.push(`Slide file must start with a YAML frontmatter block containing marp: true: ${toDisplayPath(filePath)}`);
|
|
846
840
|
} else {
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
|
|
841
|
+
const frontmatterBody = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)[1];
|
|
842
|
+
const firstKey = frontmatterBody.trimStart().split(/\r?\n/)[0];
|
|
843
|
+
if (!/^marp:\s*true$/.test(firstKey)) {
|
|
844
|
+
errors.push(`Slide frontmatter must include marp: true as the first key: ${toDisplayPath(filePath)}`);
|
|
850
845
|
}
|
|
851
846
|
}
|
|
852
847
|
|
package/lib/lint.test.js
CHANGED
|
@@ -721,8 +721,8 @@ test('reports unexpected directories inside a skill package', () => {
|
|
|
721
721
|
expect(result.errors.join('\n')).toContain('extras');
|
|
722
722
|
});
|
|
723
723
|
|
|
724
|
-
test('
|
|
725
|
-
const workspaceRoot = createWorkspace('asset-subdir-
|
|
724
|
+
test('allows nested directories in .assets', () => {
|
|
725
|
+
const workspaceRoot = createWorkspace('asset-subdir-allowed', {
|
|
726
726
|
'.xdrs/index.md': rootIndex(),
|
|
727
727
|
'.xdrs/_local/index.md': '# _local Scope Overview\n\nOverview.\n\n[ADRs](adrs/index.md)\n',
|
|
728
728
|
'.xdrs/_local/adrs/index.md': localAdrIndex([
|
|
@@ -738,64 +738,19 @@ test('reports nested directories in .assets when it has 10 files or fewer', () =
|
|
|
738
738
|
'',
|
|
739
739
|
'## Context and Problem Statement',
|
|
740
740
|
'',
|
|
741
|
-
'See .',
|
|
741
|
+
'See .',
|
|
742
742
|
'',
|
|
743
743
|
'## Decision Outcome',
|
|
744
744
|
'',
|
|
745
745
|
'Test decision outcome.',
|
|
746
746
|
''
|
|
747
747
|
].join('\n'),
|
|
748
|
-
'.xdrs/_local/adrs/principles/.assets/used.png': Buffer.alloc(0),
|
|
749
|
-
'.xdrs/_local/adrs/principles/.assets/grouped/extra.png': Buffer.alloc(0),
|
|
750
|
-
});
|
|
751
|
-
|
|
752
|
-
const result = lintWorkspace(workspaceRoot);
|
|
753
|
-
|
|
754
|
-
expect(result.errors.join('\n')).toContain('.assets directory must be flat unless it already contains more than 10 files');
|
|
755
|
-
expect(result.errors.join('\n')).toContain('.assets/grouped');
|
|
756
|
-
});
|
|
757
|
-
|
|
758
|
-
test('allows nested directories in .assets when it has more than 10 files', () => {
|
|
759
|
-
const workspaceRoot = createWorkspace('asset-subdir-large-enough', {
|
|
760
|
-
'.xdrs/index.md': rootIndex(),
|
|
761
|
-
'.xdrs/_local/index.md': '# _local Scope Overview\n\nOverview.\n\n[ADRs](adrs/index.md)\n',
|
|
762
|
-
'.xdrs/_local/adrs/index.md': localAdrIndex([
|
|
763
|
-
'- [001-main](principles/001-main.md) - Main decision'
|
|
764
|
-
]),
|
|
765
|
-
'.xdrs/_local/adrs/principles/001-main.md': [
|
|
766
|
-
'---',
|
|
767
|
-
'name: _local-adr-policy-001-main-decision',
|
|
768
|
-
'description: Test XDRS element',
|
|
769
|
-
'---',
|
|
770
|
-
'',
|
|
771
|
-
'# _local-adr-policy-001: Main decision',
|
|
772
|
-
'',
|
|
773
|
-
'## Context and Problem Statement',
|
|
774
|
-
'',
|
|
775
|
-
'See .',
|
|
776
|
-
'',
|
|
777
|
-
'## Decision Outcome',
|
|
778
|
-
'',
|
|
779
|
-
'Test decision outcome.',
|
|
780
|
-
''
|
|
781
|
-
].join('\n'),
|
|
782
|
-
'.xdrs/_local/adrs/principles/.assets/used.png': Buffer.alloc(0),
|
|
783
|
-
'.xdrs/_local/adrs/principles/.assets/01.png': Buffer.alloc(0),
|
|
784
|
-
'.xdrs/_local/adrs/principles/.assets/02.png': Buffer.alloc(0),
|
|
785
|
-
'.xdrs/_local/adrs/principles/.assets/03.png': Buffer.alloc(0),
|
|
786
|
-
'.xdrs/_local/adrs/principles/.assets/04.png': Buffer.alloc(0),
|
|
787
|
-
'.xdrs/_local/adrs/principles/.assets/05.png': Buffer.alloc(0),
|
|
788
|
-
'.xdrs/_local/adrs/principles/.assets/06.png': Buffer.alloc(0),
|
|
789
|
-
'.xdrs/_local/adrs/principles/.assets/07.png': Buffer.alloc(0),
|
|
790
|
-
'.xdrs/_local/adrs/principles/.assets/08.png': Buffer.alloc(0),
|
|
791
|
-
'.xdrs/_local/adrs/principles/.assets/09.png': Buffer.alloc(0),
|
|
792
|
-
'.xdrs/_local/adrs/principles/.assets/10.png': Buffer.alloc(0),
|
|
793
|
-
'.xdrs/_local/adrs/principles/.assets/grouped/11.png': Buffer.alloc(0),
|
|
748
|
+
'.xdrs/_local/adrs/principles/.assets/grouped/used.png': Buffer.alloc(0),
|
|
794
749
|
});
|
|
795
750
|
|
|
796
751
|
const result = lintWorkspace(workspaceRoot);
|
|
797
752
|
|
|
798
|
-
expect(result.errors.join('\n')).not.toContain('.assets directory must be flat
|
|
753
|
+
expect(result.errors.join('\n')).not.toContain('.assets directory must be flat');
|
|
799
754
|
});
|
|
800
755
|
|
|
801
756
|
function teamAdrIndex(entries) {
|
|
@@ -1346,7 +1301,32 @@ test('reports slide file missing marp: true in frontmatter', () => {
|
|
|
1346
1301
|
|
|
1347
1302
|
const result = lintWorkspace(workspaceRoot);
|
|
1348
1303
|
|
|
1349
|
-
expect(result.errors.join('\n')).toContain('Slide frontmatter must include marp: true');
|
|
1304
|
+
expect(result.errors.join('\n')).toContain('Slide frontmatter must include marp: true as the first key');
|
|
1305
|
+
});
|
|
1306
|
+
|
|
1307
|
+
test('reports slide file with marp: true not as the first frontmatter key', () => {
|
|
1308
|
+
const workspaceRoot = createWorkspace('slide-marp-not-first', {
|
|
1309
|
+
'.xdrs/index.md': rootIndex(),
|
|
1310
|
+
'.xdrs/_local/adrs/index.md': localAdrIndex([
|
|
1311
|
+
'- [001-main](principles/001-main.md) - Main decision'
|
|
1312
|
+
]),
|
|
1313
|
+
'.xdrs/_local/adrs/principles/001-main.md': xdrDocument('Body.\n\n[Slides](.assets/001-main-slides.md)'),
|
|
1314
|
+
'.xdrs/_local/adrs/principles/.assets/001-main-slides.md': [
|
|
1315
|
+
'---',
|
|
1316
|
+
'theme: default',
|
|
1317
|
+
'marp: true',
|
|
1318
|
+
'---',
|
|
1319
|
+
'',
|
|
1320
|
+
'# Slides',
|
|
1321
|
+
'',
|
|
1322
|
+
'[Parent](../001-main.md)',
|
|
1323
|
+
''
|
|
1324
|
+
].join('\n'),
|
|
1325
|
+
});
|
|
1326
|
+
|
|
1327
|
+
const result = lintWorkspace(workspaceRoot);
|
|
1328
|
+
|
|
1329
|
+
expect(result.errors.join('\n')).toContain('Slide frontmatter must include marp: true as the first key');
|
|
1350
1330
|
});
|
|
1351
1331
|
|
|
1352
1332
|
test('reports slide file without any frontmatter', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xdrs-core",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.2",
|
|
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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"jest": "^29.7.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"filedist": "^0.34.
|
|
33
|
+
"filedist": "^0.34.2",
|
|
34
34
|
"ignore": "^7.0.5",
|
|
35
35
|
"minimatch": "^10.2.5"
|
|
36
36
|
},
|