import assert from 'node:assert/strict' import { existsSync, readFileSync } from 'node:fs' import { dirname, join } from 'node:path' import test from 'node:test' import { fileURLToPath } from 'node:url' const here = dirname(fileURLToPath(import.meta.url)) const root = join(here, '..', '..') const agentsSkills = join(root, '.agents', 'skills') const NAMES = [ 'openspec-apply-change', 'openspec-archive-change', 'openspec-explore', 'openspec-propose', 'openspec-sync-specs', 'openspec-update-change', ] test('repository ships six agents skills for DSH', () => { assert.equal(readFileSync(join(agentsSkills, '.openspec-target'), 'utf8').trim(), 'agents') for (const name of NAMES) { const file = join(agentsSkills, name, 'SKILL.md') assert.ok(existsSync(file), `${name}/SKILL.md is missing`) const text = readFileSync(file, 'utf8') assert.match(text, new RegExp(`^name: ${name}$`, 'm'), `${name}: frontmatter name must match the dir`) assert.match(text, /description: .*openspec/i, `${name}: description must mention openspec`) } })