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
65 lines • 1.88 kB
TypeScript
/**
* ID Extractor - Extract requirement IDs from various file types
* Supports: Use Cases (UC-xxx), NFRs (NFR-XXX-xxx), User Stories (US-xxx), Features (F-xxx)
*/
export interface RequirementId {
id: string;
type: 'use-case' | 'nfr' | 'user-story' | 'feature' | 'acceptance-criteria';
lineNumber?: number;
context?: string;
}
export interface ExtractionResult {
filePath: string;
ids: RequirementId[];
extractionTime: number;
}
/**
* IDExtractor - Extract requirement IDs from code, tests, and documentation
*/
export declare class IDExtractor {
private readonly patterns;
private readonly combinedPattern;
/**
* Extract IDs from a single line of text
*/
extractFromLine(line: string, lineNumber?: number): RequirementId[];
/**
* Extract IDs from file content
*/
extractFromContent(content: string, _filePath?: string): RequirementId[];
/**
* Extract IDs from multiple files (parallel processing)
*/
extractFromFiles(files: Map<string, string>): Promise<Map<string, ExtractionResult>>;
/**
* Determine requirement type from ID pattern
*/
private determineType;
/**
* Extract context around the ID (up to 50 characters before/after)
*/
private extractContext;
/**
* Validate ID format
*/
isValidId(id: string): boolean;
/**
* Parse ID to extract components (e.g., NFR-PERF-001 -> {prefix: 'NFR', category: 'PERF', number: '001'})
*/
parseId(id: string): {
prefix: string;
category?: string;
number: string;
} | null;
/**
* Get all patterns for testing/validation
*/
getPatterns(): {
useCase: RegExp;
nfr: RegExp;
userStory: RegExp;
feature: RegExp;
acceptanceCriteria: RegExp;
};
}
//# sourceMappingURL=id-extractor.d.ts.map