// tools/init-project/skills-writer.ts — Write .claude/skills/ files during init_project
// SPEC-519: Generate compact skill file for dense SDD mode
import { writeFile, mkdir, access } from 'node:fs/promises';
import { join } from 'node:path';
import { assertEnglishOnlyArtifactText } from '../../engine/spec-language/english-only.js';
const COMPACT_SKILL_PATH = '.claude/skills/compact.md';
const COMPACT_SKILL_CONTENT = `# /compact — Dense SDD Mode

For the rest of this session:
- Respond in ≤3 lines unless generating code or spec content
- Format: bullets only, no prose
- Skip all preamble ("I'll now...", "Let me...")
- Skip all trailing summaries
- Abbreviate: spec → S, acceptance criteria → AC, implementation → impl
- File paths: basename only unless disambiguation needed
- Tool results: show only failures and key numbers, skip "all good" confirmations

---

# /ultra-compact — Extreme Dense Mode

For the rest of this session:
- 1-line confirmations only
- Numbers over words (3 specs, 2 failing, $0.02)
- Skip all context — just results
- Code only when explicitly requested

---

# /verbose — Return to Normal Mode

Disable compact/ultra-compact mode. Return to default response style.
`;
/**
 * Write .claude/skills/compact.md only if it does not exist yet.
 * @returns true if the file was created, false if it already existed.
 */
export async function generateCompactSkillIfMissing(projectPath) {
    const skillPath = join(projectPath, COMPACT_SKILL_PATH);
    try {
        await access(skillPath);
        return false; // already exists
    }
    catch {
        const skillsDir = join(projectPath, '.claude/skills');
        await mkdir(skillsDir, { recursive: true });
        assertEnglishOnlyArtifactText(COMPACT_SKILL_CONTENT, 'skill');
        await writeFile(skillPath, COMPACT_SKILL_CONTENT, 'utf-8');
        return true;
    }
}
//# sourceMappingURL=skills-writer.js.map