export const WORKFLOW_SKILL_DEFINITIONS = [
    {
        name: 'implement-spec',
        description: 'Implement a SPEC from draft to done following the SDD workflow.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Glob', 'Grep'],
        triggers: ['planu/specs/**/*.md'],
        templateBody: `# implement-spec

Implement a SPEC from draft to done.

## Steps

1. Read the spec fully — understand all acceptance criteria.
2. Update \`status: implementing\` in spec frontmatter.
3. Implement each file in the order listed in the spec's Technical section.
4. Run typecheck: \`{typecheck_cmd}\`
5. Run tests: \`{test_cmd}\`
6. Fix all failures before committing.
7. Commit: \`feat(spec-ID): description\`
8. Update spec \`status: done\` + add \`completedAt\`.

## Commands

- Typecheck: \`{typecheck_cmd}\`
- Tests: \`{test_cmd}\`
- Install: \`{package_manager} install\`

## Rules

- Never skip a failing test.
- Never commit if typecheck fails.
- One commit per spec.
`,
    },
    {
        name: 'new-feature',
        description: 'Full SDD cycle: idea → spec → implement → validate.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Glob', 'Grep'],
        templateBody: `# new-feature

Full SDD lifecycle for a new feature.

## Steps

1. Capture the idea with \`capture_idea\`.
2. Promote to spec with \`create_spec\`.
3. Challenge with \`challenge_spec\` — harden criteria.
4. Check readiness with \`check_readiness\`.
5. Approve spec.
6. Implement (see \`implement-spec\` skill).
7. Run: \`{test_cmd}\`
8. Validate: \`validate\` tool.
9. Mark done.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
- Package manager: \`{package_manager}\`
`,
    },
    {
        name: 'resume-session',
        description: 'Resume work after a context switch.',
        allowedTools: ['Read', 'Bash', 'Glob'],
        templateBody: `# resume-session

Resume work after a context switch or new Claude Code session.

## Steps

1. Read \`planu/session-context.md\` for current state.
2. Run \`git status\` — check for uncommitted changes.
3. Run \`git log --oneline -10\` — see recent commits.
4. Check open PRs: \`gh pr list --state open --author @me\`
5. List in-progress specs: \`list_specs\` filtered by status.
6. Resume the highest-priority in-progress spec.

## Commands

- Status: \`git status\`
- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'review-and-merge',
        description: 'Multi-teammate code review + merge workflow.',
        allowedTools: ['Bash', 'Read'],
        templateBody: `# review-and-merge

Multi-teammate code review and merge.

## Steps

1. Create PR: \`gh pr create\`
2. Launch two Opus review agents in parallel (correctness + security).
3. Fix all critical findings.
4. Push fixes.
5. Merge when approved.
6. Delete branch.

## Commands

- Run tests before PR: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
- Install: \`{package_manager} install\`
`,
    },
    {
        name: 'spec-health',
        description: 'Run health check and auto-fix spec docs.',
        allowedTools: ['Read', 'Write', 'Edit'],
        triggers: ['planu/specs/**/*.md'],
        templateBody: `# spec-health

Run health check and auto-fix spec documentation.

## Steps

1. Run \`health_check_all\` — identify broken specs.
2. Run \`heal_spec_docs\` — auto-fix placeholder paths.
3. Run \`run_spec_lint\` — check spec quality.
4. Fix remaining issues manually.
5. Commit fixes.

## Commands

- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'parallel-safe',
        description: 'Generate parallel orchestration plan for independent workstreams.',
        allowedTools: ['Read', 'Write'],
        templateBody: `# parallel-safe

Generate a parallel-safe orchestration plan.

## Steps

1. Run \`check_parallel_safety\` on the spec set.
2. Identify file ownership boundaries.
3. Generate teammate prompts with \`generate_teammate_prompt\`.
4. Launch parallel agents.
5. Synthesize and review results.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'release',
        description: 'Version bump + publish to npm.',
        allowedTools: ['Bash', 'Read', 'Write', 'Edit'],
        templateBody: `# release

Version bump and npm publish workflow.

## Steps

1. Ensure all tests pass: \`{test_cmd}\`
2. Run typecheck: \`{typecheck_cmd}\`
3. Run \`create_release\` — bump version + generate changelog.
4. Build: \`{build_cmd}\`
5. Publish: \`{package_manager} publish\`
6. Push tag: \`git push --tags\`

## Commands

- Tests: \`{test_cmd}\`
- Build: \`{build_cmd}\`
- Publish: \`{package_manager} publish\`
`,
    },
    {
        name: 'update-docs',
        description: 'Sync website/ and README with new tools and features.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Glob'],
        triggers: ['src/tools/**/*.ts'],
        templateBody: `# update-docs

Sync documentation with new tools and features.

## Steps

1. List new tools added since last release.
2. Update README tool count and descriptions.
3. Update website/ pages if applicable.
4. Run \`generate_docs_site\` if site generator is available.
5. Commit: \`docs(planu): update docs for vX.Y.Z\`

## Commands

- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'create-skill',
        description: 'Scaffold a new Planu skill file.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash'],
        triggers: ['.claude/skills/**/*.md'],
        templateBody: `# create-skill

