/** * Custom instruction/rules discovery utilities * Handles finding and loading custom instructions from the filesystem */ import type { DevToolsSys } from "../../types"; import type { CustomInstruction } from "#ai-utils"; /** * Get custom instructions from the filesystem * Searches for instruction files in: * - .cursor/rules/ - Rule files (.mdc or RULE.md only) * - .builder/rules/ - Rule files (.mdc or RULE.md only) * - .agents/rules/ - Rule files (.mdc or RULE.md only) * - .claude/skills/ - SKILL.md files only (subdirectories supported) * - .builder/skills/ - SKILL.md files only (subdirectories supported) * - .agents/skills/ - SKILL.md files only (subdirectories supported) * - .cursorrules, .builderrules, .windsurfrules * - .github/copilot-instructions.md * * Also scans the equivalent folders under the user's home directory * (`~/.builder/skills/`, `~/.claude/skills/`, etc.) so user-level skills * and rules are available in every project. * * @param sys - System utilities * @param projectDir - Project directory (used for relative paths) * @param currentDir - Starting directory for search * @param rootDir - Root directory to stop search * @param homeDir - Override for the user's home directory (for testing) * @returns Array of discovered custom instructions (both rules and skills) */ export declare function getCustomInstructions({ sys, projectDir, currentDir, rootDir, allowedCommands, skipCommandSecurity, homeDir, }: { sys: DevToolsSys; projectDir: string; currentDir: string; rootDir: string; allowedCommands?: RegExp[]; skipCommandSecurity?: boolean; homeDir?: string; }): Promise;