@intentsolutionsio/freshie-inventory-manager 1.0.0
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/.claude-plugin/plugin.json +21 -0
- package/README.md +47 -0
- package/agents/anomaly-detector.md +113 -0
- package/agents/compliance-validator.md +79 -0
- package/agents/discovery-scanner.md +57 -0
- package/package.json +42 -0
- package/skills/freshie-inventory/SKILL.md +396 -0
- package/skills/freshie-inventory/references/common-queries.md +349 -0
- package/skills/freshie-inventory/references/examples.md +183 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "freshie-inventory-manager",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Unified command center for the freshie ecosystem inventory database — discovery scans, compliance grading, batch remediation, querying, and reporting across 50 tables of plugin/skill/pack metadata",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Jeremy Longshore",
|
|
7
|
+
"email": "jeremy@intentsolutions.io"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/jeremylongshore/claude-code-plugins",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"database",
|
|
13
|
+
"inventory",
|
|
14
|
+
"freshie",
|
|
15
|
+
"compliance",
|
|
16
|
+
"sqlite",
|
|
17
|
+
"ecosystem",
|
|
18
|
+
"audit",
|
|
19
|
+
"agent-skills"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Freshie Inventory Manager
|
|
2
|
+
|
|
3
|
+
Unified command center for the freshie ecosystem inventory database. Manages discovery scans, compliance validation, batch remediation, ad-hoc queries, and status reporting across the full plugin/skill/pack lifecycle.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
/plugin marketplace add jeremylongshore/claude-code-plugins
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Invoke with natural language:
|
|
14
|
+
|
|
15
|
+
- `freshie status` — dashboard with run counts, grades, staleness
|
|
16
|
+
- `run a discovery scan` — trigger rebuild-inventory.py
|
|
17
|
+
- `compliance check` — validate and populate DB with enterprise grading
|
|
18
|
+
- `remediate skills` — batch fix compliance issues
|
|
19
|
+
- `query freshie for stub skills` — ad-hoc SQLite queries
|
|
20
|
+
- `freshie report` — generate a status update summary
|
|
21
|
+
- `compare discovery runs` — delta analysis between runs
|
|
22
|
+
- `show pack coverage` — SaaS pack completeness metrics
|
|
23
|
+
- `find anomalies` — detect data quality issues
|
|
24
|
+
- `export grades to CSV` — export compliance data
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Pre-loaded DB status via dynamic context injection
|
|
29
|
+
- 10 distinct operations with automatic intent detection
|
|
30
|
+
- Pre-built query library for common investigations
|
|
31
|
+
- Delta reporting between discovery runs
|
|
32
|
+
- Dry-run-first remediation safety pattern
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- `sqlite3` CLI
|
|
37
|
+
- `python3` with `pyyaml`
|
|
38
|
+
- Freshie database at `freshie/inventory.sqlite`
|
|
39
|
+
|
|
40
|
+
## Files
|
|
41
|
+
|
|
42
|
+
- `skills/freshie-inventory/SKILL.md` — Main skill definition
|
|
43
|
+
- `skills/freshie-inventory/references/common-queries.md` — Pre-built SQLite query library
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: anomaly-detector
|
|
3
|
+
description: "Detect data quality issues, stubs, orphan plugins, and outliers in the freshie inventory database"
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a freshie anomaly detector. Your job is to identify data quality issues,
|
|
8
|
+
suspicious patterns, and outliers in the ecosystem inventory database.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
Run these checks against the latest discovery run and group findings by severity.
|
|
13
|
+
|
|
14
|
+
### Check 1: Stored Anomalies
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
sqlite3 freshie/inventory.sqlite "
|
|
18
|
+
SELECT * FROM anomalies
|
|
19
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
20
|
+
ORDER BY rowid;
|
|
21
|
+
"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Check 2: Low Word Count Skills (Likely Stubs)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
sqlite3 freshie/inventory.sqlite "
|
|
28
|
+
SELECT cs.skill_path, cs.word_count, sc.grade, sc.is_stub
|
|
29
|
+
FROM content_signals cs
|
|
30
|
+
JOIN skill_compliance sc ON cs.skill_path = sc.skill_path AND cs.run_id = sc.run_id
|
|
31
|
+
WHERE cs.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
32
|
+
AND cs.word_count < 50
|
|
33
|
+
ORDER BY cs.word_count ASC LIMIT 20;
|
|
34
|
+
"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Check 3: Plugins with No Skills
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sqlite3 freshie/inventory.sqlite "
|
|
41
|
+
SELECT p.name, p.category
|
|
42
|
+
FROM plugins p
|
|
43
|
+
LEFT JOIN skills s ON p.path = s.plugin_path AND p.run_id = s.run_id
|
|
44
|
+
WHERE p.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
45
|
+
AND s.name IS NULL
|
|
46
|
+
ORDER BY p.category, p.name;
|
|
47
|
+
"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Check 4: High Template-Text Density
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
sqlite3 freshie/inventory.sqlite "
|
|
54
|
+
SELECT cs.skill_path, cs.placeholder_density, cs.word_count, sc.grade
|
|
55
|
+
FROM content_signals cs
|
|
56
|
+
JOIN skill_compliance sc ON cs.skill_path = sc.skill_path AND cs.run_id = sc.run_id
|
|
57
|
+
WHERE cs.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
58
|
+
AND cs.placeholder_density > 0.1
|
|
59
|
+
ORDER BY cs.placeholder_density DESC LIMIT 15;
|
|
60
|
+
"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Check 5: Duplicate Files
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
sqlite3 freshie/inventory.sqlite "
|
|
67
|
+
SELECT filename, COUNT(*) as occurrences
|
|
68
|
+
FROM duplicate_files
|
|
69
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
70
|
+
GROUP BY filename
|
|
71
|
+
HAVING COUNT(*) > 1
|
|
72
|
+
ORDER BY occurrences DESC LIMIT 15;
|
|
73
|
+
"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Check 6: Score Outliers (> 2 std dev from mean)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
sqlite3 freshie/inventory.sqlite "
|
|
80
|
+
WITH stats AS (
|
|
81
|
+
SELECT AVG(score) as avg_score, AVG(score*score) - AVG(score)*AVG(score) as variance
|
|
82
|
+
FROM skill_compliance WHERE run_id=(SELECT MAX(id) FROM discovery_runs)
|
|
83
|
+
)
|
|
84
|
+
SELECT sc.skill_path, sc.score, sc.grade
|
|
85
|
+
FROM skill_compliance sc, stats
|
|
86
|
+
WHERE sc.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
87
|
+
AND ABS(sc.score - stats.avg_score) > 2 * SQRT(stats.variance)
|
|
88
|
+
ORDER BY sc.score ASC LIMIT 20;
|
|
89
|
+
"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Output Format
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
ANOMALY SCAN RESULTS
|
|
96
|
+
======================
|
|
97
|
+
|
|
98
|
+
CRITICAL:
|
|
99
|
+
- {finding} ({count} affected)
|
|
100
|
+
|
|
101
|
+
WARNING:
|
|
102
|
+
- {finding} ({count} affected)
|
|
103
|
+
|
|
104
|
+
INFO:
|
|
105
|
+
- {finding} ({count} affected)
|
|
106
|
+
|
|
107
|
+
Total: {n} findings across {categories} categories
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Categorize by severity:
|
|
111
|
+
- **CRITICAL**: Plugins with no skills, D/F grades, missing DB tables
|
|
112
|
+
- **WARNING**: Stubs, high template density, score outliers
|
|
113
|
+
- **INFO**: Duplicates, minor data quality notes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-validator
|
|
3
|
+
description: "Run enterprise compliance validation against the freshie DB and produce grade summary with worst offenders"
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a freshie compliance validator. Your job is to run the enterprise-tier validation
|
|
8
|
+
pipeline, populate the freshie database with results, and produce a structured summary.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. **Run the validator** with enterprise grading and DB population:
|
|
13
|
+
```bash
|
|
14
|
+
python3 scripts/validate-skills-schema.py --enterprise --populate-db freshie/inventory.sqlite --verbose
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Summarize grade distribution** with percentages:
|
|
18
|
+
```bash
|
|
19
|
+
sqlite3 freshie/inventory.sqlite "
|
|
20
|
+
SELECT grade, COUNT(*) as count,
|
|
21
|
+
ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM skill_compliance
|
|
22
|
+
WHERE run_id=(SELECT MAX(id) FROM discovery_runs)), 1) as pct
|
|
23
|
+
FROM skill_compliance
|
|
24
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
25
|
+
GROUP BY grade ORDER BY grade;
|
|
26
|
+
"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. **Calculate average score**:
|
|
30
|
+
```bash
|
|
31
|
+
sqlite3 freshie/inventory.sqlite "
|
|
32
|
+
SELECT ROUND(AVG(score), 1) as avg_score
|
|
33
|
+
FROM skill_compliance
|
|
34
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs);
|
|
35
|
+
"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4. **List worst offenders** (D and F grades):
|
|
39
|
+
```bash
|
|
40
|
+
sqlite3 freshie/inventory.sqlite "
|
|
41
|
+
SELECT skill_path, score, grade, error_count, warning_count
|
|
42
|
+
FROM skill_compliance
|
|
43
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
44
|
+
AND grade IN ('D', 'F')
|
|
45
|
+
ORDER BY score ASC LIMIT 15;
|
|
46
|
+
"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
5. **Count upgrade candidates** (B grade, score 85-89):
|
|
50
|
+
```bash
|
|
51
|
+
sqlite3 freshie/inventory.sqlite "
|
|
52
|
+
SELECT COUNT(*) as upgrade_candidates
|
|
53
|
+
FROM skill_compliance
|
|
54
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
55
|
+
AND score BETWEEN 85 AND 89;
|
|
56
|
+
"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Output Format
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
COMPLIANCE VALIDATION COMPLETE
|
|
63
|
+
================================
|
|
64
|
+
Grade Distribution:
|
|
65
|
+
A: {n} ({pct}%) | B: {n} ({pct}%) | C: {n} ({pct}%) | D: {n} ({pct}%) | F: {n} ({pct}%)
|
|
66
|
+
|
|
67
|
+
Average Score: {avg}/100
|
|
68
|
+
Upgrade Candidates (B, 85-89): {n}
|
|
69
|
+
|
|
70
|
+
Worst Offenders:
|
|
71
|
+
{path} — {score} ({grade}) [{errors} errors, {warnings} warnings]
|
|
72
|
+
...
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Error Handling
|
|
76
|
+
|
|
77
|
+
- If validator fails, report error output and suggest `pip install pyyaml`
|
|
78
|
+
- If DB is empty, recommend running a discovery scan first
|
|
79
|
+
- Validator may produce warnings — include notable ones in the summary
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discovery-scanner
|
|
3
|
+
description: "Run freshie discovery scans — full repo scan via rebuild-inventory.py with delta reporting against previous run"
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a freshie ecosystem scanner. Your job is to run a full discovery scan of the
|
|
8
|
+
claude-code-plugins repository and report what changed.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. **Show current state** before scanning:
|
|
13
|
+
```bash
|
|
14
|
+
sqlite3 freshie/inventory.sqlite "SELECT id, run_date, total_plugins, total_skills, COALESCE(total_packs, 0) as total_packs FROM discovery_runs ORDER BY id DESC LIMIT 1;"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Run the scan**:
|
|
18
|
+
```bash
|
|
19
|
+
python3 freshie/scripts/rebuild-inventory.py
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3. **Report the delta** — compare new run vs previous:
|
|
23
|
+
```bash
|
|
24
|
+
sqlite3 freshie/inventory.sqlite "
|
|
25
|
+
SELECT
|
|
26
|
+
d1.id as new_run, d1.total_plugins as new_plugins, d1.total_skills as new_skills,
|
|
27
|
+
COALESCE(d1.total_packs, 0) as new_packs,
|
|
28
|
+
d2.id as old_run, d2.total_plugins as old_plugins, d2.total_skills as old_skills,
|
|
29
|
+
COALESCE(d2.total_packs, 0) as old_packs,
|
|
30
|
+
d1.total_plugins - d2.total_plugins as plugin_delta,
|
|
31
|
+
d1.total_skills - d2.total_skills as skill_delta
|
|
32
|
+
FROM discovery_runs d1
|
|
33
|
+
JOIN discovery_runs d2 ON d2.id = d1.id - 1
|
|
34
|
+
ORDER BY d1.id DESC LIMIT 1;
|
|
35
|
+
"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Output Format
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
DISCOVERY SCAN COMPLETE
|
|
42
|
+
========================
|
|
43
|
+
New Run: #{id} ({date})
|
|
44
|
+
Previous: #{id} ({date})
|
|
45
|
+
|
|
46
|
+
Plugins: {old} → {new} ({+/-delta})
|
|
47
|
+
Skills: {old} → {new} ({+/-delta})
|
|
48
|
+
Packs: {old} → {new} ({+/-delta})
|
|
49
|
+
|
|
50
|
+
Scan duration: {time}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Error Handling
|
|
54
|
+
|
|
55
|
+
- If `rebuild-inventory.py` fails, report the error output verbatim
|
|
56
|
+
- If this is the first run (no previous), just report absolute counts
|
|
57
|
+
- If DB doesn't exist, the script will create it
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@intentsolutionsio/freshie-inventory-manager",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Unified command center for the freshie ecosystem inventory database — discovery scans, compliance grading, batch remediation, querying, and reporting across 50 tables of plugin/skill/pack metadata",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"database",
|
|
7
|
+
"inventory",
|
|
8
|
+
"freshie",
|
|
9
|
+
"compliance",
|
|
10
|
+
"sqlite",
|
|
11
|
+
"ecosystem",
|
|
12
|
+
"audit",
|
|
13
|
+
"agent-skills",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"claude-plugin",
|
|
16
|
+
"tonsofskills"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/jeremylongshore/claude-code-plugins-plus-skills.git",
|
|
21
|
+
"directory": "plugins/database/freshie-inventory-manager"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://tonsofskills.com/plugins/freshie-inventory-manager",
|
|
24
|
+
"bugs": "https://github.com/jeremylongshore/claude-code-plugins-plus-skills/issues",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "Jeremy Longshore",
|
|
28
|
+
"email": "jeremy@intentsolutions.io"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"README.md",
|
|
35
|
+
".claude-plugin",
|
|
36
|
+
"skills",
|
|
37
|
+
"agents"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"postinstall": "node -e \"console.log(\\\"\\\\n→ This npm package is a tracking/proof artifact. Install the plugin via:\\\\n ccpi install freshie-inventory-manager\\\\n or /plugin install freshie-inventory-manager@claude-code-plugins-plus in Claude Code\\\\n\\\")\""
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: freshie-inventory
|
|
3
|
+
description: |
|
|
4
|
+
Manage the freshie ecosystem inventory database — a CMDB tracking all plugins,
|
|
5
|
+
skills, packs, and compliance grades across 50 SQLite tables. Use when checking
|
|
6
|
+
ecosystem health, running discovery scans, validating compliance, remediating
|
|
7
|
+
issues, querying inventory data, comparing runs, exporting data, or generating
|
|
8
|
+
status reports. Trigger with "freshie status", "inventory scan", "ecosystem audit",
|
|
9
|
+
"grade report", "compliance check", "remediate skills", "query freshie",
|
|
10
|
+
"compare runs", "export grades", or "freshie report".
|
|
11
|
+
allowed-tools: Read, Write, Edit, Bash(sqlite3:*), Bash(python3:*), Bash(node:*), Bash(mkdir:*), Bash(wc:*), Glob, Grep, AskUserQuestion, Skill, Agent
|
|
12
|
+
version: 1.0.0
|
|
13
|
+
author: Jeremy Longshore <jeremy@intentsolutions.io>
|
|
14
|
+
license: MIT
|
|
15
|
+
compatible-with: claude-code, codex, openclaw
|
|
16
|
+
tags: [database, inventory, freshie, compliance, ecosystem, sqlite]
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Freshie Inventory Manager
|
|
20
|
+
|
|
21
|
+
Interactive command center for the freshie ecosystem inventory database.
|
|
22
|
+
|
|
23
|
+
## Current DB Status
|
|
24
|
+
|
|
25
|
+
!`sqlite3 freshie/inventory.sqlite "SELECT 'Run #' || id || ' — ' || run_date || ' | Plugins: ' || total_plugins || ' | Skills: ' || total_skills || ' | Packs: ' || COALESCE(total_packs, 0) FROM discovery_runs ORDER BY id DESC LIMIT 3;" 2>/dev/null || echo "DB not found at freshie/inventory.sqlite"`
|
|
26
|
+
|
|
27
|
+
!`sqlite3 freshie/inventory.sqlite "SELECT grade || ': ' || COUNT(*) FROM skill_compliance GROUP BY grade ORDER BY grade;" 2>/dev/null`
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
|
|
31
|
+
The freshie database is the single source of truth for ecosystem-wide metrics — plugin counts,
|
|
32
|
+
skill compliance grades, pack coverage, anomaly detection, and historical trends across versioned
|
|
33
|
+
discovery runs. This skill is an **interactive wizard** — it always asks what you want to do,
|
|
34
|
+
then delegates heavy operations to specialized subagents.
|
|
35
|
+
|
|
36
|
+
**Database location:** `freshie/inventory.sqlite` (50 tables, versioned by `run_id`)
|
|
37
|
+
|
|
38
|
+
**Key scripts:**
|
|
39
|
+
- `freshie/scripts/rebuild-inventory.py` — full repo scan, creates new discovery run
|
|
40
|
+
- `freshie/scripts/batch-remediate.py` — auto-fix compliance issues
|
|
41
|
+
- `scripts/validate-skills-schema.py` — enterprise validation with DB population
|
|
42
|
+
|
|
43
|
+
## Prerequisites
|
|
44
|
+
|
|
45
|
+
- `sqlite3` CLI available on PATH
|
|
46
|
+
- `python3` with `pyyaml` installed
|
|
47
|
+
- Working directory is the repo root (`claude-code-plugins/`)
|
|
48
|
+
- Database exists at `freshie/inventory.sqlite`
|
|
49
|
+
- `/email` skill installed (for PDF report emailing)
|
|
50
|
+
|
|
51
|
+
## Instructions
|
|
52
|
+
|
|
53
|
+
### Step 1: Present Main Menu
|
|
54
|
+
|
|
55
|
+
When invoked, ALWAYS start by presenting this menu using AskUserQuestion:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
FRESHIE INVENTORY COMMAND CENTER
|
|
59
|
+
================================================================
|
|
60
|
+
|
|
61
|
+
What would you like to do?
|
|
62
|
+
|
|
63
|
+
1. Dashboard — Current status, grades, staleness
|
|
64
|
+
2. Discovery Scan — Full repo scan, create new run
|
|
65
|
+
3. Compliance Check — Enterprise validation + DB population
|
|
66
|
+
4. Remediation — Batch fix compliance issues
|
|
67
|
+
5. Query — Ad-hoc SQLite queries
|
|
68
|
+
6. Compare Runs — Delta analysis between runs
|
|
69
|
+
7. Export Data — CSV exports to freshie/exports/
|
|
70
|
+
8. Anomaly Scan — Data quality + outlier detection
|
|
71
|
+
9. Pack Coverage — SaaS pack completeness metrics
|
|
72
|
+
10. Full Audit — Scan + validate + report (end-to-end)
|
|
73
|
+
11. Report Only — Generate summary from existing data
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Use AskUserQuestion with these options. If the user's initial prompt already contains
|
|
77
|
+
a clear intent (e.g., "freshie status"), skip the menu and route directly.
|
|
78
|
+
|
|
79
|
+
### Step 2: Execute Chosen Workflow
|
|
80
|
+
|
|
81
|
+
Based on selection, follow the matching workflow below. Every workflow ends with
|
|
82
|
+
Step 3 (Email Report).
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Workflow A: Dashboard
|
|
87
|
+
|
|
88
|
+
Run these queries and present as a formatted dashboard:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
sqlite3 freshie/inventory.sqlite "SELECT id, run_date, total_plugins, total_skills, COALESCE(total_packs,0) FROM discovery_runs ORDER BY id DESC LIMIT 1;"
|
|
92
|
+
sqlite3 freshie/inventory.sqlite "SELECT grade, COUNT(*) FROM skill_compliance WHERE run_id=(SELECT MAX(id) FROM discovery_runs) GROUP BY grade ORDER BY grade;"
|
|
93
|
+
sqlite3 freshie/inventory.sqlite "SELECT CAST(julianday('now') - julianday(run_date) AS INTEGER) FROM discovery_runs ORDER BY id DESC LIMIT 1;"
|
|
94
|
+
sqlite3 freshie/inventory.sqlite "SELECT 'plugins', COUNT(*) FROM plugins WHERE run_id=(SELECT MAX(id) FROM discovery_runs) UNION ALL SELECT 'skills', COUNT(*) FROM skills WHERE run_id=(SELECT MAX(id) FROM discovery_runs) UNION ALL SELECT 'packs', COUNT(*) FROM packs WHERE run_id=(SELECT MAX(id) FROM discovery_runs) UNION ALL SELECT 'anomalies', COUNT(*) FROM anomalies WHERE run_id=(SELECT MAX(id) FROM discovery_runs);"
|
|
95
|
+
# Core vs SaaS pack breakdown
|
|
96
|
+
sqlite3 freshie/inventory.sqlite "SELECT CASE WHEN path LIKE '%saas-packs%' THEN 'saas-pack-skills' ELSE 'core-skills' END as type, COUNT(*) FROM skills WHERE run_id=(SELECT MAX(id) FROM discovery_runs) GROUP BY type;"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Present as:
|
|
100
|
+
```
|
|
101
|
+
FRESHIE INVENTORY DASHBOARD
|
|
102
|
+
============================
|
|
103
|
+
Last Scan: Run #{id} — {date} ({days} days ago)
|
|
104
|
+
Plugins: {n}
|
|
105
|
+
Skills: {n} total
|
|
106
|
+
Core: {n} (hand-crafted plugin skills)
|
|
107
|
+
SaaS Packs: {n} (auto-generated pack skills)
|
|
108
|
+
Packs: {n}
|
|
109
|
+
|
|
110
|
+
Grade Distribution:
|
|
111
|
+
A: {n} B: {n} C: {n} D: {n} F: {n}
|
|
112
|
+
|
|
113
|
+
Staleness: {Fresh (<3d) | Stale (3-7d) | CRITICAL (>7d)}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If Critical (>7 days), recommend a discovery scan.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Workflow B: Discovery Scan
|
|
121
|
+
|
|
122
|
+
**Delegate to the discovery-scanner subagent** via the Agent tool:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
Launch Agent: discovery-scanner
|
|
126
|
+
Prompt: "Run a full freshie discovery scan. Show current state first, execute
|
|
127
|
+
rebuild-inventory.py, then report the delta (plugin/skill count changes)
|
|
128
|
+
compared to the previous run."
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The subagent handles the long-running scan in isolation and returns the delta report.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Workflow C: Compliance Check
|
|
136
|
+
|
|
137
|
+
**Delegate to the compliance-validator subagent** via the Agent tool:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Launch Agent: compliance-validator
|
|
141
|
+
Prompt: "Run enterprise compliance validation against the freshie DB.
|
|
142
|
+
Execute: python3 scripts/validate-skills-schema.py --enterprise --populate-db freshie/inventory.sqlite --verbose
|
|
143
|
+
Then summarize: grade distribution with percentages, and list all D/F grade skills."
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The subagent runs the full validation pipeline and returns a structured summary.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Workflow D: Remediation
|
|
151
|
+
|
|
152
|
+
**CRITICAL: Always dry-run first, then confirm before executing.**
|
|
153
|
+
|
|
154
|
+
1. Run dry-run:
|
|
155
|
+
```bash
|
|
156
|
+
python3 freshie/scripts/batch-remediate.py --dry-run
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
2. Present the changes that would be made.
|
|
160
|
+
|
|
161
|
+
3. Use AskUserQuestion:
|
|
162
|
+
```
|
|
163
|
+
REMEDIATION PREVIEW
|
|
164
|
+
================================================================
|
|
165
|
+
{summary of proposed changes}
|
|
166
|
+
|
|
167
|
+
Proceed?
|
|
168
|
+
- Execute — Apply all fixes
|
|
169
|
+
- Cancel — Abort, no changes made
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
4. Only if user selects "Execute":
|
|
173
|
+
```bash
|
|
174
|
+
python3 freshie/scripts/batch-remediate.py --all --execute
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
5. After execution, run Workflow C (Compliance Check) to measure improvement.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Workflow E: Query
|
|
182
|
+
|
|
183
|
+
For ad-hoc queries, load the pre-built query library from [common-queries.md](references/common-queries.md).
|
|
184
|
+
|
|
185
|
+
Match the user's question to the closest pre-built query. If no match, construct a custom
|
|
186
|
+
query against the freshie schema using these key tables:
|
|
187
|
+
|
|
188
|
+
| Table | Contents |
|
|
189
|
+
|-------|----------|
|
|
190
|
+
| `plugins` | name, category, version, path |
|
|
191
|
+
| `skills` | name, plugin_path, has_references, has_scripts |
|
|
192
|
+
| `packs` | name, skill_count, category |
|
|
193
|
+
| `skill_compliance` | score, grade, error_count, warning_count, is_stub |
|
|
194
|
+
| `plugin_compliance` | plugin-level roll-up scores |
|
|
195
|
+
| `content_signals` | word_count, code_block_count |
|
|
196
|
+
| `anomalies` | detected data quality issues |
|
|
197
|
+
| `discovery_runs` | run history with timestamps |
|
|
198
|
+
|
|
199
|
+
Always filter to latest run: `WHERE run_id = (SELECT MAX(id) FROM discovery_runs)`
|
|
200
|
+
|
|
201
|
+
After showing results, use AskUserQuestion to offer follow-up:
|
|
202
|
+
```
|
|
203
|
+
Results shown. What next?
|
|
204
|
+
- Refine query — Modify or drill deeper
|
|
205
|
+
- Export to CSV — Save results to file
|
|
206
|
+
- Back to menu — Return to main menu
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Workflow F: Compare Runs
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
sqlite3 freshie/inventory.sqlite "SELECT id, run_date, total_plugins, total_skills, COALESCE(total_packs,0) FROM discovery_runs ORDER BY id;"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
If more than 2 runs exist, use AskUserQuestion to let user pick which two to compare.
|
|
218
|
+
Default to the two most recent.
|
|
219
|
+
|
|
220
|
+
Use the "Historical Trends" queries from [common-queries.md](references/common-queries.md) for:
|
|
221
|
+
- Grade distribution comparison between runs
|
|
222
|
+
- Skills that changed grade (upgrades/downgrades with score delta)
|
|
223
|
+
- New skills added since previous run
|
|
224
|
+
- Skills removed since previous run
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Workflow G: Export Data
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
mkdir -p freshie/exports
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Use AskUserQuestion to let user pick what to export:
|
|
235
|
+
```
|
|
236
|
+
EXPORT OPTIONS
|
|
237
|
+
================================================================
|
|
238
|
+
What should I export?
|
|
239
|
+
|
|
240
|
+
- Skill Grades — All skill compliance scores + grades
|
|
241
|
+
- Plugin Inventory — All plugins with category and version
|
|
242
|
+
- Pack Coverage — Pack names, skill counts, categories
|
|
243
|
+
- Full Dump — All three exports
|
|
244
|
+
- Custom Query — Export any query result to CSV
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Then run the appropriate export:
|
|
248
|
+
```bash
|
|
249
|
+
sqlite3 -header -csv freshie/inventory.sqlite "{query}" > freshie/exports/{filename}.csv
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Report file paths and row counts.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Workflow H: Anomaly Scan
|
|
257
|
+
|
|
258
|
+
**Delegate to the anomaly-detector subagent** via the Agent tool:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
Launch Agent: anomaly-detector
|
|
262
|
+
Prompt: "Run anomaly detection on the freshie inventory DB. Check:
|
|
263
|
+
1. Stored anomalies from the latest discovery run
|
|
264
|
+
2. Skills with word count < 50 (likely stubs)
|
|
265
|
+
3. Plugins with no skills
|
|
266
|
+
4. Skills with high template-text density (>10%)
|
|
267
|
+
5. Duplicate files
|
|
268
|
+
Report all findings grouped by severity."
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Workflow I: Pack Coverage
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
sqlite3 freshie/inventory.sqlite "SELECT name, skill_count, category FROM packs WHERE run_id=(SELECT MAX(id) FROM discovery_runs) ORDER BY skill_count DESC;"
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Also flag packs below minimum viable (< 3 skills) and show grade distribution within packs.
|
|
280
|
+
Use pack coverage queries from [common-queries.md](references/common-queries.md).
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Workflow J: Full Audit
|
|
285
|
+
|
|
286
|
+
This is the power workflow — runs everything end-to-end:
|
|
287
|
+
|
|
288
|
+
1. **Discovery Scan** (Workflow B) — via subagent
|
|
289
|
+
2. **Compliance Check** (Workflow C) — via subagent
|
|
290
|
+
3. **Anomaly Scan** (Workflow H) — via subagent
|
|
291
|
+
4. **Report Generation** (Workflow K) — compile all results
|
|
292
|
+
|
|
293
|
+
Launch steps 1-3 as parallel subagents, then compile the report when all complete.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Workflow K: Report Only
|
|
298
|
+
|
|
299
|
+
Generate a summary report from existing data (no new scans). Gather dashboard data
|
|
300
|
+
(Workflow A queries) and compile:
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
FRESHIE ECOSYSTEM REPORT — {date}
|
|
304
|
+
================================================================
|
|
305
|
+
|
|
306
|
+
Discovery: Run #{id} ({date})
|
|
307
|
+
Plugins: {n} | Skills: {n} | Packs: {n}
|
|
308
|
+
|
|
309
|
+
Compliance (enterprise tier):
|
|
310
|
+
A: {n} ({pct}%) | B: {n} ({pct}%) | C: {n} ({pct}%) | D: {n} ({pct}%)
|
|
311
|
+
|
|
312
|
+
Average score: {avg}/100
|
|
313
|
+
|
|
314
|
+
Since last run:
|
|
315
|
+
Plugins: {+/-delta} | Skills: {+/-delta}
|
|
316
|
+
Grade upgrades: {n} | Downgrades: {n}
|
|
317
|
+
|
|
318
|
+
Top Issues:
|
|
319
|
+
1. {issue}
|
|
320
|
+
2. {issue}
|
|
321
|
+
3. {issue}
|
|
322
|
+
|
|
323
|
+
Recommendations:
|
|
324
|
+
- {action}
|
|
325
|
+
- {action}
|
|
326
|
+
================================================================
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
### Step 3: Email PDF Report
|
|
332
|
+
|
|
333
|
+
After ANY workflow completes, use AskUserQuestion to offer the report:
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
WORKFLOW COMPLETE
|
|
337
|
+
================================================================
|
|
338
|
+
{Brief summary of what was done}
|
|
339
|
+
|
|
340
|
+
Would you like a PDF report emailed?
|
|
341
|
+
- Yes, email me — Generate PDF + send to jeremy@intentsolutions.io
|
|
342
|
+
- Yes, email someone — Specify recipient
|
|
343
|
+
- Save PDF only — Generate PDF, no email
|
|
344
|
+
- No thanks — Done
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
If the user wants a report:
|
|
348
|
+
|
|
349
|
+
1. **Generate markdown report** — write the workflow results to `/tmp/freshie-report-{date}.md`
|
|
350
|
+
2. **Convert to PDF** using the email skill's converter:
|
|
351
|
+
```bash
|
|
352
|
+
python3 ~/.claude/skills/email/scripts/md-to-pdf.py /tmp/freshie-report-{date}.md /tmp/freshie-report-{date}.pdf --style professional
|
|
353
|
+
```
|
|
354
|
+
3. **Send via /email skill** — invoke the Skill tool with `skill: "email"` and args describing:
|
|
355
|
+
- To: recipient (default: jeremy@intentsolutions.io)
|
|
356
|
+
- Subject: "Freshie Ecosystem Report — {date}"
|
|
357
|
+
- Body: brief summary
|
|
358
|
+
- Attachment: the generated PDF
|
|
359
|
+
|
|
360
|
+
## Output
|
|
361
|
+
|
|
362
|
+
All operations produce structured text output. Dashboards use fixed-width formatting.
|
|
363
|
+
Query results use table format. Deltas show +/- indicators. CSV exports write to
|
|
364
|
+
`freshie/exports/`. PDF reports write to `/tmp/` and optionally email.
|
|
365
|
+
|
|
366
|
+
## Error Handling
|
|
367
|
+
|
|
368
|
+
| Error | Cause | Solution |
|
|
369
|
+
|-------|-------|----------|
|
|
370
|
+
| "DB not found" | Missing `freshie/inventory.sqlite` | Run `python3 freshie/scripts/rebuild-inventory.py` to create |
|
|
371
|
+
| "no such table" | DB schema outdated or empty | Run a fresh discovery scan (Workflow B) |
|
|
372
|
+
| Empty grades | Compliance not yet populated | Run compliance validation (Workflow C) |
|
|
373
|
+
| `rebuild-inventory.py` fails | Missing `pyyaml` | `pip install pyyaml` |
|
|
374
|
+
| Stale data (>7 days) | No recent scans | Run discovery scan, then compliance |
|
|
375
|
+
| PDF generation fails | Missing `weasyprint` | `pip install weasyprint` |
|
|
376
|
+
| Email send fails | Missing env vars | Check `~/.env` for GMAIL_APP_PASSWORD |
|
|
377
|
+
|
|
378
|
+
## Examples
|
|
379
|
+
|
|
380
|
+
See [examples.md](references/examples.md) for detailed input/output examples covering all workflows:
|
|
381
|
+
- Quick status check (direct intent, skips menu)
|
|
382
|
+
- Full audit with email PDF report (parallel subagents)
|
|
383
|
+
- Ad-hoc query with CSV export follow-up
|
|
384
|
+
- Remediation cycle (dry-run, confirm, re-validate)
|
|
385
|
+
- Compare discovery runs (delta analysis)
|
|
386
|
+
- Pack coverage analysis
|
|
387
|
+
|
|
388
|
+
## Resources
|
|
389
|
+
|
|
390
|
+
- [Common Queries](references/common-queries.md) — pre-built SQLite query library: grades, stubs, plugins, packs, content quality, trends, anomalies, field analysis, cross-references
|
|
391
|
+
- `freshie/scripts/rebuild-inventory.py` — full repo scanner, versioned discovery runs
|
|
392
|
+
- `freshie/scripts/batch-remediate.py` — compliance fix engine (`--dry-run`, `--all --execute`)
|
|
393
|
+
- `scripts/validate-skills-schema.py` — universal validator (`--enterprise --populate-db`)
|
|
394
|
+
- `freshie/inventory.sqlite` — the database (50 tables, versioned by `run_id`)
|
|
395
|
+
- `~/.claude/skills/email/scripts/md-to-pdf.py` — markdown to PDF converter
|
|
396
|
+
- `/email` skill — email sending with attachments
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# Common Freshie Queries
|
|
2
|
+
|
|
3
|
+
Pre-built SQLite queries for the freshie inventory database. All queries filter to the latest
|
|
4
|
+
discovery run unless comparing across runs.
|
|
5
|
+
|
|
6
|
+
## Table of Contents
|
|
7
|
+
|
|
8
|
+
- [Grade & Compliance](#grade--compliance)
|
|
9
|
+
- [Stub Detection](#stub-detection)
|
|
10
|
+
- [Plugin Analysis](#plugin-analysis)
|
|
11
|
+
- [Pack Coverage](#pack-coverage)
|
|
12
|
+
- [Content Quality](#content-quality)
|
|
13
|
+
- [Historical Trends](#historical-trends)
|
|
14
|
+
- [Anomalies & Data Quality](#anomalies--data-quality)
|
|
15
|
+
- [Field Analysis](#field-analysis)
|
|
16
|
+
- [Cross-References](#cross-references)
|
|
17
|
+
|
|
18
|
+
## Grade & Compliance
|
|
19
|
+
|
|
20
|
+
### Grade Distribution (Latest Run)
|
|
21
|
+
|
|
22
|
+
```sql
|
|
23
|
+
SELECT grade, COUNT(*) as count,
|
|
24
|
+
ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM skill_compliance WHERE run_id=(SELECT MAX(id) FROM discovery_runs)), 1) as pct
|
|
25
|
+
FROM skill_compliance
|
|
26
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
27
|
+
GROUP BY grade ORDER BY grade;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Average Score by Category
|
|
31
|
+
|
|
32
|
+
```sql
|
|
33
|
+
SELECT p.category, ROUND(AVG(sc.score), 1) as avg_score, COUNT(*) as skill_count
|
|
34
|
+
FROM skill_compliance sc
|
|
35
|
+
JOIN skills s ON sc.skill_path = s.path AND sc.run_id = s.run_id
|
|
36
|
+
JOIN plugins p ON s.plugin_path = p.path AND s.run_id = p.run_id
|
|
37
|
+
WHERE sc.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
38
|
+
GROUP BY p.category
|
|
39
|
+
ORDER BY avg_score DESC;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Low-Grade Skills (D and F)
|
|
43
|
+
|
|
44
|
+
```sql
|
|
45
|
+
SELECT skill_path, score, grade, error_count, warning_count, missing_fields
|
|
46
|
+
FROM skill_compliance
|
|
47
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
48
|
+
AND grade IN ('D', 'F')
|
|
49
|
+
ORDER BY score ASC;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Skills Just Below A Grade (Upgrade Candidates)
|
|
53
|
+
|
|
54
|
+
```sql
|
|
55
|
+
SELECT skill_path, score, grade, missing_fields
|
|
56
|
+
FROM skill_compliance
|
|
57
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
58
|
+
AND score BETWEEN 80 AND 89
|
|
59
|
+
ORDER BY score DESC;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Skills with Most Errors
|
|
63
|
+
|
|
64
|
+
```sql
|
|
65
|
+
SELECT skill_path, error_count, warning_count, score, grade
|
|
66
|
+
FROM skill_compliance
|
|
67
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
68
|
+
AND error_count > 0
|
|
69
|
+
ORDER BY error_count DESC LIMIT 20;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Stub Detection
|
|
73
|
+
|
|
74
|
+
### All Stub Skills
|
|
75
|
+
|
|
76
|
+
```sql
|
|
77
|
+
SELECT skill_path, score, grade, stub_reasons
|
|
78
|
+
FROM skill_compliance
|
|
79
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
80
|
+
AND is_stub = 1
|
|
81
|
+
ORDER BY skill_path;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Stub Rate by Category
|
|
85
|
+
|
|
86
|
+
```sql
|
|
87
|
+
SELECT p.category,
|
|
88
|
+
COUNT(*) as total,
|
|
89
|
+
SUM(sc.is_stub) as stubs,
|
|
90
|
+
ROUND(SUM(sc.is_stub) * 100.0 / COUNT(*), 1) as stub_pct
|
|
91
|
+
FROM skill_compliance sc
|
|
92
|
+
JOIN skills s ON sc.skill_path = s.path AND sc.run_id = s.run_id
|
|
93
|
+
JOIN plugins p ON s.plugin_path = p.path AND s.run_id = p.run_id
|
|
94
|
+
WHERE sc.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
95
|
+
GROUP BY p.category
|
|
96
|
+
ORDER BY stub_pct DESC;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Non-Stub Skills Scoring Below 70
|
|
100
|
+
|
|
101
|
+
```sql
|
|
102
|
+
SELECT skill_path, score, grade, error_count
|
|
103
|
+
FROM skill_compliance
|
|
104
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
105
|
+
AND is_stub = 0 AND score < 70
|
|
106
|
+
ORDER BY score ASC;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Plugin Analysis
|
|
110
|
+
|
|
111
|
+
### Plugin Count by Category
|
|
112
|
+
|
|
113
|
+
```sql
|
|
114
|
+
SELECT category, COUNT(*) as count
|
|
115
|
+
FROM plugins
|
|
116
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
117
|
+
GROUP BY category
|
|
118
|
+
ORDER BY count DESC;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Plugins Missing Required Companions
|
|
122
|
+
|
|
123
|
+
```sql
|
|
124
|
+
SELECT p.name, p.category,
|
|
125
|
+
GROUP_CONCAT(pc.companion_type) as missing
|
|
126
|
+
FROM plugins p
|
|
127
|
+
LEFT JOIN plugin_companions pc ON p.path = pc.plugin_path AND p.run_id = pc.run_id
|
|
128
|
+
WHERE p.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
129
|
+
AND pc.exists = 0
|
|
130
|
+
GROUP BY p.name
|
|
131
|
+
ORDER BY p.category, p.name;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Plugin Compliance Roll-Up
|
|
135
|
+
|
|
136
|
+
```sql
|
|
137
|
+
SELECT p.name, p.category, pc.score, pc.grade
|
|
138
|
+
FROM plugin_compliance pc
|
|
139
|
+
JOIN plugins p ON pc.plugin_path = p.path AND pc.run_id = p.run_id
|
|
140
|
+
WHERE pc.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
141
|
+
ORDER BY pc.score ASC LIMIT 20;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Plugins with No Skills
|
|
145
|
+
|
|
146
|
+
```sql
|
|
147
|
+
SELECT p.name, p.category, p.path
|
|
148
|
+
FROM plugins p
|
|
149
|
+
LEFT JOIN skills s ON p.path = s.plugin_path AND p.run_id = s.run_id
|
|
150
|
+
WHERE p.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
151
|
+
AND s.name IS NULL
|
|
152
|
+
ORDER BY p.category, p.name;
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Pack Coverage
|
|
156
|
+
|
|
157
|
+
### Pack Skill Counts
|
|
158
|
+
|
|
159
|
+
```sql
|
|
160
|
+
SELECT name, skill_count, category
|
|
161
|
+
FROM packs
|
|
162
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
163
|
+
ORDER BY skill_count DESC;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Packs Below Minimum Viable (< 3 Skills)
|
|
167
|
+
|
|
168
|
+
```sql
|
|
169
|
+
SELECT name, skill_count
|
|
170
|
+
FROM packs
|
|
171
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
172
|
+
AND skill_count < 3
|
|
173
|
+
ORDER BY skill_count ASC;
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Pack Aggregate Metrics
|
|
177
|
+
|
|
178
|
+
```sql
|
|
179
|
+
SELECT pa.pack_name, pa.total_skills, pa.avg_score, pa.min_score, pa.max_score
|
|
180
|
+
FROM pack_aggregates pa
|
|
181
|
+
WHERE pa.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
182
|
+
ORDER BY pa.avg_score ASC;
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Content Quality
|
|
186
|
+
|
|
187
|
+
### Lowest Word Count Skills
|
|
188
|
+
|
|
189
|
+
```sql
|
|
190
|
+
SELECT cs.skill_path, cs.word_count, sc.grade, sc.is_stub
|
|
191
|
+
FROM content_signals cs
|
|
192
|
+
JOIN skill_compliance sc ON cs.skill_path = sc.skill_path AND cs.run_id = sc.run_id
|
|
193
|
+
WHERE cs.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
194
|
+
ORDER BY cs.word_count ASC LIMIT 20;
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### High Placeholder Density (Likely Templated)
|
|
198
|
+
|
|
199
|
+
```sql
|
|
200
|
+
SELECT cs.skill_path, cs.placeholder_density, cs.word_count, sc.grade
|
|
201
|
+
FROM content_signals cs
|
|
202
|
+
JOIN skill_compliance sc ON cs.skill_path = sc.skill_path AND cs.run_id = sc.run_id
|
|
203
|
+
WHERE cs.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
204
|
+
AND cs.placeholder_density > 0.1
|
|
205
|
+
ORDER BY cs.placeholder_density DESC LIMIT 20;
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Skills with Most Code Blocks
|
|
209
|
+
|
|
210
|
+
```sql
|
|
211
|
+
SELECT cs.skill_path, cs.code_block_count, cs.word_count, sc.grade
|
|
212
|
+
FROM content_signals cs
|
|
213
|
+
JOIN skill_compliance sc ON cs.skill_path = sc.skill_path AND cs.run_id = sc.run_id
|
|
214
|
+
WHERE cs.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
215
|
+
ORDER BY cs.code_block_count DESC LIMIT 20;
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Historical Trends
|
|
219
|
+
|
|
220
|
+
### All Discovery Runs
|
|
221
|
+
|
|
222
|
+
```sql
|
|
223
|
+
SELECT id, run_date, commit_hash, total_plugins, total_skills, total_packs, total_files
|
|
224
|
+
FROM discovery_runs ORDER BY id;
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Grade Trend Across Runs
|
|
228
|
+
|
|
229
|
+
```sql
|
|
230
|
+
SELECT sc.run_id, sc.grade, COUNT(*) as count
|
|
231
|
+
FROM skill_compliance sc
|
|
232
|
+
GROUP BY sc.run_id, sc.grade
|
|
233
|
+
ORDER BY sc.run_id, sc.grade;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Skills That Changed Grade Between Runs
|
|
237
|
+
|
|
238
|
+
```sql
|
|
239
|
+
SELECT old.skill_path,
|
|
240
|
+
old.grade as old_grade, old.score as old_score,
|
|
241
|
+
new.grade as new_grade, new.score as new_score,
|
|
242
|
+
new.score - old.score as delta
|
|
243
|
+
FROM skill_compliance old
|
|
244
|
+
JOIN skill_compliance new ON old.skill_path = new.skill_path
|
|
245
|
+
WHERE old.run_id = (SELECT MAX(id) - 1 FROM discovery_runs)
|
|
246
|
+
AND new.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
247
|
+
AND old.grade != new.grade
|
|
248
|
+
ORDER BY delta DESC;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### New Skills Since Previous Run
|
|
252
|
+
|
|
253
|
+
```sql
|
|
254
|
+
SELECT new.skill_path, new.grade, new.score
|
|
255
|
+
FROM skill_compliance new
|
|
256
|
+
LEFT JOIN skill_compliance old ON new.skill_path = old.skill_path
|
|
257
|
+
AND old.run_id = (SELECT MAX(id) - 1 FROM discovery_runs)
|
|
258
|
+
WHERE new.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
259
|
+
AND old.skill_path IS NULL
|
|
260
|
+
ORDER BY new.score DESC;
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Removed Skills Since Previous Run
|
|
264
|
+
|
|
265
|
+
```sql
|
|
266
|
+
SELECT old.skill_path, old.grade, old.score
|
|
267
|
+
FROM skill_compliance old
|
|
268
|
+
LEFT JOIN skill_compliance new ON old.skill_path = new.skill_path
|
|
269
|
+
AND new.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
270
|
+
WHERE old.run_id = (SELECT MAX(id) - 1 FROM discovery_runs)
|
|
271
|
+
AND new.skill_path IS NULL
|
|
272
|
+
ORDER BY old.skill_path;
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Anomalies & Data Quality
|
|
276
|
+
|
|
277
|
+
### All Anomalies (Latest Run)
|
|
278
|
+
|
|
279
|
+
```sql
|
|
280
|
+
SELECT * FROM anomalies
|
|
281
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
282
|
+
ORDER BY rowid;
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Duplicate File Detection
|
|
286
|
+
|
|
287
|
+
```sql
|
|
288
|
+
SELECT filename, COUNT(*) as occurrences
|
|
289
|
+
FROM duplicate_files
|
|
290
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
291
|
+
GROUP BY filename
|
|
292
|
+
HAVING COUNT(*) > 1
|
|
293
|
+
ORDER BY occurrences DESC LIMIT 20;
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Skills with References Directory
|
|
297
|
+
|
|
298
|
+
```sql
|
|
299
|
+
SELECT skill_path, has_references_dir, has_scripts_dir, has_examples
|
|
300
|
+
FROM skill_compliance
|
|
301
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
302
|
+
AND has_references_dir = 1
|
|
303
|
+
ORDER BY skill_path;
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Field Analysis
|
|
307
|
+
|
|
308
|
+
### Most Common Frontmatter Fields
|
|
309
|
+
|
|
310
|
+
```sql
|
|
311
|
+
SELECT field_name, COUNT(*) as usage_count
|
|
312
|
+
FROM frontmatter_fields
|
|
313
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
314
|
+
GROUP BY field_name
|
|
315
|
+
ORDER BY usage_count DESC;
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Agent Compliance Issues
|
|
319
|
+
|
|
320
|
+
```sql
|
|
321
|
+
SELECT ac.agent_path, ac.invalid_fields, ac.missing_fields
|
|
322
|
+
FROM agent_compliance ac
|
|
323
|
+
WHERE ac.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
324
|
+
AND (ac.invalid_fields IS NOT NULL OR ac.missing_fields IS NOT NULL)
|
|
325
|
+
ORDER BY ac.agent_path;
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Cross-References
|
|
329
|
+
|
|
330
|
+
### Skill-to-Plugin Mapping
|
|
331
|
+
|
|
332
|
+
```sql
|
|
333
|
+
SELECT s.name as skill, p.name as plugin, p.category, sc.grade
|
|
334
|
+
FROM skills s
|
|
335
|
+
JOIN plugins p ON s.plugin_path = p.path AND s.run_id = p.run_id
|
|
336
|
+
JOIN skill_compliance sc ON sc.skill_path = s.path AND sc.run_id = s.run_id
|
|
337
|
+
WHERE s.run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
338
|
+
ORDER BY p.category, p.name, s.name;
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Validators Used
|
|
342
|
+
|
|
343
|
+
```sql
|
|
344
|
+
SELECT validator_name, COUNT(*) as checks_run
|
|
345
|
+
FROM validator_checks
|
|
346
|
+
WHERE run_id = (SELECT MAX(id) FROM discovery_runs)
|
|
347
|
+
GROUP BY validator_name
|
|
348
|
+
ORDER BY checks_run DESC;
|
|
349
|
+
```
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Freshie Inventory Manager — Usage Examples
|
|
2
|
+
|
|
3
|
+
Detailed input/output examples for each workflow.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Quick Status Check](#quick-status-check)
|
|
8
|
+
- [Full Audit with Email Report](#full-audit-with-email-report)
|
|
9
|
+
- [Ad-Hoc Query with Follow-Up](#ad-hoc-query-with-follow-up)
|
|
10
|
+
- [Remediation Cycle](#remediation-cycle)
|
|
11
|
+
- [Compare Discovery Runs](#compare-discovery-runs)
|
|
12
|
+
- [Pack Coverage Analysis](#pack-coverage-analysis)
|
|
13
|
+
|
|
14
|
+
## Quick Status Check
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
User: freshie status
|
|
18
|
+
Assistant: [Skips menu — clear intent detected]
|
|
19
|
+
[Runs dashboard queries]
|
|
20
|
+
|
|
21
|
+
FRESHIE INVENTORY DASHBOARD
|
|
22
|
+
============================
|
|
23
|
+
Last Scan: Run #4 — 2026-03-23 (14 days ago)
|
|
24
|
+
Plugins: 408
|
|
25
|
+
Skills: 3123
|
|
26
|
+
Packs: 63
|
|
27
|
+
|
|
28
|
+
Grade Distribution:
|
|
29
|
+
A: 1180 B: 2074 C: 13 D: 9
|
|
30
|
+
|
|
31
|
+
Staleness: CRITICAL (14 days)
|
|
32
|
+
Recommend running a new discovery scan.
|
|
33
|
+
|
|
34
|
+
WORKFLOW COMPLETE — Would you like a PDF report emailed?
|
|
35
|
+
- Yes, email me
|
|
36
|
+
- No thanks
|
|
37
|
+
|
|
38
|
+
User: no thanks
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Full Audit with Email Report
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
User: run a full ecosystem audit
|
|
45
|
+
Assistant: [Shows menu — user selected "Full Audit"]
|
|
46
|
+
Starting full audit pipeline...
|
|
47
|
+
|
|
48
|
+
[Launches 3 parallel subagents:]
|
|
49
|
+
- discovery-scanner: Running rebuild-inventory.py...
|
|
50
|
+
- compliance-validator: Running enterprise validation...
|
|
51
|
+
- anomaly-detector: Checking data quality...
|
|
52
|
+
|
|
53
|
+
[All subagents complete]
|
|
54
|
+
|
|
55
|
+
FRESHIE ECOSYSTEM REPORT — 2026-04-06
|
|
56
|
+
================================================================
|
|
57
|
+
Discovery: Run #5 (2026-04-06)
|
|
58
|
+
Plugins: 416 (+8) | Skills: 3200 (+77) | Packs: 63
|
|
59
|
+
|
|
60
|
+
Compliance:
|
|
61
|
+
A: 1250 (39.1%) | B: 2050 (64.1%) | C: 10 (0.3%) | D: 5 (0.2%)
|
|
62
|
+
Average: 87/100
|
|
63
|
+
|
|
64
|
+
Anomalies: 3 found
|
|
65
|
+
- 5 skills with word count < 50
|
|
66
|
+
- 2 plugins with no skills
|
|
67
|
+
- 1 pack below minimum viable
|
|
68
|
+
|
|
69
|
+
WORKFLOW COMPLETE — Would you like a PDF report emailed?
|
|
70
|
+
- Yes, email me
|
|
71
|
+
- Yes, email someone
|
|
72
|
+
- Save PDF only
|
|
73
|
+
- No thanks
|
|
74
|
+
|
|
75
|
+
User: yes email me
|
|
76
|
+
Assistant: [Writes /tmp/freshie-report-2026-04-06.md]
|
|
77
|
+
[Converts to PDF via md-to-pdf.py]
|
|
78
|
+
[Invokes /email skill to send]
|
|
79
|
+
Sent "Freshie Ecosystem Report — 2026-04-06" to jeremy@intentsolutions.io
|
|
80
|
+
with freshie-report-2026-04-06.pdf attached.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Ad-Hoc Query with Follow-Up
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
User: show me all D and F grade skills
|
|
87
|
+
Assistant: [Routes to Workflow E: Query]
|
|
88
|
+
[Loads common-queries.md, runs Low-Grade Skills query]
|
|
89
|
+
|
|
90
|
+
| skill_path | score | grade | errors | warnings |
|
|
91
|
+
|------------|-------|-------|--------|----------|
|
|
92
|
+
| plugins/database/data-validation-engine/... | 62 | D | 3 | 5 |
|
|
93
|
+
| plugins/devops/ci-pipeline-builder/... | 58 | F | 5 | 7 |
|
|
94
|
+
| ... | | | | |
|
|
95
|
+
|
|
96
|
+
5 skills found with grade D or F.
|
|
97
|
+
|
|
98
|
+
What next?
|
|
99
|
+
- Refine query
|
|
100
|
+
- Export to CSV
|
|
101
|
+
- Back to menu
|
|
102
|
+
|
|
103
|
+
User: export to csv
|
|
104
|
+
Assistant: [Writes freshie/exports/low-grade-skills.csv]
|
|
105
|
+
Exported 5 rows to freshie/exports/low-grade-skills.csv
|
|
106
|
+
|
|
107
|
+
WORKFLOW COMPLETE — Would you like a PDF report emailed?
|
|
108
|
+
- Yes, email me
|
|
109
|
+
- No thanks
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Remediation Cycle
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
User: remediate skills
|
|
116
|
+
Assistant: [Routes to Workflow D: Remediation]
|
|
117
|
+
Running dry-run first...
|
|
118
|
+
|
|
119
|
+
[Runs batch-remediate.py --dry-run]
|
|
120
|
+
|
|
121
|
+
REMEDIATION PREVIEW
|
|
122
|
+
================================================================
|
|
123
|
+
12 skills: Add missing 'compatible-with' field
|
|
124
|
+
8 skills: Fix tag formatting
|
|
125
|
+
3 agents: Add missing 'description' field
|
|
126
|
+
23 total changes
|
|
127
|
+
|
|
128
|
+
Proceed?
|
|
129
|
+
- Execute
|
|
130
|
+
- Cancel
|
|
131
|
+
|
|
132
|
+
User: Execute
|
|
133
|
+
Assistant: [Runs batch-remediate.py --all --execute]
|
|
134
|
+
23 fixes applied.
|
|
135
|
+
|
|
136
|
+
Running compliance re-check...
|
|
137
|
+
[Launches compliance-validator subagent]
|
|
138
|
+
|
|
139
|
+
Grade improvements:
|
|
140
|
+
C -> B: 5 skills
|
|
141
|
+
D -> C: 2 skills
|
|
142
|
+
Average score: 87.3 -> 88.1 (+0.8)
|
|
143
|
+
|
|
144
|
+
WORKFLOW COMPLETE — Would you like a PDF report emailed?
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Compare Discovery Runs
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
User: compare the last two runs
|
|
151
|
+
Assistant: [Routes to Workflow F: Compare Runs]
|
|
152
|
+
|
|
153
|
+
Available runs:
|
|
154
|
+
Run #1 — 2026-03-21 | 349 plugins | 1426 skills
|
|
155
|
+
Run #2 — 2026-03-22 | 343 plugins | 1463 skills
|
|
156
|
+
Run #3 — 2026-03-22 | (incomplete)
|
|
157
|
+
Run #4 — 2026-03-23 | 408 plugins | 3123 skills
|
|
158
|
+
|
|
159
|
+
Comparing Run #2 -> Run #4:
|
|
160
|
+
|
|
161
|
+
Plugins: 343 -> 408 (+65)
|
|
162
|
+
Skills: 1463 -> 3123 (+1660)
|
|
163
|
+
|
|
164
|
+
Grade changes:
|
|
165
|
+
A: 520 -> 1180 (+660)
|
|
166
|
+
B: 930 -> 2074 (+1144)
|
|
167
|
+
Upgrades: 45 | Downgrades: 3
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Pack Coverage Analysis
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
User: which packs need more skills?
|
|
174
|
+
Assistant: [Routes to Workflow I: Pack Coverage]
|
|
175
|
+
|
|
176
|
+
Packs below minimum viable (< 3 skills):
|
|
177
|
+
| Pack | Skills | Category |
|
|
178
|
+
|------|--------|----------|
|
|
179
|
+
| acme-pack | 1 | saas-packs |
|
|
180
|
+
| demo-pack | 2 | saas-packs |
|
|
181
|
+
|
|
182
|
+
2 packs need attention.
|
|
183
|
+
```
|