@valentia-ai-skills/framework 2.0.6 → 2.0.8

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
@@ -58,10 +58,26 @@ npx ai-skills status # Show installed entities, team info, detected tool
58
58
  npx ai-skills list # List locally bundled skills
59
59
  npx ai-skills analyze # Analyze staged/last commit against active skills
60
60
  npx ai-skills analyze --last # Analyze the most recent commit
61
+ npx ai-skills upload-code-audit --path ./CodeMatters/ # Upload a CodeMatters audit package
62
+ npx ai-skills audit-status --project "My Project" # Show latest audit summary for a project
61
63
  npx ai-skills doctor # Health check (config, API, tools, entity counts)
62
64
  npx ai-skills help # Show help
63
65
  ```
64
66
 
67
+ #### Code Quality Audits
68
+
69
+ ```bash
70
+ # Upload a CodeMatters audit package to the Skills Console
71
+ npx ai-skills upload-code-audit --path ./CodeMatters/
72
+ npx ai-skills upload-code-audit --path ./CodeMatters/ --dry-run # validate only
73
+ npx ai-skills upload-code-audit --path ./CodeMatters/ --token <token>
74
+
75
+ # Show the latest audit summary for a project in the terminal
76
+ npx ai-skills audit-status --project "Clinical Sanctuary"
77
+ ```
78
+
79
+ The `--path` directory for `upload-code-audit` must contain a `manifest.json` file and the generated markdown reports from the `code-quality-auditor` skill. See the [Code Quality Audits](#code-quality-audits) section below for the expected format.
80
+
65
81
  #### Legacy Codebase Intelligence Scanner
66
82
 
67
83
  ```bash
@@ -70,9 +86,9 @@ npx ai-skills upload-legacy-scan --path ./my-project-intelligence/
70
86
  npx ai-skills upload-legacy-scan --path ./my-project-intelligence/ --dry-run # validate only
71
87
  npx ai-skills upload-legacy-scan --path ./my-project-intelligence/ --token <token>
72
88
 
73
- # Download a project's skills from the console install into your local AI tools
89
+ # Download a project recreates exact intelligence folder structure (modules/, diagrams/, reports)
74
90
  npx ai-skills legacy-projects add "My Project"
75
- npx ai-skills legacy-projects add "My Project" --path ./output-dir/ # also save raw files locally
91
+ npx ai-skills legacy-projects add "My Project" --path ~/projects/ # save to a specific directory
76
92
 
77
93
  # List all legacy projects for your team
78
94
  npx ai-skills legacy-projects list
@@ -93,6 +109,8 @@ The `--path` directory for `upload-legacy-scan` must contain a `manifest.json` f
93
109
  | `AI_SKILLS_API_URL` | Override the Supabase Edge Function URL |
94
110
  | `AI_SKILLS_ANALYZE_URL` | Override the analyze commit function URL |
95
111
  | `AI_SKILLS_SCAN_URL` | Override the scan results function URL |
112
+ | `AI_SKILLS_UPLOAD_CODE_AUDIT_URL` | Override the upload-code-audit Edge Function URL |
113
+ | `AI_SKILLS_MANAGE_CODE_AUDITS_URL` | Override the manage-code-audits Edge Function URL |
96
114
  | `AI_SKILLS_UPLOAD_LEGACY_URL` | Override the upload-legacy-scan Edge Function URL |
97
115
  | `AI_SKILLS_MANAGE_LEGACY_URL` | Override the manage-legacy-projects Edge Function URL |
98
116
 
@@ -279,6 +297,121 @@ A post-commit git hook is automatically installed during setup to run analysis a
279
297
 
280
298
  ---
281
299
 
