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

84 lines 3.24 kB
/** * Best-Practices Audit Handler * * Launches `/best-practices-audit` — a research-grounded validation of a * target (file, directory, or topic) against current external best practices * with citation guardrails. The actual research is performed by the agent * following the slash command skill in research-complete; this handler is * a thin shim that parses flags, validates the target, computes the output * path, and either spawns the configured provider or prints guidance for * IDE-integrated providers. * * Pattern matches src/cli/handlers/sdlc-accelerate.ts — same agent-spawn * conventions, same provider gating, same --params / --dangerous handling. * * @architecture @.aiwg/architecture/decisions/ADR-023-contributor-discovery-convention.md * @issue #943 */ import type { CommandHandler, HandlerContext, HandlerResult } from './types.js'; /** * Audit-specific flags. These are not consumed by the spawn machinery — * they're forwarded verbatim to the slash command so the agent skill can * apply them. The handler validates a few but does not interpret most; * focus area names and standard names are open vocabularies. */ interface AuditOpts { focus?: string; framework?: string; standard?: string; recency?: string; depth?: 'quick' | 'standard' | 'deep'; sources?: string; exclude?: string; citeThreshold?: number; dissent?: boolean; validateMode?: boolean; output?: string; } /** * Best-practices audit positional + flag parser. Distinct from * `parseAgentSpawnFlags` because most of the flags are forwarded to the * skill. We extract only the ones we need to validate locally; the rest * survive in `remaining` and get appended to the slash-command prompt. */ declare function parseAuditFlags(args: string[]): { audit: AuditOpts; rest: string[]; }; /** * Compute the default output path. Naming convention from #929 §5: * * .aiwg/reports/best-practices-audit-<target-slug>-<YYYY-MM-DD>.md * * The slug is derived from a path basename, freeform topic words, or 'audit' * if neither produces something usable. */ declare function computeOutputPath(target: string, override: string | undefined, projectRoot: string): string; export declare class BestPracticesAuditHandler implements CommandHandler { id: string; name: string; description: string; category: "orchestration"; aliases: string[]; execute(ctx: HandlerContext): Promise<HandlerResult>; /** * Compose the slash-command invocation. The agent skill receives the * target and forwarded flags verbatim, plus an explicit `--output` * pointing at the absolute output path so the skill writes to the * handler-computed location regardless of how it interprets cwd. */ private buildPrompt; private spawnAgent; private getNotFoundMessage; private getHelpText; } export declare const bestPracticesAuditHandler: BestPracticesAuditHandler; /** * Internal exports for testing only. Not part of the public CLI surface. */ export declare const __test__: { parseAuditFlags: typeof parseAuditFlags; computeOutputPath: typeof computeOutputPath; }; export {}; //# sourceMappingURL=best-practices-audit.d.ts.map