agentlens / src /parsers /copilot.ts
hongcoding's picture
feat: AgentLens v0.1.0 — cross-agent config migration + adversarial code QA
7bedc79 verified
Raw History Blame Contribute Delete
738 Bytes
import type { Rule } from "../core/types.js";
import type { ConfigParser } from "./base.js";
import { nextRuleId, classifyRule, extractRuleBlocks } from "./base.js";
/**
* GitHub Copilot instructions parser.
* Reads: .github/copilot-instructions.md
*/
export const copilotParser: ConfigParser = {
agent: "copilot",
filePatterns: [".github/copilot-instructions.md"],
parse(content: string, filePath: string): Rule[] {
const blocks = extractRuleBlocks(content);
return blocks.map((block) => ({
id: nextRuleId(),
category: classifyRule(block),
content: block,
scope: "project" as const,
source: { agent: "copilot" as const, file: filePath },
status: "active" as const,
}));
},
};