300
+ ## Code Quality Audits
301
+
302
+ The framework supports ingesting audit packages generated by the `code-quality-auditor` skill. Once uploaded, the audit becomes reviewable in the **Skills Console** under the **Code Audits** section, with score history preserved per project.
303
+
304
+ ### How It Works
305
+
306
+ 1. **Audit** — Run the `code-quality-auditor` skill against a codebase and generate a `CodeMatters/` folder
307
+ 2. **Upload** — `npx ai-skills upload-code-audit --path <folder>` sends the package to the Skills Console and creates a new historical audit entry
308
+ 3. **Review** — Tech leads review the latest audit in the **Code Audits** section, update review status, and compare it against previous runs
309
+ 4. **Track** — The console keeps score trends, finding counts, report tabs, diagrams, and remediation guidance per project
310
+ 5. **Check** — Developers can run `npx ai-skills audit-status --project <name>` to see the latest audit summary in the terminal
311
+
312
+ ### CodeMatters Package Format
313
+
314
+ The folder passed to `--path` should follow this layout:
315
+
316
+ ```text
317
+ CodeMatters/
318
+ ├── manifest.json
319
+ ├── CODE_AUDIT_OVERVIEW.md
320
+ ├── SECURITY_AUDIT.md
321
+ ├── ERROR_HANDLING.md
322
+ ├── CORRECTNESS.md
323
+ ├── CRASH_RISK.md
324
+ ├── CODE_QUALITY.md
325
+ ├── STANDARDS.md
326
+ ├── PERFORMANCE.md
327
+ ├── MAINTAINABILITY.md
328
+ ├── DEPENDENCY_HEALTH.md
329
+ ├── ACCESSIBILITY.md
330
+ ├── TEST_COVERAGE.md
331
+ ├── ARCHITECTURE.md
332
+ ├── FRAMEWORK_REVIEW.md
333
+ ├── REMEDIATION_PLAN.md
334
+ └── *.mmd / *.mermaid # optional diagrams
335
+ ```
336
+
337
+ **Canonical `manifest.json` shape:**
338
+
339
+ ```json
340
+ {
341
+ "project_name": "Clinical Sanctuary",
342
+ "audited_at": "2026-04-02T12:00:00.000Z",
343
+ "overall_score": 48,
344
+ "overall_grade": "D",
345
+ "tech_stack": {
346
+ "language": "TypeScript",
347
+ "framework": "React",
348
+ "runtime_version": "Node 20"
349
+ },
350
+ "is_healthcare": true,
351
+ "findings": {
352
+ "critical": 5,
353
+ "high": 5,
354
+ "medium": 5,
355
+ "low": 18,
356
+ "total": 33
357
+ },
358
+ "scores": {
359
+ "security": { "score": 42, "grade": "F", "finding_count": { "critical": 5, "high": 5, "medium": 5, "low": 18 } },
360
+ "error_handling": { "score": 55, "grade": "D", "finding_count": { "critical": 0, "high": 1, "medium": 4, "low": 3 } },
361
+ "correctness": { "score": 65, "grade": "C", "finding_count": { "critical": 0, "high": 1, "medium": 3, "low": 2 } },
362
+ "crash_risk": { "score": 50, "grade": "D", "finding_count": { "critical": 0, "high": 2, "medium": 2, "low": 1 } },
363
+ "code_quality": { "score": 72, "grade": "C", "finding_count": { "critical": 0, "high": 0, "medium": 2, "low": 6 } },
364
+ "standards": { "score": 60, "grade": "C", "finding_count": { "critical": 0, "high": 0, "medium": 2, "low": 4 } },
365
+ "performance": { "score": 65, "grade": "C", "finding_count": { "critical": 0, "high": 0, "medium": 2, "low": 3 } },
366
+ "maintainability": { "score": 68, "grade": "C", "finding_count": { "critical": 0, "high": 0, "medium": 1, "low": 5 } },
367
+ "dependency_health": { "score": 35, "grade": "F", "finding_count": { "critical": 0, "high": 3, "medium": 1, "low": 2 } },
368
+ "accessibility": { "score": 55, "grade": "D", "finding_count": { "critical": 0, "high": 0, "medium": 3, "low": 4 } },
369
+ "test_coverage": { "score": 0, "grade": "F", "finding_count": { "critical": 0, "high": 0, "medium": 0, "low": 6 } },
370
+ "architecture": { "score": 72, "grade": "C", "finding_count": { "critical": 0, "high": 0, "medium": 1, "low": 2 } }
371
+ }
372
+ }
373
+ ```
374
+
375
+ The uploader is slightly defensive around aliases such as `project`, `name`, `overallScore`, `overallGrade`, `auditedAt`, `category_scores`, and `categories`, but the shape above is the supported v1 contract.
376
+
377
+ ### Skills Console — Code Audits View
378
+
379
+ After upload, each project appears in the **Code Audits** section with:
380
+
381
+ | View | Contents |
382
+ |------|----------|
383
+ | **List** | Latest audit per project, score bars, severity totals, status, delta vs previous |
384
+ | **Detail** | Score breakdown, comparison panel, audit history chart, review status, reviewer notes |
385
+ | **Report Tabs** | Overview, category reports, remediation plan, diagrams |
386
+ | **All Files** | Full file list with filtering and inline preview |
387
+
388
+ ### CLI Commands
389
+
390
+ ```bash
391
+ # Upload a new audit run (history is preserved)
392
+ npx ai-skills upload-code-audit --path ./CodeMatters/
393
+
394
+ # Validate the payload without uploading
395
+ npx ai-skills upload-code-audit --path ./CodeMatters/ --dry-run
396
+
397
+ # Show the latest audit summary for a project
398
+ npx ai-skills audit-status --project "Clinical Sanctuary"
399
+ ```
400
+
401
+ ### Deployment Requirements
402
+
403
+ To enable Code Audits in a deployed environment, you need to ship the backend pieces and the updated console:
404
+
405
+ 1. Run the new Supabase migration: `skills-console/supabase/migrations/015_code_audits.sql`
406
+ 2. Deploy the new Edge Functions:
407
+ `supabase functions deploy upload-code-audit`
408
+ `supabase functions deploy manage-code-audits`
409
+ 3. Redeploy the Skills Console frontend so `/code-audits` and `/code-audits/:id` are available
410
+
411
+ The `upload-code-audit` function will attempt to create and use the `code-audits` Storage bucket automatically as a best-effort backup mirror. Postgres remains the source of truth even if the storage mirror is unavailable.
412
+
413
+ ---
414
+
282
415
  ## Legacy Codebase Intelligence Scanner
