Files
oh-my-pi/packages/coding-agent/src/capability/instruction.ts
T
can1357 0438f01fd5 feat(coding-agent): added multi-tool config discovery across 8 AI IDEs
- Added unified capability-based discovery system for loading configuration from 8 AI coding tools (Cursor, Windsurf, Cline, GitHub Copilot, Gemini, Codex, Claude, VS Code).
- Added Discovery settings tab in interactive mode for enabling/disabling configuration providers.
- Added provider source attribution showing which tool contributed each configuration item.
- Added support for tool-specific rule formats including Cursor MDC, Windsurf global_rules, and Cline .clinerules.
- Changed MCP tool name parsing to use last underscore separator for improved server name handling.
- Refactored core loaders (skills, hooks, custom tools, slash commands) to use capability API instead of manual directory scanning.
2026-01-03 18:26:07 +01:00

38 lines
1023 B
TypeScript

/**
* Instructions Capability
*
* GitHub Copilot-style instructions with optional file pattern matching.
*/
import { defineCapability } from "./index";
import type { SourceMeta } from "./types";
/**
* An instruction with optional file pattern matching.
*/
export interface Instruction {
/** Instruction name (derived from filename) */
name: string;
/** Absolute path to instruction file */
path: string;
/** Instruction content (markdown) */
content: string;
/** Glob pattern for files this applies to */
applyTo?: string;
/** Source metadata */
_source: SourceMeta;
}
export const instructionCapability = defineCapability<Instruction>({
id: "instructions",
displayName: "Instructions",
description: "File-specific instructions with glob pattern matching (GitHub Copilot format)",
key: (inst) => inst.name,
validate: (inst) => {
if (!inst.name) return "Missing name";
if (!inst.path) return "Missing path";
if (inst.content === undefined) return "Missing content";
return undefined;
},
});