vibe-rules
Version:
A utility for managing Cursor rules, Windsurf rules, and other AI prompts
65 lines (64 loc) • 1.95 kB
TypeScript
/**
* Rule type definitions for the vibe-rules utility
*/
export type * from "./schemas.js";
export interface RuleConfig {
name: string;
content: string;
description?: string;
}
export interface StoredRuleConfig {
name: string;
content: string;
description?: string;
metadata?: RuleGeneratorOptions;
}
export declare const RuleType: {
readonly CURSOR: "cursor";
readonly WINDSURF: "windsurf";
readonly CLAUDE_CODE: "claude-code";
readonly GEMINI: "gemini";
readonly CODEX: "codex";
readonly AMP: "amp";
readonly CLINERULES: "clinerules";
readonly ROO: "roo";
readonly ZED: "zed";
readonly UNIFIED: "unified";
readonly VSCODE: "vscode";
readonly CUSTOM: "custom";
};
export type RuleTypeArray = (typeof RuleType)[keyof typeof RuleType][];
export type RuleType = (typeof RuleType)[keyof typeof RuleType];
export interface RuleProvider {
/**
* Creates a new rule file with the given content
*/
saveRule(config: RuleConfig, options?: RuleGeneratorOptions): Promise<string>;
/**
* Loads a rule from storage
*/
loadRule(name: string): Promise<RuleConfig | null>;
/**
* Lists all available rules
*/
listRules(): Promise<string[]>;
/**
* Appends a rule to an existing file
*/
appendRule(name: string, targetPath?: string): Promise<boolean>;
/**
* Formats and appends a rule directly from a RuleConfig object
*/
appendFormattedRule(config: RuleConfig, targetPath: string, isGlobal?: boolean, options?: RuleGeneratorOptions): Promise<boolean>;
/**
* Generates formatted rule content with editor-specific formatting
*/
generateRuleContent(config: RuleConfig, options?: RuleGeneratorOptions): string;
}
export interface RuleGeneratorOptions {
description?: string;
isGlobal?: boolean;
alwaysApply?: boolean;
globs?: string | string[];
debug?: boolean;
}