CtrlK
BlogDocsLog inGet started
Tessl Logo

tessleng/skill-insights

Scan a directory or workspace for SKILL.md files across all agents and repos, capture supporting files (references, scripts, linked docs), dedupe vendored copies, enrich each Tessl tile with registry signals, and emit a canonical JSON inventory validated by JSON Schema. Then run four analytical phases in parallel against the inventory — staleness + git provenance (history, broken refs, contributors), quality (Tessl `skill review`), duplicates (similarity + LLM judgement), registry-search (per-standalone-skill registry suggestions, HTTP only) — and render a self-contained interactive HTML report with a top-of-report health overview, top-issues panel, recently-changed list, and per-tessl.json manifests view.

84

1.44x
Quality

90%

Does it follow best practices?

Impact

97%

1.44x

Average score across 2 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

render_org_usage.pyskills/posthog-skill-query/scripts/

#!/usr/bin/env python3
"""Render the org-usage HTML report.

Reads `org_usage.json` produced by fetch_org_usage.py and the bundled
template at references/org-usage-report-template.html, substitutes the
single `<!--@ORG_USAGE_DATA@-->` placeholder, and writes a self-contained
HTML file.

The template owns all visual presentation, sorting, filtering, and the
data-caveats footer. This script is just a string substitution — it
applies no analysis or judgement to the data.
"""
from __future__ import annotations

import argparse
from pathlib import Path

PLACEHOLDER = "<!--@ORG_USAGE_DATA@-->"


def load_json_or_null(path: Path) -> str:
    if not path.exists():
        return "null"
    # Escape closing-tag sequences so the embedded JSON can't break out of
    # its <script type="application/json"> container.
    return path.read_text().replace("</", "<\\/")


def parse_args() -> argparse.Namespace:
    p = argparse.ArgumentParser(description="Render the org-usage HTML report.")
    p.add_argument("--input", required=True, help="Path to org_usage.json")
    p.add_argument("--template", default=None,
                   help="Path to org-usage-report-template.html "
                        "(default: <tile>/references/org-usage-report-template.html, resolved relative to this script)")
    p.add_argument("--output", required=True, help="Path to write the rendered HTML report")
    return p.parse_args()


def default_template_path() -> Path:
    # Tile layout: <tile>/skills/posthog-skill-query/scripts/render_org_usage.py
    #              <tile>/references/org-usage-report-template.html
    return Path(__file__).resolve().parent.parent.parent.parent / "references" / "org-usage-report-template.html"


def main() -> int:
    args = parse_args()
    template_path = Path(args.template) if args.template else default_template_path()
    input_path = Path(args.input)
    output_path = Path(args.output)

    if not template_path.exists():
        raise SystemExit(f"ERROR: template not found: {template_path}")
    template = template_path.read_text()

    if PLACEHOLDER not in template:
        raise SystemExit(
            f"ERROR: template at {template_path} is missing the {PLACEHOLDER!r} placeholder.",
        )

    rendered = template.replace(PLACEHOLDER, load_json_or_null(input_path))

    if PLACEHOLDER in rendered:
        raise SystemExit(f"ERROR: placeholder {PLACEHOLDER!r} was not substituted")

    output_path.parent.mkdir(parents=True, exist_ok=True)
    output_path.write_text(rendered)
    print(f"wrote {output_path} ({output_path.stat().st_size:,} bytes)")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

skills

README.md

tile.json