Scaffold a new Planu skill.

## Steps

1. Identify the workflow to capture.
2. Create \`.claude/skills/{skill-name}/skill.md\` with YAML frontmatter.
3. Write clear step-by-step instructions.
4. Add \`triggers\` and \`allowedTools\` frontmatter fields.
5. Test the skill by running it.
6. Register via \`reconcile_skills\`.

## Commands

- Typecheck: \`{typecheck_cmd}\`
- Tests: \`{test_cmd}\`
`,
    },
    {
        name: 'validate-spec',
        description: 'Run the validate tool against an implemented spec.',
        allowedTools: ['Read'],
        triggers: ['planu/specs/**/*.md'],
        templateBody: `# validate-spec

Validate spec compliance after implementation.

## Steps

1. Run \`validate\` tool on the implemented spec.
2. Review each unmet criterion.
3. Fix gaps in implementation.
4. Re-run \`{test_cmd}\` to confirm fixes.
5. Re-run \`validate\` — all criteria must pass.
6. Mark spec as done.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'tdd-cycle',
        description: 'Red-green-refactor TDD loop.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash'],
        triggers: ['tests/**/*.test.ts', 'src/**/*.ts'],
        templateBody: `# tdd-cycle

Red-green-refactor TDD loop.

## Steps

1. Write a failing test first (RED).
2. Run: \`{test_cmd}\` — confirm failure.
3. Write minimum code to pass (GREEN).
4. Run: \`{test_cmd}\` — confirm pass.
5. Refactor for clarity (REFACTOR).
6. Run: \`{test_cmd}\` again — still green.
7. Repeat for each criterion.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'security-review',
        description: 'Run security scan on changes before merge.',
        allowedTools: ['Read', 'Bash', 'Glob', 'Grep'],
        templateBody: `# security-review

Run a security review on changes.

## Steps

1. Run \`security_scan\` on changed files.
2. Review findings: critical → fix now; medium → evaluate; low → note.
3. Check authorization logic: ownership validation, not just auth.
4. Check Zod/input validation on all entry points.
5. Fix all critical issues.
6. Re-run \`{test_cmd}\` to confirm no regressions.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'lessons-learned',
        description: 'Capture lessons after a bug or rollback.',
        allowedTools: ['Read', 'Write'],
        templateBody: `# lessons-learned

Capture lessons after a bug or rollback.

## Steps

1. Describe what happened (root cause).
2. Run \`log_lesson\` with the insight.
3. Update MEMORY.md if it's a permanent pattern.
4. Add a test to prevent regression: \`{test_cmd}\`
5. Update relevant skill files if the workflow needs changing.

## Commands

- Tests: \`{test_cmd}\`
`,
    },
    {
        name: 'capture-learning',
        description: 'Route a new workflow pattern to the correct skill file.',
        allowedTools: ['Read', 'Write', 'Edit'],
        triggers: ['.claude/skills/**/*.md', '~/.claude/CLAUDE.md'],
        templateBody: `# capture-learning

Route a new workflow pattern to the correct skill or rule file.

## Steps

1. Identify the new pattern or lesson.
2. Determine target: skill file, CLAUDE.md rule, or MEMORY.md.
3. If skill: update \`.claude/skills/<skill-name>/skill.md\`.
4. If rule: update \`~/.claude/rules/<category>.md\`.
5. If permanent memory: update \`MEMORY.md\`.
6. Commit the updated file.

## Commands

- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'research-specs',
        description: 'Research specs before starting a new implementation phase.',
        allowedTools: ['Read', 'Glob', 'Grep'],
        triggers: ['planu/specs/**/*.md'],
        templateBody: `# research-specs

Research specs before starting a new phase.

## Steps

1. Run \`list_specs\` — review all approved/in-progress specs.
2. Run \`analyze_spec_dependencies\` — understand ordering.
3. Run \`critical_path_analyzer\` — identify blockers.
4. Check for dependency specs that need to land first.
5. Prioritize and plan implementation order.

## Commands

- Typecheck: \`{typecheck_cmd}\`
- Package manager: \`{package_manager}\`
`,
    },
    {
        name: 'validate-spec-integrity',
        description: 'Check spec file integrity before a phase begins.',
        allowedTools: ['Read', 'Glob'],
        triggers: ['planu/specs/**/*.md'],
        templateBody: `# validate-spec-integrity

Validate spec file integrity before starting a phase.

## Steps

1. Run \`run_spec_lint\` — check for lint violations.
2. Run \`spec_health_check\` — detect broken references.
3. Check frontmatter completeness: id, title, status, criteria.
4. Verify all referenced files exist.
5. Fix issues before implementation begins.

## Commands

- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'update-readme',
        description: 'Update README when new tools are added.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash'],
        triggers: ['src/tools/**/*.ts', 'README.md'],
        templateBody: `# update-readme

Update README when new tools are added.

## Steps

1. Count new tools: \`grep -r "name:" src/tools --include="*.ts" | wc -l\`
2. Update tool count in README header.
3. Add new tools to the appropriate section.
4. Update CHANGELOG if not already done.
5. Commit: \`docs: update README for new tools\`

## Commands

- Typecheck: \`{typecheck_cmd}\`
`,
    },
    {
        name: 'mcp-builder',
        description: 'Design and implement an MCP tool end-to-end.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Glob', 'Grep'],
        triggers: ['src/tools/**/*.ts'],
        templateBody: `# mcp-builder

Design and implement an MCP tool.

## Steps

1. Create spec for the tool (use \`create_spec\`).
2. Define input schema (Zod) in \`src/tools/<tool-name>/schema.ts\`.
3. Implement handler in \`src/tools/<tool-name>/handler.ts\`.
4. Register tool in \`src/tools/index.ts\`.
5. Write unit + integration tests.
6. Run: \`{test_cmd}\`
7. Run: \`{typecheck_cmd}\`
8. Validate spec compliance.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
- Install: \`{package_manager} install\`
`,
    },
    {
        name: 'autonomous-sdd',
        description: 'Full autonomous spec-to-merge cycle without interruptions.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Glob', 'Grep'],
        templateBody: `# autonomous-sdd

Full autonomous SDD cycle: spec → implement → validate → merge.

## Steps

1. Create spec → challenge → check readiness → approve.
2. Implement all files in spec order.
3. Run: \`{typecheck_cmd}\` — fix all errors.
4. Run: \`{test_cmd}\` — fix all failures.
5. Run \`validate\` — confirm all criteria met.
6. Create PR + run dual Opus review.
7. Fix critical findings.
8. Merge.
9. Mark spec done.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
- Build: \`{build_cmd}\`
`,
    },
    {
        name: 'brainstorm',
        description: 'Structured idea exploration session before writing a spec.',
        allowedTools: ['Read', 'Write'],
        templateBody: `# brainstorm

Structured idea exploration before spec creation.

## Steps

1. Define the problem clearly in 1-2 sentences.
2. Explore 3+ alternative approaches.
3. Evaluate trade-offs: complexity, risk, effort.
4. Choose the best approach.
5. Capture insights with \`capture_idea\`.
6. Promote to spec with \`create_spec\`.

## Outcome

- A clear problem statement
- Chosen approach with rationale
- Initial acceptance criteria

## Commands

- Package manager: \`{package_manager}\`
`,
    },
    {
        name: 'finishing-branch',
        description: 'Finalize branch before merge: lint, tests, docs.',
        allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Glob'],
        templateBody: `# finishing-branch

Finalize a branch before merging.

## Checklist

1. All tests pass: \`{test_cmd}\`
2. Typecheck clean: \`{typecheck_cmd}\`
3. No uncommitted changes: \`git status\`
4. Branch is up to date: \`git fetch && git rebase origin/main\`
5. PR created: \`gh pr create\`
6. Dual Opus code review done.
7. All critical findings fixed.
8. Ready to merge.

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
- Install: \`{package_manager} install\`
`,
    },
    {
        name: 'debug-session',
        description: 'Systematic debugging workflow for bugs and test failures.',
        allowedTools: ['Read', 'Bash', 'Glob', 'Grep', 'Write', 'Edit'],
        triggers: ['tests/**/*.test.ts', 'src/**/*.ts'],
        templateBody: `# debug-session

Systematic debugging for bugs and test failures.

## Steps

1. Reproduce the issue: \`{test_cmd}\` or manual steps.
2. Identify the failing assertion or error message.
3. Trace the call stack — find the root cause.
4. Propose a fix hypothesis.
5. Implement the fix.
6. Run: \`{test_cmd}\` — confirm fix.
7. Run: \`{typecheck_cmd}\` — no new errors.
8. Add a regression test.
9. Commit: \`fix: <root cause summary>\`

## Commands

- Tests: \`{test_cmd}\`
- Typecheck: \`{typecheck_cmd}\`
`,
    },
];
//# sourceMappingURL=skill-definitions.js.map