/**
 * skill-author/test-template.mjs — C4 structural-test renderer.
 *
 * Pure function. Returns the TypeScript source of a per-skill structural test
 * file mirroring packages/framework/src/__tests__/apt-design-skill-structure.test.ts.
 *
 * The generated test is intentionally minimal: it pins the contract basics
 * (frontmatter name, four required section tags) so the skill immediately has
 * a drift-detector after scaffold. Authors can extend the generated test with
 * skill-specific assertions once the SKILL.md body is fleshed out.
 */
/**
 * @param {{ name: string }} opts — name is the kebab slug AFTER `apt:`
 * @returns {string} TypeScript source
 */
export function renderStructuralTest({ name }) {
    const fullName = `apt:${name}`;
    const skillDir = `apt-${name}`;
    const describeTitle = `${fullName} SKILL.md structure`;
    return `/**
 * apt-${name}-skill-structure.test.ts — structural test for the ${fullName} skill.
 *
 * Generated by \`apt-tools author-skill ${name}\`. Pins the canonical SKILL.md
 * contract (C4) at author-time: frontmatter name + the four required section
 * tags. Extend with skill-specific assertions as the SKILL.md body is filled in.
 */

import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, it } from 'vitest'

// __dirname = packages/framework/src/__tests__ → ../.. = packages/framework
const FRAMEWORK_ROOT = resolve(__dirname, '..', '..')
const SKILL_PATH = resolve(FRAMEWORK_ROOT, 'skills/${skillDir}/SKILL.md')

describe('${describeTitle}', () => {
	it('exists and has the expected frontmatter name', () => {
		const contents = readFileSync(SKILL_PATH, 'utf-8')
		expect(contents).toMatch(/^---\\n[\\s\\S]*?name:\\s*${fullName}/m)
	})

	it('contains <objective>, <your_environment>, <state_files>, <process> sections', () => {
		const contents = readFileSync(SKILL_PATH, 'utf-8')
		expect(contents).toContain('<objective>')
		expect(contents).toContain('</objective>')
		expect(contents).toContain('<your_environment>')
		expect(contents).toContain('</your_environment>')
		expect(contents).toContain('<state_files>')
		expect(contents).toContain('</state_files>')
		expect(contents).toContain('<process>')
		expect(contents).toContain('</process>')
	})
})
`;
}
//# sourceMappingURL=test-template.mjs.map