import type { EvidenceType } from "./tasks.js"; import type { ContextBudgetMetadata } from "./context.js"; export type SkillLoadBudget = "small" | "normal" | "large"; export type SkillRenderTarget = "generic" | "claude" | "cursor" | "codex" | "vscode" | "windsurf"; export interface Skill { id: string; name: string; summary: string; triggers: string[]; roles: string[]; capabilities: string[]; riskAreas: string[]; sourceGroups: string[]; entry: string; assets: string[]; evidence: EvidenceType[]; loadBudget: SkillLoadBudget; instructions: string[]; } export interface SkillPlanItem { skill: Skill; score: number; rationale: string[]; } export interface SkillPlan { taskId: string; selected: SkillPlanItem[]; skipped: SkillPlanItem[]; sourceGroups: string[]; } export interface RuntimeSkillPlanRequest { prompt: string; role?: string; phase?: string; risks?: string[]; paths?: string[]; acceptanceCriteria?: string[]; evidence?: EvidenceType[]; } export interface SkillValidationReport { valid: boolean; errors: string[]; warnings: string[]; } export interface CollaborationFlowStep { from: string; to: string; purpose: string; requiredContext: string[]; requiredArtifacts: string[]; exitCriteria: string[]; } export interface CollaborationFlow { id: string; name: string; summary: string; triggers: string[]; roles: string[]; riskAreas: string[]; requiredContext: string[]; requiredArtifacts: string[]; exitCriteria: string[]; optionalReviewers: string[]; steps: CollaborationFlowStep[]; } export interface CollaborationFlowRecommendation { flow: CollaborationFlow; score: number; rationale: string[]; missingArtifacts: string[]; requiredHandoffFields: string[]; optionalReviewers: string[]; } export interface WorkflowTemplate { id: string; name: string; summary: string; triggers: string[]; roles: string[]; riskAreas: string[]; inputs: string[]; outputs: string[]; evidenceRequirements: EvidenceType[]; gates: string[]; compatibleSkills: string[]; steps: string[]; } export interface WorkflowTemplateSelection { template: WorkflowTemplate; score: number; rationale: string[]; missingEvidence: EvidenceType[]; } export interface RenderedWorkflowTemplate { target: SkillRenderTarget; taskId?: string; selected: WorkflowTemplateSelection[]; content: string; contextBudget?: ContextBudgetMetadata; } export interface PhasePlaybook { phase: string; path: string; content: string; missing: boolean; warning?: string; } export interface AgentLessonInput { taskId?: string; actor: string; operation: string; failedAction: string; errorSignature: string; rootCause: string; fix: string; prevention: string; appliesTo: string[]; verifiedBy: string[]; } export interface AgentLesson extends AgentLessonInput { id: string; timestamp: string; archivedAt?: string; archiveReason?: string; } export type MemoryHookPoint = "before_plan" | "before_implementation" | "before_handoff" | "before_final" | "after_failure"; export interface MemoryLessonSnippet { type: "lesson"; score: number; operation: string; errorSignature: string; fix: string; prevention: string; appliesTo: string[]; taskId?: string; timestamp: string; } export interface MemoryPromptSnippet { type: "prompt"; score: number; file: string; artifact: string; summary: string; } export interface MemorySectionReport { section: "lessons" | "prompts"; includedCount: number; omittedCount: number; reason: string; } export interface MemoryPacket { taskId?: string; role?: string; hook: MemoryHookPoint; queryTerms: string[]; tokenBudget: number; estimatedTokens: number; lessons: MemoryLessonSnippet[]; prompts: MemoryPromptSnippet[]; sections: MemorySectionReport[]; redaction: { applied: boolean; patterns: string[]; }; }