UNPKG

aiwg

Version:

Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo

196 lines 6.61 kB
/** * Example Generation System * * Automatically generates before/after examples demonstrating AI pattern removal * and voice transformation. Integrates with WritingValidationEngine, ContentDiversifier, * and PromptOptimizer to produce high-quality training examples. * * Week 6 Construction Phase Implementation */ import type { WritingValidationEngine } from './validation-engine.js'; import { ContentDiversifier, Voice, Perspective } from './content-diversifier.js'; export interface ExampleGenerationOptions { domain: 'academic' | 'technical' | 'executive' | 'casual'; patternType: 'banned-phrases' | 'formulaic-structures' | 'weak-voice' | 'all'; count: number; includeAnnotations?: boolean; } export interface GeneratedExample { before: string; after: string; changes: Change[]; reasoning: string; domain: string; score: { before: number; after: number; delta: number; }; } export interface Change { type: 'banned-phrase' | 'structure' | 'voice' | 'specificity'; original: string; replacement: string; reasoning: string; } export interface CorpusConfig { topics: string[]; domains: ('academic' | 'technical' | 'executive' | 'casual')[]; patternTypes: ('banned-phrases' | 'formulaic-structures' | 'weak-voice' | 'all')[]; examplesPerTopic: number; } export interface ImprovementAnalysis { totalChanges: number; changesByType: Map<string, number>; avgScoreImprovement: number; topImprovements: Change[]; keyLearnings: string[]; } export interface ComparisonReport { totalExamples: number; avgScoreBefore: number; avgScoreAfter: number; avgDelta: number; commonPatterns: Map<string, number>; bestPerforming: GeneratedExample[]; worstPerforming: GeneratedExample[]; summary: string; } export interface ExamplePair { before: string; after: string; changes: string[]; improvements: string[]; } export interface Example { content: string; voice: Voice; context: string; demonstrates: string[]; } export interface CodeExample { code: string; language: string; voice: Voice; context: string; } export interface Scenario { description: string; perspective: Perspective; useCase: string; voice: Voice; } /** * Core Example Generator class * Week 6: Enhanced with ValidationEngine integration and comprehensive example generation */ export declare class ExampleGenerator { private diversifier; private validator?; constructor(validator?: WritingValidationEngine, diversifier?: ContentDiversifier); /** * Week 6: Generate single before/after example with validation scoring */ generateExample(topic: string, options: ExampleGenerationOptions): Promise<GeneratedExample>; /** * Week 6: Generate multiple examples for a corpus */ generateExampleSet(topics: string[], options: ExampleGenerationOptions): Promise<GeneratedExample[]>; /** * Week 6: Generate domain-specific examples */ generateAcademicExample(topic: string): Promise<GeneratedExample>; generateTechnicalExample(topic: string): Promise<GeneratedExample>; generateExecutiveExample(topic: string): Promise<GeneratedExample>; generateCasualExample(topic: string): Promise<GeneratedExample>; /** * Week 6: Generate pattern-specific examples */ generateBannedPhraseExample(topic: string, phrase: string): Promise<GeneratedExample>; generateFormulicStructureExample(topic: string, structure: string): Promise<GeneratedExample>; /** * Week 6: Batch operations - generate example corpus */ generateExampleCorpus(config: CorpusConfig): Promise<Map<string, GeneratedExample>>; /** * Week 6: Export examples in multiple formats */ exportExamples(examples: GeneratedExample[], format: 'markdown' | 'json' | 'html'): Promise<string>; /** * Week 6: Analyze improvement for single example */ analyzeImprovement(example: GeneratedExample): ImprovementAnalysis; /** * Week 6: Compare multiple examples */ compareExamples(examples: GeneratedExample[]): ComparisonReport; /** * Legacy: Generate before/after example pair */ generateBeforeAfter(topic: string, voice?: Voice): Promise<ExamplePair>; /** * Legacy: Generate diverse examples demonstrating a concept */ generateDiverseExamples(concept: string, count: number): Promise<Example[]>; /** * Legacy: Generate code examples with varying voices */ generateCodeExamples(technology: string, variations?: number): Promise<CodeExample[]>; /** * Legacy: Generate scenarios from different perspectives */ generateScenarios(useCase: string, perspectives?: Perspective[]): Promise<Scenario[]>; /** * Legacy: Generate comparison examples showing different approaches */ generateComparisonExamples(topic: string, approaches: string[]): Promise<{ topic: string; comparisons: Array<{ approach: string; content: string; }>; }>; /** * Legacy: Generate tutorial-style examples */ generateTutorialExample(task: string, steps: string[]): Promise<{ task: string; content: string; }>; /** * Legacy: Generate Q&A style examples */ generateQAExample(topic: string, questionCount?: number): Promise<string>; private generateBeforeContent; private generateBeforeContentWithPhrase; private generateBeforeContentWithStructure; private generateAfterContent; private mapDomainToVoice; private applyDomainTransformations; private removeAIPatterns; private addAuthenticityMarkers; private addSpecificity; private identifyChanges; private generateReasoningFromChanges; private extractKeyLearnings; private generateComparisonSummary; private getBeforeTemplates; private exportAsMarkdown; private exportAsJSON; private exportAsHTML; private escapeHtml; private createMockValidation; private generateAIContent; private generateBaseContent; private generateUseCaseContent; private generateApproachContent; private generateStatementsAboutTopic; private generateCodeExampleForVoice; private identifyImprovements; private identifyDemonstratedPrinciples; /** * Generate diverse scenarios with specific count */ generateDiverseScenarios(useCase: string, count: number): Promise<Scenario[]>; } //# sourceMappingURL=example-generator.d.ts.map