283
416
 
284
417
  The framework supports ingesting intelligence packages generated by legacy codebase scanners. Once uploaded, the extracted skills, architecture diagrams, and reports become reviewable in the **Skills Console** under the **Legacy Scanners** section.
@@ -288,8 +421,8 @@ The framework supports ingesting intelligence packages generated by legacy codeb
288
421
  1. **Scan** — A compatible scanner tool analyses an existing codebase and produces an intelligence folder
289
422
  2. **Upload** — `npx ai-skills upload-legacy-scan --path <folder>` ships the intelligence package to your team's Skills Console, creating or refreshing the project
290
423
  3. **Review** — Tech leads review auto-generated skills, reports, and diagrams in the Skills Console, approving or flagging each document
291
- 4. **Install** — Developers run `npx ai-skills legacy-projects add <project-name>` to download approved skills from the console and have them installed into their local AI tools automatically
292
- 5. **Code** — AI tools (Claude Code, Cursor, Copilot, Windsurf) now have full context about the legacy project's patterns
424
+ 4. **Download** — Developers run `npx ai-skills legacy-projects add <project-name>` to reconstruct the full intelligence package folder locally identical structure to the original scan output (`modules/`, `diagrams/`, report `.md` files, `manifest.json`)
425
+ 5. **Code** — AI tools (Claude Code, Cursor, Copilot, Windsurf) can now read the local package using the project's legacy-reading skills
293
426
  6. **Rescan** — Re-running `upload-legacy-scan` on the same project name replaces all documents with the latest scan output
294
427
 
295
428
  ### Intelligence Package Format
@@ -310,24 +443,35 @@ my-project-intelligence/
310
443
  ├── api-registry.md
311
444
  ├── business-rules.md
312
445
  ├── risk-assessment.md
313
- └── reproduction-guide.md
446
+ ├── reproduction-guide.md
447
+ └── custom-audit-findings.md
314
448
  ```
315
449
 
316
450
  **`manifest.json` schema:**
317
451
 
318
452
  ```json
319
453
  {
320
- "project_name": "legacy-billing-service",
321
- "tech_stack": ["Node.js", "PostgreSQL", "React"],
454
+ "project": "legacy-billing-service",
455
+ "scanned_at": "2026-03-30T12:00:00.000Z",
456
+ "skills": [],
322
457
  "statistics": {
323
- "module_count": 24,
324
- "total_endpoints": 68,
325
- "total_business_rules": 142,
458
+ "total_modules": 24,
326
459
  "completeness_score": 78
460
+ },
461
+ "reports": [
462
+ { "document_type": "api_registry", "file": "reports/api-registry.md" },
463
+ { "document_type": "custom_audit_findings", "name": "Custom Audit Findings", "file": "reports/custom-audit-findings.md", "type": "report" }
464
+ ],
465
+ "tech_stack": {
466
+ "language": "Node.js",
467
+ "database": "PostgreSQL",
468
+ "frontend": "React"
327
469
  }
328
470
  }
329
471
  ```
330
472
 
473
+ Any extra markdown file in `reports/` is uploaded as a `report` document automatically, even if it is not one of the built-in report names. If you want explicit control, add it to `manifest.json -> reports`; custom entries must use `type: "report"`. Built-in `overview` and `reproduction_guide` remain guide documents.
474
+
331
475
  ### Skills Console — Legacy Scanners View
332
476
 
333
477
  After upload, each project appears in the **Legacy Scanners** section of the Skills Console with five tabs:
@@ -348,9 +492,9 @@ Approved skills are promoted into the team's standard toolkit and distributed on
348
492
  # Upload a scan package (add new project or replace existing)
349
493
  npx ai-skills upload-legacy-scan --path ./my-project-intelligence/
350
494
 
351
- # Download a project's skills and install them into your local AI tools
352
- npx ai-skills legacy-projects add "My Project"
353
- npx ai-skills legacy-projects add "My Project" --path ./output/ # also write raw files locally
495
+ # Download a project recreates the exact intelligence package folder structure locally
496
+ npx ai-skills legacy-projects add "Clinical Sanctuary"
497
+ npx ai-skills legacy-projects add "Clinical Sanctuary" --path ~/projects/ # save to specific dir
354
498
 
355
499
  # List all projects with status, module count, and completeness score
356
500
  npx ai-skills legacy-projects list