feat(ui): add attack path custom query skill for Lighthouse AI#10323
feat(ui): add attack path custom query skill for Lighthouse AI#10323
Conversation
- Add SkillMetadata and SkillDefinition interfaces - Add skill registry with register, get, and list functions - Add load_skill LangChain tool for loading skill instructions - Add LOAD_SKILL meta-tool constant and chain-of-thought handling - Add generateSkillCatalog for dynamic system prompt injection - Wire skills infrastructure into Lighthouse workflow
- Add attack-path-custom-query skill definition with openCypher guidance - Register skill in skills index to populate the catalog - Add cartography schema tool to allowed tools list
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
|
✅ All necessary |
🔒 Container Security ScanImage: 📊 Vulnerability Summary
1 package(s) affected
|
|
No issues found. Notes (below threshold, informational only):
|
Suggestion: make skill registration explicit instead of side-effect importsThe current pattern uses bare side-effect imports to trigger registration: // index.ts
import "./definitions/attack-path-custom-query"; // side-effect triggers registerSkill()This has three risks:
Suggested refactor (2 files, ~5 lines): // definitions/attack-path-custom-query.ts
import type { SkillDefinition } from "../types";
export const customAttackPathQuerySkill: SkillDefinition = {
metadata: { ... },
instructions: `...`,
};
// Remove the registerSkill() call — registration moves to the barrel// index.ts
import { registerSkill } from "./registry";
import { customAttackPathQuerySkill } from "./definitions/attack-path-custom-query";
// Explicit registration — tree-shake-proof, grep-friendly
registerSkill(customAttackPathQuerySkill);
export { getAllSkillMetadata, getRegisteredSkillIds, getSkillById } from "./registry";
export type { SkillDefinition, SkillMetadata } from "./types";The named import creates a real binding the bundler must preserve (it's consumed by |
…imports Move registerSkill() from the definition file to the barrel (index.ts) with a named import. This makes the binding tree-shake-proof and prevents skills from silently vanishing if the bare import is ever dropped.
Remove trailing blank line and sort imports alphabetically.
Context
Add the first Lighthouse skill: Attack Path Custom Query. This skill provides the LLM with openCypher syntax guidance and Cartography schema knowledge for writing graph queries against Prowler's cloud infrastructure data.
Depends on:
Description
New file:
ui/lib/lighthouse/skills/definitions/attack-path-custom-query.ts— Full skill definition with openCypher patterns, Cartography schema reference, provider isolation rules, and example queriesModified files:
ui/lib/lighthouse/skills/index.ts— Import skill definition to trigger registrationui/lib/lighthouse/workflow.ts— Addprowler_app_get_attack_paths_cartography_schemato allowed toolsSteps to review
definitions/attack-path-custom-query.tsindex.tstriggers registrationALLOWED_TOOLSinworkflow.tsChecklist
Community Checklist
UI (if applicable)
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.