omk-agent-core 0.95.2 → 0.96.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -456,7 +456,7 @@ const readFileTool: AgentTool = {
456
456
  // or a claim list. Omit to let the tool run exclusively (or as an unclaimed
457
457
  // extension tool when strictExtensionClaims is false).
458
458
  resourceClaims: (args, context) => [
459
- { kind: "path", path: args.path, access: "read" },
459
+ { kind: "path", key: args.path, access: "read" },
460
460
  ],
461
461
 
462
462
  // Per-tool timeout in milliseconds. 0 disables the timer for this tool.
@@ -1 +1 @@
1
- {"version":3,"file":"reverse-skill.d.ts","sourceRoot":"","sources":["../../src/harness/reverse-skill.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtF,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,eAAe,GAAG,iBAAiB,GAAG,qBAAqB,CAAC;AAEhH,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,gBAAgB,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACtC,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ali\" | \"unknown\";\n\nexport type ReverseSkillRisk = \"passive-analysis\" | \"local-tooling\" | \"active-security\" | \"exploit-development\";\n\nexport interface ReverseSkillRoute {\n\tid: string;\n\tlabel: string;\n\tskillPath: string;\n\ttargetPatterns: string[];\n\tintentPatterns: string[];\n\ttoolPatterns: string[];\n\tkeywords: string[];\n\trequiredTools: string[];\n\toptionalTools: string[];\n\tskillHints: string[];\n\tmcpHints: string[];\n\thookHints: string[];\n\tacceptance: string[];\n\tfirstActions: string[];\n\trisk: ReverseSkillRisk;\n}\n\nexport interface ReverseSkillRouteInput {\n\tquery: string;\n\ttargetType?: string;\n\tintent?: string;\n\ttoolchain?: string;\n\tplatform?: ReverseSkillPlatform;\n\tmaxAlternatives?: number;\n}\n\nexport interface ReverseSkillRouteScore {\n\troute: ReverseSkillRoute;\n\tscore: number;\n\tconfidence: number;\n\tmatched: {\n\t\ttarget: string[];\n\t\tintent: string[];\n\t\ttoolchain: string[];\n\t\tkeywords: string[];\n\t};\n\tmissingDimensions: string[];\n}\n\nexport interface ReverseSkillRouteDecision {\n\tquery: string;\n\tplatform: ReverseSkillPlatform;\n\tnormalizedQuery: string;\n\tprimary?: ReverseSkillRouteScore;\n\talternatives: ReverseSkillRouteScore[];\n\tunmatched: boolean;\n\tnextAction: string;\n}\n\nexport interface ReverseSkillSpecInput {\n\tname: string;\n\tdescription?: string;\n\ttriggerSummary: string;\n\trouteIds?: string[];\n\tworkflowSteps?: string[];\n\ttools?: string[];\n\tmcpServers?: string[];\n\thooks?: string[];\n\tacceptance?: string[];\n\treferences?: string[];\n\tsafetyNotes?: string[];\n}\n\nexport interface ReverseSkillSourceFacts {\n\theadings: string[];\n\tskillPaths: string[];\n\tscriptPaths: string[];\n\ttools: string[];\n\tmcpServers: string[];\n\ttriggerTerms: string[];\n}\n\nexport interface ReverseSkillSourceInput {\n\tname?: string;\n\tdescription?: string;\n\tsourceText: string;\n\ttriggerSummary?: string;\n}\n\nconst ROUTE_SCORE_TARGET_WEIGHT = 4;\nconst ROUTE_SCORE_INTENT_WEIGHT = 3;\nconst ROUTE_SCORE_TOOL_WEIGHT = 2;\nconst ROUTE_SCORE_KEYWORD_WEIGHT = 1;\nconst ROUTE_SCORE_FULL_TRIAD_BONUS = 4;\nconst ROUTE_SCORE_CONFIDENCE_DENOMINATOR = 14;\n\nexport const REVERSE_SKILL_ROUTES: ReverseSkillRoute[] = [\n\t{\n\t\tid: \"apk-reverse\",\n\t\tlabel: \"APK / Android reverse engineering\",\n\t\tskillPath: \"skills/apk-reverse/SKILL.md\",\n\t\ttargetPatterns: [\"apk\", \"android\", \"aab\", \"smali\", \"jni\", \"dex\", \"안드로이드\", \"反编译\"],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"unpack\",\n\t\t\t\"repack\",\n\t\t\t\"manifest\",\n\t\t\t\"frida\",\n\t\t\t\"hook\",\n\t\t\t\"ssl pinning\",\n\t\t\t\"root detection\",\n\t\t\t\"rebuild\",\n\t\t\t\"sign\",\n\t\t\t\"설치\",\n\t\t\t\"리패키징\",\n\t\t],\n\t\ttoolPatterns: [\"jadx\", \"apktool\", \"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tkeywords: [\"classes.dex\", \"androidmanifest\", \"native library\", \"lib/\", \".so\", \"certificate pinning\", \"smali\"],\n\t\trequiredTools: [\"jadx\", \"apktool\"],\n\t\toptionalTools: [\"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tskillHints: [\"apk-reverse\", \"reverse-engineering\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright for app docs only\", \"idapro if native .so becomes dominant\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"subagent-stop-audit\"],\n\t\tacceptance: [\n\t\t\t\"Target package structure is identified\",\n\t\t\t\"Static findings cite class/method/file paths\",\n\t\t\t\"Any dynamic step is scoped to a local test device or emulator\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm target artifact path\",\n\t\t\t\"Decode APK metadata\",\n\t\t\t\"Route native .so files to binary analysis when needed\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ida-reverse\",\n\t\tlabel: \"Binary reverse engineering with decompiler-first workflow\",\n\t\tskillPath: \"skills/ida-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"exe\",\n\t\t\t\"dll\",\n\t\t\t\"elf\",\n\t\t\t\"so\",\n\t\t\t\"dylib\",\n\t\t\t\"macho\",\n\t\t\t\"pe\",\n\t\t\t\"binary\",\n\t\t\t\"firmware blob\",\n\t\t\t\"바이너리\",\n\t\t\t\"二进制\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"disassemble\",\n\t\t\t\"xref\",\n\t\t\t\"call graph\",\n\t\t\t\"data flow\",\n\t\t\t\"rename\",\n\t\t\t\"symbol\",\n\t\t\t\"recover\",\n\t\t\t\"pseudocode\",\n\t\t\t\"함수\",\n\t\t\t\"反汇编\",\n\t\t],\n\t\ttoolPatterns: [\"ida\", \"idapro\", \"idalib\", \"ida-pro-mcp\", \"ghidra\", \"r2\", \"radare2\"],\n\t\tkeywords: [\"imports\", \"exports\", \"strings\", \"function\", \"offset\", \"xref\", \"pdb\", \"symbols\"],\n\t\trequiredTools: [\"idapro\"],\n\t\toptionalTools: [\"idalib-mcp\", \"ghidra\", \"radare2\", \"rabin2\"],\n\t\tskillHints: [\"ida-reverse\", \"radare2\", \"reverse-engineering\", \"binary-diff\"],\n\t\tmcpHints: [\"idapro\", \"filesystem\", \"serena\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Functions are cited by address/name\",\n\t\t\t\"Hypotheses cite disassembly, decompiler, xref, or string evidence\",\n\t\t\t\"Output distinguishes evidence from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run strings/imports reconnaissance\",\n\t\t\t\"Choose IDA or CLI path based on available tools\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"radare2\",\n\t\tlabel: \"Binary reconnaissance with radare2 CLI\",\n\t\tskillPath: \"skills/radare2/SKILL.md\",\n\t\ttargetPatterns: [\"binary\", \"elf\", \"pe\", \"macho\", \"so\", \"dll\", \"firmware\", \"바이너리\"],\n\t\tintentPatterns: [\"quick recon\", \"strings\", \"imports\", \"exports\", \"patch\", \"offset\", \"cli\", \"headless\"],\n\t\ttoolPatterns: [\"radare2\", \"r2\", \"rabin2\", \"rasm2\", \"radiff2\"],\n\t\tkeywords: [\"entrypoint\", \"section\", \"symbol\", \"hex\", \"disassembly\", \"patch bytes\"],\n\t\trequiredTools: [\"radare2\", \"rabin2\"],\n\t\toptionalTools: [\"rasm2\", \"radiff2\", \"r2pipe\"],\n\t\tskillHints: [\"radare2\", \"ida-reverse\", \"reverse-engineering\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Recon output names sections, imports, symbols, and notable strings\",\n\t\t\t\"Patch guidance includes offset and before/after bytes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Run file metadata\",\n\t\t\t\"Run rabin2-style reconnaissance\",\n\t\t\t\"Escalate to decompiler if CLI evidence is insufficient\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"js-reverse\",\n\t\tlabel: \"Frontend JavaScript signature and request reconstruction\",\n\t\tskillPath: \"skills/js-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"javascript\",\n\t\t\t\"js\",\n\t\t\t\"frontend\",\n\t\t\t\"webpack\",\n\t\t\t\"source map\",\n\t\t\t\"sourcemap\",\n\t\t\t\"web\",\n\t\t\t\"browser\",\n\t\t\t\"前端\",\n\t\t\t\"프론트\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"signature\",\n\t\t\t\"encrypted params\",\n\t\t\t\"request replay\",\n\t\t\t\"token\",\n\t\t\t\"decrypt\",\n\t\t\t\"environment patch\",\n\t\t\t\"ast\",\n\t\t\t\"breakpoint\",\n\t\t\t\"hook\",\n\t\t\t\"서명\",\n\t\t\t\"암호화\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome\", \"cdp\", \"jshook\", \"jshookmcp\", \"node\", \"anything-analyzer\"],\n\t\tkeywords: [\n\t\t\t\"sign\",\n\t\t\t\"nonce\",\n\t\t\t\"timestamp\",\n\t\t\t\"crypto\",\n\t\t\t\"axios\",\n\t\t\t\"fetch\",\n\t\t\t\"xhr\",\n\t\t\t\"webpackJsonp\",\n\t\t\t\"localStorage\",\n\t\t\t\"cookie\",\n\t\t],\n\t\trequiredTools: [\"node\"],\n\t\toptionalTools: [\"playwright\", \"jshookmcp\", \"anything-analyzer\", \"chrome\"],\n\t\tskillHints: [\"js-reverse\", \"browser-automation\", \"docs-generator\"],\n\t\tmcpHints: [\"chrome-devtools\", \"playwright\", \"fetch\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"session-context\"],\n\t\tacceptance: [\n\t\t\t\"Target request and parameter names are identified\",\n\t\t\t\"Recovered algorithm has a local reproduction or explicit blocker\",\n\t\t\t\"Browser/runtime observations are tied to request evidence\",\n\t\t],\n\t\tfirstActions: [\"Identify target request\", \"Find producer function\", \"Rebuild the minimum local reproduction\"],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"browser-automation\",\n\t\tlabel: \"Browser or desktop evidence collection\",\n\t\tskillPath: \"skills/browser-automation/SKILL.md\",\n\t\ttargetPatterns: [\"website\", \"browser\", \"web app\", \"desktop app\", \"page\", \"form\", \"웹\", \"브라우저\"],\n\t\tintentPatterns: [\n\t\t\t\"open\",\n\t\t\t\"screenshot\",\n\t\t\t\"fill\",\n\t\t\t\"crawl\",\n\t\t\t\"capture\",\n\t\t\t\"network\",\n\t\t\t\"login\",\n\t\t\t\"observe\",\n\t\t\t\"click\",\n\t\t\t\"샷\",\n\t\t\t\"스크린샷\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome-devtools\", \"agent-browser\", \"openreverse\", \"anything-analyzer\"],\n\t\tkeywords: [\"dom\", \"selector\", \"network log\", \"console\", \"cookie\", \"screenshot\", \"trace\"],\n\t\trequiredTools: [\"playwright\"],\n\t\toptionalTools: [\"chrome\", \"agent-browser\", \"anything-analyzer\"],\n\t\tskillHints: [\"browser-automation\", \"js-reverse\", \"docs-generator\"],\n\t\tmcpHints: [\"playwright\", \"chrome-devtools\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Browser state is captured with URL and selector evidence\",\n\t\t\t\"Screenshots or logs are saved as artifacts when visual proof matters\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Open the target in an isolated browser context\",\n\t\t\t\"Capture visible state\",\n\t\t\t\"Record console/network evidence\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ctf-sandbox-orchestrator\",\n\t\tlabel: \"CTF challenge routing\",\n\t\tskillPath: \"../CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md\",\n\t\ttargetPatterns: [\"ctf\", \"challenge\", \"flag\", \"pwn\", \"crypto challenge\", \"forensics\", \"misc\", \"rev\", \"대회\"],\n\t\tintentPatterns: [\"solve\", \"find flag\", \"exploit\", \"writeup\", \"sandbox\", \"analyze challenge\"],\n\t\ttoolPatterns: [\"pwntools\", \"gdb\", \"python\", \"sage\", \"z3\", \"binwalk\", \"wireshark\"],\n\t\tkeywords: [\"flag{\", \"ctf\", \"nc \", \"remote\", \"proof\", \"challenge files\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"python\", \"gdb\", \"pwntools\", \"z3\", \"binwalk\"],\n\t\tskillHints: [\"ctf-sandbox-orchestrator\", \"reverse-engineering\", \"pwn-chain\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"memory\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Challenge category is justified by evidence\",\n\t\t\t\"Solution artifacts are reproducible\",\n\t\t\t\"Writeup includes the shortest verified path\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory challenge files\",\n\t\t\t\"Classify dominant evidence\",\n\t\t\t\"Dispatch to the narrowest CTF sub-skill\",\n\t\t],\n\t\trisk: \"exploit-development\",\n\t},\n\t{\n\t\tid: \"api-security\",\n\t\tlabel: \"API security review and authorized test planning\",\n\t\tskillPath: \"skills/api-security/SKILL.md\",\n\t\ttargetPatterns: [\"api\", \"rest\", \"graphql\", \"websocket\", \"jwt\", \"oauth\", \"endpoint\"],\n\t\tintentPatterns: [\"review\", \"test\", \"auth\", \"idor\", \"bola\", \"bfla\", \"rate limit\", \"schema\", \"권한\", \"越权\"],\n\t\ttoolPatterns: [\"burp\", \"postman\", \"nuclei\", \"zap\", \"curl\", \"graphql\"],\n\t\tkeywords: [\"authorization\", \"authentication\", \"tenant\", \"object id\", \"jwt\", \"scope\", \"graphql\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"burpsuite\", \"nuclei\", \"zap\", \"node\", \"python\"],\n\t\tskillHints: [\"api-security\", \"pentest-tools\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Scope boundary is explicit\",\n\t\t\t\"Findings include request/response evidence or code references\",\n\t\t\t\"High-risk active steps require explicit target scope\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Identify API surface\",\n\t\t\t\"Map auth and tenant boundaries\",\n\t\t\t\"Choose static review or scoped dynamic testing\",\n\t\t],\n\t\trisk: \"active-security\",\n\t},\n\t{\n\t\tid: \"supply-chain-security\",\n\t\tlabel: \"Supply-chain and CI/CD security analysis\",\n\t\tskillPath: \"skills/supply-chain-security/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"dependency\",\n\t\t\t\"package\",\n\t\t\t\"sbom\",\n\t\t\t\"container\",\n\t\t\t\"docker\",\n\t\t\t\"ci\",\n\t\t\t\"workflow\",\n\t\t\t\"github actions\",\n\t\t\t\"supply chain\",\n\t\t],\n\t\tintentPatterns: [\"scan\", \"audit\", \"gitleaks\", \"trivy\", \"osv\", \"syft\", \"secret\", \"provenance\", \"attestation\"],\n\t\ttoolPatterns: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"npm audit\", \"semgrep\"],\n\t\tkeywords: [\"package-lock\", \"npm-shrinkwrap\", \"dockerfile\", \"workflow\", \"actions\", \"secret\", \"sbom\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"semgrep\"],\n\t\tskillHints: [\"supply-chain-security\", \"security-review\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\"],\n\t\thookHints: [\"protect-secrets\", \"pre-shell-guard\", \"npm-audit-summary\"],\n\t\tacceptance: [\n\t\t\t\"Dependency, workflow, and secret surfaces are separated\",\n\t\t\t\"Findings cite exact files and lockfile evidence\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory package managers and workflows\",\n\t\t\t\"Run non-mutating scans first\",\n\t\t\t\"Triangulate tool output with source evidence\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"docs-generator\",\n\t\tlabel: \"Security or reverse-engineering report generation\",\n\t\tskillPath: \"skills/docs-generator/SKILL.md\",\n\t\ttargetPatterns: [\"report\", \"writeup\", \"documentation\", \"diagram\", \"flowchart\", \"보고서\", \"문서\"],\n\t\tintentPatterns: [\"write\", \"summarize\", \"generate\", \"document\", \"explain\", \"diagram\", \"publish\"],\n\t\ttoolPatterns: [\"markdown\", \"mermaid\", \"graphviz\", \"plantuml\", \"pdf\"],\n\t\tkeywords: [\"executive summary\", \"reproduction\", \"impact\", \"timeline\", \"artifact\", \"evidence\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"graphviz\", \"plantuml\", \"pandoc\"],\n\t\tskillHints: [\"docs-generator\", \"diagram-generator\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Report separates facts, analysis, and recommendations\",\n\t\t\t\"Artifacts and commands are reproducible\",\n\t\t\t\"Sensitive values are redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect evidence paths\",\n\t\t\t\"Choose report template\",\n\t\t\t\"Add at least one flow or evidence diagram when useful\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n];\n\nconst TOOL_ALIASES: Record<string, string[]> = {\n\t\"anything-analyzer\": [\"anything-analyzer\"],\n\tadb: [\"adb\"],\n\tapktool: [\"apktool\"],\n\tapksigner: [\"apksigner\"],\n\tbinwalk: [\"binwalk\"],\n\tburpsuite: [\"burpsuite\"],\n\tchrome: [\"google-chrome\", \"chromium\", \"chrome\"],\n\tfrida: [\"frida\", \"frida-ps\"],\n\tgdb: [\"gdb\"],\n\tghidra: [\"ghidraRun\", \"analyzeHeadless\"],\n\tgitleaks: [\"gitleaks\"],\n\tgraphviz: [\"dot\"],\n\tidapro: [\"ida\", \"idat\", \"idat64\"],\n\t\"idalib-mcp\": [\"ida-pro-mcp\", \"idalib-mcp\"],\n\tjadx: [\"jadx\"],\n\tjshookmcp: [\"jshook\", \"npx\"],\n\tnode: [\"node\"],\n\tnuclei: [\"nuclei\"],\n\tpandoc: [\"pandoc\"],\n\tplantuml: [\"plantuml\"],\n\tplaywright: [\"playwright\", \"npx\"],\n\tpwntools: [\"python\"],\n\tpython: [\"python3\", \"python\"],\n\tradare2: [\"radare2\", \"r2\"],\n\trabin2: [\"rabin2\"],\n\tradiff2: [\"radiff2\"],\n\trasm2: [\"rasm2\"],\n\tsemgrep: [\"semgrep\"],\n\tsyft: [\"syft\"],\n\ttrivy: [\"trivy\"],\n\tzap: [\"zap.sh\", \"zap-baseline.py\"],\n\tzipalign: [\"zipalign\"],\n\tz3: [\"z3\"],\n};\n\nexport function getReverseSkillToolAliases(tool: string): string[] {\n\treturn TOOL_ALIASES[tool] ?? [tool];\n}\n\nexport function normalizeReverseSkillText(text: string | undefined): string {\n\treturn (text ?? \"\")\n\t\t.normalize(\"NFKC\")\n\t\t.toLowerCase()\n\t\t.replace(/[\\u2018\\u2019]/g, \"'\")\n\t\t.replace(/[\\u201c\\u201d]/g, '\"')\n\t\t.replace(/[_./\\\\:-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction findPatternMatches(text: string, patterns: string[]): string[] {\n\tconst matches: string[] = [];\n\tfor (const pattern of patterns) {\n\t\tconst normalizedPattern = normalizeReverseSkillText(pattern);\n\t\tif (!normalizedPattern) continue;\n\t\tif (text.includes(normalizedPattern)) matches.push(pattern);\n\t}\n\treturn matches;\n}\n\nfunction unique(items: string[]): string[] {\n\treturn Array.from(new Set(items.filter((item) => item.trim().length > 0)));\n}\n\nfunction clampConfidence(score: number): number {\n\tif (score <= 0) return 0;\n\treturn Math.min(0.99, Number((score / ROUTE_SCORE_CONFIDENCE_DENOMINATOR).toFixed(2)));\n}\n\nfunction scoreRoute(\n\troute: ReverseSkillRoute,\n\tinput: ReverseSkillRouteInput,\n\tnormalizedQuery: string,\n): ReverseSkillRouteScore {\n\tconst targetText = normalizeReverseSkillText(`${input.targetType ?? \"\"} ${normalizedQuery}`);\n\tconst intentText = normalizeReverseSkillText(`${input.intent ?? \"\"} ${normalizedQuery}`);\n\tconst toolText = normalizeReverseSkillText(`${input.toolchain ?? \"\"} ${normalizedQuery}`);\n\n\tconst target = findPatternMatches(targetText, route.targetPatterns);\n\tconst intent = findPatternMatches(intentText, route.intentPatterns);\n\tconst toolchain = findPatternMatches(toolText, route.toolPatterns);\n\tconst keywords = findPatternMatches(normalizedQuery, route.keywords);\n\n\tlet score =\n\t\ttarget.length * ROUTE_SCORE_TARGET_WEIGHT +\n\t\tintent.length * ROUTE_SCORE_INTENT_WEIGHT +\n\t\ttoolchain.length * ROUTE_SCORE_TOOL_WEIGHT +\n\t\tkeywords.length * ROUTE_SCORE_KEYWORD_WEIGHT;\n\n\tif (target.length > 0 && intent.length > 0 && toolchain.length > 0) {\n\t\tscore += ROUTE_SCORE_FULL_TRIAD_BONUS;\n\t}\n\n\tconst missingDimensions: string[] = [];\n\tif (target.length === 0) missingDimensions.push(\"target\");\n\tif (intent.length === 0) missingDimensions.push(\"intent\");\n\tif (toolchain.length === 0) missingDimensions.push(\"toolchain\");\n\n\treturn {\n\t\troute,\n\t\tscore,\n\t\tconfidence: clampConfidence(score),\n\t\tmatched: { target, intent, toolchain, keywords },\n\t\tmissingDimensions,\n\t};\n}\n\nexport function routeReverseSkill(input: ReverseSkillRouteInput): ReverseSkillRouteDecision {\n\tconst normalizedQuery = normalizeReverseSkillText(input.query);\n\tconst platform = input.platform ?? \"unknown\";\n\tconst maxAlternatives = input.maxAlternatives ?? 3;\n\tconst scored = REVERSE_SKILL_ROUTES.map((route) => scoreRoute(route, input, normalizedQuery))\n\t\t.filter((candidate) => candidate.score > 0)\n\t\t.sort(\n\t\t\t(a, b) => b.score - a.score || REVERSE_SKILL_ROUTES.indexOf(a.route) - REVERSE_SKILL_ROUTES.indexOf(b.route),\n\t\t);\n\n\tconst primary = scored[0];\n\tconst alternatives = scored.slice(1, maxAlternatives + 1);\n\tconst unmatched = !primary || primary.score < ROUTE_SCORE_TARGET_WEIGHT || primary.confidence < 0.18;\n\tconst nextAction = unmatched\n\t\t? \"No strong route matched. Create or extend a reverse-skill route before executing specialized tooling.\"\n\t\t: `Read ${primary.route.skillPath}, then execute first action: ${primary.route.firstActions[0] ?? \"classify target\"}.`;\n\n\treturn {\n\t\tquery: input.query,\n\t\tplatform,\n\t\tnormalizedQuery,\n\t\tprimary: unmatched ? undefined : primary,\n\t\talternatives,\n\t\tunmatched,\n\t\tnextAction,\n\t};\n}\n\nfunction formatMatches(score: ReverseSkillRouteScore): string {\n\tconst parts = [\n\t\t`target=${score.matched.target.join(\", \") || \"—\"}`,\n\t\t`intent=${score.matched.intent.join(\", \") || \"—\"}`,\n\t\t`toolchain=${score.matched.toolchain.join(\", \") || \"—\"}`,\n\t\t`keywords=${score.matched.keywords.join(\", \") || \"—\"}`,\n\t];\n\treturn parts.join(\"; \");\n}\n\nexport function formatReverseSkillRouteDecision(decision: ReverseSkillRouteDecision): string {\n\tif (decision.unmatched || !decision.primary) {\n\t\treturn [\n\t\t\t\"# Reverse Skill Route\",\n\t\t\t\"\",\n\t\t\t`Query: ${decision.query}`,\n\t\t\t\"\",\n\t\t\t\"No strong route matched.\",\n\t\t\t\"Next action: create or extend a route before specialized execution.\",\n\t\t].join(\"\\n\");\n\t}\n\n\tconst primary = decision.primary;\n\tconst lines = [\n\t\t\"# Reverse Skill Route\",\n\t\t\"\",\n\t\t`Query: ${decision.query}`,\n\t\t`Platform: ${decision.platform}`,\n\t\t\"\",\n\t\t`## Primary: ${primary.route.label}`,\n\t\t`- Route ID: ${primary.route.id}`,\n\t\t`- Skill path: ${primary.route.skillPath}`,\n\t\t`- Confidence: ${primary.confidence}`,\n\t\t`- Score: ${primary.score}`,\n\t\t`- Matches: ${formatMatches(primary)}`,\n\t\t`- Risk: ${primary.route.risk}`,\n\t\t`- Required tools: ${primary.route.requiredTools.join(\", \") || \"none\"}`,\n\t\t`- Optional tools: ${primary.route.optionalTools.join(\", \") || \"none\"}`,\n\t\t`- Skill hints: ${primary.route.skillHints.join(\", \")}`,\n\t\t`- MCP hints: ${primary.route.mcpHints.join(\", \")}`,\n\t\t`- Hooks: ${primary.route.hookHints.join(\", \")}`,\n\t\t\"\",\n\t\t\"## First actions\",\n\t\t...primary.route.firstActions.map((action, index) => `${index + 1}. ${action}`),\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t...primary.route.acceptance.map((item) => `- ${item}`),\n\t];\n\n\tif (decision.alternatives.length > 0) {\n\t\tlines.push(\"\", \"## Alternatives\");\n\t\tfor (const alternative of decision.alternatives) {\n\t\t\tlines.push(`- ${alternative.route.id} (${alternative.confidence}): ${formatMatches(alternative)}`);\n\t\t}\n\t}\n\n\tlines.push(\"\", `Next action: ${decision.nextAction}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function planReverseSkillToolChecks(decision: ReverseSkillRouteDecision, maxTools = 12): string[] {\n\tconst routes = [decision.primary, ...decision.alternatives].filter((score): score is ReverseSkillRouteScore =>\n\t\tBoolean(score),\n\t);\n\tconst tools: string[] = [];\n\tfor (const score of routes) {\n\t\ttools.push(...score.route.requiredTools, ...score.route.optionalTools);\n\t}\n\treturn unique(tools).slice(0, maxTools);\n}\n\nexport function normalizeReverseSkillName(name: string): string {\n\tconst normalized = normalizeReverseSkillText(name)\n\t\t.replace(/[^a-z0-9-]+/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.slice(0, 64)\n\t\t.replace(/-$/g, \"\");\n\treturn normalized || \"reverse-skill\";\n}\n\nfunction yamlString(value: string): string {\n\treturn JSON.stringify(value);\n}\n\nfunction compactDescription(input: ReverseSkillSpecInput, routes: ReverseSkillRoute[]): string {\n\tconst fallback = `Use when ${input.triggerSummary}`;\n\tconst base = input.description?.trim() || fallback;\n\tconst routeNames = routes.map((route) => route.id).join(\", \");\n\tconst suffix = routeNames ? ` Routes through ${routeNames}.` : \"\";\n\tconst description = `${base}${suffix}`;\n\treturn description.length <= 1024 ? description : `${description.slice(0, 1021).trimEnd()}...`;\n}\n\nfunction routesFromIds(routeIds: string[] | undefined): ReverseSkillRoute[] {\n\tif (!routeIds) return [];\n\treturn routeIds\n\t\t.map((routeId) => REVERSE_SKILL_ROUTES.find((route) => route.id === routeId))\n\t\t.filter((route): route is ReverseSkillRoute => Boolean(route));\n}\n\nexport function formatReverseSkillMarkdown(input: ReverseSkillSpecInput): string {\n\tconst routes = routesFromIds(input.routeIds);\n\tconst name = normalizeReverseSkillName(input.name);\n\tconst description = compactDescription(input, routes);\n\tconst workflowSteps = input.workflowSteps?.length\n\t\t? input.workflowSteps\n\t\t: [\n\t\t\t\t\"Classify target, intent, and available toolchain before execution\",\n\t\t\t\t\"Read the routed sub-skill or reference\",\n\t\t\t\t\"Collect evidence and record blockers\",\n\t\t\t\t\"Verify output against acceptance criteria\",\n\t\t\t];\n\tconst tools = unique([\n\t\t...(input.tools ?? []),\n\t\t...routes.flatMap((route) => [...route.requiredTools, ...route.optionalTools]),\n\t]);\n\tconst mcpServers = unique([...(input.mcpServers ?? []), ...routes.flatMap((route) => route.mcpHints)]);\n\tconst hooks = unique([...(input.hooks ?? []), ...routes.flatMap((route) => route.hookHints)]);\n\tconst acceptance = unique([...(input.acceptance ?? []), ...routes.flatMap((route) => route.acceptance)]);\n\tconst safetyNotes = input.safetyNotes?.length\n\t\t? input.safetyNotes\n\t\t: [\n\t\t\t\t\"Operate only on user-provided local artifacts or explicitly scoped targets\",\n\t\t\t\t\"Do not write secrets, tokens, credentials, or raw private data into skill artifacts\",\n\t\t\t];\n\n\tconst lines = [\n\t\t\"---\",\n\t\t`name: ${name}`,\n\t\t`description: ${yamlString(description)}`,\n\t\t\"---\",\n\t\t\"\",\n\t\t`# ${name}`,\n\t\t\"\",\n\t\t\"## Routing contract\",\n\t\t\"\",\n\t\t`Trigger this skill when ${input.triggerSummary}.`,\n\t\t\"\",\n\t\t\"1. Classify the target type, user intent, and toolchain signals before choosing tools.\",\n\t\t\"2. Read the narrowest referenced sub-skill or reference before running specialized tooling.\",\n\t\t\"3. Prefer passive/local evidence collection first; escalate only when the task scope requires it.\",\n\t\t\"4. Save evidence paths and blockers in the final response.\",\n\t\t\"\",\n\t\t\"## Workflow\",\n\t\t\"\",\n\t\t...workflowSteps.map((step, index) => `${index + 1}. ${step}`),\n\t\t\"\",\n\t\t\"## Tool selection\",\n\t\t\"\",\n\t\t`- Tools: ${tools.join(\", \") || \"none required\"}`,\n\t\t`- MCP: ${mcpServers.join(\", \") || \"filesystem/read-only\"}`,\n\t\t`- Hooks: ${hooks.join(\", \") || \"pre-shell-guard, protect-secrets\"}`,\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t\"\",\n\t\t...(acceptance.length > 0\n\t\t\t? acceptance.map((item) => `- ${item}`)\n\t\t\t: [\"- Output includes routed skill, evidence, commands, and remaining blockers\"]),\n\t\t\"\",\n\t\t\"## Safety constraints\",\n\t\t\"\",\n\t\t...safetyNotes.map((note) => `- ${note}`),\n\t];\n\n\tif (routes.length > 0) {\n\t\tlines.push(\"\", \"## Built-in routes\", \"\");\n\t\tfor (const route of routes) {\n\t\t\tlines.push(`- ${route.id}: ${route.skillPath}`);\n\t\t}\n\t}\n\n\tif (input.references?.length) {\n\t\tlines.push(\"\", \"## References\", \"\");\n\t\tfor (const reference of input.references) lines.push(`- ${reference}`);\n\t}\n\n\treturn `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n\nexport function extractReverseSkillFactsFromMarkdown(sourceText: string): ReverseSkillSourceFacts {\n\tconst headings = unique(\n\t\tArray.from(sourceText.matchAll(/^#{1,4}\\s+(.+)$/gm)).map((match) => match[1]?.trim() ?? \"\"),\n\t).slice(0, 24);\n\tconst skillPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+SKILL\\.md)/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst scriptPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+\\.(?:ps1|sh|py|js|ts))/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst knownTools = Object.keys(TOOL_ALIASES);\n\tconst normalizedSource = normalizeReverseSkillText(sourceText);\n\tconst tools = knownTools.filter((tool) => normalizedSource.includes(normalizeReverseSkillText(tool)));\n\tconst mcpServers = unique(\n\t\tArray.from(sourceText.matchAll(/\\b([a-z0-9-]+)\\s+MCP\\b/gi)).map((match) => match[1]?.toLowerCase() ?? \"\"),\n\t);\n\tconst triggerTerms = unique(\n\t\tREVERSE_SKILL_ROUTES.flatMap((route) => [\n\t\t\t...route.targetPatterns,\n\t\t\t...route.intentPatterns,\n\t\t\t...route.toolPatterns,\n\t\t]).filter((term) => normalizedSource.includes(normalizeReverseSkillText(term))),\n\t).slice(0, 40);\n\n\treturn { headings, skillPaths, scriptPaths, tools, mcpServers, triggerTerms };\n}\n\nexport function formatReverseSkillFromSource(input: ReverseSkillSourceInput): string {\n\tconst facts = extractReverseSkillFactsFromMarkdown(input.sourceText);\n\tconst query = [input.triggerSummary, facts.triggerTerms.slice(0, 12).join(\" \"), facts.headings.slice(0, 8).join(\" \")]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\tconst decision = routeReverseSkill({ query: query || input.sourceText.slice(0, 500) });\n\tconst routeIds = [decision.primary?.route.id, ...decision.alternatives.map((item) => item.route.id)].filter(\n\t\t(routeId): routeId is string => Boolean(routeId),\n\t);\n\tconst name = input.name ?? (decision.primary ? `${decision.primary.route.id}-workflow` : \"reverse-skill-workflow\");\n\tconst triggerSummary =\n\t\tinput.triggerSummary ??\n\t\t(facts.triggerTerms.slice(0, 8).join(\", \") || \"reverse-engineering or security routing is needed\");\n\tconst workflowSteps = [\n\t\t\"Classify the incoming request against target, intent, and toolchain signals\",\n\t\t\"Load the routed sub-skill before running specialized tooling\",\n\t\t\"Check local tool availability only for tools required by the selected route\",\n\t\t\"Return evidence paths, commands, confidence, and blockers\",\n\t];\n\n\treturn formatReverseSkillMarkdown({\n\t\tname,\n\t\tdescription: input.description,\n\t\ttriggerSummary,\n\t\trouteIds,\n\t\tworkflowSteps,\n\t\ttools: facts.tools,\n\t\tmcpServers: facts.mcpServers,\n\t\treferences: unique([...facts.skillPaths, ...facts.scriptPaths]).slice(0, 20),\n\t});\n}\n"]}
1
+ {"version":3,"file":"reverse-skill.d.ts","sourceRoot":"","sources":["../../src/harness/reverse-skill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M,CAAC;CACxB;AASD,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EA+WnD,CAAC;AAwCF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEjE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAS1E;AA2DD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,yBAAyB,CA0B1F;AAYD,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,CAgD3F;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,yBAAyB,EAAE,QAAQ,SAAK,GAAG,MAAM,EAAE,CASvG;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ9D;AAsBD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CA6E/E;AAED,wBAAgB,oCAAoC,CAAC,UAAU,EAAE,MAAM,GAAG,uBAAuB,CAyBhG;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CA8BnF","sourcesContent":["export type ReverseSkillPlatform = \"windows\" | \"linux\" | \"macos\" | \"kali\" | \"unknown\";\n\nexport type ReverseSkillRisk = \"passive-analysis\" | \"local-tooling\" | \"active-security\" | \"exploit-development\";\n\nexport interface ReverseSkillRoute {\n\tid: string;\n\tlabel: string;\n\tskillPath: string;\n\ttargetPatterns: string[];\n\tintentPatterns: string[];\n\ttoolPatterns: string[];\n\tkeywords: string[];\n\trequiredTools: string[];\n\toptionalTools: string[];\n\tskillHints: string[];\n\tmcpHints: string[];\n\thookHints: string[];\n\tacceptance: string[];\n\tfirstActions: string[];\n\trisk: ReverseSkillRisk;\n}\n\nexport interface ReverseSkillRouteInput {\n\tquery: string;\n\ttargetType?: string;\n\tintent?: string;\n\ttoolchain?: string;\n\tplatform?: ReverseSkillPlatform;\n\tmaxAlternatives?: number;\n}\n\nexport interface ReverseSkillRouteScore {\n\troute: ReverseSkillRoute;\n\tscore: number;\n\tconfidence: number;\n\tmatched: {\n\t\ttarget: string[];\n\t\tintent: string[];\n\t\ttoolchain: string[];\n\t\tkeywords: string[];\n\t};\n\tmissingDimensions: string[];\n}\n\nexport interface ReverseSkillRouteDecision {\n\tquery: string;\n\tplatform: ReverseSkillPlatform;\n\tnormalizedQuery: string;\n\tprimary?: ReverseSkillRouteScore;\n\talternatives: ReverseSkillRouteScore[];\n\tunmatched: boolean;\n\tnextAction: string;\n}\n\nexport interface ReverseSkillSpecInput {\n\tname: string;\n\tdescription?: string;\n\ttriggerSummary: string;\n\trouteIds?: string[];\n\tworkflowSteps?: string[];\n\ttools?: string[];\n\tmcpServers?: string[];\n\thooks?: string[];\n\tacceptance?: string[];\n\treferences?: string[];\n\tsafetyNotes?: string[];\n}\n\nexport interface ReverseSkillSourceFacts {\n\theadings: string[];\n\tskillPaths: string[];\n\tscriptPaths: string[];\n\ttools: string[];\n\tmcpServers: string[];\n\ttriggerTerms: string[];\n}\n\nexport interface ReverseSkillSourceInput {\n\tname?: string;\n\tdescription?: string;\n\tsourceText: string;\n\ttriggerSummary?: string;\n}\n\nconst ROUTE_SCORE_TARGET_WEIGHT = 4;\nconst ROUTE_SCORE_INTENT_WEIGHT = 3;\nconst ROUTE_SCORE_TOOL_WEIGHT = 2;\nconst ROUTE_SCORE_KEYWORD_WEIGHT = 1;\nconst ROUTE_SCORE_FULL_TRIAD_BONUS = 4;\nconst ROUTE_SCORE_CONFIDENCE_DENOMINATOR = 14;\n\nexport const REVERSE_SKILL_ROUTES: ReverseSkillRoute[] = [\n\t{\n\t\tid: \"apk-reverse\",\n\t\tlabel: \"APK / Android reverse engineering\",\n\t\tskillPath: \"skills/apk-reverse/SKILL.md\",\n\t\ttargetPatterns: [\"apk\", \"android\", \"aab\", \"smali\", \"jni\", \"dex\", \"안드로이드\", \"反编译\"],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"unpack\",\n\t\t\t\"repack\",\n\t\t\t\"manifest\",\n\t\t\t\"frida\",\n\t\t\t\"hook\",\n\t\t\t\"ssl pinning\",\n\t\t\t\"root detection\",\n\t\t\t\"rebuild\",\n\t\t\t\"sign\",\n\t\t\t\"설치\",\n\t\t\t\"리패키징\",\n\t\t],\n\t\ttoolPatterns: [\"jadx\", \"apktool\", \"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tkeywords: [\"classes.dex\", \"androidmanifest\", \"native library\", \"lib/\", \".so\", \"certificate pinning\", \"smali\"],\n\t\trequiredTools: [\"jadx\", \"apktool\"],\n\t\toptionalTools: [\"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tskillHints: [\"apk-reverse\", \"reverse-engineering\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright for app docs only\", \"idapro if native .so becomes dominant\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"subagent-stop-audit\"],\n\t\tacceptance: [\n\t\t\t\"Target package structure is identified\",\n\t\t\t\"Static findings cite class/method/file paths\",\n\t\t\t\"Any dynamic step is scoped to a local test device or emulator\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm target artifact path\",\n\t\t\t\"Decode APK metadata\",\n\t\t\t\"Route native .so files to binary analysis when needed\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ida-reverse\",\n\t\tlabel: \"Binary reverse engineering with decompiler-first workflow\",\n\t\tskillPath: \"skills/ida-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"exe\",\n\t\t\t\"dll\",\n\t\t\t\"elf\",\n\t\t\t\"so\",\n\t\t\t\"dylib\",\n\t\t\t\"macho\",\n\t\t\t\"pe\",\n\t\t\t\"binary\",\n\t\t\t\"firmware blob\",\n\t\t\t\"바이너리\",\n\t\t\t\"二进制\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"disassemble\",\n\t\t\t\"xref\",\n\t\t\t\"call graph\",\n\t\t\t\"data flow\",\n\t\t\t\"rename\",\n\t\t\t\"symbol\",\n\t\t\t\"recover\",\n\t\t\t\"pseudocode\",\n\t\t\t\"함수\",\n\t\t\t\"反汇编\",\n\t\t],\n\t\ttoolPatterns: [\"ida\", \"idapro\", \"idalib\", \"ida-pro-mcp\", \"ghidra\", \"r2\", \"radare2\"],\n\t\tkeywords: [\"imports\", \"exports\", \"strings\", \"function\", \"offset\", \"xref\", \"pdb\", \"symbols\"],\n\t\trequiredTools: [\"idapro\"],\n\t\toptionalTools: [\"idalib-mcp\", \"ghidra\", \"radare2\", \"rabin2\"],\n\t\tskillHints: [\"ida-reverse\", \"radare2\", \"reverse-engineering\", \"binary-diff\"],\n\t\tmcpHints: [\"idapro\", \"filesystem\", \"serena\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Functions are cited by address/name\",\n\t\t\t\"Hypotheses cite disassembly, decompiler, xref, or string evidence\",\n\t\t\t\"Output distinguishes evidence from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run strings/imports reconnaissance\",\n\t\t\t\"Choose IDA or CLI path based on available tools\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"radare2\",\n\t\tlabel: \"Binary reconnaissance with radare2 CLI\",\n\t\tskillPath: \"skills/radare2/SKILL.md\",\n\t\ttargetPatterns: [\"binary\", \"elf\", \"pe\", \"macho\", \"so\", \"dll\", \"firmware\", \"바이너리\"],\n\t\tintentPatterns: [\"quick recon\", \"strings\", \"imports\", \"exports\", \"patch\", \"offset\", \"cli\", \"headless\"],\n\t\ttoolPatterns: [\"radare2\", \"r2\", \"rabin2\", \"rasm2\", \"radiff2\"],\n\t\tkeywords: [\"entrypoint\", \"section\", \"symbol\", \"hex\", \"disassembly\", \"patch bytes\"],\n\t\trequiredTools: [\"radare2\", \"rabin2\"],\n\t\toptionalTools: [\"rasm2\", \"radiff2\", \"r2pipe\"],\n\t\tskillHints: [\"radare2\", \"ida-reverse\", \"reverse-engineering\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Recon output names sections, imports, symbols, and notable strings\",\n\t\t\t\"Patch guidance includes offset and before/after bytes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Run file metadata\",\n\t\t\t\"Run rabin2-style reconnaissance\",\n\t\t\t\"Escalate to decompiler if CLI evidence is insufficient\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"js-reverse\",\n\t\tlabel: \"Frontend JavaScript signature and request reconstruction\",\n\t\tskillPath: \"skills/js-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"javascript\",\n\t\t\t\"js\",\n\t\t\t\"frontend\",\n\t\t\t\"webpack\",\n\t\t\t\"source map\",\n\t\t\t\"sourcemap\",\n\t\t\t\"web\",\n\t\t\t\"browser\",\n\t\t\t\"前端\",\n\t\t\t\"프론트\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"signature\",\n\t\t\t\"encrypted params\",\n\t\t\t\"request replay\",\n\t\t\t\"token\",\n\t\t\t\"decrypt\",\n\t\t\t\"environment patch\",\n\t\t\t\"ast\",\n\t\t\t\"breakpoint\",\n\t\t\t\"hook\",\n\t\t\t\"서명\",\n\t\t\t\"암호화\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome\", \"cdp\", \"jshook\", \"jshookmcp\", \"node\", \"anything-analyzer\"],\n\t\tkeywords: [\n\t\t\t\"sign\",\n\t\t\t\"nonce\",\n\t\t\t\"timestamp\",\n\t\t\t\"crypto\",\n\t\t\t\"axios\",\n\t\t\t\"fetch\",\n\t\t\t\"xhr\",\n\t\t\t\"webpackJsonp\",\n\t\t\t\"localStorage\",\n\t\t\t\"cookie\",\n\t\t],\n\t\trequiredTools: [\"node\"],\n\t\toptionalTools: [\"playwright\", \"jshookmcp\", \"anything-analyzer\", \"chrome\"],\n\t\tskillHints: [\"js-reverse\", \"browser-automation\", \"docs-generator\"],\n\t\tmcpHints: [\"chrome-devtools\", \"playwright\", \"fetch\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"session-context\"],\n\t\tacceptance: [\n\t\t\t\"Target request and parameter names are identified\",\n\t\t\t\"Recovered algorithm has a local reproduction or explicit blocker\",\n\t\t\t\"Browser/runtime observations are tied to request evidence\",\n\t\t],\n\t\tfirstActions: [\"Identify target request\", \"Find producer function\", \"Rebuild the minimum local reproduction\"],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"browser-automation\",\n\t\tlabel: \"Browser or desktop evidence collection\",\n\t\tskillPath: \"skills/browser-automation/SKILL.md\",\n\t\ttargetPatterns: [\"website\", \"browser\", \"web app\", \"desktop app\", \"page\", \"form\", \"웹\", \"브라우저\"],\n\t\tintentPatterns: [\n\t\t\t\"open\",\n\t\t\t\"screenshot\",\n\t\t\t\"fill\",\n\t\t\t\"crawl\",\n\t\t\t\"capture\",\n\t\t\t\"network\",\n\t\t\t\"login\",\n\t\t\t\"observe\",\n\t\t\t\"click\",\n\t\t\t\"샷\",\n\t\t\t\"스크린샷\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome-devtools\", \"agent-browser\", \"openreverse\", \"anything-analyzer\"],\n\t\tkeywords: [\"dom\", \"selector\", \"network log\", \"console\", \"cookie\", \"screenshot\", \"trace\"],\n\t\trequiredTools: [\"playwright\"],\n\t\toptionalTools: [\"chrome\", \"agent-browser\", \"anything-analyzer\"],\n\t\tskillHints: [\"browser-automation\", \"js-reverse\", \"docs-generator\"],\n\t\tmcpHints: [\"playwright\", \"chrome-devtools\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Browser state is captured with URL and selector evidence\",\n\t\t\t\"Screenshots or logs are saved as artifacts when visual proof matters\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Open the target in an isolated browser context\",\n\t\t\t\"Capture visible state\",\n\t\t\t\"Record console/network evidence\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"gitreverse\",\n\t\tlabel: \"Repository-to-prompt reconstruction (GitReverse workflow)\",\n\t\tskillPath: \"skills/gitreverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"github\",\n\t\t\t\"gitlab\",\n\t\t\t\"gitee\",\n\t\t\t\"repository\",\n\t\t\t\"repo\",\n\t\t\t\"monorepo\",\n\t\t\t\"codebase\",\n\t\t\t\"레포지토리\",\n\t\t\t\"저장소\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"vibe code\",\n\t\t\t\"prompt\",\n\t\t\t\"paste into\",\n\t\t\t\"cursor\",\n\t\t\t\"claude code\",\n\t\t\t\"codex\",\n\t\t\t\"from scratch\",\n\t\t\t\"reconstruct\",\n\t\t\t\"synthesize\",\n\t\t\t\"프롬프트\",\n\t\t],\n\t\ttoolPatterns: [\"git\", \"gh\", \"github cli\", \"github api\", \"gitreverse\"],\n\t\tkeywords: [\n\t\t\t\"owner/repo\",\n\t\t\t\"file tree\",\n\t\t\t\"readme\",\n\t\t\t\"repo metadata\",\n\t\t\t\"shareable link\",\n\t\t\t\"synthetic prompt\",\n\t\t\t\"vibe coding\",\n\t\t],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"git\", \"gh\"],\n\t\tskillHints: [\"gitreverse\", \"clone-website\", \"docs-generator\"],\n\t\tmcpHints: [\"github\", \"filesystem\"],\n\t\thookHints: [\"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Repository owner/name is parsed from the URL or slug before any fetch\",\n\t\t\t\"The generated prompt is grounded in README and file-tree evidence\",\n\t\t\t\"Only public repository data is used; private or credential-bearing content is refused and redacted\",\n\t\t\t\"Observed repo facts and synthesized prompt text are clearly separated\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Parse owner/repo from the GitHub URL or `owner/repo` slug\",\n\t\t\t\"Fetch repo metadata, root file tree (depth 1), and README\",\n\t\t\t\"Synthesize one short conversational prompt grounded in that context\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"ctf-sandbox-orchestrator\",\n\t\tlabel: \"CTF challenge routing\",\n\t\tskillPath: \"../CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md\",\n\t\ttargetPatterns: [\"ctf\", \"challenge\", \"flag\", \"pwn\", \"crypto challenge\", \"forensics\", \"misc\", \"rev\", \"대회\"],\n\t\tintentPatterns: [\"solve\", \"find flag\", \"exploit\", \"writeup\", \"sandbox\", \"analyze challenge\"],\n\t\ttoolPatterns: [\"pwntools\", \"gdb\", \"python\", \"sage\", \"z3\", \"binwalk\", \"wireshark\"],\n\t\tkeywords: [\"flag{\", \"ctf\", \"nc \", \"remote\", \"proof\", \"challenge files\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"python\", \"gdb\", \"pwntools\", \"z3\", \"binwalk\"],\n\t\tskillHints: [\"ctf-sandbox-orchestrator\", \"reverse-engineering\", \"pwn-chain\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"memory\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Challenge category is justified by evidence\",\n\t\t\t\"Solution artifacts are reproducible\",\n\t\t\t\"Writeup includes the shortest verified path\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory challenge files\",\n\t\t\t\"Classify dominant evidence\",\n\t\t\t\"Dispatch to the narrowest CTF sub-skill\",\n\t\t],\n\t\trisk: \"exploit-development\",\n\t},\n\t{\n\t\tid: \"api-security\",\n\t\tlabel: \"API security review and authorized test planning\",\n\t\tskillPath: \"skills/api-security/SKILL.md\",\n\t\ttargetPatterns: [\"api\", \"rest\", \"graphql\", \"websocket\", \"jwt\", \"oauth\", \"endpoint\"],\n\t\tintentPatterns: [\"review\", \"test\", \"auth\", \"idor\", \"bola\", \"bfla\", \"rate limit\", \"schema\", \"권한\", \"越权\"],\n\t\ttoolPatterns: [\"burp\", \"postman\", \"nuclei\", \"zap\", \"curl\", \"graphql\"],\n\t\tkeywords: [\"authorization\", \"authentication\", \"tenant\", \"object id\", \"jwt\", \"scope\", \"graphql\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"burpsuite\", \"nuclei\", \"zap\", \"node\", \"python\"],\n\t\tskillHints: [\"api-security\", \"pentest-tools\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Scope boundary is explicit\",\n\t\t\t\"Findings include request/response evidence or code references\",\n\t\t\t\"High-risk active steps require explicit target scope\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Identify API surface\",\n\t\t\t\"Map auth and tenant boundaries\",\n\t\t\t\"Choose static review or scoped dynamic testing\",\n\t\t],\n\t\trisk: \"active-security\",\n\t},\n\t{\n\t\tid: \"supply-chain-security\",\n\t\tlabel: \"Supply-chain and CI/CD security analysis\",\n\t\tskillPath: \"skills/supply-chain-security/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"dependency\",\n\t\t\t\"package\",\n\t\t\t\"sbom\",\n\t\t\t\"container\",\n\t\t\t\"docker\",\n\t\t\t\"ci\",\n\t\t\t\"workflow\",\n\t\t\t\"github actions\",\n\t\t\t\"supply chain\",\n\t\t],\n\t\tintentPatterns: [\"scan\", \"audit\", \"gitleaks\", \"trivy\", \"osv\", \"syft\", \"secret\", \"provenance\", \"attestation\"],\n\t\ttoolPatterns: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"npm audit\", \"semgrep\"],\n\t\tkeywords: [\"package-lock\", \"npm-shrinkwrap\", \"dockerfile\", \"workflow\", \"actions\", \"secret\", \"sbom\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"semgrep\"],\n\t\tskillHints: [\"supply-chain-security\", \"security-review\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\"],\n\t\thookHints: [\"protect-secrets\", \"pre-shell-guard\", \"npm-audit-summary\"],\n\t\tacceptance: [\n\t\t\t\"Dependency, workflow, and secret surfaces are separated\",\n\t\t\t\"Findings cite exact files and lockfile evidence\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory package managers and workflows\",\n\t\t\t\"Run non-mutating scans first\",\n\t\t\t\"Triangulate tool output with source evidence\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"docs-generator\",\n\t\tlabel: \"Security or reverse-engineering report generation\",\n\t\tskillPath: \"skills/docs-generator/SKILL.md\",\n\t\ttargetPatterns: [\"report\", \"writeup\", \"documentation\", \"diagram\", \"flowchart\", \"보고서\", \"문서\"],\n\t\tintentPatterns: [\"write\", \"summarize\", \"generate\", \"document\", \"explain\", \"diagram\", \"publish\"],\n\t\ttoolPatterns: [\"markdown\", \"mermaid\", \"graphviz\", \"plantuml\", \"pdf\"],\n\t\tkeywords: [\"executive summary\", \"reproduction\", \"impact\", \"timeline\", \"artifact\", \"evidence\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"graphviz\", \"plantuml\", \"pandoc\"],\n\t\tskillHints: [\"docs-generator\", \"diagram-generator\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Report separates facts, analysis, and recommendations\",\n\t\t\t\"Artifacts and commands are reproducible\",\n\t\t\t\"Sensitive values are redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect evidence paths\",\n\t\t\t\"Choose report template\",\n\t\t\t\"Add at least one flow or evidence diagram when useful\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n];\n\nconst TOOL_ALIASES: Record<string, string[]> = {\n\t\"anything-analyzer\": [\"anything-analyzer\"],\n\tadb: [\"adb\"],\n\tapktool: [\"apktool\"],\n\tapksigner: [\"apksigner\"],\n\tbinwalk: [\"binwalk\"],\n\tburpsuite: [\"burpsuite\"],\n\tchrome: [\"google-chrome\", \"chromium\", \"chrome\"],\n\tfrida: [\"frida\", \"frida-ps\"],\n\tgdb: [\"gdb\"],\n\tgh: [\"gh\"],\n\tgit: [\"git\"],\n\tghidra: [\"ghidraRun\", \"analyzeHeadless\"],\n\tgitleaks: [\"gitleaks\"],\n\tgraphviz: [\"dot\"],\n\tidapro: [\"ida\", \"idat\", \"idat64\"],\n\t\"idalib-mcp\": [\"ida-pro-mcp\", \"idalib-mcp\"],\n\tjadx: [\"jadx\"],\n\tjshookmcp: [\"jshook\", \"npx\"],\n\tnode: [\"node\"],\n\tnuclei: [\"nuclei\"],\n\tpandoc: [\"pandoc\"],\n\tplantuml: [\"plantuml\"],\n\tplaywright: [\"playwright\", \"npx\"],\n\tpwntools: [\"python\"],\n\tpython: [\"python3\", \"python\"],\n\tradare2: [\"radare2\", \"r2\"],\n\trabin2: [\"rabin2\"],\n\tradiff2: [\"radiff2\"],\n\trasm2: [\"rasm2\"],\n\tsemgrep: [\"semgrep\"],\n\tsyft: [\"syft\"],\n\ttrivy: [\"trivy\"],\n\tzap: [\"zap.sh\", \"zap-baseline.py\"],\n\tzipalign: [\"zipalign\"],\n\tz3: [\"z3\"],\n};\n\nexport function getReverseSkillToolAliases(tool: string): string[] {\n\treturn TOOL_ALIASES[tool] ?? [tool];\n}\n\nexport function normalizeReverseSkillText(text: string | undefined): string {\n\treturn (text ?? \"\")\n\t\t.normalize(\"NFKC\")\n\t\t.toLowerCase()\n\t\t.replace(/[\\u2018\\u2019]/g, \"'\")\n\t\t.replace(/[\\u201c\\u201d]/g, '\"')\n\t\t.replace(/[_./\\\\:-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction findPatternMatches(text: string, patterns: string[]): string[] {\n\tconst matches: string[] = [];\n\tfor (const pattern of patterns) {\n\t\tconst normalizedPattern = normalizeReverseSkillText(pattern);\n\t\tif (!normalizedPattern) continue;\n\t\tif (text.includes(normalizedPattern)) matches.push(pattern);\n\t}\n\treturn matches;\n}\n\nfunction unique(items: string[]): string[] {\n\treturn Array.from(new Set(items.filter((item) => item.trim().length > 0)));\n}\n\nfunction clampConfidence(score: number): number {\n\tif (score <= 0) return 0;\n\treturn Math.min(0.99, Number((score / ROUTE_SCORE_CONFIDENCE_DENOMINATOR).toFixed(2)));\n}\n\nfunction scoreRoute(\n\troute: ReverseSkillRoute,\n\tinput: ReverseSkillRouteInput,\n\tnormalizedQuery: string,\n): ReverseSkillRouteScore {\n\tconst targetText = normalizeReverseSkillText(`${input.targetType ?? \"\"} ${normalizedQuery}`);\n\tconst intentText = normalizeReverseSkillText(`${input.intent ?? \"\"} ${normalizedQuery}`);\n\tconst toolText = normalizeReverseSkillText(`${input.toolchain ?? \"\"} ${normalizedQuery}`);\n\n\tconst target = findPatternMatches(targetText, route.targetPatterns);\n\tconst intent = findPatternMatches(intentText, route.intentPatterns);\n\tconst toolchain = findPatternMatches(toolText, route.toolPatterns);\n\tconst keywords = findPatternMatches(normalizedQuery, route.keywords);\n\n\tlet score =\n\t\ttarget.length * ROUTE_SCORE_TARGET_WEIGHT +\n\t\tintent.length * ROUTE_SCORE_INTENT_WEIGHT +\n\t\ttoolchain.length * ROUTE_SCORE_TOOL_WEIGHT +\n\t\tkeywords.length * ROUTE_SCORE_KEYWORD_WEIGHT;\n\n\tif (target.length > 0 && intent.length > 0 && toolchain.length > 0) {\n\t\tscore += ROUTE_SCORE_FULL_TRIAD_BONUS;\n\t}\n\n\tconst missingDimensions: string[] = [];\n\tif (target.length === 0) missingDimensions.push(\"target\");\n\tif (intent.length === 0) missingDimensions.push(\"intent\");\n\tif (toolchain.length === 0) missingDimensions.push(\"toolchain\");\n\n\treturn {\n\t\troute,\n\t\tscore,\n\t\tconfidence: clampConfidence(score),\n\t\tmatched: { target, intent, toolchain, keywords },\n\t\tmissingDimensions,\n\t};\n}\n\nexport function routeReverseSkill(input: ReverseSkillRouteInput): ReverseSkillRouteDecision {\n\tconst normalizedQuery = normalizeReverseSkillText(input.query);\n\tconst platform = input.platform ?? \"unknown\";\n\tconst maxAlternatives = input.maxAlternatives ?? 3;\n\tconst scored = REVERSE_SKILL_ROUTES.map((route) => scoreRoute(route, input, normalizedQuery))\n\t\t.filter((candidate) => candidate.score > 0)\n\t\t.sort(\n\t\t\t(a, b) => b.score - a.score || REVERSE_SKILL_ROUTES.indexOf(a.route) - REVERSE_SKILL_ROUTES.indexOf(b.route),\n\t\t);\n\n\tconst primary = scored[0];\n\tconst alternatives = scored.slice(1, maxAlternatives + 1);\n\tconst unmatched = !primary || primary.score < ROUTE_SCORE_TARGET_WEIGHT || primary.confidence < 0.18;\n\tconst nextAction = unmatched\n\t\t? \"No strong route matched. Create or extend a reverse-skill route before executing specialized tooling.\"\n\t\t: `Read ${primary.route.skillPath}, then execute first action: ${primary.route.firstActions[0] ?? \"classify target\"}.`;\n\n\treturn {\n\t\tquery: input.query,\n\t\tplatform,\n\t\tnormalizedQuery,\n\t\tprimary: unmatched ? undefined : primary,\n\t\talternatives,\n\t\tunmatched,\n\t\tnextAction,\n\t};\n}\n\nfunction formatMatches(score: ReverseSkillRouteScore): string {\n\tconst parts = [\n\t\t`target=${score.matched.target.join(\", \") || \"—\"}`,\n\t\t`intent=${score.matched.intent.join(\", \") || \"—\"}`,\n\t\t`toolchain=${score.matched.toolchain.join(\", \") || \"—\"}`,\n\t\t`keywords=${score.matched.keywords.join(\", \") || \"—\"}`,\n\t];\n\treturn parts.join(\"; \");\n}\n\nexport function formatReverseSkillRouteDecision(decision: ReverseSkillRouteDecision): string {\n\tif (decision.unmatched || !decision.primary) {\n\t\treturn [\n\t\t\t\"# Reverse Skill Route\",\n\t\t\t\"\",\n\t\t\t`Query: ${decision.query}`,\n\t\t\t\"\",\n\t\t\t\"No strong route matched.\",\n\t\t\t\"Next action: create or extend a route before specialized execution.\",\n\t\t].join(\"\\n\");\n\t}\n\n\tconst primary = decision.primary;\n\tconst lines = [\n\t\t\"# Reverse Skill Route\",\n\t\t\"\",\n\t\t`Query: ${decision.query}`,\n\t\t`Platform: ${decision.platform}`,\n\t\t\"\",\n\t\t`## Primary: ${primary.route.label}`,\n\t\t`- Route ID: ${primary.route.id}`,\n\t\t`- Skill path: ${primary.route.skillPath}`,\n\t\t`- Confidence: ${primary.confidence}`,\n\t\t`- Score: ${primary.score}`,\n\t\t`- Matches: ${formatMatches(primary)}`,\n\t\t`- Risk: ${primary.route.risk}`,\n\t\t`- Required tools: ${primary.route.requiredTools.join(\", \") || \"none\"}`,\n\t\t`- Optional tools: ${primary.route.optionalTools.join(\", \") || \"none\"}`,\n\t\t`- Skill hints: ${primary.route.skillHints.join(\", \")}`,\n\t\t`- MCP hints: ${primary.route.mcpHints.join(\", \")}`,\n\t\t`- Hooks: ${primary.route.hookHints.join(\", \")}`,\n\t\t\"\",\n\t\t\"## First actions\",\n\t\t...primary.route.firstActions.map((action, index) => `${index + 1}. ${action}`),\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t...primary.route.acceptance.map((item) => `- ${item}`),\n\t];\n\n\tif (decision.alternatives.length > 0) {\n\t\tlines.push(\"\", \"## Alternatives\");\n\t\tfor (const alternative of decision.alternatives) {\n\t\t\tlines.push(`- ${alternative.route.id} (${alternative.confidence}): ${formatMatches(alternative)}`);\n\t\t}\n\t}\n\n\tlines.push(\"\", `Next action: ${decision.nextAction}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function planReverseSkillToolChecks(decision: ReverseSkillRouteDecision, maxTools = 12): string[] {\n\tconst routes = [decision.primary, ...decision.alternatives].filter((score): score is ReverseSkillRouteScore =>\n\t\tBoolean(score),\n\t);\n\tconst tools: string[] = [];\n\tfor (const score of routes) {\n\t\ttools.push(...score.route.requiredTools, ...score.route.optionalTools);\n\t}\n\treturn unique(tools).slice(0, maxTools);\n}\n\nexport function normalizeReverseSkillName(name: string): string {\n\tconst normalized = normalizeReverseSkillText(name)\n\t\t.replace(/[^a-z0-9-]+/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.slice(0, 64)\n\t\t.replace(/-$/g, \"\");\n\treturn normalized || \"reverse-skill\";\n}\n\nfunction yamlString(value: string): string {\n\treturn JSON.stringify(value);\n}\n\nfunction compactDescription(input: ReverseSkillSpecInput, routes: ReverseSkillRoute[]): string {\n\tconst fallback = `Use when ${input.triggerSummary}`;\n\tconst base = input.description?.trim() || fallback;\n\tconst routeNames = routes.map((route) => route.id).join(\", \");\n\tconst suffix = routeNames ? ` Routes through ${routeNames}.` : \"\";\n\tconst description = `${base}${suffix}`;\n\treturn description.length <= 1024 ? description : `${description.slice(0, 1021).trimEnd()}...`;\n}\n\nfunction routesFromIds(routeIds: string[] | undefined): ReverseSkillRoute[] {\n\tif (!routeIds) return [];\n\treturn routeIds\n\t\t.map((routeId) => REVERSE_SKILL_ROUTES.find((route) => route.id === routeId))\n\t\t.filter((route): route is ReverseSkillRoute => Boolean(route));\n}\n\nexport function formatReverseSkillMarkdown(input: ReverseSkillSpecInput): string {\n\tconst routes = routesFromIds(input.routeIds);\n\tconst name = normalizeReverseSkillName(input.name);\n\tconst description = compactDescription(input, routes);\n\tconst workflowSteps = input.workflowSteps?.length\n\t\t? input.workflowSteps\n\t\t: [\n\t\t\t\t\"Classify target, intent, and available toolchain before execution\",\n\t\t\t\t\"Read the routed sub-skill or reference\",\n\t\t\t\t\"Collect evidence and record blockers\",\n\t\t\t\t\"Verify output against acceptance criteria\",\n\t\t\t];\n\tconst tools = unique([\n\t\t...(input.tools ?? []),\n\t\t...routes.flatMap((route) => [...route.requiredTools, ...route.optionalTools]),\n\t]);\n\tconst mcpServers = unique([...(input.mcpServers ?? []), ...routes.flatMap((route) => route.mcpHints)]);\n\tconst hooks = unique([...(input.hooks ?? []), ...routes.flatMap((route) => route.hookHints)]);\n\tconst acceptance = unique([...(input.acceptance ?? []), ...routes.flatMap((route) => route.acceptance)]);\n\tconst safetyNotes = input.safetyNotes?.length\n\t\t? input.safetyNotes\n\t\t: [\n\t\t\t\t\"Operate only on user-provided local artifacts or explicitly scoped targets\",\n\t\t\t\t\"Do not write secrets, tokens, credentials, or raw private data into skill artifacts\",\n\t\t\t];\n\n\tconst lines = [\n\t\t\"---\",\n\t\t`name: ${name}`,\n\t\t`description: ${yamlString(description)}`,\n\t\t\"---\",\n\t\t\"\",\n\t\t`# ${name}`,\n\t\t\"\",\n\t\t\"## Routing contract\",\n\t\t\"\",\n\t\t`Trigger this skill when ${input.triggerSummary}.`,\n\t\t\"\",\n\t\t\"1. Classify the target type, user intent, and toolchain signals before choosing tools.\",\n\t\t\"2. Read the narrowest referenced sub-skill or reference before running specialized tooling.\",\n\t\t\"3. Prefer passive/local evidence collection first; escalate only when the task scope requires it.\",\n\t\t\"4. Save evidence paths and blockers in the final response.\",\n\t\t\"\",\n\t\t\"## Workflow\",\n\t\t\"\",\n\t\t...workflowSteps.map((step, index) => `${index + 1}. ${step}`),\n\t\t\"\",\n\t\t\"## Tool selection\",\n\t\t\"\",\n\t\t`- Tools: ${tools.join(\", \") || \"none required\"}`,\n\t\t`- MCP: ${mcpServers.join(\", \") || \"filesystem/read-only\"}`,\n\t\t`- Hooks: ${hooks.join(\", \") || \"pre-shell-guard, protect-secrets\"}`,\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t\"\",\n\t\t...(acceptance.length > 0\n\t\t\t? acceptance.map((item) => `- ${item}`)\n\t\t\t: [\"- Output includes routed skill, evidence, commands, and remaining blockers\"]),\n\t\t\"\",\n\t\t\"## Safety constraints\",\n\t\t\"\",\n\t\t...safetyNotes.map((note) => `- ${note}`),\n\t];\n\n\tif (routes.length > 0) {\n\t\tlines.push(\"\", \"## Built-in routes\", \"\");\n\t\tfor (const route of routes) {\n\t\t\tlines.push(`- ${route.id}: ${route.skillPath}`);\n\t\t}\n\t}\n\n\tif (input.references?.length) {\n\t\tlines.push(\"\", \"## References\", \"\");\n\t\tfor (const reference of input.references) lines.push(`- ${reference}`);\n\t}\n\n\treturn `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n\nexport function extractReverseSkillFactsFromMarkdown(sourceText: string): ReverseSkillSourceFacts {\n\tconst headings = unique(\n\t\tArray.from(sourceText.matchAll(/^#{1,4}\\s+(.+)$/gm)).map((match) => match[1]?.trim() ?? \"\"),\n\t).slice(0, 24);\n\tconst skillPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+SKILL\\.md)/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst scriptPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+\\.(?:ps1|sh|py|js|ts))/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst knownTools = Object.keys(TOOL_ALIASES);\n\tconst normalizedSource = normalizeReverseSkillText(sourceText);\n\tconst tools = knownTools.filter((tool) => normalizedSource.includes(normalizeReverseSkillText(tool)));\n\tconst mcpServers = unique(\n\t\tArray.from(sourceText.matchAll(/\\b([a-z0-9-]+)\\s+MCP\\b/gi)).map((match) => match[1]?.toLowerCase() ?? \"\"),\n\t);\n\tconst triggerTerms = unique(\n\t\tREVERSE_SKILL_ROUTES.flatMap((route) => [\n\t\t\t...route.targetPatterns,\n\t\t\t...route.intentPatterns,\n\t\t\t...route.toolPatterns,\n\t\t]).filter((term) => normalizedSource.includes(normalizeReverseSkillText(term))),\n\t).slice(0, 40);\n\n\treturn { headings, skillPaths, scriptPaths, tools, mcpServers, triggerTerms };\n}\n\nexport function formatReverseSkillFromSource(input: ReverseSkillSourceInput): string {\n\tconst facts = extractReverseSkillFactsFromMarkdown(input.sourceText);\n\tconst query = [input.triggerSummary, facts.triggerTerms.slice(0, 12).join(\" \"), facts.headings.slice(0, 8).join(\" \")]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\tconst decision = routeReverseSkill({ query: query || input.sourceText.slice(0, 500) });\n\tconst routeIds = [decision.primary?.route.id, ...decision.alternatives.map((item) => item.route.id)].filter(\n\t\t(routeId): routeId is string => Boolean(routeId),\n\t);\n\tconst name = input.name ?? (decision.primary ? `${decision.primary.route.id}-workflow` : \"reverse-skill-workflow\");\n\tconst triggerSummary =\n\t\tinput.triggerSummary ??\n\t\t(facts.triggerTerms.slice(0, 8).join(\", \") || \"reverse-engineering or security routing is needed\");\n\tconst workflowSteps = [\n\t\t\"Classify the incoming request against target, intent, and toolchain signals\",\n\t\t\"Load the routed sub-skill before running specialized tooling\",\n\t\t\"Check local tool availability only for tools required by the selected route\",\n\t\t\"Return evidence paths, commands, confidence, and blockers\",\n\t];\n\n\treturn formatReverseSkillMarkdown({\n\t\tname,\n\t\tdescription: input.description,\n\t\ttriggerSummary,\n\t\trouteIds,\n\t\tworkflowSteps,\n\t\ttools: facts.tools,\n\t\tmcpServers: facts.mcpServers,\n\t\treferences: unique([...facts.skillPaths, ...facts.scriptPaths]).slice(0, 20),\n\t});\n}\n"]}
@@ -207,6 +207,61 @@ export const REVERSE_SKILL_ROUTES = [
207
207
  ],
208
208
  risk: "local-tooling",
209
209
  },
210
+ {
211
+ id: "gitreverse",
212
+ label: "Repository-to-prompt reconstruction (GitReverse workflow)",
213
+ skillPath: "skills/gitreverse/SKILL.md",
214
+ targetPatterns: [
215
+ "github",
216
+ "gitlab",
217
+ "gitee",
218
+ "repository",
219
+ "repo",
220
+ "monorepo",
221
+ "codebase",
222
+ "레포지토리",
223
+ "저장소",
224
+ ],
225
+ intentPatterns: [
226
+ "vibe code",
227
+ "prompt",
228
+ "paste into",
229
+ "cursor",
230
+ "claude code",
231
+ "codex",
232
+ "from scratch",
233
+ "reconstruct",
234
+ "synthesize",
235
+ "프롬프트",
236
+ ],
237
+ toolPatterns: ["git", "gh", "github cli", "github api", "gitreverse"],
238
+ keywords: [
239
+ "owner/repo",
240
+ "file tree",
241
+ "readme",
242
+ "repo metadata",
243
+ "shareable link",
244
+ "synthetic prompt",
245
+ "vibe coding",
246
+ ],
247
+ requiredTools: [],
248
+ optionalTools: ["git", "gh"],
249
+ skillHints: ["gitreverse", "clone-website", "docs-generator"],
250
+ mcpHints: ["github", "filesystem"],
251
+ hookHints: ["protect-secrets", "stop-verify"],
252
+ acceptance: [
253
+ "Repository owner/name is parsed from the URL or slug before any fetch",
254
+ "The generated prompt is grounded in README and file-tree evidence",
255
+ "Only public repository data is used; private or credential-bearing content is refused and redacted",
256
+ "Observed repo facts and synthesized prompt text are clearly separated",
257
+ ],
258
+ firstActions: [
259
+ "Parse owner/repo from the GitHub URL or `owner/repo` slug",
260
+ "Fetch repo metadata, root file tree (depth 1), and README",
261
+ "Synthesize one short conversational prompt grounded in that context",
262
+ ],
263
+ risk: "passive-analysis",
264
+ },
210
265
  {
211
266
  id: "ctf-sandbox-orchestrator",
212
267
  label: "CTF challenge routing",
@@ -327,6 +382,8 @@ const TOOL_ALIASES = {
327
382
  chrome: ["google-chrome", "chromium", "chrome"],
328
383
  frida: ["frida", "frida-ps"],
329
384
  gdb: ["gdb"],
385
+ gh: ["gh"],
386
+ git: ["git"],
330
387
  ghidra: ["ghidraRun", "analyzeHeadless"],
331
388
  gitleaks: ["gitleaks"],
332
389
  graphviz: ["dot"],
@@ -1 +1 @@
1
- {"version":3,"file":"reverse-skill.js","sourceRoot":"","sources":["../../src/harness/reverse-skill.ts"],"names":[],"mappings":"AAoFA,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AACvC,MAAM,kCAAkC,GAA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export type ReverseSkillPlatform = \"windows\" | \"linux\" | \"macos\" | \"kali\" | \"unknown\";\n\nexport type ReverseSkillRisk = \"passive-analysis\" | \"local-tooling\" | \"active-security\" | \"exploit-development\";\n\nexport interface ReverseSkillRoute {\n\tid: string;\n\tlabel: string;\n\tskillPath: string;\n\ttargetPatterns: string[];\n\tintentPatterns: string[];\n\ttoolPatterns: string[];\n\tkeywords: string[];\n\trequiredTools: string[];\n\toptionalTools: string[];\n\tskillHints: string[];\n\tmcpHints: string[];\n\thookHints: string[];\n\tacceptance: string[];\n\tfirstActions: string[];\n\trisk: ReverseSkillRisk;\n}\n\nexport interface ReverseSkillRouteInput {\n\tquery: string;\n\ttargetType?: string;\n\tintent?: string;\n\ttoolchain?: string;\n\tplatform?: ReverseSkillPlatform;\n\tmaxAlternatives?: number;\n}\n\nexport interface ReverseSkillRouteScore {\n\troute: ReverseSkillRoute;\n\tscore: number;\n\tconfidence: number;\n\tmatched: {\n\t\ttarget: string[];\n\t\tintent: string[];\n\t\ttoolchain: string[];\n\t\tkeywords: string[];\n\t};\n\tmissingDimensions: string[];\n}\n\nexport interface ReverseSkillRouteDecision {\n\tquery: string;\n\tplatform: ReverseSkillPlatform;\n\tnormalizedQuery: string;\n\tprimary?: ReverseSkillRouteScore;\n\talternatives: ReverseSkillRouteScore[];\n\tunmatched: boolean;\n\tnextAction: string;\n}\n\nexport interface ReverseSkillSpecInput {\n\tname: string;\n\tdescription?: string;\n\ttriggerSummary: string;\n\trouteIds?: string[];\n\tworkflowSteps?: string[];\n\ttools?: string[];\n\tmcpServers?: string[];\n\thooks?: string[];\n\tacceptance?: string[];\n\treferences?: string[];\n\tsafetyNotes?: string[];\n}\n\nexport interface ReverseSkillSourceFacts {\n\theadings: string[];\n\tskillPaths: string[];\n\tscriptPaths: string[];\n\ttools: string[];\n\tmcpServers: string[];\n\ttriggerTerms: string[];\n}\n\nexport interface ReverseSkillSourceInput {\n\tname?: string;\n\tdescription?: string;\n\tsourceText: string;\n\ttriggerSummary?: string;\n}\n\nconst ROUTE_SCORE_TARGET_WEIGHT = 4;\nconst ROUTE_SCORE_INTENT_WEIGHT = 3;\nconst ROUTE_SCORE_TOOL_WEIGHT = 2;\nconst ROUTE_SCORE_KEYWORD_WEIGHT = 1;\nconst ROUTE_SCORE_FULL_TRIAD_BONUS = 4;\nconst ROUTE_SCORE_CONFIDENCE_DENOMINATOR = 14;\n\nexport const REVERSE_SKILL_ROUTES: ReverseSkillRoute[] = [\n\t{\n\t\tid: \"apk-reverse\",\n\t\tlabel: \"APK / Android reverse engineering\",\n\t\tskillPath: \"skills/apk-reverse/SKILL.md\",\n\t\ttargetPatterns: [\"apk\", \"android\", \"aab\", \"smali\", \"jni\", \"dex\", \"안드로이드\", \"反编译\"],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"unpack\",\n\t\t\t\"repack\",\n\t\t\t\"manifest\",\n\t\t\t\"frida\",\n\t\t\t\"hook\",\n\t\t\t\"ssl pinning\",\n\t\t\t\"root detection\",\n\t\t\t\"rebuild\",\n\t\t\t\"sign\",\n\t\t\t\"설치\",\n\t\t\t\"리패키징\",\n\t\t],\n\t\ttoolPatterns: [\"jadx\", \"apktool\", \"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tkeywords: [\"classes.dex\", \"androidmanifest\", \"native library\", \"lib/\", \".so\", \"certificate pinning\", \"smali\"],\n\t\trequiredTools: [\"jadx\", \"apktool\"],\n\t\toptionalTools: [\"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tskillHints: [\"apk-reverse\", \"reverse-engineering\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright for app docs only\", \"idapro if native .so becomes dominant\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"subagent-stop-audit\"],\n\t\tacceptance: [\n\t\t\t\"Target package structure is identified\",\n\t\t\t\"Static findings cite class/method/file paths\",\n\t\t\t\"Any dynamic step is scoped to a local test device or emulator\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm target artifact path\",\n\t\t\t\"Decode APK metadata\",\n\t\t\t\"Route native .so files to binary analysis when needed\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ida-reverse\",\n\t\tlabel: \"Binary reverse engineering with decompiler-first workflow\",\n\t\tskillPath: \"skills/ida-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"exe\",\n\t\t\t\"dll\",\n\t\t\t\"elf\",\n\t\t\t\"so\",\n\t\t\t\"dylib\",\n\t\t\t\"macho\",\n\t\t\t\"pe\",\n\t\t\t\"binary\",\n\t\t\t\"firmware blob\",\n\t\t\t\"바이너리\",\n\t\t\t\"二进制\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"disassemble\",\n\t\t\t\"xref\",\n\t\t\t\"call graph\",\n\t\t\t\"data flow\",\n\t\t\t\"rename\",\n\t\t\t\"symbol\",\n\t\t\t\"recover\",\n\t\t\t\"pseudocode\",\n\t\t\t\"함수\",\n\t\t\t\"反汇编\",\n\t\t],\n\t\ttoolPatterns: [\"ida\", \"idapro\", \"idalib\", \"ida-pro-mcp\", \"ghidra\", \"r2\", \"radare2\"],\n\t\tkeywords: [\"imports\", \"exports\", \"strings\", \"function\", \"offset\", \"xref\", \"pdb\", \"symbols\"],\n\t\trequiredTools: [\"idapro\"],\n\t\toptionalTools: [\"idalib-mcp\", \"ghidra\", \"radare2\", \"rabin2\"],\n\t\tskillHints: [\"ida-reverse\", \"radare2\", \"reverse-engineering\", \"binary-diff\"],\n\t\tmcpHints: [\"idapro\", \"filesystem\", \"serena\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Functions are cited by address/name\",\n\t\t\t\"Hypotheses cite disassembly, decompiler, xref, or string evidence\",\n\t\t\t\"Output distinguishes evidence from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run strings/imports reconnaissance\",\n\t\t\t\"Choose IDA or CLI path based on available tools\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"radare2\",\n\t\tlabel: \"Binary reconnaissance with radare2 CLI\",\n\t\tskillPath: \"skills/radare2/SKILL.md\",\n\t\ttargetPatterns: [\"binary\", \"elf\", \"pe\", \"macho\", \"so\", \"dll\", \"firmware\", \"바이너리\"],\n\t\tintentPatterns: [\"quick recon\", \"strings\", \"imports\", \"exports\", \"patch\", \"offset\", \"cli\", \"headless\"],\n\t\ttoolPatterns: [\"radare2\", \"r2\", \"rabin2\", \"rasm2\", \"radiff2\"],\n\t\tkeywords: [\"entrypoint\", \"section\", \"symbol\", \"hex\", \"disassembly\", \"patch bytes\"],\n\t\trequiredTools: [\"radare2\", \"rabin2\"],\n\t\toptionalTools: [\"rasm2\", \"radiff2\", \"r2pipe\"],\n\t\tskillHints: [\"radare2\", \"ida-reverse\", \"reverse-engineering\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Recon output names sections, imports, symbols, and notable strings\",\n\t\t\t\"Patch guidance includes offset and before/after bytes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Run file metadata\",\n\t\t\t\"Run rabin2-style reconnaissance\",\n\t\t\t\"Escalate to decompiler if CLI evidence is insufficient\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"js-reverse\",\n\t\tlabel: \"Frontend JavaScript signature and request reconstruction\",\n\t\tskillPath: \"skills/js-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"javascript\",\n\t\t\t\"js\",\n\t\t\t\"frontend\",\n\t\t\t\"webpack\",\n\t\t\t\"source map\",\n\t\t\t\"sourcemap\",\n\t\t\t\"web\",\n\t\t\t\"browser\",\n\t\t\t\"前端\",\n\t\t\t\"프론트\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"signature\",\n\t\t\t\"encrypted params\",\n\t\t\t\"request replay\",\n\t\t\t\"token\",\n\t\t\t\"decrypt\",\n\t\t\t\"environment patch\",\n\t\t\t\"ast\",\n\t\t\t\"breakpoint\",\n\t\t\t\"hook\",\n\t\t\t\"서명\",\n\t\t\t\"암호화\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome\", \"cdp\", \"jshook\", \"jshookmcp\", \"node\", \"anything-analyzer\"],\n\t\tkeywords: [\n\t\t\t\"sign\",\n\t\t\t\"nonce\",\n\t\t\t\"timestamp\",\n\t\t\t\"crypto\",\n\t\t\t\"axios\",\n\t\t\t\"fetch\",\n\t\t\t\"xhr\",\n\t\t\t\"webpackJsonp\",\n\t\t\t\"localStorage\",\n\t\t\t\"cookie\",\n\t\t],\n\t\trequiredTools: [\"node\"],\n\t\toptionalTools: [\"playwright\", \"jshookmcp\", \"anything-analyzer\", \"chrome\"],\n\t\tskillHints: [\"js-reverse\", \"browser-automation\", \"docs-generator\"],\n\t\tmcpHints: [\"chrome-devtools\", \"playwright\", \"fetch\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"session-context\"],\n\t\tacceptance: [\n\t\t\t\"Target request and parameter names are identified\",\n\t\t\t\"Recovered algorithm has a local reproduction or explicit blocker\",\n\t\t\t\"Browser/runtime observations are tied to request evidence\",\n\t\t],\n\t\tfirstActions: [\"Identify target request\", \"Find producer function\", \"Rebuild the minimum local reproduction\"],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"browser-automation\",\n\t\tlabel: \"Browser or desktop evidence collection\",\n\t\tskillPath: \"skills/browser-automation/SKILL.md\",\n\t\ttargetPatterns: [\"website\", \"browser\", \"web app\", \"desktop app\", \"page\", \"form\", \"웹\", \"브라우저\"],\n\t\tintentPatterns: [\n\t\t\t\"open\",\n\t\t\t\"screenshot\",\n\t\t\t\"fill\",\n\t\t\t\"crawl\",\n\t\t\t\"capture\",\n\t\t\t\"network\",\n\t\t\t\"login\",\n\t\t\t\"observe\",\n\t\t\t\"click\",\n\t\t\t\"샷\",\n\t\t\t\"스크린샷\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome-devtools\", \"agent-browser\", \"openreverse\", \"anything-analyzer\"],\n\t\tkeywords: [\"dom\", \"selector\", \"network log\", \"console\", \"cookie\", \"screenshot\", \"trace\"],\n\t\trequiredTools: [\"playwright\"],\n\t\toptionalTools: [\"chrome\", \"agent-browser\", \"anything-analyzer\"],\n\t\tskillHints: [\"browser-automation\", \"js-reverse\", \"docs-generator\"],\n\t\tmcpHints: [\"playwright\", \"chrome-devtools\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Browser state is captured with URL and selector evidence\",\n\t\t\t\"Screenshots or logs are saved as artifacts when visual proof matters\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Open the target in an isolated browser context\",\n\t\t\t\"Capture visible state\",\n\t\t\t\"Record console/network evidence\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ctf-sandbox-orchestrator\",\n\t\tlabel: \"CTF challenge routing\",\n\t\tskillPath: \"../CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md\",\n\t\ttargetPatterns: [\"ctf\", \"challenge\", \"flag\", \"pwn\", \"crypto challenge\", \"forensics\", \"misc\", \"rev\", \"대회\"],\n\t\tintentPatterns: [\"solve\", \"find flag\", \"exploit\", \"writeup\", \"sandbox\", \"analyze challenge\"],\n\t\ttoolPatterns: [\"pwntools\", \"gdb\", \"python\", \"sage\", \"z3\", \"binwalk\", \"wireshark\"],\n\t\tkeywords: [\"flag{\", \"ctf\", \"nc \", \"remote\", \"proof\", \"challenge files\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"python\", \"gdb\", \"pwntools\", \"z3\", \"binwalk\"],\n\t\tskillHints: [\"ctf-sandbox-orchestrator\", \"reverse-engineering\", \"pwn-chain\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"memory\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Challenge category is justified by evidence\",\n\t\t\t\"Solution artifacts are reproducible\",\n\t\t\t\"Writeup includes the shortest verified path\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory challenge files\",\n\t\t\t\"Classify dominant evidence\",\n\t\t\t\"Dispatch to the narrowest CTF sub-skill\",\n\t\t],\n\t\trisk: \"exploit-development\",\n\t},\n\t{\n\t\tid: \"api-security\",\n\t\tlabel: \"API security review and authorized test planning\",\n\t\tskillPath: \"skills/api-security/SKILL.md\",\n\t\ttargetPatterns: [\"api\", \"rest\", \"graphql\", \"websocket\", \"jwt\", \"oauth\", \"endpoint\"],\n\t\tintentPatterns: [\"review\", \"test\", \"auth\", \"idor\", \"bola\", \"bfla\", \"rate limit\", \"schema\", \"권한\", \"越权\"],\n\t\ttoolPatterns: [\"burp\", \"postman\", \"nuclei\", \"zap\", \"curl\", \"graphql\"],\n\t\tkeywords: [\"authorization\", \"authentication\", \"tenant\", \"object id\", \"jwt\", \"scope\", \"graphql\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"burpsuite\", \"nuclei\", \"zap\", \"node\", \"python\"],\n\t\tskillHints: [\"api-security\", \"pentest-tools\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Scope boundary is explicit\",\n\t\t\t\"Findings include request/response evidence or code references\",\n\t\t\t\"High-risk active steps require explicit target scope\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Identify API surface\",\n\t\t\t\"Map auth and tenant boundaries\",\n\t\t\t\"Choose static review or scoped dynamic testing\",\n\t\t],\n\t\trisk: \"active-security\",\n\t},\n\t{\n\t\tid: \"supply-chain-security\",\n\t\tlabel: \"Supply-chain and CI/CD security analysis\",\n\t\tskillPath: \"skills/supply-chain-security/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"dependency\",\n\t\t\t\"package\",\n\t\t\t\"sbom\",\n\t\t\t\"container\",\n\t\t\t\"docker\",\n\t\t\t\"ci\",\n\t\t\t\"workflow\",\n\t\t\t\"github actions\",\n\t\t\t\"supply chain\",\n\t\t],\n\t\tintentPatterns: [\"scan\", \"audit\", \"gitleaks\", \"trivy\", \"osv\", \"syft\", \"secret\", \"provenance\", \"attestation\"],\n\t\ttoolPatterns: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"npm audit\", \"semgrep\"],\n\t\tkeywords: [\"package-lock\", \"npm-shrinkwrap\", \"dockerfile\", \"workflow\", \"actions\", \"secret\", \"sbom\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"semgrep\"],\n\t\tskillHints: [\"supply-chain-security\", \"security-review\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\"],\n\t\thookHints: [\"protect-secrets\", \"pre-shell-guard\", \"npm-audit-summary\"],\n\t\tacceptance: [\n\t\t\t\"Dependency, workflow, and secret surfaces are separated\",\n\t\t\t\"Findings cite exact files and lockfile evidence\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory package managers and workflows\",\n\t\t\t\"Run non-mutating scans first\",\n\t\t\t\"Triangulate tool output with source evidence\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"docs-generator\",\n\t\tlabel: \"Security or reverse-engineering report generation\",\n\t\tskillPath: \"skills/docs-generator/SKILL.md\",\n\t\ttargetPatterns: [\"report\", \"writeup\", \"documentation\", \"diagram\", \"flowchart\", \"보고서\", \"문서\"],\n\t\tintentPatterns: [\"write\", \"summarize\", \"generate\", \"document\", \"explain\", \"diagram\", \"publish\"],\n\t\ttoolPatterns: [\"markdown\", \"mermaid\", \"graphviz\", \"plantuml\", \"pdf\"],\n\t\tkeywords: [\"executive summary\", \"reproduction\", \"impact\", \"timeline\", \"artifact\", \"evidence\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"graphviz\", \"plantuml\", \"pandoc\"],\n\t\tskillHints: [\"docs-generator\", \"diagram-generator\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Report separates facts, analysis, and recommendations\",\n\t\t\t\"Artifacts and commands are reproducible\",\n\t\t\t\"Sensitive values are redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect evidence paths\",\n\t\t\t\"Choose report template\",\n\t\t\t\"Add at least one flow or evidence diagram when useful\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n];\n\nconst TOOL_ALIASES: Record<string, string[]> = {\n\t\"anything-analyzer\": [\"anything-analyzer\"],\n\tadb: [\"adb\"],\n\tapktool: [\"apktool\"],\n\tapksigner: [\"apksigner\"],\n\tbinwalk: [\"binwalk\"],\n\tburpsuite: [\"burpsuite\"],\n\tchrome: [\"google-chrome\", \"chromium\", \"chrome\"],\n\tfrida: [\"frida\", \"frida-ps\"],\n\tgdb: [\"gdb\"],\n\tghidra: [\"ghidraRun\", \"analyzeHeadless\"],\n\tgitleaks: [\"gitleaks\"],\n\tgraphviz: [\"dot\"],\n\tidapro: [\"ida\", \"idat\", \"idat64\"],\n\t\"idalib-mcp\": [\"ida-pro-mcp\", \"idalib-mcp\"],\n\tjadx: [\"jadx\"],\n\tjshookmcp: [\"jshook\", \"npx\"],\n\tnode: [\"node\"],\n\tnuclei: [\"nuclei\"],\n\tpandoc: [\"pandoc\"],\n\tplantuml: [\"plantuml\"],\n\tplaywright: [\"playwright\", \"npx\"],\n\tpwntools: [\"python\"],\n\tpython: [\"python3\", \"python\"],\n\tradare2: [\"radare2\", \"r2\"],\n\trabin2: [\"rabin2\"],\n\tradiff2: [\"radiff2\"],\n\trasm2: [\"rasm2\"],\n\tsemgrep: [\"semgrep\"],\n\tsyft: [\"syft\"],\n\ttrivy: [\"trivy\"],\n\tzap: [\"zap.sh\", \"zap-baseline.py\"],\n\tzipalign: [\"zipalign\"],\n\tz3: [\"z3\"],\n};\n\nexport function getReverseSkillToolAliases(tool: string): string[] {\n\treturn TOOL_ALIASES[tool] ?? [tool];\n}\n\nexport function normalizeReverseSkillText(text: string | undefined): string {\n\treturn (text ?? \"\")\n\t\t.normalize(\"NFKC\")\n\t\t.toLowerCase()\n\t\t.replace(/[\\u2018\\u2019]/g, \"'\")\n\t\t.replace(/[\\u201c\\u201d]/g, '\"')\n\t\t.replace(/[_./\\\\:-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction findPatternMatches(text: string, patterns: string[]): string[] {\n\tconst matches: string[] = [];\n\tfor (const pattern of patterns) {\n\t\tconst normalizedPattern = normalizeReverseSkillText(pattern);\n\t\tif (!normalizedPattern) continue;\n\t\tif (text.includes(normalizedPattern)) matches.push(pattern);\n\t}\n\treturn matches;\n}\n\nfunction unique(items: string[]): string[] {\n\treturn Array.from(new Set(items.filter((item) => item.trim().length > 0)));\n}\n\nfunction clampConfidence(score: number): number {\n\tif (score <= 0) return 0;\n\treturn Math.min(0.99, Number((score / ROUTE_SCORE_CONFIDENCE_DENOMINATOR).toFixed(2)));\n}\n\nfunction scoreRoute(\n\troute: ReverseSkillRoute,\n\tinput: ReverseSkillRouteInput,\n\tnormalizedQuery: string,\n): ReverseSkillRouteScore {\n\tconst targetText = normalizeReverseSkillText(`${input.targetType ?? \"\"} ${normalizedQuery}`);\n\tconst intentText = normalizeReverseSkillText(`${input.intent ?? \"\"} ${normalizedQuery}`);\n\tconst toolText = normalizeReverseSkillText(`${input.toolchain ?? \"\"} ${normalizedQuery}`);\n\n\tconst target = findPatternMatches(targetText, route.targetPatterns);\n\tconst intent = findPatternMatches(intentText, route.intentPatterns);\n\tconst toolchain = findPatternMatches(toolText, route.toolPatterns);\n\tconst keywords = findPatternMatches(normalizedQuery, route.keywords);\n\n\tlet score =\n\t\ttarget.length * ROUTE_SCORE_TARGET_WEIGHT +\n\t\tintent.length * ROUTE_SCORE_INTENT_WEIGHT +\n\t\ttoolchain.length * ROUTE_SCORE_TOOL_WEIGHT +\n\t\tkeywords.length * ROUTE_SCORE_KEYWORD_WEIGHT;\n\n\tif (target.length > 0 && intent.length > 0 && toolchain.length > 0) {\n\t\tscore += ROUTE_SCORE_FULL_TRIAD_BONUS;\n\t}\n\n\tconst missingDimensions: string[] = [];\n\tif (target.length === 0) missingDimensions.push(\"target\");\n\tif (intent.length === 0) missingDimensions.push(\"intent\");\n\tif (toolchain.length === 0) missingDimensions.push(\"toolchain\");\n\n\treturn {\n\t\troute,\n\t\tscore,\n\t\tconfidence: clampConfidence(score),\n\t\tmatched: { target, intent, toolchain, keywords },\n\t\tmissingDimensions,\n\t};\n}\n\nexport function routeReverseSkill(input: ReverseSkillRouteInput): ReverseSkillRouteDecision {\n\tconst normalizedQuery = normalizeReverseSkillText(input.query);\n\tconst platform = input.platform ?? \"unknown\";\n\tconst maxAlternatives = input.maxAlternatives ?? 3;\n\tconst scored = REVERSE_SKILL_ROUTES.map((route) => scoreRoute(route, input, normalizedQuery))\n\t\t.filter((candidate) => candidate.score > 0)\n\t\t.sort(\n\t\t\t(a, b) => b.score - a.score || REVERSE_SKILL_ROUTES.indexOf(a.route) - REVERSE_SKILL_ROUTES.indexOf(b.route),\n\t\t);\n\n\tconst primary = scored[0];\n\tconst alternatives = scored.slice(1, maxAlternatives + 1);\n\tconst unmatched = !primary || primary.score < ROUTE_SCORE_TARGET_WEIGHT || primary.confidence < 0.18;\n\tconst nextAction = unmatched\n\t\t? \"No strong route matched. Create or extend a reverse-skill route before executing specialized tooling.\"\n\t\t: `Read ${primary.route.skillPath}, then execute first action: ${primary.route.firstActions[0] ?? \"classify target\"}.`;\n\n\treturn {\n\t\tquery: input.query,\n\t\tplatform,\n\t\tnormalizedQuery,\n\t\tprimary: unmatched ? undefined : primary,\n\t\talternatives,\n\t\tunmatched,\n\t\tnextAction,\n\t};\n}\n\nfunction formatMatches(score: ReverseSkillRouteScore): string {\n\tconst parts = [\n\t\t`target=${score.matched.target.join(\", \") || \"—\"}`,\n\t\t`intent=${score.matched.intent.join(\", \") || \"—\"}`,\n\t\t`toolchain=${score.matched.toolchain.join(\", \") || \"—\"}`,\n\t\t`keywords=${score.matched.keywords.join(\", \") || \"—\"}`,\n\t];\n\treturn parts.join(\"; \");\n}\n\nexport function formatReverseSkillRouteDecision(decision: ReverseSkillRouteDecision): string {\n\tif (decision.unmatched || !decision.primary) {\n\t\treturn [\n\t\t\t\"# Reverse Skill Route\",\n\t\t\t\"\",\n\t\t\t`Query: ${decision.query}`,\n\t\t\t\"\",\n\t\t\t\"No strong route matched.\",\n\t\t\t\"Next action: create or extend a route before specialized execution.\",\n\t\t].join(\"\\n\");\n\t}\n\n\tconst primary = decision.primary;\n\tconst lines = [\n\t\t\"# Reverse Skill Route\",\n\t\t\"\",\n\t\t`Query: ${decision.query}`,\n\t\t`Platform: ${decision.platform}`,\n\t\t\"\",\n\t\t`## Primary: ${primary.route.label}`,\n\t\t`- Route ID: ${primary.route.id}`,\n\t\t`- Skill path: ${primary.route.skillPath}`,\n\t\t`- Confidence: ${primary.confidence}`,\n\t\t`- Score: ${primary.score}`,\n\t\t`- Matches: ${formatMatches(primary)}`,\n\t\t`- Risk: ${primary.route.risk}`,\n\t\t`- Required tools: ${primary.route.requiredTools.join(\", \") || \"none\"}`,\n\t\t`- Optional tools: ${primary.route.optionalTools.join(\", \") || \"none\"}`,\n\t\t`- Skill hints: ${primary.route.skillHints.join(\", \")}`,\n\t\t`- MCP hints: ${primary.route.mcpHints.join(\", \")}`,\n\t\t`- Hooks: ${primary.route.hookHints.join(\", \")}`,\n\t\t\"\",\n\t\t\"## First actions\",\n\t\t...primary.route.firstActions.map((action, index) => `${index + 1}. ${action}`),\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t...primary.route.acceptance.map((item) => `- ${item}`),\n\t];\n\n\tif (decision.alternatives.length > 0) {\n\t\tlines.push(\"\", \"## Alternatives\");\n\t\tfor (const alternative of decision.alternatives) {\n\t\t\tlines.push(`- ${alternative.route.id} (${alternative.confidence}): ${formatMatches(alternative)}`);\n\t\t}\n\t}\n\n\tlines.push(\"\", `Next action: ${decision.nextAction}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function planReverseSkillToolChecks(decision: ReverseSkillRouteDecision, maxTools = 12): string[] {\n\tconst routes = [decision.primary, ...decision.alternatives].filter((score): score is ReverseSkillRouteScore =>\n\t\tBoolean(score),\n\t);\n\tconst tools: string[] = [];\n\tfor (const score of routes) {\n\t\ttools.push(...score.route.requiredTools, ...score.route.optionalTools);\n\t}\n\treturn unique(tools).slice(0, maxTools);\n}\n\nexport function normalizeReverseSkillName(name: string): string {\n\tconst normalized = normalizeReverseSkillText(name)\n\t\t.replace(/[^a-z0-9-]+/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.slice(0, 64)\n\t\t.replace(/-$/g, \"\");\n\treturn normalized || \"reverse-skill\";\n}\n\nfunction yamlString(value: string): string {\n\treturn JSON.stringify(value);\n}\n\nfunction compactDescription(input: ReverseSkillSpecInput, routes: ReverseSkillRoute[]): string {\n\tconst fallback = `Use when ${input.triggerSummary}`;\n\tconst base = input.description?.trim() || fallback;\n\tconst routeNames = routes.map((route) => route.id).join(\", \");\n\tconst suffix = routeNames ? ` Routes through ${routeNames}.` : \"\";\n\tconst description = `${base}${suffix}`;\n\treturn description.length <= 1024 ? description : `${description.slice(0, 1021).trimEnd()}...`;\n}\n\nfunction routesFromIds(routeIds: string[] | undefined): ReverseSkillRoute[] {\n\tif (!routeIds) return [];\n\treturn routeIds\n\t\t.map((routeId) => REVERSE_SKILL_ROUTES.find((route) => route.id === routeId))\n\t\t.filter((route): route is ReverseSkillRoute => Boolean(route));\n}\n\nexport function formatReverseSkillMarkdown(input: ReverseSkillSpecInput): string {\n\tconst routes = routesFromIds(input.routeIds);\n\tconst name = normalizeReverseSkillName(input.name);\n\tconst description = compactDescription(input, routes);\n\tconst workflowSteps = input.workflowSteps?.length\n\t\t? input.workflowSteps\n\t\t: [\n\t\t\t\t\"Classify target, intent, and available toolchain before execution\",\n\t\t\t\t\"Read the routed sub-skill or reference\",\n\t\t\t\t\"Collect evidence and record blockers\",\n\t\t\t\t\"Verify output against acceptance criteria\",\n\t\t\t];\n\tconst tools = unique([\n\t\t...(input.tools ?? []),\n\t\t...routes.flatMap((route) => [...route.requiredTools, ...route.optionalTools]),\n\t]);\n\tconst mcpServers = unique([...(input.mcpServers ?? []), ...routes.flatMap((route) => route.mcpHints)]);\n\tconst hooks = unique([...(input.hooks ?? []), ...routes.flatMap((route) => route.hookHints)]);\n\tconst acceptance = unique([...(input.acceptance ?? []), ...routes.flatMap((route) => route.acceptance)]);\n\tconst safetyNotes = input.safetyNotes?.length\n\t\t? input.safetyNotes\n\t\t: [\n\t\t\t\t\"Operate only on user-provided local artifacts or explicitly scoped targets\",\n\t\t\t\t\"Do not write secrets, tokens, credentials, or raw private data into skill artifacts\",\n\t\t\t];\n\n\tconst lines = [\n\t\t\"---\",\n\t\t`name: ${name}`,\n\t\t`description: ${yamlString(description)}`,\n\t\t\"---\",\n\t\t\"\",\n\t\t`# ${name}`,\n\t\t\"\",\n\t\t\"## Routing contract\",\n\t\t\"\",\n\t\t`Trigger this skill when ${input.triggerSummary}.`,\n\t\t\"\",\n\t\t\"1. Classify the target type, user intent, and toolchain signals before choosing tools.\",\n\t\t\"2. Read the narrowest referenced sub-skill or reference before running specialized tooling.\",\n\t\t\"3. Prefer passive/local evidence collection first; escalate only when the task scope requires it.\",\n\t\t\"4. Save evidence paths and blockers in the final response.\",\n\t\t\"\",\n\t\t\"## Workflow\",\n\t\t\"\",\n\t\t...workflowSteps.map((step, index) => `${index + 1}. ${step}`),\n\t\t\"\",\n\t\t\"## Tool selection\",\n\t\t\"\",\n\t\t`- Tools: ${tools.join(\", \") || \"none required\"}`,\n\t\t`- MCP: ${mcpServers.join(\", \") || \"filesystem/read-only\"}`,\n\t\t`- Hooks: ${hooks.join(\", \") || \"pre-shell-guard, protect-secrets\"}`,\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t\"\",\n\t\t...(acceptance.length > 0\n\t\t\t? acceptance.map((item) => `- ${item}`)\n\t\t\t: [\"- Output includes routed skill, evidence, commands, and remaining blockers\"]),\n\t\t\"\",\n\t\t\"## Safety constraints\",\n\t\t\"\",\n\t\t...safetyNotes.map((note) => `- ${note}`),\n\t];\n\n\tif (routes.length > 0) {\n\t\tlines.push(\"\", \"## Built-in routes\", \"\");\n\t\tfor (const route of routes) {\n\t\t\tlines.push(`- ${route.id}: ${route.skillPath}`);\n\t\t}\n\t}\n\n\tif (input.references?.length) {\n\t\tlines.push(\"\", \"## References\", \"\");\n\t\tfor (const reference of input.references) lines.push(`- ${reference}`);\n\t}\n\n\treturn `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n\nexport function extractReverseSkillFactsFromMarkdown(sourceText: string): ReverseSkillSourceFacts {\n\tconst headings = unique(\n\t\tArray.from(sourceText.matchAll(/^#{1,4}\\s+(.+)$/gm)).map((match) => match[1]?.trim() ?? \"\"),\n\t).slice(0, 24);\n\tconst skillPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+SKILL\\.md)/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst scriptPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+\\.(?:ps1|sh|py|js|ts))/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst knownTools = Object.keys(TOOL_ALIASES);\n\tconst normalizedSource = normalizeReverseSkillText(sourceText);\n\tconst tools = knownTools.filter((tool) => normalizedSource.includes(normalizeReverseSkillText(tool)));\n\tconst mcpServers = unique(\n\t\tArray.from(sourceText.matchAll(/\\b([a-z0-9-]+)\\s+MCP\\b/gi)).map((match) => match[1]?.toLowerCase() ?? \"\"),\n\t);\n\tconst triggerTerms = unique(\n\t\tREVERSE_SKILL_ROUTES.flatMap((route) => [\n\t\t\t...route.targetPatterns,\n\t\t\t...route.intentPatterns,\n\t\t\t...route.toolPatterns,\n\t\t]).filter((term) => normalizedSource.includes(normalizeReverseSkillText(term))),\n\t).slice(0, 40);\n\n\treturn { headings, skillPaths, scriptPaths, tools, mcpServers, triggerTerms };\n}\n\nexport function formatReverseSkillFromSource(input: ReverseSkillSourceInput): string {\n\tconst facts = extractReverseSkillFactsFromMarkdown(input.sourceText);\n\tconst query = [input.triggerSummary, facts.triggerTerms.slice(0, 12).join(\" \"), facts.headings.slice(0, 8).join(\" \")]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\tconst decision = routeReverseSkill({ query: query || input.sourceText.slice(0, 500) });\n\tconst routeIds = [decision.primary?.route.id, ...decision.alternatives.map((item) => item.route.id)].filter(\n\t\t(routeId): routeId is string => Boolean(routeId),\n\t);\n\tconst name = input.name ?? (decision.primary ? `${decision.primary.route.id}-workflow` : \"reverse-skill-workflow\");\n\tconst triggerSummary =\n\t\tinput.triggerSummary ??\n\t\t(facts.triggerTerms.slice(0, 8).join(\", \") || \"reverse-engineering or security routing is needed\");\n\tconst workflowSteps = [\n\t\t\"Classify the incoming request against target, intent, and toolchain signals\",\n\t\t\"Load the routed sub-skill before running specialized tooling\",\n\t\t\"Check local tool availability only for tools required by the selected route\",\n\t\t\"Return evidence paths, commands, confidence, and blockers\",\n\t];\n\n\treturn formatReverseSkillMarkdown({\n\t\tname,\n\t\tdescription: input.description,\n\t\ttriggerSummary,\n\t\trouteIds,\n\t\tworkflowSteps,\n\t\ttools: facts.tools,\n\t\tmcpServers: facts.mcpServers,\n\t\treferences: unique([...facts.skillPaths, ...facts.scriptPaths]).slice(0, 20),\n\t});\n}\n"]}
1
+ {"version":3,"file":"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AAC,CAAC,EAAE,EAAE,CAAC;KAC5E,CAAC,CAAC;AAAA,CACH","sourcesContent":["export type ReverseSkillPlatform = \"windows\" | \"linux\" | \"macos\" | \"kali\" | \"unknown\";\n\nexport type ReverseSkillRisk = \"passive-analysis\" | \"local-tooling\" | \"active-security\" | \"exploit-development\";\n\nexport interface ReverseSkillRoute {\n\tid: string;\n\tlabel: string;\n\tskillPath: string;\n\ttargetPatterns: string[];\n\tintentPatterns: string[];\n\ttoolPatterns: string[];\n\tkeywords: string[];\n\trequiredTools: string[];\n\toptionalTools: string[];\n\tskillHints: string[];\n\tmcpHints: string[];\n\thookHints: string[];\n\tacceptance: string[];\n\tfirstActions: string[];\n\trisk: ReverseSkillRisk;\n}\n\nexport interface ReverseSkillRouteInput {\n\tquery: string;\n\ttargetType?: string;\n\tintent?: string;\n\ttoolchain?: string;\n\tplatform?: ReverseSkillPlatform;\n\tmaxAlternatives?: number;\n}\n\nexport interface ReverseSkillRouteScore {\n\troute: ReverseSkillRoute;\n\tscore: number;\n\tconfidence: number;\n\tmatched: {\n\t\ttarget: string[];\n\t\tintent: string[];\n\t\ttoolchain: string[];\n\t\tkeywords: string[];\n\t};\n\tmissingDimensions: string[];\n}\n\nexport interface ReverseSkillRouteDecision {\n\tquery: string;\n\tplatform: ReverseSkillPlatform;\n\tnormalizedQuery: string;\n\tprimary?: ReverseSkillRouteScore;\n\talternatives: ReverseSkillRouteScore[];\n\tunmatched: boolean;\n\tnextAction: string;\n}\n\nexport interface ReverseSkillSpecInput {\n\tname: string;\n\tdescription?: string;\n\ttriggerSummary: string;\n\trouteIds?: string[];\n\tworkflowSteps?: string[];\n\ttools?: string[];\n\tmcpServers?: string[];\n\thooks?: string[];\n\tacceptance?: string[];\n\treferences?: string[];\n\tsafetyNotes?: string[];\n}\n\nexport interface ReverseSkillSourceFacts {\n\theadings: string[];\n\tskillPaths: string[];\n\tscriptPaths: string[];\n\ttools: string[];\n\tmcpServers: string[];\n\ttriggerTerms: string[];\n}\n\nexport interface ReverseSkillSourceInput {\n\tname?: string;\n\tdescription?: string;\n\tsourceText: string;\n\ttriggerSummary?: string;\n}\n\nconst ROUTE_SCORE_TARGET_WEIGHT = 4;\nconst ROUTE_SCORE_INTENT_WEIGHT = 3;\nconst ROUTE_SCORE_TOOL_WEIGHT = 2;\nconst ROUTE_SCORE_KEYWORD_WEIGHT = 1;\nconst ROUTE_SCORE_FULL_TRIAD_BONUS = 4;\nconst ROUTE_SCORE_CONFIDENCE_DENOMINATOR = 14;\n\nexport const REVERSE_SKILL_ROUTES: ReverseSkillRoute[] = [\n\t{\n\t\tid: \"apk-reverse\",\n\t\tlabel: \"APK / Android reverse engineering\",\n\t\tskillPath: \"skills/apk-reverse/SKILL.md\",\n\t\ttargetPatterns: [\"apk\", \"android\", \"aab\", \"smali\", \"jni\", \"dex\", \"안드로이드\", \"反编译\"],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"unpack\",\n\t\t\t\"repack\",\n\t\t\t\"manifest\",\n\t\t\t\"frida\",\n\t\t\t\"hook\",\n\t\t\t\"ssl pinning\",\n\t\t\t\"root detection\",\n\t\t\t\"rebuild\",\n\t\t\t\"sign\",\n\t\t\t\"설치\",\n\t\t\t\"리패키징\",\n\t\t],\n\t\ttoolPatterns: [\"jadx\", \"apktool\", \"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tkeywords: [\"classes.dex\", \"androidmanifest\", \"native library\", \"lib/\", \".so\", \"certificate pinning\", \"smali\"],\n\t\trequiredTools: [\"jadx\", \"apktool\"],\n\t\toptionalTools: [\"adb\", \"frida\", \"apksigner\", \"zipalign\", \"objection\"],\n\t\tskillHints: [\"apk-reverse\", \"reverse-engineering\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"playwright for app docs only\", \"idapro if native .so becomes dominant\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"subagent-stop-audit\"],\n\t\tacceptance: [\n\t\t\t\"Target package structure is identified\",\n\t\t\t\"Static findings cite class/method/file paths\",\n\t\t\t\"Any dynamic step is scoped to a local test device or emulator\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Confirm target artifact path\",\n\t\t\t\"Decode APK metadata\",\n\t\t\t\"Route native .so files to binary analysis when needed\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"ida-reverse\",\n\t\tlabel: \"Binary reverse engineering with decompiler-first workflow\",\n\t\tskillPath: \"skills/ida-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"exe\",\n\t\t\t\"dll\",\n\t\t\t\"elf\",\n\t\t\t\"so\",\n\t\t\t\"dylib\",\n\t\t\t\"macho\",\n\t\t\t\"pe\",\n\t\t\t\"binary\",\n\t\t\t\"firmware blob\",\n\t\t\t\"바이너리\",\n\t\t\t\"二进制\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"decompile\",\n\t\t\t\"disassemble\",\n\t\t\t\"xref\",\n\t\t\t\"call graph\",\n\t\t\t\"data flow\",\n\t\t\t\"rename\",\n\t\t\t\"symbol\",\n\t\t\t\"recover\",\n\t\t\t\"pseudocode\",\n\t\t\t\"함수\",\n\t\t\t\"反汇编\",\n\t\t],\n\t\ttoolPatterns: [\"ida\", \"idapro\", \"idalib\", \"ida-pro-mcp\", \"ghidra\", \"r2\", \"radare2\"],\n\t\tkeywords: [\"imports\", \"exports\", \"strings\", \"function\", \"offset\", \"xref\", \"pdb\", \"symbols\"],\n\t\trequiredTools: [\"idapro\"],\n\t\toptionalTools: [\"idalib-mcp\", \"ghidra\", \"radare2\", \"rabin2\"],\n\t\tskillHints: [\"ida-reverse\", \"radare2\", \"reverse-engineering\", \"binary-diff\"],\n\t\tmcpHints: [\"idapro\", \"filesystem\", \"serena\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Functions are cited by address/name\",\n\t\t\t\"Hypotheses cite disassembly, decompiler, xref, or string evidence\",\n\t\t\t\"Output distinguishes evidence from inference\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect file metadata\",\n\t\t\t\"Run strings/imports reconnaissance\",\n\t\t\t\"Choose IDA or CLI path based on available tools\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"radare2\",\n\t\tlabel: \"Binary reconnaissance with radare2 CLI\",\n\t\tskillPath: \"skills/radare2/SKILL.md\",\n\t\ttargetPatterns: [\"binary\", \"elf\", \"pe\", \"macho\", \"so\", \"dll\", \"firmware\", \"바이너리\"],\n\t\tintentPatterns: [\"quick recon\", \"strings\", \"imports\", \"exports\", \"patch\", \"offset\", \"cli\", \"headless\"],\n\t\ttoolPatterns: [\"radare2\", \"r2\", \"rabin2\", \"rasm2\", \"radiff2\"],\n\t\tkeywords: [\"entrypoint\", \"section\", \"symbol\", \"hex\", \"disassembly\", \"patch bytes\"],\n\t\trequiredTools: [\"radare2\", \"rabin2\"],\n\t\toptionalTools: [\"rasm2\", \"radiff2\", \"r2pipe\"],\n\t\tskillHints: [\"radare2\", \"ida-reverse\", \"reverse-engineering\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Recon output names sections, imports, symbols, and notable strings\",\n\t\t\t\"Patch guidance includes offset and before/after bytes\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Run file metadata\",\n\t\t\t\"Run rabin2-style reconnaissance\",\n\t\t\t\"Escalate to decompiler if CLI evidence is insufficient\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"js-reverse\",\n\t\tlabel: \"Frontend JavaScript signature and request reconstruction\",\n\t\tskillPath: \"skills/js-reverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"javascript\",\n\t\t\t\"js\",\n\t\t\t\"frontend\",\n\t\t\t\"webpack\",\n\t\t\t\"source map\",\n\t\t\t\"sourcemap\",\n\t\t\t\"web\",\n\t\t\t\"browser\",\n\t\t\t\"前端\",\n\t\t\t\"프론트\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"signature\",\n\t\t\t\"encrypted params\",\n\t\t\t\"request replay\",\n\t\t\t\"token\",\n\t\t\t\"decrypt\",\n\t\t\t\"environment patch\",\n\t\t\t\"ast\",\n\t\t\t\"breakpoint\",\n\t\t\t\"hook\",\n\t\t\t\"서명\",\n\t\t\t\"암호화\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome\", \"cdp\", \"jshook\", \"jshookmcp\", \"node\", \"anything-analyzer\"],\n\t\tkeywords: [\n\t\t\t\"sign\",\n\t\t\t\"nonce\",\n\t\t\t\"timestamp\",\n\t\t\t\"crypto\",\n\t\t\t\"axios\",\n\t\t\t\"fetch\",\n\t\t\t\"xhr\",\n\t\t\t\"webpackJsonp\",\n\t\t\t\"localStorage\",\n\t\t\t\"cookie\",\n\t\t],\n\t\trequiredTools: [\"node\"],\n\t\toptionalTools: [\"playwright\", \"jshookmcp\", \"anything-analyzer\", \"chrome\"],\n\t\tskillHints: [\"js-reverse\", \"browser-automation\", \"docs-generator\"],\n\t\tmcpHints: [\"chrome-devtools\", \"playwright\", \"fetch\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"session-context\"],\n\t\tacceptance: [\n\t\t\t\"Target request and parameter names are identified\",\n\t\t\t\"Recovered algorithm has a local reproduction or explicit blocker\",\n\t\t\t\"Browser/runtime observations are tied to request evidence\",\n\t\t],\n\t\tfirstActions: [\"Identify target request\", \"Find producer function\", \"Rebuild the minimum local reproduction\"],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"browser-automation\",\n\t\tlabel: \"Browser or desktop evidence collection\",\n\t\tskillPath: \"skills/browser-automation/SKILL.md\",\n\t\ttargetPatterns: [\"website\", \"browser\", \"web app\", \"desktop app\", \"page\", \"form\", \"웹\", \"브라우저\"],\n\t\tintentPatterns: [\n\t\t\t\"open\",\n\t\t\t\"screenshot\",\n\t\t\t\"fill\",\n\t\t\t\"crawl\",\n\t\t\t\"capture\",\n\t\t\t\"network\",\n\t\t\t\"login\",\n\t\t\t\"observe\",\n\t\t\t\"click\",\n\t\t\t\"샷\",\n\t\t\t\"스크린샷\",\n\t\t],\n\t\ttoolPatterns: [\"playwright\", \"chrome-devtools\", \"agent-browser\", \"openreverse\", \"anything-analyzer\"],\n\t\tkeywords: [\"dom\", \"selector\", \"network log\", \"console\", \"cookie\", \"screenshot\", \"trace\"],\n\t\trequiredTools: [\"playwright\"],\n\t\toptionalTools: [\"chrome\", \"agent-browser\", \"anything-analyzer\"],\n\t\tskillHints: [\"browser-automation\", \"js-reverse\", \"docs-generator\"],\n\t\tmcpHints: [\"playwright\", \"chrome-devtools\", \"filesystem\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Browser state is captured with URL and selector evidence\",\n\t\t\t\"Screenshots or logs are saved as artifacts when visual proof matters\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Open the target in an isolated browser context\",\n\t\t\t\"Capture visible state\",\n\t\t\t\"Record console/network evidence\",\n\t\t],\n\t\trisk: \"local-tooling\",\n\t},\n\t{\n\t\tid: \"gitreverse\",\n\t\tlabel: \"Repository-to-prompt reconstruction (GitReverse workflow)\",\n\t\tskillPath: \"skills/gitreverse/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"github\",\n\t\t\t\"gitlab\",\n\t\t\t\"gitee\",\n\t\t\t\"repository\",\n\t\t\t\"repo\",\n\t\t\t\"monorepo\",\n\t\t\t\"codebase\",\n\t\t\t\"레포지토리\",\n\t\t\t\"저장소\",\n\t\t],\n\t\tintentPatterns: [\n\t\t\t\"vibe code\",\n\t\t\t\"prompt\",\n\t\t\t\"paste into\",\n\t\t\t\"cursor\",\n\t\t\t\"claude code\",\n\t\t\t\"codex\",\n\t\t\t\"from scratch\",\n\t\t\t\"reconstruct\",\n\t\t\t\"synthesize\",\n\t\t\t\"프롬프트\",\n\t\t],\n\t\ttoolPatterns: [\"git\", \"gh\", \"github cli\", \"github api\", \"gitreverse\"],\n\t\tkeywords: [\n\t\t\t\"owner/repo\",\n\t\t\t\"file tree\",\n\t\t\t\"readme\",\n\t\t\t\"repo metadata\",\n\t\t\t\"shareable link\",\n\t\t\t\"synthetic prompt\",\n\t\t\t\"vibe coding\",\n\t\t],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"git\", \"gh\"],\n\t\tskillHints: [\"gitreverse\", \"clone-website\", \"docs-generator\"],\n\t\tmcpHints: [\"github\", \"filesystem\"],\n\t\thookHints: [\"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Repository owner/name is parsed from the URL or slug before any fetch\",\n\t\t\t\"The generated prompt is grounded in README and file-tree evidence\",\n\t\t\t\"Only public repository data is used; private or credential-bearing content is refused and redacted\",\n\t\t\t\"Observed repo facts and synthesized prompt text are clearly separated\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Parse owner/repo from the GitHub URL or `owner/repo` slug\",\n\t\t\t\"Fetch repo metadata, root file tree (depth 1), and README\",\n\t\t\t\"Synthesize one short conversational prompt grounded in that context\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"ctf-sandbox-orchestrator\",\n\t\tlabel: \"CTF challenge routing\",\n\t\tskillPath: \"../CTF-Sandbox-Orchestrator/ctf-sandbox-orchestrator/SKILL.md\",\n\t\ttargetPatterns: [\"ctf\", \"challenge\", \"flag\", \"pwn\", \"crypto challenge\", \"forensics\", \"misc\", \"rev\", \"대회\"],\n\t\tintentPatterns: [\"solve\", \"find flag\", \"exploit\", \"writeup\", \"sandbox\", \"analyze challenge\"],\n\t\ttoolPatterns: [\"pwntools\", \"gdb\", \"python\", \"sage\", \"z3\", \"binwalk\", \"wireshark\"],\n\t\tkeywords: [\"flag{\", \"ctf\", \"nc \", \"remote\", \"proof\", \"challenge files\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"python\", \"gdb\", \"pwntools\", \"z3\", \"binwalk\"],\n\t\tskillHints: [\"ctf-sandbox-orchestrator\", \"reverse-engineering\", \"pwn-chain\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"memory\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Challenge category is justified by evidence\",\n\t\t\t\"Solution artifacts are reproducible\",\n\t\t\t\"Writeup includes the shortest verified path\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory challenge files\",\n\t\t\t\"Classify dominant evidence\",\n\t\t\t\"Dispatch to the narrowest CTF sub-skill\",\n\t\t],\n\t\trisk: \"exploit-development\",\n\t},\n\t{\n\t\tid: \"api-security\",\n\t\tlabel: \"API security review and authorized test planning\",\n\t\tskillPath: \"skills/api-security/SKILL.md\",\n\t\ttargetPatterns: [\"api\", \"rest\", \"graphql\", \"websocket\", \"jwt\", \"oauth\", \"endpoint\"],\n\t\tintentPatterns: [\"review\", \"test\", \"auth\", \"idor\", \"bola\", \"bfla\", \"rate limit\", \"schema\", \"권한\", \"越权\"],\n\t\ttoolPatterns: [\"burp\", \"postman\", \"nuclei\", \"zap\", \"curl\", \"graphql\"],\n\t\tkeywords: [\"authorization\", \"authentication\", \"tenant\", \"object id\", \"jwt\", \"scope\", \"graphql\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"burpsuite\", \"nuclei\", \"zap\", \"node\", \"python\"],\n\t\tskillHints: [\"api-security\", \"pentest-tools\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\", \"playwright\"],\n\t\thookHints: [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"],\n\t\tacceptance: [\n\t\t\t\"Scope boundary is explicit\",\n\t\t\t\"Findings include request/response evidence or code references\",\n\t\t\t\"High-risk active steps require explicit target scope\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Identify API surface\",\n\t\t\t\"Map auth and tenant boundaries\",\n\t\t\t\"Choose static review or scoped dynamic testing\",\n\t\t],\n\t\trisk: \"active-security\",\n\t},\n\t{\n\t\tid: \"supply-chain-security\",\n\t\tlabel: \"Supply-chain and CI/CD security analysis\",\n\t\tskillPath: \"skills/supply-chain-security/SKILL.md\",\n\t\ttargetPatterns: [\n\t\t\t\"dependency\",\n\t\t\t\"package\",\n\t\t\t\"sbom\",\n\t\t\t\"container\",\n\t\t\t\"docker\",\n\t\t\t\"ci\",\n\t\t\t\"workflow\",\n\t\t\t\"github actions\",\n\t\t\t\"supply chain\",\n\t\t],\n\t\tintentPatterns: [\"scan\", \"audit\", \"gitleaks\", \"trivy\", \"osv\", \"syft\", \"secret\", \"provenance\", \"attestation\"],\n\t\ttoolPatterns: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"npm audit\", \"semgrep\"],\n\t\tkeywords: [\"package-lock\", \"npm-shrinkwrap\", \"dockerfile\", \"workflow\", \"actions\", \"secret\", \"sbom\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"trivy\", \"syft\", \"gitleaks\", \"osv-scanner\", \"semgrep\"],\n\t\tskillHints: [\"supply-chain-security\", \"security-review\", \"docs-generator\"],\n\t\tmcpHints: [\"filesystem\", \"github\"],\n\t\thookHints: [\"protect-secrets\", \"pre-shell-guard\", \"npm-audit-summary\"],\n\t\tacceptance: [\n\t\t\t\"Dependency, workflow, and secret surfaces are separated\",\n\t\t\t\"Findings cite exact files and lockfile evidence\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Inventory package managers and workflows\",\n\t\t\t\"Run non-mutating scans first\",\n\t\t\t\"Triangulate tool output with source evidence\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n\t{\n\t\tid: \"docs-generator\",\n\t\tlabel: \"Security or reverse-engineering report generation\",\n\t\tskillPath: \"skills/docs-generator/SKILL.md\",\n\t\ttargetPatterns: [\"report\", \"writeup\", \"documentation\", \"diagram\", \"flowchart\", \"보고서\", \"문서\"],\n\t\tintentPatterns: [\"write\", \"summarize\", \"generate\", \"document\", \"explain\", \"diagram\", \"publish\"],\n\t\ttoolPatterns: [\"markdown\", \"mermaid\", \"graphviz\", \"plantuml\", \"pdf\"],\n\t\tkeywords: [\"executive summary\", \"reproduction\", \"impact\", \"timeline\", \"artifact\", \"evidence\"],\n\t\trequiredTools: [],\n\t\toptionalTools: [\"graphviz\", \"plantuml\", \"pandoc\"],\n\t\tskillHints: [\"docs-generator\", \"diagram-generator\"],\n\t\tmcpHints: [\"filesystem\"],\n\t\thookHints: [\"protect-secrets\"],\n\t\tacceptance: [\n\t\t\t\"Report separates facts, analysis, and recommendations\",\n\t\t\t\"Artifacts and commands are reproducible\",\n\t\t\t\"Sensitive values are redacted\",\n\t\t],\n\t\tfirstActions: [\n\t\t\t\"Collect evidence paths\",\n\t\t\t\"Choose report template\",\n\t\t\t\"Add at least one flow or evidence diagram when useful\",\n\t\t],\n\t\trisk: \"passive-analysis\",\n\t},\n];\n\nconst TOOL_ALIASES: Record<string, string[]> = {\n\t\"anything-analyzer\": [\"anything-analyzer\"],\n\tadb: [\"adb\"],\n\tapktool: [\"apktool\"],\n\tapksigner: [\"apksigner\"],\n\tbinwalk: [\"binwalk\"],\n\tburpsuite: [\"burpsuite\"],\n\tchrome: [\"google-chrome\", \"chromium\", \"chrome\"],\n\tfrida: [\"frida\", \"frida-ps\"],\n\tgdb: [\"gdb\"],\n\tgh: [\"gh\"],\n\tgit: [\"git\"],\n\tghidra: [\"ghidraRun\", \"analyzeHeadless\"],\n\tgitleaks: [\"gitleaks\"],\n\tgraphviz: [\"dot\"],\n\tidapro: [\"ida\", \"idat\", \"idat64\"],\n\t\"idalib-mcp\": [\"ida-pro-mcp\", \"idalib-mcp\"],\n\tjadx: [\"jadx\"],\n\tjshookmcp: [\"jshook\", \"npx\"],\n\tnode: [\"node\"],\n\tnuclei: [\"nuclei\"],\n\tpandoc: [\"pandoc\"],\n\tplantuml: [\"plantuml\"],\n\tplaywright: [\"playwright\", \"npx\"],\n\tpwntools: [\"python\"],\n\tpython: [\"python3\", \"python\"],\n\tradare2: [\"radare2\", \"r2\"],\n\trabin2: [\"rabin2\"],\n\tradiff2: [\"radiff2\"],\n\trasm2: [\"rasm2\"],\n\tsemgrep: [\"semgrep\"],\n\tsyft: [\"syft\"],\n\ttrivy: [\"trivy\"],\n\tzap: [\"zap.sh\", \"zap-baseline.py\"],\n\tzipalign: [\"zipalign\"],\n\tz3: [\"z3\"],\n};\n\nexport function getReverseSkillToolAliases(tool: string): string[] {\n\treturn TOOL_ALIASES[tool] ?? [tool];\n}\n\nexport function normalizeReverseSkillText(text: string | undefined): string {\n\treturn (text ?? \"\")\n\t\t.normalize(\"NFKC\")\n\t\t.toLowerCase()\n\t\t.replace(/[\\u2018\\u2019]/g, \"'\")\n\t\t.replace(/[\\u201c\\u201d]/g, '\"')\n\t\t.replace(/[_./\\\\:-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\nfunction findPatternMatches(text: string, patterns: string[]): string[] {\n\tconst matches: string[] = [];\n\tfor (const pattern of patterns) {\n\t\tconst normalizedPattern = normalizeReverseSkillText(pattern);\n\t\tif (!normalizedPattern) continue;\n\t\tif (text.includes(normalizedPattern)) matches.push(pattern);\n\t}\n\treturn matches;\n}\n\nfunction unique(items: string[]): string[] {\n\treturn Array.from(new Set(items.filter((item) => item.trim().length > 0)));\n}\n\nfunction clampConfidence(score: number): number {\n\tif (score <= 0) return 0;\n\treturn Math.min(0.99, Number((score / ROUTE_SCORE_CONFIDENCE_DENOMINATOR).toFixed(2)));\n}\n\nfunction scoreRoute(\n\troute: ReverseSkillRoute,\n\tinput: ReverseSkillRouteInput,\n\tnormalizedQuery: string,\n): ReverseSkillRouteScore {\n\tconst targetText = normalizeReverseSkillText(`${input.targetType ?? \"\"} ${normalizedQuery}`);\n\tconst intentText = normalizeReverseSkillText(`${input.intent ?? \"\"} ${normalizedQuery}`);\n\tconst toolText = normalizeReverseSkillText(`${input.toolchain ?? \"\"} ${normalizedQuery}`);\n\n\tconst target = findPatternMatches(targetText, route.targetPatterns);\n\tconst intent = findPatternMatches(intentText, route.intentPatterns);\n\tconst toolchain = findPatternMatches(toolText, route.toolPatterns);\n\tconst keywords = findPatternMatches(normalizedQuery, route.keywords);\n\n\tlet score =\n\t\ttarget.length * ROUTE_SCORE_TARGET_WEIGHT +\n\t\tintent.length * ROUTE_SCORE_INTENT_WEIGHT +\n\t\ttoolchain.length * ROUTE_SCORE_TOOL_WEIGHT +\n\t\tkeywords.length * ROUTE_SCORE_KEYWORD_WEIGHT;\n\n\tif (target.length > 0 && intent.length > 0 && toolchain.length > 0) {\n\t\tscore += ROUTE_SCORE_FULL_TRIAD_BONUS;\n\t}\n\n\tconst missingDimensions: string[] = [];\n\tif (target.length === 0) missingDimensions.push(\"target\");\n\tif (intent.length === 0) missingDimensions.push(\"intent\");\n\tif (toolchain.length === 0) missingDimensions.push(\"toolchain\");\n\n\treturn {\n\t\troute,\n\t\tscore,\n\t\tconfidence: clampConfidence(score),\n\t\tmatched: { target, intent, toolchain, keywords },\n\t\tmissingDimensions,\n\t};\n}\n\nexport function routeReverseSkill(input: ReverseSkillRouteInput): ReverseSkillRouteDecision {\n\tconst normalizedQuery = normalizeReverseSkillText(input.query);\n\tconst platform = input.platform ?? \"unknown\";\n\tconst maxAlternatives = input.maxAlternatives ?? 3;\n\tconst scored = REVERSE_SKILL_ROUTES.map((route) => scoreRoute(route, input, normalizedQuery))\n\t\t.filter((candidate) => candidate.score > 0)\n\t\t.sort(\n\t\t\t(a, b) => b.score - a.score || REVERSE_SKILL_ROUTES.indexOf(a.route) - REVERSE_SKILL_ROUTES.indexOf(b.route),\n\t\t);\n\n\tconst primary = scored[0];\n\tconst alternatives = scored.slice(1, maxAlternatives + 1);\n\tconst unmatched = !primary || primary.score < ROUTE_SCORE_TARGET_WEIGHT || primary.confidence < 0.18;\n\tconst nextAction = unmatched\n\t\t? \"No strong route matched. Create or extend a reverse-skill route before executing specialized tooling.\"\n\t\t: `Read ${primary.route.skillPath}, then execute first action: ${primary.route.firstActions[0] ?? \"classify target\"}.`;\n\n\treturn {\n\t\tquery: input.query,\n\t\tplatform,\n\t\tnormalizedQuery,\n\t\tprimary: unmatched ? undefined : primary,\n\t\talternatives,\n\t\tunmatched,\n\t\tnextAction,\n\t};\n}\n\nfunction formatMatches(score: ReverseSkillRouteScore): string {\n\tconst parts = [\n\t\t`target=${score.matched.target.join(\", \") || \"—\"}`,\n\t\t`intent=${score.matched.intent.join(\", \") || \"—\"}`,\n\t\t`toolchain=${score.matched.toolchain.join(\", \") || \"—\"}`,\n\t\t`keywords=${score.matched.keywords.join(\", \") || \"—\"}`,\n\t];\n\treturn parts.join(\"; \");\n}\n\nexport function formatReverseSkillRouteDecision(decision: ReverseSkillRouteDecision): string {\n\tif (decision.unmatched || !decision.primary) {\n\t\treturn [\n\t\t\t\"# Reverse Skill Route\",\n\t\t\t\"\",\n\t\t\t`Query: ${decision.query}`,\n\t\t\t\"\",\n\t\t\t\"No strong route matched.\",\n\t\t\t\"Next action: create or extend a route before specialized execution.\",\n\t\t].join(\"\\n\");\n\t}\n\n\tconst primary = decision.primary;\n\tconst lines = [\n\t\t\"# Reverse Skill Route\",\n\t\t\"\",\n\t\t`Query: ${decision.query}`,\n\t\t`Platform: ${decision.platform}`,\n\t\t\"\",\n\t\t`## Primary: ${primary.route.label}`,\n\t\t`- Route ID: ${primary.route.id}`,\n\t\t`- Skill path: ${primary.route.skillPath}`,\n\t\t`- Confidence: ${primary.confidence}`,\n\t\t`- Score: ${primary.score}`,\n\t\t`- Matches: ${formatMatches(primary)}`,\n\t\t`- Risk: ${primary.route.risk}`,\n\t\t`- Required tools: ${primary.route.requiredTools.join(\", \") || \"none\"}`,\n\t\t`- Optional tools: ${primary.route.optionalTools.join(\", \") || \"none\"}`,\n\t\t`- Skill hints: ${primary.route.skillHints.join(\", \")}`,\n\t\t`- MCP hints: ${primary.route.mcpHints.join(\", \")}`,\n\t\t`- Hooks: ${primary.route.hookHints.join(\", \")}`,\n\t\t\"\",\n\t\t\"## First actions\",\n\t\t...primary.route.firstActions.map((action, index) => `${index + 1}. ${action}`),\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t...primary.route.acceptance.map((item) => `- ${item}`),\n\t];\n\n\tif (decision.alternatives.length > 0) {\n\t\tlines.push(\"\", \"## Alternatives\");\n\t\tfor (const alternative of decision.alternatives) {\n\t\t\tlines.push(`- ${alternative.route.id} (${alternative.confidence}): ${formatMatches(alternative)}`);\n\t\t}\n\t}\n\n\tlines.push(\"\", `Next action: ${decision.nextAction}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function planReverseSkillToolChecks(decision: ReverseSkillRouteDecision, maxTools = 12): string[] {\n\tconst routes = [decision.primary, ...decision.alternatives].filter((score): score is ReverseSkillRouteScore =>\n\t\tBoolean(score),\n\t);\n\tconst tools: string[] = [];\n\tfor (const score of routes) {\n\t\ttools.push(...score.route.requiredTools, ...score.route.optionalTools);\n\t}\n\treturn unique(tools).slice(0, maxTools);\n}\n\nexport function normalizeReverseSkillName(name: string): string {\n\tconst normalized = normalizeReverseSkillText(name)\n\t\t.replace(/[^a-z0-9-]+/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.slice(0, 64)\n\t\t.replace(/-$/g, \"\");\n\treturn normalized || \"reverse-skill\";\n}\n\nfunction yamlString(value: string): string {\n\treturn JSON.stringify(value);\n}\n\nfunction compactDescription(input: ReverseSkillSpecInput, routes: ReverseSkillRoute[]): string {\n\tconst fallback = `Use when ${input.triggerSummary}`;\n\tconst base = input.description?.trim() || fallback;\n\tconst routeNames = routes.map((route) => route.id).join(\", \");\n\tconst suffix = routeNames ? ` Routes through ${routeNames}.` : \"\";\n\tconst description = `${base}${suffix}`;\n\treturn description.length <= 1024 ? description : `${description.slice(0, 1021).trimEnd()}...`;\n}\n\nfunction routesFromIds(routeIds: string[] | undefined): ReverseSkillRoute[] {\n\tif (!routeIds) return [];\n\treturn routeIds\n\t\t.map((routeId) => REVERSE_SKILL_ROUTES.find((route) => route.id === routeId))\n\t\t.filter((route): route is ReverseSkillRoute => Boolean(route));\n}\n\nexport function formatReverseSkillMarkdown(input: ReverseSkillSpecInput): string {\n\tconst routes = routesFromIds(input.routeIds);\n\tconst name = normalizeReverseSkillName(input.name);\n\tconst description = compactDescription(input, routes);\n\tconst workflowSteps = input.workflowSteps?.length\n\t\t? input.workflowSteps\n\t\t: [\n\t\t\t\t\"Classify target, intent, and available toolchain before execution\",\n\t\t\t\t\"Read the routed sub-skill or reference\",\n\t\t\t\t\"Collect evidence and record blockers\",\n\t\t\t\t\"Verify output against acceptance criteria\",\n\t\t\t];\n\tconst tools = unique([\n\t\t...(input.tools ?? []),\n\t\t...routes.flatMap((route) => [...route.requiredTools, ...route.optionalTools]),\n\t]);\n\tconst mcpServers = unique([...(input.mcpServers ?? []), ...routes.flatMap((route) => route.mcpHints)]);\n\tconst hooks = unique([...(input.hooks ?? []), ...routes.flatMap((route) => route.hookHints)]);\n\tconst acceptance = unique([...(input.acceptance ?? []), ...routes.flatMap((route) => route.acceptance)]);\n\tconst safetyNotes = input.safetyNotes?.length\n\t\t? input.safetyNotes\n\t\t: [\n\t\t\t\t\"Operate only on user-provided local artifacts or explicitly scoped targets\",\n\t\t\t\t\"Do not write secrets, tokens, credentials, or raw private data into skill artifacts\",\n\t\t\t];\n\n\tconst lines = [\n\t\t\"---\",\n\t\t`name: ${name}`,\n\t\t`description: ${yamlString(description)}`,\n\t\t\"---\",\n\t\t\"\",\n\t\t`# ${name}`,\n\t\t\"\",\n\t\t\"## Routing contract\",\n\t\t\"\",\n\t\t`Trigger this skill when ${input.triggerSummary}.`,\n\t\t\"\",\n\t\t\"1. Classify the target type, user intent, and toolchain signals before choosing tools.\",\n\t\t\"2. Read the narrowest referenced sub-skill or reference before running specialized tooling.\",\n\t\t\"3. Prefer passive/local evidence collection first; escalate only when the task scope requires it.\",\n\t\t\"4. Save evidence paths and blockers in the final response.\",\n\t\t\"\",\n\t\t\"## Workflow\",\n\t\t\"\",\n\t\t...workflowSteps.map((step, index) => `${index + 1}. ${step}`),\n\t\t\"\",\n\t\t\"## Tool selection\",\n\t\t\"\",\n\t\t`- Tools: ${tools.join(\", \") || \"none required\"}`,\n\t\t`- MCP: ${mcpServers.join(\", \") || \"filesystem/read-only\"}`,\n\t\t`- Hooks: ${hooks.join(\", \") || \"pre-shell-guard, protect-secrets\"}`,\n\t\t\"\",\n\t\t\"## Acceptance\",\n\t\t\"\",\n\t\t...(acceptance.length > 0\n\t\t\t? acceptance.map((item) => `- ${item}`)\n\t\t\t: [\"- Output includes routed skill, evidence, commands, and remaining blockers\"]),\n\t\t\"\",\n\t\t\"## Safety constraints\",\n\t\t\"\",\n\t\t...safetyNotes.map((note) => `- ${note}`),\n\t];\n\n\tif (routes.length > 0) {\n\t\tlines.push(\"\", \"## Built-in routes\", \"\");\n\t\tfor (const route of routes) {\n\t\t\tlines.push(`- ${route.id}: ${route.skillPath}`);\n\t\t}\n\t}\n\n\tif (input.references?.length) {\n\t\tlines.push(\"\", \"## References\", \"\");\n\t\tfor (const reference of input.references) lines.push(`- ${reference}`);\n\t}\n\n\treturn `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n\nexport function extractReverseSkillFactsFromMarkdown(sourceText: string): ReverseSkillSourceFacts {\n\tconst headings = unique(\n\t\tArray.from(sourceText.matchAll(/^#{1,4}\\s+(.+)$/gm)).map((match) => match[1]?.trim() ?? \"\"),\n\t).slice(0, 24);\n\tconst skillPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+SKILL\\.md)/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst scriptPaths = unique(\n\t\tArray.from(sourceText.matchAll(/[`(\\s]([^`\\s)]+\\.(?:ps1|sh|py|js|ts))/g)).map((match) => match[1] ?? \"\"),\n\t);\n\tconst knownTools = Object.keys(TOOL_ALIASES);\n\tconst normalizedSource = normalizeReverseSkillText(sourceText);\n\tconst tools = knownTools.filter((tool) => normalizedSource.includes(normalizeReverseSkillText(tool)));\n\tconst mcpServers = unique(\n\t\tArray.from(sourceText.matchAll(/\\b([a-z0-9-]+)\\s+MCP\\b/gi)).map((match) => match[1]?.toLowerCase() ?? \"\"),\n\t);\n\tconst triggerTerms = unique(\n\t\tREVERSE_SKILL_ROUTES.flatMap((route) => [\n\t\t\t...route.targetPatterns,\n\t\t\t...route.intentPatterns,\n\t\t\t...route.toolPatterns,\n\t\t]).filter((term) => normalizedSource.includes(normalizeReverseSkillText(term))),\n\t).slice(0, 40);\n\n\treturn { headings, skillPaths, scriptPaths, tools, mcpServers, triggerTerms };\n}\n\nexport function formatReverseSkillFromSource(input: ReverseSkillSourceInput): string {\n\tconst facts = extractReverseSkillFactsFromMarkdown(input.sourceText);\n\tconst query = [input.triggerSummary, facts.triggerTerms.slice(0, 12).join(\" \"), facts.headings.slice(0, 8).join(\" \")]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\tconst decision = routeReverseSkill({ query: query || input.sourceText.slice(0, 500) });\n\tconst routeIds = [decision.primary?.route.id, ...decision.alternatives.map((item) => item.route.id)].filter(\n\t\t(routeId): routeId is string => Boolean(routeId),\n\t);\n\tconst name = input.name ?? (decision.primary ? `${decision.primary.route.id}-workflow` : \"reverse-skill-workflow\");\n\tconst triggerSummary =\n\t\tinput.triggerSummary ??\n\t\t(facts.triggerTerms.slice(0, 8).join(\", \") || \"reverse-engineering or security routing is needed\");\n\tconst workflowSteps = [\n\t\t\"Classify the incoming request against target, intent, and toolchain signals\",\n\t\t\"Load the routed sub-skill before running specialized tooling\",\n\t\t\"Check local tool availability only for tools required by the selected route\",\n\t\t\"Return evidence paths, commands, confidence, and blockers\",\n\t];\n\n\treturn formatReverseSkillMarkdown({\n\t\tname,\n\t\tdescription: input.description,\n\t\ttriggerSummary,\n\t\trouteIds,\n\t\tworkflowSteps,\n\t\ttools: facts.tools,\n\t\tmcpServers: facts.mcpServers,\n\t\treferences: unique([...facts.skillPaths, ...facts.scriptPaths]).slice(0, 20),\n\t});\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omk-agent-core",
3
- "version": "0.95.2",
3
+ "version": "0.96.1",
4
4
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "prepublishOnly": "npm run clean && npm run build"
30
30
  },
31
31
  "dependencies": {
32
- "omk-ai": "^0.95.2",
32
+ "omk-ai": "^0.96.1",
33
33
  "ignore": "7.0.6",
34
34
  "typebox": "1.3.11",
35
35
  "yaml": "2.9.0"
@@ -54,6 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@types/node": "24.12.4",
56
56
  "@vitest/coverage-v8": "3.2.6",
57
+ "fast-check": "4.9.0",
57
58
  "typescript": "5.9.3",
58
59
  "vitest": "3.2.6"
59
60
  }