~/.claude/CLAUDE.md specifies English for code and documentation, Norwegian for dialog only. Norwegian had crept into surface text across v7.5-v7.7. Translated to English in eight surfaces. No scanner, hook, or behavior changes — purely surface text. - 18 skill commands: the HTML Report-step now reads "HTML report: [Open in browser]" instead of "HTML-rapport: [Åpne i nettleser]" - scripts/lib/report-renderers.mjs: key-stat labels, lede defaults, table headers, maturity-ladder descriptions, action-tier labels, clean buckets, dry-run/apply copy, and JS comments. Regex alternations /^high|^høy/ and /resolution|løsning/i preserved. - playground/llm-security-playground.html: same renderer changes mirrored bit-identical, plus playground-only UI strings (catalog, breadcrumb aria-label, theme toggle, builder-modal hint, guide-panel "no projects yet", delete confirmation, alert/copy). Demo-state fixture content for dft-komplett-demo preserved (intentional Norwegian persona). - agents/skill-scanner-agent.md + agents/mcp-scanner-agent.md: Generaliseringsgrense + Parallell Read-strategi sections translated to Generalization boundary + Parallel Read strategy. - README.md: playground architecture prose + Recent versions table (v7.5.0 — v7.7.1). - CLAUDE.md: v7.7.1 highlights translated, new v7.7.2 highlights added. - ../../README.md: llm-security v7.5.0 — v7.7.1 bullets. - ../../CLAUDE.md: llm-security catalog entry. - docs/scanner-reference.md: six runnable-examples table cells. - docs/version-history.md: new v7.7.2 entry. v7.5-v7.7 narrative sections left in original language (deferred per operator). - Version bumped 7.7.1 → 7.7.2 in package.json, .claude-plugin/plugin.json, README badge + Recent versions, CLAUDE.md header + state, docs/version-history.md, playground renderHome hardcoded string, root README + CLAUDE.md llm-security entries. Tests: 1820/1820 green. CLI smoke-test: 18/18 commandIds produce >138 KB self-contained HTML. Browser-dogfood verified. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
141 lines
3.9 KiB
Markdown
141 lines
3.9 KiB
Markdown
---
|
|
name: security:registry
|
|
description: Skill signature registry — view stats, scan and register skills, search known fingerprints
|
|
allowed-tools: Bash, Read, Agent
|
|
model: sonnet
|
|
---
|
|
|
|
# /security registry [scan <path|url> | search <pattern>]
|
|
|
|
Local database of known skill fingerprints and risk profiles. Enables instant re-scan detection.
|
|
|
|
## Step 1: Parse Sub-command
|
|
|
|
Extract from `$ARGUMENTS`:
|
|
- Empty or `stats` → **show stats**
|
|
- `scan <path|url>` → **scan and register**
|
|
- `search <pattern>` → **search registry**
|
|
|
|
Determine plugin root (parent of this `commands/` folder).
|
|
|
|
## Step 2a: Stats (default)
|
|
|
|
```bash
|
|
node -e "
|
|
import { getStats, listEntries } from '<plugin-root>/scanners/lib/skill-registry.mjs';
|
|
const stats = getStats('<plugin-root>');
|
|
const recent = listEntries({}, '<plugin-root>').slice(0, 5);
|
|
console.log(JSON.stringify({ stats, recent }));
|
|
" --input-type=module
|
|
```
|
|
|
|
Display:
|
|
|
|
```
|
|
## Skill Signature Registry
|
|
|
|
| Metric | Value |
|
|
|--------|-------|
|
|
| Total entries | X |
|
|
| Scanned | X |
|
|
| Seed | X |
|
|
| ALLOW | X |
|
|
| WARNING | X |
|
|
| BLOCK | X |
|
|
| Stale (>7d) | X |
|
|
| Avg risk score | X/100 |
|
|
|
|
### Recent Entries
|
|
| Name | Verdict | Risk | Last Scanned |
|
|
```
|
|
|
|
## Step 2b: Scan and Register
|
|
|
|
Resolve target — if `$ARGUMENTS` contains a URL, clone via `node <plugin-root>/scanners/lib/git-clone.mjs clone "<url>"` first.
|
|
|
|
**Fingerprint:**
|
|
|
|
```bash
|
|
node -e "
|
|
import { fingerprintSkill, checkRegistry } from '<plugin-root>/scanners/lib/skill-registry.mjs';
|
|
const result = fingerprintSkill('<target>');
|
|
const check = checkRegistry(result.fingerprint, '<plugin-root>');
|
|
console.log(JSON.stringify({ ...result, ...check }));
|
|
" --input-type=module
|
|
```
|
|
|
|
**If found and not stale:** Display cached result. Skip full scan.
|
|
|
|
```
|
|
## Registry Hit
|
|
|
|
**Name:** <name> | **Fingerprint:** <first 12 chars>
|
|
**Verdict:** <verdict> | **Risk Score:** <score>/100
|
|
**Last scanned:** <date> | **Scan count:** <n>
|
|
**Status:** Cached result (use `/security scan` to force re-scan)
|
|
```
|
|
|
|
**If not found or stale:** Run `/security scan <target>`, then register:
|
|
|
|
```bash
|
|
node -e "
|
|
import { registerScan } from '<plugin-root>/scanners/lib/skill-registry.mjs';
|
|
const result = registerScan({
|
|
skillPath: '<target>',
|
|
fingerprint: '<fingerprint>',
|
|
name: '<name>',
|
|
files: <files_json>,
|
|
verdict: '<verdict>',
|
|
risk_score: <score>,
|
|
counts: <counts_json>,
|
|
files_scanned: <n>
|
|
}, '<plugin-root>');
|
|
console.log(JSON.stringify(result.entry));
|
|
" --input-type=module
|
|
```
|
|
|
|
Display: "Registered: <name> (<fingerprint first 12>) — <verdict>"
|
|
|
|
Clean up clone if remote.
|
|
|
|
## Step 2c: Search
|
|
|
|
```bash
|
|
node -e "
|
|
import { searchRegistry } from '<plugin-root>/scanners/lib/skill-registry.mjs';
|
|
const matches = searchRegistry('<pattern>', '<plugin-root>');
|
|
console.log(JSON.stringify(matches));
|
|
" --input-type=module
|
|
```
|
|
|
|
Display results table:
|
|
|
|
```
|
|
## Registry Search: "<pattern>"
|
|
|
|
**Matches:** X
|
|
|
|
| Name | Fingerprint | Verdict | Risk | Last Scanned |
|
|
```
|
|
|
|
If no matches: "No entries matching '<pattern>'."
|
|
|
|
## Step 3: HTML Report
|
|
|
|
After producing the markdown registry output above (stats / scan-result / search-result, whichever sub-command ran):
|
|
|
|
1. Compute a temp markdown path:
|
|
```bash
|
|
node -p "require('path').join(require('os').tmpdir(), 'sec-registry-' + Date.now() + '.md')"
|
|
```
|
|
2. Use the Write tool to save the **entire markdown output you just produced** (Skill Signature Registry header + metric table + Recent Entries, OR Registry Hit banner, OR Registry Search results) to that temp path. Verbatim.
|
|
3. Run the renderer:
|
|
```bash
|
|
node <plugin-root>/scripts/render-report.mjs registry --in "<temp-md-path>"
|
|
```
|
|
The CLI writes `reports/registry-<YYYYMMDD-HHmmss>.html` relative to CWD and prints `file:///abs/path.html` on stdout.
|
|
4. Append to your response (markdown link, no bare URL):
|
|
|
|
> **HTML report:** [Open in browser](file:///abs/path.html)
|
|
|
|
If the CLI exits non-zero, mention the error but do not block — the markdown output above is the primary deliverable.
|