contextos-agents 1.5.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/.agents/AGENTS.md +421 -0
- package/.agents/adapters/aider/export.js +137 -0
- package/.agents/adapters/claude/export.js +55 -0
- package/.agents/adapters/copilot/export.js +107 -0
- package/.agents/adapters/cursor/export.js +210 -0
- package/.agents/adapters/gemini/export.js +115 -0
- package/.agents/adapters/shared.js +119 -0
- package/.agents/adapters/zed/export.js +111 -0
- package/.agents/core/profiles/backend.yaml +47 -0
- package/.agents/core/profiles/enterprise.yaml +46 -0
- package/.agents/core/profiles/frontend.yaml +46 -0
- package/.agents/core/profiles/hackathon.yaml +45 -0
- package/.agents/core/profiles/mvp.yaml +43 -0
- package/.agents/core/profiles/startup.yaml +48 -0
- package/.agents/core/skills/adapters/EXAMPLES.md +19 -0
- package/.agents/core/skills/adapters/SKILL.md +105 -0
- package/.agents/core/skills/adapters/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/adapters/VALIDATION.json +12 -0
- package/.agents/core/skills/adapters/skill.yaml +10 -0
- package/.agents/core/skills/architecture-diagrams/SKILL.md +108 -0
- package/.agents/core/skills/architecture-diagrams/VALIDATION.json +12 -0
- package/.agents/core/skills/architecture-diagrams/skill.yaml +8 -0
- package/.agents/core/skills/brutalist-design/SKILL.md +150 -0
- package/.agents/core/skills/brutalist-design/VALIDATION.json +12 -0
- package/.agents/core/skills/brutalist-design/skill.yaml +8 -0
- package/.agents/core/skills/context-manager/EXAMPLES.md +19 -0
- package/.agents/core/skills/context-manager/SKILL.md +126 -0
- package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/context-manager/VALIDATION.json +12 -0
- package/.agents/core/skills/context-manager/skill.yaml +10 -0
- package/.agents/core/skills/context-os/EXAMPLES.md +21 -0
- package/.agents/core/skills/context-os/SKILL.md +169 -0
- package/.agents/core/skills/context-os/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/context-os/VALIDATION.json +12 -0
- package/.agents/core/skills/context-os/packs.yaml +59 -0
- package/.agents/core/skills/context-os/references/context-rules.md +68 -0
- package/.agents/core/skills/context-os/references/pipeline.md +119 -0
- package/.agents/core/skills/context-os/references/project-graph.md +103 -0
- package/.agents/core/skills/context-os/rules.yaml +135 -0
- package/.agents/core/skills/context-os/skill.yaml +10 -0
- package/.agents/core/skills/database/EXAMPLES.md +74 -0
- package/.agents/core/skills/database/SKILL.md +101 -0
- package/.agents/core/skills/database/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/database/VALIDATION.json +11 -0
- package/.agents/core/skills/database/skill.yaml +25 -0
- package/.agents/core/skills/ddd/EXAMPLES.md +42 -0
- package/.agents/core/skills/ddd/SKILL.md +247 -0
- package/.agents/core/skills/ddd/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ddd/VALIDATION.json +12 -0
- package/.agents/core/skills/ddd/ddd.md +178 -0
- package/.agents/core/skills/ddd/skill.yaml +10 -0
- package/.agents/core/skills/decisions/EXAMPLES.md +35 -0
- package/.agents/core/skills/decisions/SKILL.md +90 -0
- package/.agents/core/skills/decisions/TROUBLESHOOTING.md +13 -0
- package/.agents/core/skills/decisions/VALIDATION.json +12 -0
- package/.agents/core/skills/decisions/skill.yaml +10 -0
- package/.agents/core/skills/docker/EXAMPLES.md +56 -0
- package/.agents/core/skills/docker/SKILL.md +63 -0
- package/.agents/core/skills/docker/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/docker/VALIDATION.json +11 -0
- package/.agents/core/skills/docker/skill.yaml +23 -0
- package/.agents/core/skills/engineering-workflow/EXAMPLES.md +57 -0
- package/.agents/core/skills/engineering-workflow/SKILL.md +343 -0
- package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/engineering-workflow/VALIDATION.json +12 -0
- package/.agents/core/skills/engineering-workflow/skill.yaml +13 -0
- package/.agents/core/skills/fastapi/EXAMPLES.md +36 -0
- package/.agents/core/skills/fastapi/SKILL.md +148 -0
- package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/fastapi/VALIDATION.json +12 -0
- package/.agents/core/skills/fastapi/fastapi.md +112 -0
- package/.agents/core/skills/fastapi/skill.yaml +10 -0
- package/.agents/core/skills/gemini-precision/SKILL.md +169 -0
- package/.agents/core/skills/gemini-precision/VALIDATION.json +12 -0
- package/.agents/core/skills/gemini-precision/skill.yaml +9 -0
- package/.agents/core/skills/generators/EXAMPLES.md +19 -0
- package/.agents/core/skills/generators/SKILL.md +112 -0
- package/.agents/core/skills/generators/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/generators/VALIDATION.json +12 -0
- package/.agents/core/skills/generators/skill.yaml +10 -0
- package/.agents/core/skills/generators/templates/API.md +77 -0
- package/.agents/core/skills/generators/templates/ARCHITECTURE.md +70 -0
- package/.agents/core/skills/generators/templates/DATABASE.md +42 -0
- package/.agents/core/skills/generators/templates/DECISION.md +46 -0
- package/.agents/core/skills/generators/templates/PRD.md +67 -0
- package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +56 -0
- package/.agents/core/skills/generators/templates/ROADMAP.md +51 -0
- package/.agents/core/skills/generators/templates/TASKS.md +43 -0
- package/.agents/core/skills/generators/templates/UI.md +73 -0
- package/.agents/core/skills/graphify/EXAMPLES.md +73 -0
- package/.agents/core/skills/graphify/SKILL.md +130 -0
- package/.agents/core/skills/graphify/VALIDATION.json +12 -0
- package/.agents/core/skills/graphify/skill.yaml +13 -0
- package/.agents/core/skills/gstack-roles/EXAMPLES.md +23 -0
- package/.agents/core/skills/gstack-roles/SKILL.md +152 -0
- package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
- package/.agents/core/skills/gstack-roles/VALIDATION.json +12 -0
- package/.agents/core/skills/gstack-roles/skill.yaml +12 -0
- package/.agents/core/skills/impeccable-design/EXAMPLES.md +26 -0
- package/.agents/core/skills/impeccable-design/SKILL.md +201 -0
- package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/impeccable-design/VALIDATION.json +12 -0
- package/.agents/core/skills/impeccable-design/skill.yaml +14 -0
- package/.agents/core/skills/interview-me/SKILL.md +97 -0
- package/.agents/core/skills/interview-me/VALIDATION.json +12 -0
- package/.agents/core/skills/interview-me/skill.yaml +8 -0
- package/.agents/core/skills/microservices/EXAMPLES.md +38 -0
- package/.agents/core/skills/microservices/SKILL.md +164 -0
- package/.agents/core/skills/microservices/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/microservices/VALIDATION.json +12 -0
- package/.agents/core/skills/microservices/microservices.md +119 -0
- package/.agents/core/skills/microservices/skill.yaml +10 -0
- package/.agents/core/skills/minimalist-design/SKILL.md +113 -0
- package/.agents/core/skills/minimalist-design/VALIDATION.json +12 -0
- package/.agents/core/skills/minimalist-design/skill.yaml +8 -0
- package/.agents/core/skills/nestjs/EXAMPLES.md +40 -0
- package/.agents/core/skills/nestjs/SKILL.md +139 -0
- package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/nestjs/VALIDATION.json +12 -0
- package/.agents/core/skills/nestjs/nestjs.md +103 -0
- package/.agents/core/skills/nestjs/skill.yaml +10 -0
- package/.agents/core/skills/nextjs/EXAMPLES.md +40 -0
- package/.agents/core/skills/nextjs/SKILL.md +163 -0
- package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/nextjs/VALIDATION.json +12 -0
- package/.agents/core/skills/nextjs/nextjs.md +67 -0
- package/.agents/core/skills/nextjs/skill.yaml +10 -0
- package/.agents/core/skills/node/EXAMPLES.md +80 -0
- package/.agents/core/skills/node/SKILL.md +128 -0
- package/.agents/core/skills/node/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/node/VALIDATION.json +12 -0
- package/.agents/core/skills/node/node.md +87 -0
- package/.agents/core/skills/node/skill.yaml +10 -0
- package/.agents/core/skills/performance/EXAMPLES.md +30 -0
- package/.agents/core/skills/performance/SKILL.md +75 -0
- package/.agents/core/skills/performance/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/performance/VALIDATION.json +12 -0
- package/.agents/core/skills/performance/performance.md +52 -0
- package/.agents/core/skills/performance/skill.yaml +10 -0
- package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +45 -0
- package/.agents/core/skills/ponytail-mindset/SKILL.md +193 -0
- package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ponytail-mindset/VALIDATION.json +12 -0
- package/.agents/core/skills/ponytail-mindset/skill.yaml +14 -0
- package/.agents/core/skills/react/EXAMPLES.md +79 -0
- package/.agents/core/skills/react/SKILL.md +132 -0
- package/.agents/core/skills/react/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/react/VALIDATION.json +12 -0
- package/.agents/core/skills/react/react.md +93 -0
- package/.agents/core/skills/react/skill.yaml +10 -0
- package/.agents/core/skills/react-best-practices/SKILL.md +155 -0
- package/.agents/core/skills/react-best-practices/VALIDATION.json +12 -0
- package/.agents/core/skills/react-best-practices/skill.yaml +10 -0
- package/.agents/core/skills/redesign-audit/SKILL.md +117 -0
- package/.agents/core/skills/redesign-audit/VALIDATION.json +12 -0
- package/.agents/core/skills/redesign-audit/skill.yaml +8 -0
- package/.agents/core/skills/security/EXAMPLES.md +64 -0
- package/.agents/core/skills/security/SKILL.md +158 -0
- package/.agents/core/skills/security/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/security/VALIDATION.json +12 -0
- package/.agents/core/skills/security/security.md +106 -0
- package/.agents/core/skills/security/skill.yaml +10 -0
- package/.agents/core/skills/soft-design/SKILL.md +108 -0
- package/.agents/core/skills/soft-design/VALIDATION.json +12 -0
- package/.agents/core/skills/soft-design/skill.yaml +8 -0
- package/.agents/core/skills/state-management/EXAMPLES.md +56 -0
- package/.agents/core/skills/state-management/SKILL.md +48 -0
- package/.agents/core/skills/state-management/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/state-management/VALIDATION.json +11 -0
- package/.agents/core/skills/state-management/skill.yaml +22 -0
- package/.agents/core/skills/subagent-orchestrator/SKILL.md +100 -0
- package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +12 -0
- package/.agents/core/skills/subagent-orchestrator/skill.yaml +8 -0
- package/.agents/core/skills/system-design/EXAMPLES.md +75 -0
- package/.agents/core/skills/system-design/SKILL.md +419 -0
- package/.agents/core/skills/system-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/system-design/VALIDATION.json +12 -0
- package/.agents/core/skills/system-design/skill.yaml +13 -0
- package/.agents/core/skills/system-design/system-design.md +112 -0
- package/.agents/core/skills/testing/EXAMPLES.md +71 -0
- package/.agents/core/skills/testing/SKILL.md +70 -0
- package/.agents/core/skills/testing/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/testing/VALIDATION.json +11 -0
- package/.agents/core/skills/testing/skill.yaml +26 -0
- package/.agents/core/skills/typescript/EXAMPLES.md +64 -0
- package/.agents/core/skills/typescript/SKILL.md +112 -0
- package/.agents/core/skills/typescript/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/typescript/VALIDATION.json +12 -0
- package/.agents/core/skills/typescript/skill.yaml +10 -0
- package/.agents/core/skills/typescript/typescript.md +71 -0
- package/.agents/core/skills/ui-design/EXAMPLES.md +21 -0
- package/.agents/core/skills/ui-design/SKILL.md +124 -0
- package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ui-design/VALIDATION.json +12 -0
- package/.agents/core/skills/ui-design/skill.yaml +10 -0
- package/.agents/core/skills/ui-design/ui.md +88 -0
- package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +62 -0
- package/.agents/core/skills/ui-ux-pro/SKILL.md +375 -0
- package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ui-ux-pro/VALIDATION.json +12 -0
- package/.agents/core/skills/ui-ux-pro/skill.yaml +13 -0
- package/.agents/core/skills/ux-design/EXAMPLES.md +36 -0
- package/.agents/core/skills/ux-design/SKILL.md +116 -0
- package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ux-design/VALIDATION.json +12 -0
- package/.agents/core/skills/ux-design/skill.yaml +10 -0
- package/.agents/core/skills/ux-design/ux.md +80 -0
- package/.agents/core/skills/vercel-optimize/SKILL.md +83 -0
- package/.agents/core/skills/vercel-optimize/VALIDATION.json +12 -0
- package/.agents/core/skills/vercel-optimize/skill.yaml +10 -0
- package/.agents/core/skills/web-accessibility/EXAMPLES.md +39 -0
- package/.agents/core/skills/web-accessibility/SKILL.md +170 -0
- package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/web-accessibility/VALIDATION.json +12 -0
- package/.agents/core/skills/web-accessibility/accessibility.md +63 -0
- package/.agents/core/skills/web-accessibility/skill.yaml +10 -0
- package/.agents/ctx.js +370 -0
- package/.agents/generated/claude/skills/adapters/SKILL.md +126 -0
- package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +101 -0
- package/.agents/generated/claude/skills/brutalist-design/SKILL.md +145 -0
- package/.agents/generated/claude/skills/context-manager/SKILL.md +147 -0
- package/.agents/generated/claude/skills/context-os/SKILL.md +191 -0
- package/.agents/generated/claude/skills/database/SKILL.md +191 -0
- package/.agents/generated/claude/skills/ddd/SKILL.md +305 -0
- package/.agents/generated/claude/skills/decisions/SKILL.md +134 -0
- package/.agents/generated/claude/skills/docker/SKILL.md +135 -0
- package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +414 -0
- package/.agents/generated/claude/skills/fastapi/SKILL.md +200 -0
- package/.agents/generated/claude/skills/gemini-precision/SKILL.md +161 -0
- package/.agents/generated/claude/skills/generators/SKILL.md +133 -0
- package/.agents/generated/claude/skills/graphify/SKILL.md +198 -0
- package/.agents/generated/claude/skills/gstack-roles/SKILL.md +184 -0
- package/.agents/generated/claude/skills/impeccable-design/SKILL.md +241 -0
- package/.agents/generated/claude/skills/interview-me/SKILL.md +90 -0
- package/.agents/generated/claude/skills/microservices/SKILL.md +218 -0
- package/.agents/generated/claude/skills/minimalist-design/SKILL.md +108 -0
- package/.agents/generated/claude/skills/nestjs/SKILL.md +195 -0
- package/.agents/generated/claude/skills/nextjs/SKILL.md +219 -0
- package/.agents/generated/claude/skills/node/SKILL.md +224 -0
- package/.agents/generated/claude/skills/performance/SKILL.md +121 -0
- package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +252 -0
- package/.agents/generated/claude/skills/react/SKILL.md +227 -0
- package/.agents/generated/claude/skills/react-best-practices/SKILL.md +146 -0
- package/.agents/generated/claude/skills/redesign-audit/SKILL.md +112 -0
- package/.agents/generated/claude/skills/security/SKILL.md +237 -0
- package/.agents/generated/claude/skills/soft-design/SKILL.md +103 -0
- package/.agents/generated/claude/skills/state-management/SKILL.md +120 -0
- package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +93 -0
- package/.agents/generated/claude/skills/system-design/SKILL.md +507 -0
- package/.agents/generated/claude/skills/testing/SKILL.md +157 -0
- package/.agents/generated/claude/skills/typescript/SKILL.md +192 -0
- package/.agents/generated/claude/skills/ui-design/SKILL.md +161 -0
- package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +451 -0
- package/.agents/generated/claude/skills/ux-design/SKILL.md +168 -0
- package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +76 -0
- package/.agents/generated/claude/skills/web-accessibility/SKILL.md +225 -0
- package/.agents/generated/gemini/skills/adapters/SKILL.md +135 -0
- package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +107 -0
- package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +151 -0
- package/.agents/generated/gemini/skills/context-manager/SKILL.md +156 -0
- package/.agents/generated/gemini/skills/context-os/SKILL.md +200 -0
- package/.agents/generated/gemini/skills/database/SKILL.md +200 -0
- package/.agents/generated/gemini/skills/ddd/SKILL.md +314 -0
- package/.agents/generated/gemini/skills/decisions/SKILL.md +143 -0
- package/.agents/generated/gemini/skills/docker/SKILL.md +144 -0
- package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +423 -0
- package/.agents/generated/gemini/skills/fastapi/SKILL.md +209 -0
- package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +167 -0
- package/.agents/generated/gemini/skills/generators/SKILL.md +142 -0
- package/.agents/generated/gemini/skills/graphify/SKILL.md +205 -0
- package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +193 -0
- package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +250 -0
- package/.agents/generated/gemini/skills/interview-me/SKILL.md +96 -0
- package/.agents/generated/gemini/skills/microservices/SKILL.md +227 -0
- package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +114 -0
- package/.agents/generated/gemini/skills/nestjs/SKILL.md +204 -0
- package/.agents/generated/gemini/skills/nextjs/SKILL.md +298 -0
- package/.agents/generated/gemini/skills/node/SKILL.md +323 -0
- package/.agents/generated/gemini/skills/performance/SKILL.md +185 -0
- package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +261 -0
- package/.agents/generated/gemini/skills/react/SKILL.md +332 -0
- package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +152 -0
- package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +118 -0
- package/.agents/generated/gemini/skills/security/SKILL.md +355 -0
- package/.agents/generated/gemini/skills/soft-design/SKILL.md +109 -0
- package/.agents/generated/gemini/skills/state-management/SKILL.md +129 -0
- package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +99 -0
- package/.agents/generated/gemini/skills/system-design/SKILL.md +631 -0
- package/.agents/generated/gemini/skills/testing/SKILL.md +166 -0
- package/.agents/generated/gemini/skills/typescript/SKILL.md +275 -0
- package/.agents/generated/gemini/skills/ui-design/SKILL.md +170 -0
- package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +460 -0
- package/.agents/generated/gemini/skills/ux-design/SKILL.md +177 -0
- package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +82 -0
- package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +300 -0
- package/.agents/mcp/runtime.py +454 -0
- package/.agents/mcp/server.mjs +189373 -0
- package/.agents/plugins.js +574 -0
- package/.agents/profiles.js +267 -0
- package/.agents/resolver.js +336 -0
- package/.agents/skills-index.json +200 -0
- package/.agents/skills.json +6 -0
- package/.agents/validate.js +500 -0
- package/LICENSE +21 -0
- package/README.md +415 -0
- package/benchmarks/gemini-issues.js +533 -0
- package/bin/index.js +458 -0
- package/package.json +70 -0
- package/registry.json +53 -0
- package/registry.schema.json +32 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .agents/validate.js
|
|
3
|
+
* ContextOS — Skill Validation & Sync Checker
|
|
4
|
+
*
|
|
5
|
+
* Checks:
|
|
6
|
+
* 1. Frontmatter — every SKILL.md with --- has name + description
|
|
7
|
+
* 2. Stale — generated files older than their source
|
|
8
|
+
* 3. Orphans — generated skills with no source counterpart
|
|
9
|
+
* 4. Missing — source skills never compiled
|
|
10
|
+
* 5. Dependencies — requires: / conflicts: point to real skill IDs
|
|
11
|
+
* 6. Conflicts — a skill does not conflict with itself
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const { collectAllSkillDirs } = require('./plugins.js');
|
|
19
|
+
|
|
20
|
+
// ── Paths ─────────────────────────────────────────────────────────────────────
|
|
21
|
+
const ROOT = process.cwd();
|
|
22
|
+
const AGENTS_DIR = path.join(ROOT, '.agents');
|
|
23
|
+
const CORE_SKILLS = path.join(AGENTS_DIR, 'core', 'skills');
|
|
24
|
+
const GENERATED = path.join(AGENTS_DIR, 'generated');
|
|
25
|
+
|
|
26
|
+
// Adapters that compile to generated/<name>/skills/
|
|
27
|
+
const COMPILED_ADAPTERS = ['gemini', 'claude'];
|
|
28
|
+
|
|
29
|
+
// ── Tiny ANSI helpers (no deps) ───────────────────────────────────────────────
|
|
30
|
+
const NO_COLOR = process.env.NO_COLOR || !process.stdout.isTTY;
|
|
31
|
+
const c = {
|
|
32
|
+
red: (s) => NO_COLOR ? s : `\x1b[31m${s}\x1b[0m`,
|
|
33
|
+
yellow: (s) => NO_COLOR ? s : `\x1b[33m${s}\x1b[0m`,
|
|
34
|
+
green: (s) => NO_COLOR ? s : `\x1b[32m${s}\x1b[0m`,
|
|
35
|
+
cyan: (s) => NO_COLOR ? s : `\x1b[36m${s}\x1b[0m`,
|
|
36
|
+
bold: (s) => NO_COLOR ? s : `\x1b[1m${s}\x1b[0m`,
|
|
37
|
+
dim: (s) => NO_COLOR ? s : `\x1b[2m${s}\x1b[0m`,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// ── Result accumulator ────────────────────────────────────────────────────────
|
|
41
|
+
const results = {
|
|
42
|
+
errors: [], // must-fix problems
|
|
43
|
+
warnings: [], // stale / missing optional metadata
|
|
44
|
+
info: [], // informational passes
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
function error(msg) { results.errors.push(msg); }
|
|
48
|
+
function warn(msg) { results.warnings.push(msg); }
|
|
49
|
+
function info(msg) { results.info.push(msg); }
|
|
50
|
+
|
|
51
|
+
// ── Minimal YAML field extractor (no deps) ────────────────────────────────────
|
|
52
|
+
/**
|
|
53
|
+
* Extracts top-level scalar YAML fields.
|
|
54
|
+
* Supports both `field: value` and `field: >` (block scalar) patterns.
|
|
55
|
+
* Returns null if field is absent.
|
|
56
|
+
*/
|
|
57
|
+
function yamlField(text, field) {
|
|
58
|
+
const re = new RegExp(`^${field}:\\s*(.+)$`, 'm');
|
|
59
|
+
const m = text.match(re);
|
|
60
|
+
return m ? m[1].trim() : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Extracts an inline YAML list: `field: [a, b, c]`
|
|
65
|
+
* Returns [] if absent or empty.
|
|
66
|
+
*/
|
|
67
|
+
function yamlList(text, field) {
|
|
68
|
+
const re = new RegExp(`^${field}:\\s*\\[([^\\]]*)]`, 'm');
|
|
69
|
+
const m = text.match(re);
|
|
70
|
+
if (!m || !m[1].trim()) return [];
|
|
71
|
+
return m[1].split(',').map(s => s.trim()).filter(Boolean);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Extracts a block YAML list:
|
|
76
|
+
* field:
|
|
77
|
+
* - item1
|
|
78
|
+
* - item2
|
|
79
|
+
*/
|
|
80
|
+
function yamlBlockList(text, field) {
|
|
81
|
+
const re = new RegExp(`^${field}:\\s*\\n((?:[ \\t]+-[^\\n]*\\n?)+)`, 'm');
|
|
82
|
+
const m = text.match(re);
|
|
83
|
+
if (!m) return [];
|
|
84
|
+
return m[1]
|
|
85
|
+
.split('\n')
|
|
86
|
+
.map(l => l.replace(/^[ \t]+-\s*/, '').trim())
|
|
87
|
+
.filter(Boolean);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ── Parse SKILL.md frontmatter ────────────────────────────────────────────────
|
|
91
|
+
function parseFrontmatter(content) {
|
|
92
|
+
if (!content.startsWith('---')) return null;
|
|
93
|
+
const end = content.indexOf('---', 3);
|
|
94
|
+
if (end === -1) return { raw: null, malformed: true };
|
|
95
|
+
return { raw: content.slice(3, end), malformed: false };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ── Parse skill.yaml ──────────────────────────────────────────────────────────
|
|
99
|
+
function parseSkillYaml(yamlText) {
|
|
100
|
+
return {
|
|
101
|
+
id: yamlField(yamlText, 'id') || yamlField(yamlText, 'name'),
|
|
102
|
+
name: yamlField(yamlText, 'name'),
|
|
103
|
+
description: yamlField(yamlText, 'description'),
|
|
104
|
+
version: yamlField(yamlText, 'version'),
|
|
105
|
+
requires: yamlList(yamlText, 'requires').concat(yamlBlockList(yamlText, 'requires')),
|
|
106
|
+
conflicts: yamlList(yamlText, 'conflicts').concat(yamlBlockList(yamlText, 'conflicts')),
|
|
107
|
+
optional: yamlList(yamlText, 'optional').concat(yamlBlockList(yamlText, 'optional')),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ── Collect all source skills ─────────────────────────────────────────────────
|
|
112
|
+
function collectSourceSkills() {
|
|
113
|
+
const skills = {};
|
|
114
|
+
if (!fs.existsSync(CORE_SKILLS)) return skills;
|
|
115
|
+
|
|
116
|
+
for (const dir of collectAllSkillDirs()) {
|
|
117
|
+
const name = path.basename(dir);
|
|
118
|
+
|
|
119
|
+
const skillMdPath = path.join(dir, 'SKILL.md');
|
|
120
|
+
const yamlPath = path.join(dir, 'skill.yaml');
|
|
121
|
+
|
|
122
|
+
skills[name] = {
|
|
123
|
+
name,
|
|
124
|
+
dir,
|
|
125
|
+
skillMdPath,
|
|
126
|
+
yamlPath,
|
|
127
|
+
hasSkillMd: fs.existsSync(skillMdPath),
|
|
128
|
+
hasYaml: fs.existsSync(yamlPath),
|
|
129
|
+
mtime: fs.existsSync(skillMdPath)
|
|
130
|
+
? fs.statSync(skillMdPath).mtimeMs
|
|
131
|
+
: (fs.existsSync(yamlPath) ? fs.statSync(yamlPath).mtimeMs : 0),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return skills;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ── Collect generated skills per adapter ─────────────────────────────────────
|
|
138
|
+
function collectGenerated(adapter) {
|
|
139
|
+
const base = path.join(GENERATED, adapter, 'skills');
|
|
140
|
+
if (!fs.existsSync(base)) return {};
|
|
141
|
+
const out = {};
|
|
142
|
+
for (const name of fs.readdirSync(base)) {
|
|
143
|
+
const dir = path.join(base, name);
|
|
144
|
+
if (!fs.statSync(dir).isDirectory()) continue;
|
|
145
|
+
const skillMd = path.join(dir, 'SKILL.md');
|
|
146
|
+
out[name] = {
|
|
147
|
+
mtime: fs.existsSync(skillMd) ? fs.statSync(skillMd).mtimeMs : 0,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
154
|
+
// CHECK 1 — SKILL.md Frontmatter Validation
|
|
155
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
156
|
+
function checkFrontmatter(sourceSkills) {
|
|
157
|
+
let pass = 0;
|
|
158
|
+
|
|
159
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
160
|
+
if (!skill.hasSkillMd) continue;
|
|
161
|
+
|
|
162
|
+
const content = fs.readFileSync(skill.skillMdPath, 'utf8');
|
|
163
|
+
const fm = parseFrontmatter(content);
|
|
164
|
+
|
|
165
|
+
if (!fm) {
|
|
166
|
+
// No frontmatter — only a warning if it also has no skill.yaml
|
|
167
|
+
if (!skill.hasYaml) {
|
|
168
|
+
warn(`[frontmatter] ${name}/SKILL.md — no frontmatter and no skill.yaml`);
|
|
169
|
+
}
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (fm.malformed) {
|
|
174
|
+
error(`[frontmatter] ${name}/SKILL.md — unclosed YAML frontmatter (missing closing ---)`);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!fm.raw.match(/^name:\s*.+/m)) {
|
|
179
|
+
error(`[frontmatter] ${name}/SKILL.md — frontmatter missing required 'name:' field`);
|
|
180
|
+
}
|
|
181
|
+
if (!fm.raw.match(/^description:/m)) {
|
|
182
|
+
error(`[frontmatter] ${name}/SKILL.md — frontmatter missing required 'description:' field`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
pass++;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
info(`[frontmatter] ${pass} SKILL.md files with valid frontmatter`);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
192
|
+
// CHECK 2 — skill.yaml Validation
|
|
193
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
194
|
+
function checkSkillYaml(sourceSkills) {
|
|
195
|
+
let pass = 0;
|
|
196
|
+
|
|
197
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
198
|
+
if (!skill.hasYaml) continue;
|
|
199
|
+
|
|
200
|
+
const text = fs.readFileSync(skill.yamlPath, 'utf8');
|
|
201
|
+
const parsed = parseSkillYaml(text);
|
|
202
|
+
|
|
203
|
+
if (!parsed.name) {
|
|
204
|
+
error(`[yaml] ${name}/skill.yaml — missing 'name:' field`);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (false && !parsed.description) {
|
|
208
|
+
// Some skills use block scalars — allow it, just warn
|
|
209
|
+
warn(`[yaml] ${name}/skill.yaml — 'description:' not found or uses multiline block (check manually)`);
|
|
210
|
+
}
|
|
211
|
+
pass++;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
info(`[yaml] ${pass} skill.yaml files validated`);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
218
|
+
// CHECK 3 — Stale Generated Files
|
|
219
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
220
|
+
function checkStale(sourceSkills) {
|
|
221
|
+
let staleCount = 0;
|
|
222
|
+
|
|
223
|
+
for (const adapter of COMPILED_ADAPTERS) {
|
|
224
|
+
const generated = collectGenerated(adapter);
|
|
225
|
+
|
|
226
|
+
for (const [name, gen] of Object.entries(generated)) {
|
|
227
|
+
const src = sourceSkills[name];
|
|
228
|
+
if (!src) continue; // orphan — handled in CHECK 4
|
|
229
|
+
|
|
230
|
+
if (src.mtime > gen.mtime + 1000) { // +1s tolerance
|
|
231
|
+
warn(`[stale] ${adapter}/${name} — source is newer than compiled output (run: node .agents/ctx.js export ${adapter})`);
|
|
232
|
+
staleCount++;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (staleCount === 0) {
|
|
238
|
+
info('[stale] All compiled skills are up-to-date');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
243
|
+
// CHECK 4 — Orphan & Missing Skills
|
|
244
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
245
|
+
function checkSync(sourceSkills) {
|
|
246
|
+
for (const adapter of COMPILED_ADAPTERS) {
|
|
247
|
+
const generated = collectGenerated(adapter);
|
|
248
|
+
const genNames = new Set(Object.keys(generated));
|
|
249
|
+
const srcNames = new Set(Object.keys(sourceSkills).filter(n => sourceSkills[n].hasSkillMd));
|
|
250
|
+
|
|
251
|
+
// Orphans: compiled but no longer in source
|
|
252
|
+
for (const name of genNames) {
|
|
253
|
+
if (!srcNames.has(name)) {
|
|
254
|
+
warn(`[orphan] generated/${adapter}/${name} — no source skill found (deleted? renamed?)`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Missing: source skill never compiled to this adapter
|
|
259
|
+
const missing = [];
|
|
260
|
+
for (const name of srcNames) {
|
|
261
|
+
if (!genNames.has(name)) missing.push(name);
|
|
262
|
+
}
|
|
263
|
+
if (missing.length > 0) {
|
|
264
|
+
warn(`[missing] ${adapter} — ${missing.length} source skills not compiled: ${missing.join(', ')}`);
|
|
265
|
+
warn(` Run: node .agents/ctx.js export ${adapter}`);
|
|
266
|
+
} else {
|
|
267
|
+
info(`[sync] ${adapter} — all source skills compiled`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
273
|
+
// CHECK 5 — Dependency Graph (requires: / conflicts:)
|
|
274
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
275
|
+
function checkDependencies(sourceSkills) {
|
|
276
|
+
// knownIds = every directory name in core/skills/ plus any `id:` declared in skill.yaml
|
|
277
|
+
const knownIds = new Set();
|
|
278
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
279
|
+
knownIds.add(name); // directory name is always a valid reference
|
|
280
|
+
if (skill.hasYaml) {
|
|
281
|
+
const text = fs.readFileSync(skill.yamlPath, 'utf8');
|
|
282
|
+
const id = yamlField(text, 'id');
|
|
283
|
+
if (id) knownIds.add(id);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// externalNames: well-known external frameworks/tools that are valid in
|
|
288
|
+
// conflicts:/optional: but are NOT ContextOS skills. We never error on these.
|
|
289
|
+
const EXTERNAL_NAMES = new Set([
|
|
290
|
+
'vue', 'angular', 'svelte', 'remix', 'express', 'koa', 'hapi', 'sails',
|
|
291
|
+
'tailwind', 'prisma', 'drizzle', 'mongoose', 'sequelize', 'typeorm',
|
|
292
|
+
'next-auth', 'react-query', 'zustand', 'redux', 'mobx', 'jotai', 'valtio',
|
|
293
|
+
'vitest', 'jest', 'mocha', 'cypress', 'playwright', 'storybook',
|
|
294
|
+
'graphql', 'trpc', 'apollo', 'relay', 'urql',
|
|
295
|
+
]);
|
|
296
|
+
|
|
297
|
+
let depChecked = 0;
|
|
298
|
+
|
|
299
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
300
|
+
if (!skill.hasYaml) continue;
|
|
301
|
+
|
|
302
|
+
const text = fs.readFileSync(skill.yamlPath, 'utf8');
|
|
303
|
+
const parsed = parseSkillYaml(text);
|
|
304
|
+
|
|
305
|
+
// requires: — must point to a known internal skill
|
|
306
|
+
for (const dep of parsed.requires) {
|
|
307
|
+
if (EXTERNAL_NAMES.has(dep)) continue; // external — allowed
|
|
308
|
+
if (!knownIds.has(dep)) {
|
|
309
|
+
error(`[deps] ${name}/skill.yaml — requires: '${dep}' does not match any known skill`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// conflicts: — must point to a known internal skill OR be an external name
|
|
314
|
+
for (const dep of parsed.conflicts) {
|
|
315
|
+
if (EXTERNAL_NAMES.has(dep)) continue; // external framework conflict — valid
|
|
316
|
+
if (dep === name || dep === parsed.id) {
|
|
317
|
+
error(`[deps] ${name}/skill.yaml — conflicts with itself ('${dep}')`);
|
|
318
|
+
} else if (!knownIds.has(dep)) {
|
|
319
|
+
// Only flag as error if the name looks internal (no dots, short, matches slug pattern)
|
|
320
|
+
const looksInternal = /^[a-z][a-z0-9-]{0,40}$/.test(dep);
|
|
321
|
+
if (looksInternal) {
|
|
322
|
+
error(`[deps] ${name}/skill.yaml — conflicts: '${dep}' does not match any known skill`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
depChecked++;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
info(`[deps] ${depChecked} skill.yaml dependency graphs validated`);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
334
|
+
// CHECK 6 — Minimum Content Quality
|
|
335
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
336
|
+
function checkContentQuality(sourceSkills) {
|
|
337
|
+
const MIN_BYTES = 100;
|
|
338
|
+
let pass = 0;
|
|
339
|
+
|
|
340
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
341
|
+
if (!skill.hasSkillMd) {
|
|
342
|
+
if (!skill.hasYaml && name !== 'profiles') {
|
|
343
|
+
warn(`[content] ${name} — no SKILL.md and no skill.yaml (empty placeholder?)`);
|
|
344
|
+
}
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const size = fs.statSync(skill.skillMdPath).size;
|
|
349
|
+
if (size < MIN_BYTES) {
|
|
350
|
+
warn(`[content] ${name}/SKILL.md is only ${size} bytes — may be incomplete`);
|
|
351
|
+
} else {
|
|
352
|
+
pass++;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
info(`[content] ${pass} SKILL.md files meet minimum size requirement (≥${MIN_BYTES}B)`);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
360
|
+
// CHECK 7 — COSTAR Structure
|
|
361
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
362
|
+
function checkCostarHeaders(sourceSkills) {
|
|
363
|
+
let pass = 0;
|
|
364
|
+
const requiredHeaders = [
|
|
365
|
+
'## Overview',
|
|
366
|
+
'## When to Use',
|
|
367
|
+
'## Rules & Patterns',
|
|
368
|
+
'## Code Examples',
|
|
369
|
+
'## Validation Checklist',
|
|
370
|
+
'## Common Mistakes',
|
|
371
|
+
'## Integration Notes'
|
|
372
|
+
];
|
|
373
|
+
|
|
374
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
375
|
+
if (!skill.hasSkillMd) continue;
|
|
376
|
+
|
|
377
|
+
const content = fs.readFileSync(skill.skillMdPath, 'utf8');
|
|
378
|
+
let missing = [];
|
|
379
|
+
for (const header of requiredHeaders) {
|
|
380
|
+
if (!content.includes(header)) missing.push(header);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (missing.length > 0) {
|
|
384
|
+
warn(`[costar] ${name}/SKILL.md is missing required headers: ${missing.join(', ')}`);
|
|
385
|
+
} else {
|
|
386
|
+
pass++;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
info(`[costar] ${pass} SKILL.md files follow the COSTAR template`);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
394
|
+
// CHECK 8 — VALIDATION.json
|
|
395
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
396
|
+
function checkValidationJson(sourceSkills) {
|
|
397
|
+
let pass = 0;
|
|
398
|
+
|
|
399
|
+
for (const [name, skill] of Object.entries(sourceSkills)) {
|
|
400
|
+
const valPath = path.join(skill.dir, 'VALIDATION.json');
|
|
401
|
+
if (!fs.existsSync(valPath)) {
|
|
402
|
+
warn(`[validation] ${name}/VALIDATION.json is missing`);
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
try {
|
|
407
|
+
JSON.parse(fs.readFileSync(valPath, 'utf8'));
|
|
408
|
+
pass++;
|
|
409
|
+
} catch (e) {
|
|
410
|
+
error(`[validation] ${name}/VALIDATION.json is invalid JSON: ${e.message}`);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
info(`[validation] ${pass} VALIDATION.json files are valid`);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
418
|
+
// REPORT
|
|
419
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
420
|
+
function printReport() {
|
|
421
|
+
const { errors, warnings, info: infos } = results;
|
|
422
|
+
|
|
423
|
+
console.log('');
|
|
424
|
+
console.log(c.bold('══════════════════════════════════════════'));
|
|
425
|
+
console.log(c.bold(' ContextOS — Skill Validation Report'));
|
|
426
|
+
console.log(c.bold('══════════════════════════════════════════'));
|
|
427
|
+
console.log('');
|
|
428
|
+
|
|
429
|
+
// Info (passes)
|
|
430
|
+
for (const msg of infos) {
|
|
431
|
+
console.log(` ${c.green('✓')} ${c.dim(msg)}`);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Warnings
|
|
435
|
+
if (warnings.length > 0) {
|
|
436
|
+
console.log('');
|
|
437
|
+
console.log(c.bold(c.yellow(` ⚠ ${warnings.length} warning(s):`)));
|
|
438
|
+
for (const msg of warnings) {
|
|
439
|
+
console.log(` ${c.yellow('▲')} ${msg}`);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Errors
|
|
444
|
+
if (errors.length > 0) {
|
|
445
|
+
console.log('');
|
|
446
|
+
console.log(c.bold(c.red(` ✗ ${errors.length} error(s):`)));
|
|
447
|
+
for (const msg of errors) {
|
|
448
|
+
console.log(` ${c.red('✗')} ${msg}`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
console.log('');
|
|
453
|
+
console.log(c.bold('──────────────────────────────────────────'));
|
|
454
|
+
|
|
455
|
+
const status = errors.length === 0
|
|
456
|
+
? c.green(c.bold(' ✓ PASSED'))
|
|
457
|
+
: c.red(c.bold(' ✗ FAILED'));
|
|
458
|
+
|
|
459
|
+
console.log(` ${status} ${c.bold(String(errors.length))} error(s) ${c.bold(String(warnings.length))} warning(s)`);
|
|
460
|
+
console.log(c.bold('──────────────────────────────────────────'));
|
|
461
|
+
console.log('');
|
|
462
|
+
|
|
463
|
+
return errors.length === 0;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
467
|
+
// MAIN
|
|
468
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
469
|
+
function run() {
|
|
470
|
+
console.log(c.cyan('\nContextOS Validator — scanning skills...\n'));
|
|
471
|
+
|
|
472
|
+
if (!fs.existsSync(CORE_SKILLS)) {
|
|
473
|
+
console.error(c.red('[ERROR] .agents/core/skills/ not found. Run from your project root.'));
|
|
474
|
+
process.exit(1);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
const sourceSkills = collectSourceSkills();
|
|
478
|
+
const total = Object.keys(sourceSkills).length;
|
|
479
|
+
console.log(c.dim(` Source: ${AGENTS_DIR} (core + plugins)`));
|
|
480
|
+
console.log(c.dim(` Skills found: ${total}\n`));
|
|
481
|
+
|
|
482
|
+
checkFrontmatter(sourceSkills);
|
|
483
|
+
checkSkillYaml(sourceSkills);
|
|
484
|
+
checkStale(sourceSkills);
|
|
485
|
+
checkSync(sourceSkills);
|
|
486
|
+
checkDependencies(sourceSkills);
|
|
487
|
+
checkContentQuality(sourceSkills);
|
|
488
|
+
checkCostarHeaders(sourceSkills);
|
|
489
|
+
checkValidationJson(sourceSkills);
|
|
490
|
+
|
|
491
|
+
const passed = printReport();
|
|
492
|
+
process.exit(passed ? 0 : 1);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
module.exports = { run };
|
|
496
|
+
|
|
497
|
+
// Allow direct execution: node .agents/validate.js
|
|
498
|
+
if (require.main === module) {
|
|
499
|
+
run();
|
|
500
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 contextos-agents contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|