/** * AI Context Generator * * Creates AGENTS.md and CLAUDE.md with full inline GitNexus context. * AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Codex, Cline, etc. * CLAUDE.md is for Claude Code which only reads that file. */ import { type GeneratedSkillInfo } from './skill-gen.js'; interface RepoStats { files?: number; nodes?: number; edges?: number; communities?: number; clusters?: number; processes?: number; } export interface AIContextOptions { skipAgentsMd?: boolean; noStats?: boolean; skipSkills?: boolean; /** * Default branch used by the generated regression-compare example (#243). * Resolved by the CLI (CLI flag > `.gitnexusrc` > auto-detect > "main"); a * plain caller that omits it gets "main", preserving prior behavior. */ defaultBranch?: string; } /** * Strip backticks from a branch name before it is embedded in a Markdown * inline-code span (#1996 tri-review P1). validateBranchName already rejects * backticks for CLI/config/auto-detect inputs; this is the last-line defense at * the generation sink so the embedding is provably safe regardless of caller. */ export declare function markdownSafeBranch(branch: string): string; export declare function generateGitNexusContent(projectName: string, stats: RepoStats, generatedSkills?: GeneratedSkillInfo[], groupNames?: string[], noStats?: boolean, skipSkills?: boolean, runnerPath?: string, defaultBranch?: string): string; /** * Generate AI context files after indexing */ export declare function generateAIContextFiles(repoPath: string, storagePath: string, projectName: string, stats: RepoStats, generatedSkills?: GeneratedSkillInfo[], options?: AIContextOptions): Promise<{ files: string[]; }>; /** * Refresh only the `base_ref: "..."` value inside the GitNexus block of an * already-generated AGENTS.md / CLAUDE.md, in place (#1996 tri-review P2). * * The `alreadyUpToDate` analyze fast path returns before the normal * {@link generateAIContextFiles} call, so a changed `.gitnexusrc` defaultBranch * (or `--default-branch`) would otherwise not take effect until the next * re-index. This does a surgical line update that preserves the rest of the * block — including community-skill rows written by a prior `--skills` run — * rather than regenerating (which would drop those rows on a no-`--skills` run). * * Best-effort: missing files, a missing/blank block, or a block with no * `base_ref` line (e.g. a user-trimmed keep block) are silently skipped. Writes * only when the value actually changes, so a routine up-to-date run is a no-op. */ export declare function refreshBaseRefLine(repoPath: string, defaultBranch: string, options?: { skipAgentsMd?: boolean; }): Promise<{ files: string[]; }>; export {};