@dalzoubi/dev-agents-sync 2.0.0 → 2.0.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/package.json
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tests/define-vertical-slice-principle.test.mjs
|
|
3
|
+
*
|
|
4
|
+
* Slice: vertical-slice-guidance
|
|
5
|
+
*
|
|
6
|
+
* Asserts that the "Implementation slices" Q&A item in
|
|
7
|
+
* .agents/skills/define-spec-session.md has been updated to state:
|
|
8
|
+
*
|
|
9
|
+
* 1. Each slice must include all layers needed to demonstrate its outcome
|
|
10
|
+
* end-to-end (vertical slice principle).
|
|
11
|
+
* 2. Each slice must be independently demonstrable, deployable, or testable.
|
|
12
|
+
*
|
|
13
|
+
* These tests FAIL before the implementation change lands and PASS after.
|
|
14
|
+
*
|
|
15
|
+
* Path under test: .agents/skills/define-spec-session.md (relative to repo root)
|
|
16
|
+
* Test runner: node --test (Node built-in, >= 20)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { describe, it, before } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { readFileSync } from 'node:fs';
|
|
22
|
+
import { fileURLToPath } from 'node:url';
|
|
23
|
+
import path from 'node:path';
|
|
24
|
+
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Resolve the file under test relative to this file's location.
|
|
27
|
+
// Repo layout: packages/dev-agents-sync/tests/ -> repo root is 3 levels up.
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
31
|
+
const REPO_ROOT = path.resolve(__dirname, '../../..');
|
|
32
|
+
const SKILL_FILE = path.join(REPO_ROOT, '.agents', 'skills', 'define-spec-session.md');
|
|
33
|
+
|
|
34
|
+
let content;
|
|
35
|
+
|
|
36
|
+
before(() => {
|
|
37
|
+
content = readFileSync(SKILL_FILE, 'utf8');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Criterion 1 — vertical slice principle: all layers required end-to-end
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
describe('define-spec-session.md — vertical slice principle (all layers, end-to-end)', () => {
|
|
45
|
+
it('states that each slice must include all layers needed to demonstrate its outcome end-to-end', () => {
|
|
46
|
+
// The Implementation slices item must explicitly instruct the model that
|
|
47
|
+
// every slice should span all the layers needed to deliver its stated
|
|
48
|
+
// outcome (i.e., it is a vertical slice, not a horizontal layer slice).
|
|
49
|
+
const allLayersEndToEnd =
|
|
50
|
+
/all\s+layers\s+needed/i.test(content) ||
|
|
51
|
+
/end[- ]to[- ]end\s+(?:value|outcome|behavior|demonstration|demonstr)/i.test(content) ||
|
|
52
|
+
/(?:span|include|cover)\s+all\s+(?:required\s+)?layers/i.test(content) ||
|
|
53
|
+
/vertical\s+slice/i.test(content);
|
|
54
|
+
|
|
55
|
+
assert.ok(
|
|
56
|
+
allLayersEndToEnd,
|
|
57
|
+
'define-spec-session.md must state that each slice must include all layers needed to demonstrate its outcome end-to-end',
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// Criterion 2 — independent demonstrability / deployability / testability
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
|
|
66
|
+
describe('define-spec-session.md — each slice independently demonstrable', () => {
|
|
67
|
+
it('states that each slice can be reviewed, deployed, or tested independently', () => {
|
|
68
|
+
// The Implementation slices item must convey that the slice is
|
|
69
|
+
// independently usable — reviewable, deployable, or testable on its own —
|
|
70
|
+
// not merely that it has a name and scope.
|
|
71
|
+
const independentlyDemonstrableOrDeployable =
|
|
72
|
+
/independently\s+(?:demonstrabl|deployabl|reviewabl|testabl)/i.test(content) ||
|
|
73
|
+
/(?:demonstrabl|deployabl|reviewabl|testabl)\w*\s+independently/i.test(content) ||
|
|
74
|
+
/(?:reviewed|deployed|tested)\s+independently/i.test(content) ||
|
|
75
|
+
/independently\s+(?:reviewed|deployed|tested)/i.test(content);
|
|
76
|
+
|
|
77
|
+
assert.ok(
|
|
78
|
+
independentlyDemonstrableOrDeployable,
|
|
79
|
+
'define-spec-session.md must state that each slice can be reviewed, deployed, or tested independently',
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
});
|