@jovianops/cortex 0.3.0 → 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/.agents/plugins/marketplace.json +7 -7
- package/.claude-plugin/marketplace.json +8 -8
- package/.claude-plugin/plugin.json +2 -2
- package/.cursor-plugin/marketplace.json +3 -3
- package/.cursor-plugin/plugin.json +2 -2
- package/.github/plugin/marketplace.json +146 -0
- package/.github/plugin.json +59 -0
- package/AGENTS.md +1 -1
- package/GEMINI.md +4 -4
- package/README.md +103 -26
- package/checksums.json +65 -51
- package/evals/skill_evals.json +2 -2
- package/gemini-extension.json +2 -2
- package/package.json +6 -3
- package/packs.json +1 -1
- package/plugin.json +2 -2
- package/premium-skills/accessibility-auditor/SKILL.md +1 -1
- package/premium-skills/api-designer/SKILL.md +1 -1
- package/premium-skills/code-migration/SKILL.md +3 -1
- package/premium-skills/code-migration/scripts/migration_inventory.py +62 -0
- package/premium-skills/db-optimizer/SKILL.md +3 -1
- package/premium-skills/db-optimizer/scripts/lint_sql.py +99 -0
- package/premium-skills/devops-pipeline/SKILL.md +1 -1
- package/premium-skills/docker-generator/SKILL.md +1 -1
- package/premium-skills/incident-response/SKILL.md +3 -1
- package/premium-skills/incident-response/scripts/incident_timeline.py +78 -0
- package/premium-skills/observability-setup/SKILL.md +3 -1
- package/premium-skills/observability-setup/scripts/check_slo.py +81 -0
- package/premium-skills/performance-profiler/SKILL.md +3 -1
- package/premium-skills/performance-profiler/scripts/bench_compare.py +62 -0
- package/premium-skills/refactoring-assistant/SKILL.md +3 -1
- package/premium-skills/refactoring-assistant/scripts/complexity_scan.py +69 -0
- package/premium-skills/release-engineering/SKILL.md +1 -1
- package/premium-skills/release-engineering/scripts/semver_bump.py +0 -1
- package/premium-skills/security-auditor/SKILL.md +1 -1
- package/premium-skills/security-auditor/scripts/secret_scan.py +6 -0
- package/premium-skills/terraform-generator/SKILL.md +3 -1
- package/premium-skills/terraform-generator/scripts/lint_terraform.py +111 -0
- package/premium-skills/unit-test-generator/SKILL.md +3 -1
- package/premium-skills/unit-test-generator/scripts/test_skeleton.py +58 -0
- package/schemas/checksums.schema.json +42 -0
- package/schemas/cortex-lock.schema.json +28 -0
- package/schemas/packs.schema.json +31 -0
- package/scripts/__pycache__/eval_skills.cpython-312.pyc +0 -0
- package/scripts/__pycache__/install_skills.cpython-312.pyc +0 -0
- package/scripts/__pycache__/package_skills.cpython-312.pyc +0 -0
- package/scripts/bump_version.py +119 -0
- package/scripts/cortex.py +253 -14
- package/scripts/install_skills.py +63 -13
- package/scripts/package_skills.py +1 -1
- package/scripts/validate_manifests.py +7 -0
- package/scripts/validate_skills.py +0 -1
- package/scripts/validate_yaml.py +45 -16
- package/scripts/verify_site.py +104 -0
- package/skills/academic-assistant/SKILL.md +3 -1
- package/skills/academic-assistant/scripts/citation_check.py +54 -0
- package/skills/anti-hallucination/SKILL.md +3 -1
- package/skills/anti-hallucination/scripts/verify_claims.py +57 -0
- package/skills/blender-3d-modeling/SKILL.md +1 -1
- package/skills/code-review-assistant/SKILL.md +3 -1
- package/skills/code-review-assistant/scripts/diff_review.py +76 -0
- package/skills/college-report-card/SKILL.md +1 -1
- package/skills/documentation-generator/SKILL.md +1 -1
- package/skills/memory-manager/SKILL.md +1 -1
- package/skills/python-coding-assistant/SKILL.md +3 -1
- package/skills/python-coding-assistant/scripts/check_python_ast.py +77 -0
- package/skills/testing-automation/SKILL.md +3 -1
- package/skills/testing-automation/scripts/check_test_coverage_map.py +65 -0
- package/skills/web-scraper/SKILL.md +3 -1
- package/skills/web-scraper/scripts/check_robots.py +50 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""Cortex
|
|
2
|
+
"""Cortex v1.0.0 Multi-Agent Skill Manager — install, verify, upgrade, and uninstall SKILL.md playbooks.
|
|
3
3
|
|
|
4
4
|
Zero external dependencies (Python 3 stdlib only). Works on Linux, macOS, and Windows.
|
|
5
5
|
|
|
@@ -85,10 +85,17 @@ AGENT_TARGETS: dict[str, AgentTarget] = {
|
|
|
85
85
|
),
|
|
86
86
|
"copilot": AgentTarget(
|
|
87
87
|
key="copilot",
|
|
88
|
-
label="GitHub Copilot
|
|
88
|
+
label="GitHub Copilot",
|
|
89
89
|
global_rel=".copilot/skills",
|
|
90
90
|
project_rel=".github/skills",
|
|
91
|
-
note="Commit .github/skills/ to share skills with
|
|
91
|
+
note="Commit .github/skills/ to share skills with GitHub Copilot and Copilot coding agent.",
|
|
92
|
+
),
|
|
93
|
+
"vscode": AgentTarget(
|
|
94
|
+
key="vscode",
|
|
95
|
+
label="Visual Studio Code",
|
|
96
|
+
global_rel=".copilot/skills",
|
|
97
|
+
project_rel=".github/skills",
|
|
98
|
+
note='VS Code auto-loads SKILL.md from .github/skills/ and ~/.copilot/skills/. For native plugin installs, add "JovianOps/cortex" to chat.plugins.marketplaces.',
|
|
92
99
|
),
|
|
93
100
|
"opencode": AgentTarget(
|
|
94
101
|
key="opencode",
|
|
@@ -139,7 +146,8 @@ AGENT_ALIASES: dict[str, str] = {
|
|
|
139
146
|
"openai": "codex",
|
|
140
147
|
"gemini": "gemini-cli",
|
|
141
148
|
"github-copilot": "copilot",
|
|
142
|
-
"
|
|
149
|
+
"vs-code": "vscode",
|
|
150
|
+
"code": "vscode",
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
|
|
@@ -159,7 +167,7 @@ def raw_url(repo: str, ref: str, rel_path: str) -> str:
|
|
|
159
167
|
|
|
160
168
|
|
|
161
169
|
def fetch_bytes(url: str, timeout: int = 20) -> bytes:
|
|
162
|
-
req = urllib.request.Request(url, headers={"User-Agent": "cortex-installer/0.
|
|
170
|
+
req = urllib.request.Request(url, headers={"User-Agent": "cortex-installer/1.0.0"})
|
|
163
171
|
try:
|
|
164
172
|
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
165
173
|
return resp.read()
|
|
@@ -173,7 +181,7 @@ def load_local_catalog() -> dict:
|
|
|
173
181
|
if checksums_path.is_file():
|
|
174
182
|
return json.loads(checksums_path.read_text(encoding="utf-8"))
|
|
175
183
|
|
|
176
|
-
pkg_version = "0.
|
|
184
|
+
pkg_version = "1.0.0"
|
|
177
185
|
pkg_json = ROOT / "package.json"
|
|
178
186
|
if pkg_json.is_file():
|
|
179
187
|
pkg_version = json.loads(pkg_json.read_text(encoding="utf-8")).get("version", pkg_version)
|
|
@@ -218,21 +226,26 @@ def resolve_agents(raw_agents: list[str]) -> list[AgentTarget]:
|
|
|
218
226
|
return []
|
|
219
227
|
resolved: list[AgentTarget] = []
|
|
220
228
|
seen: set[str] = set()
|
|
229
|
+
seen_paths: set[tuple[str, str]] = set()
|
|
221
230
|
for item in raw_agents:
|
|
222
231
|
token = item.strip().lower()
|
|
223
232
|
if token == "all":
|
|
224
233
|
for key, target in AGENT_TARGETS.items():
|
|
225
|
-
|
|
234
|
+
path_pair = (target.global_rel, target.project_rel)
|
|
235
|
+
if key not in seen and path_pair not in seen_paths:
|
|
226
236
|
resolved.append(target)
|
|
227
237
|
seen.add(key)
|
|
238
|
+
seen_paths.add(path_pair)
|
|
228
239
|
continue
|
|
229
240
|
canonical = AGENT_ALIASES.get(token, token)
|
|
230
241
|
if canonical not in AGENT_TARGETS:
|
|
231
242
|
valid = ", ".join(sorted(AGENT_TARGETS.keys()) + ["all"])
|
|
232
243
|
raise SystemExit(f"ERROR: Unknown agent {item!r}. Supported: {valid}")
|
|
233
244
|
if canonical not in seen:
|
|
234
|
-
|
|
245
|
+
target = AGENT_TARGETS[canonical]
|
|
246
|
+
resolved.append(target)
|
|
235
247
|
seen.add(canonical)
|
|
248
|
+
seen_paths.add((target.global_rel, target.project_rel))
|
|
236
249
|
return resolved
|
|
237
250
|
|
|
238
251
|
|
|
@@ -348,6 +361,36 @@ def update_aider_conf(project_root: Path, installed_files: list[Path], dry_run:
|
|
|
348
361
|
print(f" Updated {conf_path} with {len(to_add)} Cortex skill(s).")
|
|
349
362
|
|
|
350
363
|
|
|
364
|
+
def update_vscode_settings(project_root: Path, dry_run: bool) -> None:
|
|
365
|
+
"""Safely enable Agent Skills in .vscode/settings.json without clobbering existing keys."""
|
|
366
|
+
settings_path = project_root / ".vscode" / "settings.json"
|
|
367
|
+
existing: dict = {}
|
|
368
|
+
if settings_path.is_file():
|
|
369
|
+
try:
|
|
370
|
+
parsed = json.loads(settings_path.read_text(encoding="utf-8"))
|
|
371
|
+
if isinstance(parsed, dict):
|
|
372
|
+
existing = parsed
|
|
373
|
+
else:
|
|
374
|
+
print(f" Skipped {settings_path}: expected top-level JSON object.")
|
|
375
|
+
return
|
|
376
|
+
except json.JSONDecodeError:
|
|
377
|
+
print(f" Skipped {settings_path}: existing file contains comments or non-strict JSON.")
|
|
378
|
+
return
|
|
379
|
+
|
|
380
|
+
if existing.get("chat.useAgentSkills") is True:
|
|
381
|
+
print(f" VS Code settings already enable chat.useAgentSkills: {settings_path}")
|
|
382
|
+
return
|
|
383
|
+
|
|
384
|
+
if dry_run:
|
|
385
|
+
print(f" [dry-run] Would set chat.useAgentSkills=true in {settings_path}")
|
|
386
|
+
return
|
|
387
|
+
|
|
388
|
+
existing["chat.useAgentSkills"] = True
|
|
389
|
+
settings_path.parent.mkdir(parents=True, exist_ok=True)
|
|
390
|
+
settings_path.write_text(json.dumps(existing, indent=2) + "\n", encoding="utf-8")
|
|
391
|
+
print(f" Updated {settings_path} with chat.useAgentSkills=true.")
|
|
392
|
+
|
|
393
|
+
|
|
351
394
|
def install_single_skill(
|
|
352
395
|
slug: str,
|
|
353
396
|
meta: dict,
|
|
@@ -443,7 +486,7 @@ def cmd_check_updates(
|
|
|
443
486
|
ref: str,
|
|
444
487
|
dry_run: bool,
|
|
445
488
|
) -> int:
|
|
446
|
-
latest_version = catalog.get("release_version", "0.
|
|
489
|
+
latest_version = catalog.get("release_version", "1.0.0")
|
|
447
490
|
skills_map = catalog["skills"]
|
|
448
491
|
updates_found = 0
|
|
449
492
|
|
|
@@ -527,14 +570,14 @@ def cmd_uninstall(
|
|
|
527
570
|
|
|
528
571
|
def parse_args(argv: list[str]) -> argparse.Namespace:
|
|
529
572
|
parser = argparse.ArgumentParser(
|
|
530
|
-
description="Install, verify, upgrade, and uninstall Cortex
|
|
573
|
+
description="Install, verify, upgrade, and uninstall Cortex v1.0.0 SKILL.md playbooks across 12 AI agent & IDE targets."
|
|
531
574
|
)
|
|
532
575
|
parser.add_argument(
|
|
533
576
|
"--agent",
|
|
534
577
|
"-a",
|
|
535
578
|
action="append",
|
|
536
579
|
default=[],
|
|
537
|
-
help="Target agent(s): claude-code, codex, gemini-cli, cursor, copilot, opencode, openclaw, goose, cline, aider, agents, or all.",
|
|
580
|
+
help="Target agent(s): claude-code, codex, gemini-cli, cursor, copilot, vscode, opencode, openclaw, goose, cline, aider, agents, or all.",
|
|
538
581
|
)
|
|
539
582
|
parser.add_argument(
|
|
540
583
|
"--collection",
|
|
@@ -594,6 +637,11 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
|
|
|
594
637
|
action="store_true",
|
|
595
638
|
help="When installing for aider, append installed SKILL.md paths to .aider.conf.yml in --project-dir.",
|
|
596
639
|
)
|
|
640
|
+
parser.add_argument(
|
|
641
|
+
"--write-vscode-settings",
|
|
642
|
+
action="store_true",
|
|
643
|
+
help="When installing for vscode, ensure chat.useAgentSkills=true in .vscode/settings.json under --project-dir.",
|
|
644
|
+
)
|
|
597
645
|
parser.add_argument("--dry-run", action="store_true", help="Preview changes without writing or deleting files.")
|
|
598
646
|
parser.add_argument("--list", action="store_true", help="List all supported agents and available Cortex skills.")
|
|
599
647
|
return parser.parse_args(argv)
|
|
@@ -609,7 +657,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
609
657
|
print(
|
|
610
658
|
f" {target.key:<12} {target.label:<38} global: ~/{target.global_rel} project: {target.project_rel}"
|
|
611
659
|
)
|
|
612
|
-
print(f"\nAvailable Cortex Skills (v{catalog.get('release_version', '0.
|
|
660
|
+
print(f"\nAvailable Cortex Skills (v{catalog.get('release_version', '1.0.0')} — {len(catalog['skills'])} total):")
|
|
613
661
|
for slug, meta in catalog["skills"].items():
|
|
614
662
|
extras = [f for f in meta.get("files", {}) if f != "SKILL.md"]
|
|
615
663
|
badge = f" [+{len(extras)} script(s)]" if extras else ""
|
|
@@ -645,7 +693,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
645
693
|
|
|
646
694
|
packs = load_packs(args.remote, args.repo, args.ref) if args.pack else {}
|
|
647
695
|
skills = select_skills(catalog, args.collection, args.skill, args.pack, packs)
|
|
648
|
-
release_ver = catalog.get("release_version", "0.
|
|
696
|
+
release_ver = catalog.get("release_version", "1.0.0")
|
|
649
697
|
|
|
650
698
|
for target in agents:
|
|
651
699
|
dest_base = destination_dir(target, args.scope, project_root)
|
|
@@ -674,6 +722,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
674
722
|
print(f" Aider usage: aider {sample_flags}{suffix}")
|
|
675
723
|
if args.write_aider_conf:
|
|
676
724
|
update_aider_conf(project_root, installed_md, args.dry_run)
|
|
725
|
+
if target.key == "vscode" and args.write_vscode_settings:
|
|
726
|
+
update_vscode_settings(project_root, args.dry_run)
|
|
677
727
|
if target.note:
|
|
678
728
|
print(f" Note: {target.note}")
|
|
679
729
|
|
|
@@ -87,7 +87,7 @@ def verify_archive(path: Path, name: str, source: Path) -> list[str]:
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
def build_checksums_manifest() -> dict:
|
|
90
|
-
pkg_version = json.loads((ROOT / "package.json").read_text(encoding="utf-8")).get("version", "0.
|
|
90
|
+
pkg_version = json.loads((ROOT / "package.json").read_text(encoding="utf-8")).get("version", "1.0.0")
|
|
91
91
|
skills_index: dict[str, dict] = {}
|
|
92
92
|
for source_dir, archive_dir in COLLECTIONS:
|
|
93
93
|
sources = skill_sources(ROOT / source_dir)
|
|
@@ -11,11 +11,13 @@ REPO_URL = "https://github.com/JovianOps/cortex"
|
|
|
11
11
|
|
|
12
12
|
PLUGIN_MANIFESTS = (
|
|
13
13
|
".claude-plugin/plugin.json",
|
|
14
|
+
".github/plugin.json",
|
|
14
15
|
"plugin.json",
|
|
15
16
|
".cursor-plugin/plugin.json",
|
|
16
17
|
)
|
|
17
18
|
MARKETPLACE_MANIFESTS = (
|
|
18
19
|
".claude-plugin/marketplace.json",
|
|
20
|
+
".github/plugin/marketplace.json",
|
|
19
21
|
".agents/plugins/marketplace.json",
|
|
20
22
|
".cursor-plugin/marketplace.json",
|
|
21
23
|
)
|
|
@@ -139,6 +141,11 @@ def main() -> int:
|
|
|
139
141
|
if len(set(versions.values())) > 1:
|
|
140
142
|
errors.append(f"Version mismatch across manifests: {versions}")
|
|
141
143
|
|
|
144
|
+
for schema_rel in ("schemas/checksums.schema.json", "schemas/packs.schema.json", "schemas/cortex-lock.schema.json"):
|
|
145
|
+
schema_data = load_json(schema_rel, errors)
|
|
146
|
+
if schema_data is not None and "$schema" not in schema_data:
|
|
147
|
+
errors.append(f"{schema_rel}: missing '$schema' key")
|
|
148
|
+
|
|
142
149
|
if errors:
|
|
143
150
|
for err in errors:
|
|
144
151
|
print(f"::error::{err}", file=sys.stderr)
|
package/scripts/validate_yaml.py
CHANGED
|
@@ -1,16 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Validate every YAML file in the repository, including .github/workflows/."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import yaml
|
|
8
|
+
|
|
9
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
10
|
+
IGNORED_DIRS = {".git", "node_modules", ".venv", "__pycache__", ".private"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def iter_yaml_files() -> list[Path]:
|
|
14
|
+
files: list[Path] = []
|
|
15
|
+
for path in sorted(ROOT.rglob("*")):
|
|
16
|
+
if not path.is_file() or path.suffix.lower() not in {".yml", ".yaml"}:
|
|
17
|
+
continue
|
|
18
|
+
if any(part in IGNORED_DIRS for part in path.relative_to(ROOT).parts):
|
|
19
|
+
continue
|
|
20
|
+
files.append(path)
|
|
21
|
+
return files
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def main() -> int:
|
|
25
|
+
files = iter_yaml_files()
|
|
26
|
+
errors: list[tuple[Path, str]] = []
|
|
27
|
+
for yaml_file in files:
|
|
28
|
+
try:
|
|
29
|
+
with yaml_file.open("r", encoding="utf-8") as handle:
|
|
30
|
+
list(yaml.safe_load_all(handle))
|
|
31
|
+
except yaml.YAMLError as exc:
|
|
32
|
+
errors.append((yaml_file, str(exc)))
|
|
33
|
+
|
|
34
|
+
if errors:
|
|
35
|
+
for path, msg in errors:
|
|
36
|
+
rel = path.relative_to(ROOT).as_posix()
|
|
37
|
+
print(f"::error file={rel}::{msg}")
|
|
38
|
+
return 1
|
|
39
|
+
|
|
40
|
+
print(f"All {len(files)} YAML file(s) valid.")
|
|
41
|
+
return 0
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Verify index.html integrity: inline JS syntax, checksums.json/packs.json parity, and WCAG 2.2 AA."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
import tempfile
|
|
9
|
+
from html.parser import HTMLParser
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
13
|
+
INDEX_HTML = ROOT / "index.html"
|
|
14
|
+
CHECKSUMS_JSON = ROOT / "checksums.json"
|
|
15
|
+
PACKS_JSON = ROOT / "packs.json"
|
|
16
|
+
A11Y_SCAN = ROOT / "premium-skills" / "accessibility-auditor" / "scripts" / "a11y_scan.py"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class _InlineScriptExtractor(HTMLParser):
|
|
20
|
+
def __init__(self) -> None:
|
|
21
|
+
super().__init__()
|
|
22
|
+
self._in_inline_script = False
|
|
23
|
+
self._buf: list[str] = []
|
|
24
|
+
self.scripts: list[str] = []
|
|
25
|
+
|
|
26
|
+
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
|
|
27
|
+
if tag.lower() == "script":
|
|
28
|
+
attr_map = {k.lower(): v for k, v in attrs}
|
|
29
|
+
if "src" not in attr_map:
|
|
30
|
+
self._in_inline_script = True
|
|
31
|
+
self._buf = []
|
|
32
|
+
|
|
33
|
+
def handle_data(self, data: str) -> None:
|
|
34
|
+
if self._in_inline_script:
|
|
35
|
+
self._buf.append(data)
|
|
36
|
+
|
|
37
|
+
def handle_endtag(self, tag: str) -> None:
|
|
38
|
+
if tag.lower() == "script" and self._in_inline_script:
|
|
39
|
+
self._in_inline_script = False
|
|
40
|
+
body = "".join(self._buf)
|
|
41
|
+
if body.strip():
|
|
42
|
+
self.scripts.append(body)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def check_inline_js(html: str) -> None:
|
|
46
|
+
parser = _InlineScriptExtractor()
|
|
47
|
+
parser.feed(html)
|
|
48
|
+
parser.close()
|
|
49
|
+
if not parser.scripts:
|
|
50
|
+
raise RuntimeError("No inline <script> blocks found in index.html")
|
|
51
|
+
for idx, body in enumerate(parser.scripts, 1):
|
|
52
|
+
with tempfile.NamedTemporaryFile("w", suffix=".js", encoding="utf-8", delete=False) as tf:
|
|
53
|
+
tf.write(body)
|
|
54
|
+
tmp_path = Path(tf.name)
|
|
55
|
+
try:
|
|
56
|
+
res = subprocess.run(["node", "--check", str(tmp_path)], check=False, capture_output=True, text=True)
|
|
57
|
+
if res.returncode != 0:
|
|
58
|
+
raise RuntimeError(f"index.html script #{idx} failed node --check:\n{res.stderr}")
|
|
59
|
+
finally:
|
|
60
|
+
tmp_path.unlink(missing_ok=True)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def check_data_parity(html: str) -> tuple[int, int]:
|
|
64
|
+
checksums = json.loads(CHECKSUMS_JSON.read_text(encoding="utf-8"))
|
|
65
|
+
packs = json.loads(PACKS_JSON.read_text(encoding="utf-8"))
|
|
66
|
+
|
|
67
|
+
missing: list[str] = []
|
|
68
|
+
for slug, meta in checksums.get("skills", {}).items():
|
|
69
|
+
skill_sha = meta["files"]["SKILL.md"]
|
|
70
|
+
zip_sha = meta["zip_sha256"]
|
|
71
|
+
if f'"{slug}"' not in html:
|
|
72
|
+
missing.append(f"skill slug {slug}")
|
|
73
|
+
if skill_sha not in html:
|
|
74
|
+
missing.append(f"{slug} SKILL.md SHA-256 ({skill_sha[:12]}...)")
|
|
75
|
+
if zip_sha not in html:
|
|
76
|
+
missing.append(f"{slug} ZIP SHA-256 ({zip_sha[:12]}...)")
|
|
77
|
+
|
|
78
|
+
for pack_id in packs.get("packs", {}):
|
|
79
|
+
if f'"{pack_id}"' not in html:
|
|
80
|
+
missing.append(f"pack id {pack_id}")
|
|
81
|
+
|
|
82
|
+
if missing:
|
|
83
|
+
raise RuntimeError("index.html out of sync with checksums.json/packs.json:\n - " + "\n - ".join(missing))
|
|
84
|
+
|
|
85
|
+
return len(checksums.get("skills", {})), len(packs.get("packs", {}))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def check_accessibility() -> None:
|
|
89
|
+
res = subprocess.run([sys.executable, str(A11Y_SCAN), str(INDEX_HTML)], check=False, capture_output=True, text=True)
|
|
90
|
+
if res.returncode != 0:
|
|
91
|
+
raise RuntimeError(f"Accessibility scan failed:\n{res.stdout}\n{res.stderr}")
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def main() -> int:
|
|
95
|
+
html = INDEX_HTML.read_text(encoding="utf-8")
|
|
96
|
+
check_inline_js(html)
|
|
97
|
+
skill_count, pack_count = check_data_parity(html)
|
|
98
|
+
check_accessibility()
|
|
99
|
+
print(f"Verified index.html: inline JS syntax OK, {skill_count} skills & {pack_count} packs in sync with checksums.json, WCAG 2.2 AA OK.")
|
|
100
|
+
return 0
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if __name__ == "__main__":
|
|
104
|
+
raise SystemExit(main())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: academic-assistant
|
|
3
3
|
description: Orchestrate grading, coding, and 3D academic workflows.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
author: Athalla Jovian Maharsa (athallajovian9-cyber), Hermes Agent
|
|
6
6
|
license: MIT
|
|
7
7
|
platforms: [linux, macos, windows]
|
|
@@ -28,6 +28,8 @@ Orchestrate high-accuracy academic tasks across grading/report cards, Python cod
|
|
|
28
28
|
|
|
29
29
|
## How to Run
|
|
30
30
|
|
|
31
|
+
> **Bundled Helper Script (`v1.0.0`):** Run `python skills/academic-assistant/scripts/citation_check.py draft.md` to verify every inline numeric citation `[1]` matches an entry in `## References`.
|
|
32
|
+
|
|
31
33
|
```bash
|
|
32
34
|
hermes skills tap add JovianOps/cortex
|
|
33
35
|
hermes skills install JovianOps/cortex/skills/academic-assistant --yes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Offline academic citation & numeric-reference auditor for academic-assistant skill."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def audit_citations(text: str) -> dict:
|
|
13
|
+
parts = re.split(r"(?im)^##\s+References\b", text, maxsplit=1)
|
|
14
|
+
body = parts[0]
|
|
15
|
+
refs_section = parts[1] if len(parts) > 1 else ""
|
|
16
|
+
cited = sorted(set(re.findall(r"\[(\d+)\]", body)), key=int)
|
|
17
|
+
defined = sorted(set(re.findall(r"(?m)^\s*(?:\[(\d+)\]|(\d+)\.)\s+\S", refs_section)), key=lambda m: int(m[0] or m[1]))
|
|
18
|
+
defined_ids = sorted({m[0] or m[1] for m in defined}, key=int)
|
|
19
|
+
|
|
20
|
+
missing_refs = [c for c in cited if c not in defined_ids]
|
|
21
|
+
uncited_refs = [d for d in defined_ids if d not in cited]
|
|
22
|
+
return {
|
|
23
|
+
"cited_count": len(cited),
|
|
24
|
+
"defined_count": len(defined_ids),
|
|
25
|
+
"missing_references": missing_refs,
|
|
26
|
+
"uncited_references": uncited_refs,
|
|
27
|
+
"ok": not missing_refs and not uncited_refs,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def main(argv: list[str] | None = None) -> int:
|
|
32
|
+
parser = argparse.ArgumentParser(description="Verify numeric inline citations [1] match a ## References section.")
|
|
33
|
+
parser.add_argument("draft", type=Path, help="Markdown academic draft file.")
|
|
34
|
+
parser.add_argument("--json", action="store_true", dest="as_json")
|
|
35
|
+
args = parser.parse_args(argv)
|
|
36
|
+
if not args.draft.is_file():
|
|
37
|
+
print(f"ERROR: File not found: {args.draft}", file=sys.stderr)
|
|
38
|
+
return 2
|
|
39
|
+
|
|
40
|
+
res = audit_citations(args.draft.read_text(encoding="utf-8"))
|
|
41
|
+
if args.as_json:
|
|
42
|
+
print(json.dumps(res, indent=2))
|
|
43
|
+
elif res["ok"]:
|
|
44
|
+
print(f"OK: All {res['cited_count']} inline citation(s) match ## References.")
|
|
45
|
+
else:
|
|
46
|
+
if res["missing_references"]:
|
|
47
|
+
print(f"ERROR: Missing reference entries for citations: {res['missing_references']}")
|
|
48
|
+
if res["uncited_references"]:
|
|
49
|
+
print(f"WARNING: Uncited entries in ## References: {res['uncited_references']}")
|
|
50
|
+
return 0 if res["ok"] else 1
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if __name__ == "__main__":
|
|
54
|
+
raise SystemExit(main())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: anti-hallucination
|
|
3
3
|
description: Verify AI claims and code with deterministic audit gates.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
author: Athalla Jovian Maharsa (athallajovian9-cyber), Hermes Agent
|
|
6
6
|
license: MIT
|
|
7
7
|
platforms: [linux, macos, windows]
|
|
@@ -28,6 +28,8 @@ Systematically audit AI-generated code, technical answers, data summaries, and c
|
|
|
28
28
|
|
|
29
29
|
## How to Run
|
|
30
30
|
|
|
31
|
+
> **Bundled Helper Script (`v1.0.0`):** Run `python skills/anti-hallucination/scripts/verify_claims.py report.md --repo .` to verify every backticked relative file path actually exists in the repository.
|
|
32
|
+
|
|
31
33
|
```bash
|
|
32
34
|
hermes skills tap add JovianOps/cortex
|
|
33
35
|
hermes skills install JovianOps/cortex/skills/anti-hallucination --yes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Offline claim verifier for anti-hallucination skill — checks cited file paths exist in a repository."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
PATH_RX = re.compile(r"`([A-Za-z0-9_.\-/]+\.[A-Za-z0-9]{1,8})`")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def verify_claims(doc_text: str, repo_root: Path) -> tuple[list[str], list[str]]:
|
|
15
|
+
cited = sorted(set(PATH_RX.findall(doc_text)))
|
|
16
|
+
verified: list[str] = []
|
|
17
|
+
missing: list[str] = []
|
|
18
|
+
for rel in cited:
|
|
19
|
+
if rel.startswith(("http://", "https://")) or "/" not in rel:
|
|
20
|
+
continue
|
|
21
|
+
candidate = (repo_root / rel).resolve()
|
|
22
|
+
try:
|
|
23
|
+
candidate.relative_to(repo_root.resolve())
|
|
24
|
+
except ValueError:
|
|
25
|
+
missing.append(rel)
|
|
26
|
+
continue
|
|
27
|
+
if candidate.exists():
|
|
28
|
+
verified.append(rel)
|
|
29
|
+
else:
|
|
30
|
+
missing.append(rel)
|
|
31
|
+
return verified, missing
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def main(argv: list[str] | None = None) -> int:
|
|
35
|
+
parser = argparse.ArgumentParser(description="Verify backticked relative file path claims against a repository.")
|
|
36
|
+
parser.add_argument("document", type=Path, help="Markdown/text response to audit.")
|
|
37
|
+
parser.add_argument("--repo", type=Path, default=Path("."), help="Repository root directory.")
|
|
38
|
+
parser.add_argument("--json", action="store_true", dest="as_json")
|
|
39
|
+
args = parser.parse_args(argv)
|
|
40
|
+
if not args.document.is_file():
|
|
41
|
+
print(f"ERROR: Document not found: {args.document}", file=sys.stderr)
|
|
42
|
+
return 2
|
|
43
|
+
|
|
44
|
+
verified, missing = verify_claims(args.document.read_text(encoding="utf-8"), args.repo)
|
|
45
|
+
if args.as_json:
|
|
46
|
+
print(json.dumps({"verified": verified, "missing": missing, "ok": not missing}, indent=2))
|
|
47
|
+
elif not missing:
|
|
48
|
+
print(f"OK: Verified {len(verified)} cited path(s); 0 hallucinated paths.")
|
|
49
|
+
else:
|
|
50
|
+
print(f"FAIL: {len(missing)} cited path(s) do not exist in {args.repo}:")
|
|
51
|
+
for m in missing:
|
|
52
|
+
print(f" - {m}")
|
|
53
|
+
return 1 if missing else 0
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
raise SystemExit(main())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-review-assistant
|
|
3
3
|
description: Run evidence-backed code reviews with severity rubrics.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
author: Athalla Jovian Maharsa (athallajovian9-cyber), Hermes Agent
|
|
6
6
|
license: MIT
|
|
7
7
|
platforms: [linux, macos, windows]
|
|
@@ -28,6 +28,8 @@ Perform rigorous, evidence-backed code and PR reviews that prioritize real corre
|
|
|
28
28
|
|
|
29
29
|
## How to Run
|
|
30
30
|
|
|
31
|
+
> **Bundled Helper Script (`v1.0.0`):** Run `git diff | python skills/code-review-assistant/scripts/diff_review.py -` to flag leftover debug calls, TODOs, and source edits lacking companion tests.
|
|
32
|
+
|
|
31
33
|
```bash
|
|
32
34
|
hermes skills tap add JovianOps/cortex
|
|
33
35
|
hermes skills install JovianOps/cortex/skills/code-review-assistant --yes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Deterministic unified-diff risk & hygiene pre-reviewer for code-review-assistant skill."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
DEBUG_PATTERNS = [
|
|
12
|
+
(re.compile(r"\bconsole\.log\s*\("), "Leftover console.log()"),
|
|
13
|
+
(re.compile(r"\bdebugger\b"), "Leftover debugger statement"),
|
|
14
|
+
(re.compile(r"\b(pdb\.set_trace|breakpoint)\s*\("), "Leftover Python debugger breakpoint"),
|
|
15
|
+
(re.compile(r"\bTODO\b|\bFIXME\b"), "Unresolved TODO/FIXME added in diff"),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def analyze_diff(diff_text: str) -> dict:
|
|
20
|
+
files: list[str] = []
|
|
21
|
+
added_lines = 0
|
|
22
|
+
removed_lines = 0
|
|
23
|
+
findings: list[dict] = []
|
|
24
|
+
current_file = "<unknown>"
|
|
25
|
+
|
|
26
|
+
for line in diff_text.splitlines():
|
|
27
|
+
if line.startswith("+++ b/"):
|
|
28
|
+
current_file = line[6:].strip()
|
|
29
|
+
if current_file not in files:
|
|
30
|
+
files.append(current_file)
|
|
31
|
+
continue
|
|
32
|
+
if line.startswith("+") and not line.startswith("+++"):
|
|
33
|
+
added_lines += 1
|
|
34
|
+
body = line[1:]
|
|
35
|
+
for rx, msg in DEBUG_PATTERNS:
|
|
36
|
+
if rx.search(body):
|
|
37
|
+
findings.append({"severity": "MEDIUM", "file": current_file, "message": msg})
|
|
38
|
+
elif line.startswith("-") and not line.startswith("---"):
|
|
39
|
+
removed_lines += 1
|
|
40
|
+
|
|
41
|
+
code_files = [f for f in files if f.endswith((".py", ".js", ".ts", ".go", ".rs", ".java")) and "test" not in f.lower()]
|
|
42
|
+
test_files = [f for f in files if "test" in f.lower() or "spec" in f.lower()]
|
|
43
|
+
if code_files and not test_files:
|
|
44
|
+
findings.append({
|
|
45
|
+
"severity": "MEDIUM",
|
|
46
|
+
"file": ", ".join(code_files[:3]),
|
|
47
|
+
"message": "Production source files changed with no companion test file edits.",
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
"files_changed": len(files),
|
|
52
|
+
"added_lines": added_lines,
|
|
53
|
+
"removed_lines": removed_lines,
|
|
54
|
+
"findings": findings,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def main(argv: list[str] | None = None) -> int:
|
|
59
|
+
parser = argparse.ArgumentParser(description="Analyze a unified diff file for review risks and debug leftovers.")
|
|
60
|
+
parser.add_argument("diff_file", type=Path, help="Path to unified diff file (or '-' for stdin).")
|
|
61
|
+
parser.add_argument("--json", action="store_true", dest="as_json")
|
|
62
|
+
args = parser.parse_args(argv)
|
|
63
|
+
|
|
64
|
+
text = sys.stdin.read() if str(args.diff_file) == "-" else args.diff_file.read_text(encoding="utf-8")
|
|
65
|
+
report = analyze_diff(text)
|
|
66
|
+
if args.as_json:
|
|
67
|
+
print(json.dumps(report, indent=2))
|
|
68
|
+
else:
|
|
69
|
+
print(f"Diff summary: {report['files_changed']} file(s), +{report['added_lines']}/-{report['removed_lines']}, {len(report['findings'])} finding(s)")
|
|
70
|
+
for f in report["findings"]:
|
|
71
|
+
print(f"[{f['severity']}] {f['file']} — {f['message']}")
|
|
72
|
+
return 1 if report["findings"] else 0
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if __name__ == "__main__":
|
|
76
|
+
raise SystemExit(main())
|