vibe-rules
Version:
A utility for managing Cursor rules, Windsurf rules, and other AI prompts
38 lines (37 loc) • 1.65 kB
TypeScript
import { RuleConfig, RuleProvider, RuleGeneratorOptions } from "../types.js";
export declare class VSCodeRuleProvider implements RuleProvider {
/**
* Generate VSCode instruction content with frontmatter
*
* NOTE: VSCode has a bug where multiple globs in applyTo don't work properly,
* so we always use "**" to apply rules universally for better reliability.
*/
generateRuleContent(config: RuleConfig, options?: RuleGeneratorOptions): string;
/**
* Saves a rule definition to internal storage for later use.
* @param config - The rule configuration.
* @returns Path where the rule definition was saved internally.
*/
saveRule(config: RuleConfig): Promise<string>;
/**
* Loads a rule definition from internal storage.
* @param name - The name of the rule to load.
* @returns The RuleConfig if found, otherwise null.
*/
loadRule(name: string): Promise<RuleConfig | null>;
/**
* Lists rule definitions available in internal storage.
* @returns An array of rule names.
*/
listRules(): Promise<string[]>;
/**
* Append a VSCode instruction rule to a target file
*/
appendRule(name: string, targetPath?: string, isGlobal?: boolean): Promise<boolean>;
/**
* Formats and applies a rule directly from a RuleConfig object.
* Creates the .github/instructions directory if it doesn't exist.
* Uses slugified rule name for the filename with .instructions.md extension.
*/
appendFormattedRule(config: RuleConfig, targetPath: string, isGlobal?: boolean, options?: RuleGeneratorOptions): Promise<boolean>;
}