dsh-project-dept 1.0.1 → 1.0.3
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/README.md +5 -3
- package/README.zh.md +5 -3
- package/index.js +26 -12
- package/locale/en.json +4 -2
- package/locale/zh.json +4 -2
- package/package.json +2 -2
- package/skills/loop-ops/SKILL.md +124 -0
- package/skills/project-dept/README.md +366 -8
- package/skills/project-dept/README_EN.md +436 -7
- package/skills/project-dept/SKILL.md +10 -21
- package/skills/project-dept/evals/evals.json +252 -7
- package/skills/project-dept/manifest.yaml +29 -3
- package/skills/project-dept/references/blind-review.md +35 -0
- package/skills/project-dept/references/project-scaffold.md +10 -4
- package/skills/project-dept/scripts/check_review_form.py +649 -0
- package/skills/project-dept/scripts/check_skill.py +943 -0
- package/skills/project-dept/scripts/dept_gate.py +90 -7
- package/skills/project-dept/scripts/run_evals.py +1344 -0
- package/skills/project-dept/static/core/output-contract.md +7 -1
- package/skills/project-dept/static/core/workflow.md +3 -2
- package/skills/project-dept/tests/test_check_review_form.py +453 -0
- package/skills/project-dept/tests/test_check_skill.py +620 -0
- package/skills/project-dept/tests/test_dept_gate_baseline.py +229 -0
- package/skills/project-dept/tests/test_dept_gate_json.py +116 -0
- package/skills/project-dept/tests/test_run_evals.py +644 -0
- package/tests/bundle.test.js +29 -9
package/tests/bundle.test.js
CHANGED
|
@@ -36,7 +36,7 @@ equal('skill name', skill.name, 'project-dept');
|
|
|
36
36
|
check('description is routing-grade', typeof skill.description === 'string' && skill.description.length > 60, `len=${skill.description && skill.description.length}`);
|
|
37
37
|
check('body does not carry frontmatter', !skill.content.startsWith('---'), skill.content.slice(0, 20));
|
|
38
38
|
check('body starts with the heading', skill.content.startsWith('# project-dept'), skill.content.slice(0, 24));
|
|
39
|
-
equal('metadata.version from frontmatter', skill.metadata && skill.metadata.version, '1.
|
|
39
|
+
equal('metadata.version from frontmatter', skill.metadata && skill.metadata.version, '1.3.8');
|
|
40
40
|
check('metadata.tags parsed as a list', Array.isArray(skill.metadata && skill.metadata.tags) && skill.metadata.tags.length === 5, JSON.stringify(skill.metadata && skill.metadata.tags));
|
|
41
41
|
check('path points at the shipped SKILL.md', skill.path === join(SKILL_DIR, 'SKILL.md'), skill.path);
|
|
42
42
|
check('resourceBase is the skill directory', skill.resourceBase.kind === 'directory' && skill.resourceBase.path === SKILL_DIR, JSON.stringify(skill.resourceBase));
|
|
@@ -78,6 +78,9 @@ const required = [
|
|
|
78
78
|
'VERIFICATION.md',
|
|
79
79
|
join('scripts', 'dept_gate.py'),
|
|
80
80
|
join('scripts', 'check_doc.py'),
|
|
81
|
+
join('scripts', 'run_evals.py'),
|
|
82
|
+
join('scripts', 'check_review_form.py'),
|
|
83
|
+
join('scripts', 'check_skill.py'),
|
|
81
84
|
join('static', 'core', 'principles.md'),
|
|
82
85
|
join('static', 'core', 'workflow.md'),
|
|
83
86
|
join('static', 'core', 'output-contract.md'),
|
|
@@ -106,14 +109,29 @@ const ctx = {
|
|
|
106
109
|
},
|
|
107
110
|
};
|
|
108
111
|
|
|
112
|
+
const declared = plugin.SKILL_NAMES.slice();
|
|
109
113
|
plugin.apply(ctx);
|
|
110
|
-
equal('apply registers
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
check(
|
|
114
|
+
equal('apply registers every declared skill', registrations.length, declared.length);
|
|
115
|
+
equal('declared skills are shipped', declared.join(','), 'project-dept,loop-ops');
|
|
116
|
+
for (const name of declared) {
|
|
117
|
+
const registered = registrations.find((item) => item.name === name) ?? {};
|
|
118
|
+
const dir = plugin.skillDirOf(name);
|
|
119
|
+
const definition = plugin.loadSkill(dir);
|
|
120
|
+
check(`registered skill "${name}" has a body`, typeof registered.content === 'string' && registered.content.trim().length > 200, String(registered.content || '').slice(0, 20));
|
|
121
|
+
check(`registered skill "${name}" description matches its file`, registered.description === definition.description);
|
|
122
|
+
check(`registered skill "${name}" keeps its resourceBase`, registered.resourceBase && registered.resourceBase.path === dir, JSON.stringify(registered.resourceBase));
|
|
123
|
+
check(`registered skill "${name}" carries metadata.version`, Boolean(registered.metadata && registered.metadata.version), JSON.stringify(registered.metadata));
|
|
124
|
+
const missingOwn = [...definition.content.matchAll(/(?:^|[\s`(])((?:static|references|scripts|tests|evals|agents)\/[A-Za-z0-9._/-]+|manifest\.yaml)/g)]
|
|
125
|
+
.map((match) => match[1].split(/[),。;]/)[0])
|
|
126
|
+
.filter((relative) => relative.endsWith('.md') || relative.endsWith('.py') || relative.endsWith('.json') || relative.endsWith('.yaml'))
|
|
127
|
+
.filter((relative) => !existsSync(join(dir, relative)));
|
|
128
|
+
check(`files declared by "${name}" exist in the bundle`, missingOwn.length === 0, `missing=${missingOwn.join(', ')}`);
|
|
129
|
+
}
|
|
130
|
+
const projectDept = registrations.find((item) => item.name === 'project-dept') ?? {};
|
|
131
|
+
equal('project-dept metadata version', projectDept.metadata && projectDept.metadata.version, '1.3.8');
|
|
132
|
+
const loopOps = registrations.find((item) => item.name === 'loop-ops') ?? {};
|
|
133
|
+
equal('loop-ops metadata version', loopOps.metadata && loopOps.metadata.version, '1.0.0');
|
|
134
|
+
check('loop-ops declares its dependency on project-dept', String(loopOps.metadata && loopOps.metadata.requires) === 'project-dept', JSON.stringify(loopOps.metadata));
|
|
117
135
|
check('apply runs through ctx.effect', effects.length === 1, String(effects.length));
|
|
118
136
|
|
|
119
137
|
let refused = false;
|
|
@@ -127,10 +145,12 @@ check('apply refuses to start without the registry', refused);
|
|
|
127
145
|
const bound = plugin.__test__.DEFAULT_SKILL_DIR;
|
|
128
146
|
check('default skill directory is inside the package', bound === join(ROOT, 'skills', 'project-dept'), bound);
|
|
129
147
|
check('skill directory separator is native', bound.includes(sep), bound);
|
|
148
|
+
check('skillDirOf resolves a bundled skill', plugin.skillDirOf('loop-ops') === join(ROOT, 'skills', 'loop-ops'), plugin.skillDirOf('loop-ops'));
|
|
149
|
+
check('bundle ships the loop-ops SKILL.md', existsSync(join(ROOT, 'skills', 'loop-ops', 'SKILL.md')));
|
|
130
150
|
|
|
131
151
|
// The packaged body must not drift from the SKILL.md the bundle advertises.
|
|
132
152
|
const raw = readFileSync(join(SKILL_DIR, 'SKILL.md'), 'utf8');
|
|
133
|
-
check('shipped SKILL.md
|
|
153
|
+
check('shipped SKILL.md declares the manifest version', raw.includes('version: 1.3.8'), 'frontmatter changed');
|
|
134
154
|
|
|
135
155
|
process.stdout.write(`\n${passed}/${passed + failures.length} passed\n`);
|
|
136
156
|
if (failures.length > 0) {
|