Skip to content

feat(guardrails): add local skill scan workspace and move skill management under Guardrails#604

Draft
seviezhou wants to merge 6 commits into
mainfrom
feat/skillscan
Draft

feat(guardrails): add local skill scan workspace and move skill management under Guardrails#604
seviezhou wants to merge 6 commits into
mainfrom
feat/skillscan

Conversation

@seviezhou

@seviezhou seviezhou commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR introduces a local skill scan workspace under Guardrails and refactors the previous skill management flow into a scan-oriented experience.

What changed

Backend

  • added a standalone local skill scanner under internal/guardrails/skillscan
  • implemented built-in static scanning rules for local skills
  • added scanner result types, artifact hashing, quick scan APIs, and tests
  • changed skill modeling to treat directory-backed skills as a single skill object
  • added entry_path to distinguish skill directory path from entry markdown path
  • updated skill content loading to read from entry_path when available

Frontend

  • moved the old Skill page under Guardrails as Skill Scan
  • removed Prompt/skill entry points and deprecated skill-related feature flags
  • redesigned the page into a scan-oriented workspace with:
    • Overview tab for scan progress and source status
    • Skills tab for source browsing, skill listing, and markdown/raw content viewing
    • Findings tab scaffold for future finding-level triage
  • simplified the skill list to focus on skill names instead of path-heavy list items
  • restored skill path display and copy-to-clipboard in the content detail header for long paths

Cleanup

  • removed unused Prompt/User Request UI entry points and related legacy files
  • removed obsolete skill_user / skill_ide scenario flag handling

Notes

  • Findings is currently a UI scaffold and will be populated once backend finding-level APIs are wired in
  • directory-backed skills are now displayed by folder name, while content is loaded from the skill entry markdown file

Testing

  • added scanner package tests for internal/guardrails/skillscan
  • frontend/backed integration for the new scan flow is not fully wired yet

Replace usage of the external `upath` library with small internal helpers for normalizing and splitting path-like strings. Added normalizePathLike, splitPathSegments, and normalizePatternForMatch to: convert backslashes to slashes, collapse consecutive slashes, strip single-dot segments, and produce stable path segments for matching. Updated display name and grouping logic (getSkillDisplayName, getTwoLevelDisplayName, getGroupKeyFromPattern, and various grouping loops) to use splitPathSegments. Also added a guard to treat empty normalized patterns as non-matching. This removes the upath import and consolidates path handling behavior in-place.
Introduce a new internal/guardrails/skillscan package implementing a local scanner for skill files. Adds scanner engine (engine.go) with file/markdown views, base64 extraction, dedupe/aggregation, quick-scan and artifact hashing; file walker (walker.go) to collect and normalize files; hashing helper (hash.go); comprehensive built-in detection rules (rules.go) for prompt injection, exec, exfiltration, Web3 risks, obfuscation, etc.; types (types.go) for result shapes and tags; and unit tests (engine_test.go) validating markdown handling, base64 decoding, hashing stability, and rule detection. This enables deterministic content hashing and local security checks for skills using the built-in rulepack, with support for adding custom rules.
Move the Skill management UI into a new Guardrails-focused SkillScan page and remove legacy skill feature flags. SkillPage was renamed to frontend/src/pages/guardrails/SkillScanPage.tsx with a large refactor: added source scan state, scan-run orchestration, progress UI (per-source & global), Scan All, and UI/content updates. Routes and layout were updated to point /prompt/skill to /guardrails/skill-scan and to surface the Skill Scan entry in the Guardrails menu; UserPage and prompt index exports were deleted. GlobalExperimentalFeatures and FeatureFlagsContext no longer load or expose skill_user/skill_ide flags, and related UI toggles were removed. Server config handlers for the scenario flags "skill_user" and "skill_ide" were also removed from internal/server/config/config.go.
Refactor Skill Scan UI and backend to support tabbed views and use skill.entry_path when resolving content. Frontend: introduce Overview/Skills/Findings tabs, add finding types/state, include skill.path in searches and displays, and simplify the skills list by removing the complex grouping logic and related helpers (path normalization, grouping/splitting, copy-path action, etc.). Adjusted progress/status chips and layouts across SkillScanPage, SkillListDialog and SkillDetailDialog (fetch now prefers entry_path || path). Backend/types: expose entry_path on skill types and update skill manager accordingly. Overall this simplifies list behavior, surfaces path info, and prepares groundwork for findings UI.
Display the selected skill's path under its name in SkillScanPage and add a small copy button. Introduces handleCopyPath to write selectedSkill.path to the clipboard and show a notification. Adds layout/styling for the path (ellipsis handling) and a ContentCopy IconButton to copy the path.
@seviezhou seviezhou changed the title feat: Skill Scanner feat(guardrails): add local skill scan workspace and move skill management under Guardrails Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant