import type { SkillCursor } from '../skill/schema';

export type Platform = 'claude-code' | 'gemini-cli' | 'codex' | 'cursor';

export const VALID_PLATFORMS: Platform[] = ['claude-code', 'gemini-cli', 'codex', 'cursor'];

export interface SkillArg {
  name: string;
  description: string;
  required: boolean;
}

export interface SlashCommandSpec {
  name: string;
  namespace: string;
  fullName: string;
  description: string;
  version: string;
  cognitiveMode?: string;
  tools: string[];
  args: SkillArg[];
  skillYamlName: string;
  sourceDir: string;
  skillsBaseDir: string;
  source?: 'project' | 'community' | 'global';
  commandName?: string;
  /** Custom namespace from skill.yaml command_namespace (e.g., 'acme' → /acme:ui) */
  customNamespace?: string;
  cursor?: SkillCursor;

  prompt: {
    context: string;
    objective: string;
    executionContext: string;
    process: string;
  };
}

/**
 * For the `cursor` platform, decides whether output is rendered as Cursor
 * rules (`.mdc` with description/globs/alwaysApply — for `~/.cursor/rules/`)
 * or as Cursor plugin commands (`.md` with name/description — for
 * `<plugin>/commands/`). Defaults to `rules` for backward compatibility
 * with `harness setup`.
 */
export type CursorRenderMode = 'rules' | 'commands';

export interface GenerateOptions {
  platforms: Platform[];
  global: boolean;
  includeGlobal: boolean;
  output?: string;
  skillsDir: string;
  dryRun: boolean;
  yes: boolean;
  cursorMode?: CursorRenderMode;
}

export const GENERATED_HEADER_CLAUDE =
  '<!-- Generated by harness generate-slash-commands. Do not edit. -->';
export const GENERATED_HEADER_GEMINI =
  '# Generated by harness generate-slash-commands. Do not edit.';
export const GENERATED_HEADER_CURSOR =
  '<!-- Generated by harness generate-slash-commands. Do not edit. -->';
export const GENERATED_HEADER_CODEX =
  '<!-- Generated by harness generate-slash-commands. Do not edit. -->';
