/** * Typed error raised when a planned `peaks standards` write target would * land outside `projectRoot` (or collide with the user-level baseline * under `/.claude/**`). Surfaced as a stable error code so CLI * callers can map it to a recoverable hint. */ export type ProjectStandardsWriteTargetReason = 'outside-project-root' | 'resolves-to-homedir-claude'; export declare class ProjectStandardsWriteTargetError extends Error { readonly code: "PROJECT_STANDARDS_WRITE_TARGET_OUTSIDE_ROOT"; readonly filePath: string; readonly projectRoot: string; readonly reason: ProjectStandardsWriteTargetReason; constructor(input: { readonly filePath: string; readonly projectRoot: string; readonly reason: ProjectStandardsWriteTargetReason; }); } export type StandardsLanguage = 'generic' | 'typescript' | 'javascript' | 'python' | 'go' | 'rust'; export type StandardsWriteStatus = 'planned' | 'existing' | 'written' | 'appended' | 'review'; export type StandardsWrite = { readonly relativePath: string; readonly filePath: string; readonly content: string; readonly status: StandardsWriteStatus; }; export type ProjectStandardsSource = { readonly sourceId: 'everything-claude-code'; readonly url: 'https://github.com/affaan-m/everything-claude-code'; readonly usage: 'curated-baseline-reference'; }; export type StandardsSkillPreflight = { readonly appliesTo: readonly ['peaks-rd', 'peaks-qa', 'peaks-solo']; readonly summary: string; }; export type ProjectStandardsInitPlan = { readonly apply: boolean; readonly projectRoot: string; readonly language: StandardsLanguage; readonly source: ProjectStandardsSource; readonly skillPreflight: StandardsSkillPreflight; readonly plannedWrites: StandardsWrite[]; }; export type ProjectStandardsInitResult = ProjectStandardsInitPlan & { readonly writtenFiles: string[]; }; export type ProjectStandardsInitSummary = { readonly apply: boolean; readonly projectRoot: string; readonly language: StandardsLanguage; readonly source: ProjectStandardsSource; readonly skillPreflight: StandardsSkillPreflight; readonly plannedWrites: Array>; readonly writtenFiles: string[]; readonly skippedFiles: string[]; }; export type ProjectStandardsUpdatePlan = ProjectStandardsInitPlan & { readonly claudeMd: { readonly relativePath: 'CLAUDE.md'; readonly filePath: string; readonly status: StandardsWriteStatus; readonly content: string; readonly appendBlock: string; readonly reviewSuggestions: string[]; }; }; export type ProjectStandardsUpdateResult = ProjectStandardsUpdatePlan & { readonly writtenFiles: string[]; readonly appendedFiles: string[]; readonly reviewSuggestions: string[]; }; export type ProjectStandardsUpdateSummary = { readonly apply: boolean; readonly projectRoot: string; readonly language: StandardsLanguage; readonly source: ProjectStandardsSource; readonly skillPreflight: StandardsSkillPreflight; readonly plannedWrites: Array>; readonly writtenFiles: string[]; readonly appendedFiles: string[]; readonly skippedFiles: string[]; readonly reviewSuggestions: string[]; readonly claudeMd: { readonly relativePath: 'CLAUDE.md'; readonly status: StandardsWriteStatus; readonly reviewSuggestions: string[]; }; }; export type ProjectStandardsInitOptions = { readonly projectRoot: string; readonly language?: string; readonly apply?: boolean; /** * Test seam: override the homedir resolver used by the * write-target containment guard. Defaults to `os.homedir()`. * Production callers should NOT pass this — it exists so unit * tests can simulate the "projectRoot === homedir" trap without * mutating global Node state (which is read-only). */ readonly resolveHomedir?: () => string; }; /** * Public alias for `detectLanguageInternal` so callers outside this * module (e.g. `workspace-service.ts` for the slice 2026-06-16 RD#7 * auto-detect path) can ask the same heuristic without re-implementing * the file-probe logic. */ export declare function detectLanguage(projectRoot: string): StandardsLanguage; export declare function createProjectStandardsInitPlan(options: ProjectStandardsInitOptions): ProjectStandardsInitPlan; export declare function createProjectStandardsUpdatePlan(options: ProjectStandardsInitOptions): ProjectStandardsUpdatePlan; export declare function executeProjectStandardsInit(options: ProjectStandardsInitOptions): ProjectStandardsInitResult; export declare function executeProjectStandardsUpdate(options: ProjectStandardsInitOptions): ProjectStandardsUpdateResult; export declare function summarizeProjectStandardsInitResult(result: ProjectStandardsInitResult): ProjectStandardsInitSummary; export declare function summarizeProjectStandardsUpdateResult(result: ProjectStandardsUpdateResult): ProjectStandardsUpdateSummary;