// data.jsx — sample skill marketplace data

const SKILLS = [
  {
    id: "pr-reviewer",
    name: "PR Reviewer",
    one_liner: "Reviews a pull request and flags risky changes with inline notes.",
    author: "Anthropic", author_verified: true,
    glyph: "PR", color: ["#5a3fa9", "#8c75d0"],
    category: "Coding", use_cases: ["code-review", "github"],
    badges: ["verified", "secure", "popular"],
    installs_30d: 12840, installs_label: "12.8k",
    activation_rate: 0.82,
    rating: 4.8, reviews: 412,
    last_updated: "2 days ago", version: "1.4.2",
    compatibility: ["Claude Code", "API"],
    pricing: "Free",
    momentum: "+38% this week",
    permissions: ["Read repo", "Write comments", "Network: github.com"],
    license: "MIT",
    team_approved: true,
    description: "Inspects diffs for risky patterns — auth, migrations, dependency upgrades, broad refactors — and posts inline review comments with severity, rationale, and suggested fixes. Works on Claude Code or as a GitHub Action.",
    best_for: ["Daily PR triage on shared repos", "Catching risky migrations before merge", "Onboarding reviewers with consistent rubric"],
    not_for: ["Style/lint nits — use a linter", "Architectural review of new systems"],
    inputs: ["Pull request diff", "Repository context"],
    outputs: ["Inline comments", "Risk summary", "Suggested patches"],
    triggers: ["pull_request opened/synchronized", "Manual /review command"],
    steps: ["Fetch diff + context", "Classify changed files by risk tier", "Generate per-hunk review comments", "Post summary + label"],
    deps: ["Octokit", "git"],
    limits: ["Diffs over 4k LOC are sampled", "Does not run tests"],
    sample_input: "Review PR #482: refactor auth middleware",
    sample_output: "**Risk: medium** — middleware now bypasses CSRF on /webhooks/*. Suggest scoping bypass to one route, not a prefix. (3 inline comments added.)",
  },
  {
    id: "spec-drafter",
    name: "Spec Drafter",
    one_liner: "Turns scattered notes into a product spec draft with goals, scope, and risks.",
    author: "irisgo/templates", author_verified: true,
    glyph: "SD", color: ["#1e5fd6", "#5a8df0"],
    category: "Writing", use_cases: ["product-spec", "writing"],
    badges: ["verified", "team"],
    installs_30d: 7420, installs_label: "7.4k",
    activation_rate: 0.71,
    rating: 4.6, reviews: 188,
    last_updated: "5 days ago", version: "0.9.1",
    compatibility: ["Claude.ai", "API"],
    pricing: "Free",
    momentum: "Trending",
    permissions: ["Read attached files"],
    license: "Apache-2.0",
    team_approved: true,
    description: "Aggregates scratch notes, transcripts, and Slack threads into a structured spec — problem, goals, non-goals, scope, open questions, risks. Outputs Markdown.",
    best_for: ["PMs writing first drafts fast", "Synthesizing meeting notes into a spec"],
    not_for: ["Final-shipping doc copy", "Pricing pages"],
    inputs: ["Notes (text, files)", "Optional template"],
    outputs: ["Markdown spec", "Open questions list"],
    triggers: ["/spec command", "Drag notes onto chat"],
    steps: ["Cluster notes by topic", "Map to spec sections", "Draft with explicit gaps marked", "Surface open questions"],
    deps: [],
    limits: ["English only", "Max ~30 input pages"],
    sample_input: "Draft a spec from these 4 meeting notes about the new billing flow.",
    sample_output: "# Billing flow v2 — Spec draft\\n## Problem\\nUsers abandon checkout at the plan-pick step (37% drop)…",
  },
  {
    id: "csv-analyst",
    name: "CSV Analyst",
    one_liner: "Summarizes a CSV and highlights anomalies, trends, and outliers.",
    author: "datalab", author_verified: true,
    glyph: "CV", color: ["#137a3d", "#3aa86a"],
    category: "Data", use_cases: ["analysis", "data"],
    badges: ["verified", "popular"],
    installs_30d: 9120, installs_label: "9.1k",
    activation_rate: 0.78,
    rating: 4.7, reviews: 244,
    last_updated: "1 week ago", version: "2.1.0",
    compatibility: ["Claude Code", "Claude.ai", "API"],
    pricing: "Free",
    momentum: "+22% this week",
    permissions: ["Read uploaded files", "Local sandbox execution"],
    license: "MIT",
    description: "Profiles a tabular dataset — schema, distributions, missing values, candidate keys — then runs anomaly detection and produces a one-page summary with charts.",
    best_for: ["First look at a new dataset", "Smoke-checking pipeline output"],
    not_for: ["Production ETL", "Time-series forecasting"],
    inputs: ["CSV / TSV / Parquet"],
    outputs: ["Summary report", "Anomaly list", "Charts"],
    triggers: ["File upload", "/analyze command"],
    steps: ["Profile schema", "Compute distributions", "Run outlier detection", "Render report"],
    deps: ["pandas", "matplotlib"],
    limits: ["Files >500MB are sampled"],
    sample_input: "Analyze sales-Q3.csv",
    sample_output: "**Schema:** 14 columns, 2.1M rows. **Anomaly:** 1,204 rows in 'amount' exceed 4σ on 2025-09-14 — investigate.",
  },
  {
    id: "deploy-agent",
    name: "Deploy Agent",
    one_liner: "Deploys a service to staging, runs smoke checks, and rolls back on failure.",
    author: "ops-co", author_verified: true,
    glyph: "DA", color: ["#0f1115", "#4a4f5a"],
    category: "Ops", use_cases: ["deploy", "ci-cd"],
    badges: ["verified", "secure"],
    installs_30d: 3210, installs_label: "3.2k",
    activation_rate: 0.69,
    rating: 4.5, reviews: 96,
    last_updated: "3 weeks ago", version: "1.2.0",
    compatibility: ["Claude Code", "CLI"],
    pricing: "Free",
    momentum: "Steady",
    permissions: ["Network: registry.k8s", "Run shell", "Read secrets (read-only)"],
    license: "MIT",
    description: "Pushes a tagged image, applies the staging manifest, runs smoke checks, and rolls back if any check fails. Writes a deploy note to your tracker.",
    best_for: ["Engineers shipping to staging", "Pre-merge previews"],
    not_for: ["Production deploys without human gate"],
    inputs: ["Service name", "Git ref"],
    outputs: ["Deploy URL", "Smoke check report"],
    triggers: ["/deploy command", "PR label: deploy-staging"],
    steps: ["Build & tag image", "Push to registry", "Apply manifest", "Run smoke checks", "Annotate or rollback"],
    deps: ["kubectl", "docker"],
    limits: ["Staging only by default"],
    sample_input: "/deploy api-gateway @ git: feat/rate-limit",
    sample_output: "Deployed → https://staging.example.com/api-gateway · Smoke: 12/12 pass",
  },
  {
    id: "research-summarizer",
    name: "Research Summarizer",
    one_liner: "Synthesizes a research thread across sources with citations.",
    author: "lib.studio", author_verified: false,
    glyph: "RS", color: ["#a87000", "#d99933"],
    category: "Research", use_cases: ["research", "synthesis"],
    badges: ["popular"],
    installs_30d: 5640, installs_label: "5.6k",
    activation_rate: 0.74,
    rating: 4.4, reviews: 162,
    last_updated: "2 weeks ago", version: "0.6.4",
    compatibility: ["Claude.ai", "API"],
    pricing: "Free",
    momentum: "+12% this week",
    permissions: ["Network: HTTPS read", "Read uploaded files"],
    license: "MIT",
    description: "Reads a set of papers, blog posts, or transcripts and produces a synthesis with inline citations, agreement matrix, and open questions.",
    best_for: ["Lit reviews", "Competitive scans"],
    not_for: ["Single-source summaries"],
    inputs: ["URLs", "PDFs", "Notes"],
    outputs: ["Synthesis", "Citation list", "Agreement matrix"],
    triggers: ["/research command"],
    steps: ["Fetch + parse sources", "Extract claims", "Cluster + reconcile", "Synthesize"],
    deps: [],
    limits: ["Up to 25 sources per run"],
    sample_input: "Summarize what we know about long-context retrieval (8 sources).",
    sample_output: "Three camps: late-fusion RAG, full-context, and hybrid. Agreement on…",
  },
  {
    id: "incident-postmortem",
    name: "Incident Postmortem",
    one_liner: "Drafts a blameless postmortem from logs, comms, and timeline data.",
    author: "irisgo/ops", author_verified: true,
    glyph: "IP", color: ["#b8241e", "#e16662"],
    category: "Ops", use_cases: ["incident", "writing"],
    badges: ["verified", "team", "new"],
    installs_30d: 1820, installs_label: "1.8k",
    activation_rate: 0.66,
    rating: 4.6, reviews: 41,
    last_updated: "Yesterday", version: "0.4.0",
    compatibility: ["Claude.ai", "Claude Code"],
    pricing: "Free",
    momentum: "New",
    permissions: ["Read attached files"],
    license: "Apache-2.0",
    team_approved: false,
    description: "Reads incident channels, log excerpts, and the timeline doc and produces a blameless postmortem: summary, contributing factors, mitigations, action items.",
    best_for: ["On-call handoff write-ups", "Quarterly review packets"],
    not_for: ["Live incident comms"],
    inputs: ["Slack export", "Logs", "Timeline doc"],
    outputs: ["Postmortem doc", "Action items"],
    triggers: ["/postmortem command"],
    steps: ["Reconstruct timeline", "Identify contributing factors", "Draft narrative", "Extract action items"],
    deps: [],
    limits: ["Best on incidents under 24h scope"],
    sample_input: "Draft postmortem for incident INC-2031.",
    sample_output: "## Summary\\n2h 14m partial outage of /checkout, US-East. Trigger: queue saturation following…",
  },
  {
    id: "schema-migrator",
    name: "Schema Migrator",
    one_liner: "Plans a safe DB migration with backfill and rollback steps.",
    author: "datalab", author_verified: true,
    glyph: "SM", color: ["#15469f", "#5a8df0"],
    category: "Data", use_cases: ["database", "migration"],
    badges: ["verified", "secure"],
    installs_30d: 2640, installs_label: "2.6k",
    activation_rate: 0.72,
    rating: 4.7, reviews: 78,
    last_updated: "4 days ago", version: "1.0.3",
    compatibility: ["Claude Code", "CLI"],
    pricing: "Free",
    momentum: "+9% this week",
    permissions: ["Read schema", "Run shell (dry-run only)"],
    license: "MIT",
    description: "Generates a migration plan with phases (add column → backfill → switch reads → drop) and a rollback for each phase.",
    best_for: ["PostgreSQL/MySQL schema changes", "Backfilling new columns"],
    not_for: ["Cross-db migrations"],
    inputs: ["Current schema", "Target schema"],
    outputs: ["Migration plan", "SQL for each phase"],
    triggers: ["/migrate plan"],
    steps: ["Diff schemas", "Order changes", "Insert backfills", "Add rollback"],
    deps: ["psql", "mysql-client"],
    limits: ["No automatic execution"],
    sample_input: "Plan migration: add 'tier' to users, default='free', backfill from billing.",
    sample_output: "5 phases, 3 backfill batches. Rollback safe through phase 4. SQL attached.",
  },
  {
    id: "design-token-sync",
    name: "Design Token Sync",
    one_liner: "Keeps Figma tokens and your codebase in sync, generates types.",
    author: "frontmatter", author_verified: false,
    glyph: "DT", color: ["#5a3fa9", "#ad9ddf"],
    category: "Coding", use_cases: ["design-system", "frontend"],
    badges: ["new"],
    installs_30d: 980, installs_label: "980",
    activation_rate: 0.61,
    rating: 4.3, reviews: 22,
    last_updated: "1 day ago", version: "0.3.0",
    compatibility: ["Claude Code", "CLI"],
    pricing: "Free",
    momentum: "New",
    permissions: ["Network: api.figma.com", "Read/write repo"],
    license: "MIT",
    description: "Pulls tokens from a Figma file, writes them as CSS variables + TypeScript types, and opens a PR when they drift.",
    best_for: ["Design system maintainers"],
    not_for: ["Per-component overrides"],
    inputs: ["Figma file ID", "Output path"],
    outputs: ["tokens.css", "tokens.d.ts", "PR with diff"],
    triggers: ["/sync tokens"],
    steps: ["Fetch tokens", "Diff against repo", "Generate files", "Open PR"],
    deps: ["@figma/rest-api"],
    limits: ["Figma Variables API only"],
    sample_input: "Sync tokens from Figma file Iris/Core",
    sample_output: "PR opened: 14 token changes, 0 breaking.",
  },
  {
    id: "meeting-recap",
    name: "Meeting Recap",
    one_liner: "Turns a transcript into a recap with decisions, owners, and follow-ups.",
    author: "irisgo/templates", author_verified: true,
    glyph: "MR", color: ["#4a4f5a", "#9099a3"],
    category: "Writing", use_cases: ["meetings", "writing"],
    badges: ["verified"],
    installs_30d: 4480, installs_label: "4.5k",
    activation_rate: 0.81,
    rating: 4.5, reviews: 131,
    last_updated: "1 week ago", version: "1.0.0",
    compatibility: ["Claude.ai", "API"],
    pricing: "Free",
    momentum: "Steady",
    permissions: ["Read attached files"],
    license: "Apache-2.0",
    description: "Reads a meeting transcript and produces a tight recap: TL;DR, decisions, owners, follow-ups, and questions left unanswered.",
    best_for: ["Weekly team meetings", "Customer call recaps"],
    not_for: ["Verbatim transcripts"],
    inputs: ["Transcript (text/VTT)"],
    outputs: ["Recap doc"],
    triggers: ["/recap command"],
    steps: ["Identify speakers", "Detect decisions/actions", "Draft recap"],
    deps: [],
    limits: ["English"],
    sample_input: "Recap the kickoff transcript.",
    sample_output: "**TL;DR** — Q4 plan locked. **Decisions:** 3. **Action items:** 7 (owners assigned)…",
  },
  {
    id: "secret-scanner",
    name: "Secret Scanner",
    one_liner: "Scans a repo or diff for leaked credentials with low false-positive rate.",
    author: "secureline", author_verified: true,
    glyph: "SS", color: ["#0c5f30", "#3aa86a"],
    category: "Ops", use_cases: ["security", "ci"],
    badges: ["verified", "secure", "team"],
    installs_30d: 6120, installs_label: "6.1k",
    activation_rate: 0.85,
    rating: 4.9, reviews: 209,
    last_updated: "3 days ago", version: "2.4.1",
    compatibility: ["Claude Code", "CLI", "API"],
    pricing: "Free",
    momentum: "+14% this week",
    permissions: ["Read repo (no network egress)"],
    license: "Apache-2.0",
    team_approved: true,
    description: "Detects API keys, tokens, and certificates in repos and diffs. Validates against issuer endpoints (offline mode available).",
    best_for: ["Pre-commit hook", "PR gate"],
    not_for: ["PII scanning"],
    inputs: ["Repo path", "Diff"],
    outputs: ["Findings list", "Severity"],
    triggers: ["/scan", "Git pre-commit"],
    steps: ["Pattern match", "Entropy check", "Validate (optional)", "Rank"],
    deps: [],
    limits: ["Validation requires network"],
    sample_input: "Scan repo for secrets.",
    sample_output: "2 findings: 1 high (AWS key in config.example.json), 1 low (test token).",
  },
  {
    id: "ux-copy-editor",
    name: "UX Copy Editor",
    one_liner: "Tightens UI copy for clarity, voice, and length without changing meaning.",
    author: "frontmatter", author_verified: false,
    glyph: "UC", color: ["#a87000", "#f3c25b"],
    category: "Writing", use_cases: ["ux-writing", "frontend"],
    badges: [],
    installs_30d: 2080, installs_label: "2.1k",
    activation_rate: 0.7,
    rating: 4.4, reviews: 58,
    last_updated: "5 days ago", version: "0.7.2",
    compatibility: ["Claude.ai", "Claude Code"],
    pricing: "Free",
    momentum: "Steady",
    permissions: ["Read repo"],
    license: "MIT",
    description: "Reviews user-facing copy in components and rewrites for clarity, voice, and length. Outputs a diff.",
    best_for: ["Pre-launch polish", "i18n source cleanup"],
    not_for: ["Brand-defining headlines"],
    inputs: ["Component files", "Voice guide (optional)"],
    outputs: ["Diff"],
    triggers: ["/copy review"],
    steps: ["Extract strings", "Apply voice rules", "Tighten", "Write diff"],
    deps: [],
    limits: ["English"],
    sample_input: "Review copy in src/onboarding/*",
    sample_output: "12 strings improved, 4 left as-is, 2 flagged for review.",
  },
  {
    id: "competitive-scan",
    name: "Competitive Scan",
    one_liner: "Maps a competitive landscape from sources you provide, with positioning.",
    author: "lib.studio", author_verified: false,
    glyph: "CS", color: ["#5a3fa9", "#8c75d0"],
    category: "Research", use_cases: ["research", "strategy"],
    badges: ["new"],
    installs_30d: 720, installs_label: "720",
    activation_rate: 0.58,
    rating: 4.2, reviews: 18,
    last_updated: "Yesterday", version: "0.2.1",
    compatibility: ["Claude.ai"],
    pricing: "Free",
    momentum: "New",
    permissions: ["Network: HTTPS read"],
    license: "MIT",
    description: "Reads competitor sites, docs, and reviews and produces a 2x2 positioning map plus capability matrix.",
    best_for: ["Strategy decks", "GTM prep"],
    not_for: ["Pricing benchmarks"],
    inputs: ["URLs", "Notes"],
    outputs: ["Positioning map", "Capability matrix"],
    triggers: ["/scan competitive"],
    steps: ["Crawl sources", "Extract claims", "Map axes", "Draft brief"],
    deps: [],
    limits: ["Up to 12 competitors"],
    sample_input: "Scan 8 dev-tool startups.",
    sample_output: "2x2 map (depth × control) with 8 placements; capability matrix attached.",
  },
];

const COLLECTIONS = [
  { id: "starter", title: "Starter pack", desc: "Five skills every new agent should know.", count: 5, curator: "IrisGo team", audience: "New users", tone: ["#5a3fa9","#ad9ddf"] },
  { id: "founder", title: "Founder workflows", desc: "From scratch notes to ship-ready specs.", count: 8, curator: "@yc", audience: "Founders, PMs", tone: ["#137a3d","#3aa86a"] },
  { id: "eng", title: "Engineering productivity", desc: "Code review, refactors, and CI helpers.", count: 12, curator: "@stripe", audience: "Engineers", tone: ["#0f1115","#4a4f5a"] },
  { id: "research", title: "Research & analysis", desc: "Synthesize sources, scan landscapes.", count: 7, curator: "lib.studio", audience: "Researchers", tone: ["#a87000","#f3c25b"] },
  { id: "secure", title: "Secure enterprise set", desc: "Reviewed, permissioned, audit-ready.", count: 9, curator: "IrisGo team", audience: "Admins", tone: ["#1e5fd6","#5a8df0"] },
];

const USE_CASE_ROWS = {
  "Coding": ["pr-reviewer", "design-token-sync", "schema-migrator"],
  "Research": ["research-summarizer", "competitive-scan"],
  "Writing": ["spec-drafter", "meeting-recap", "ux-copy-editor"],
  "Data": ["csv-analyst", "schema-migrator"],
  "Ops": ["deploy-agent", "incident-postmortem", "secret-scanner"],
};

const TRENDING_IDS = ["pr-reviewer", "secret-scanner", "csv-analyst", "spec-drafter", "incident-postmortem", "design-token-sync"];
const FEATURED_IDS = ["pr-reviewer", "spec-drafter", "csv-analyst"];

const REVIEWS = {
  "pr-reviewer": [
    { user: "marina@kepler", rating: 5, when: "3d ago", text: "Cut our PR review queue in half. The risk classification is tighter than expected — almost no false 'high' flags.", verified_team: true },
    { user: "@dvora", rating: 5, when: "1w ago", text: "Best signal-to-noise of any review bot we've tried. Inline comments are short and specific.", verified_team: false },
    { user: "ops@northwind", rating: 4, when: "2w ago", text: "Wish it ran tests. Otherwise solid.", verified_team: true },
  ],
  "spec-drafter": [
    { user: "@pm-jules", rating: 5, when: "5d ago", text: "Open-questions list alone is worth the install. Saves the awkward 'what didn't we decide?' meeting.", verified_team: false },
    { user: "alex@reservoir", rating: 4, when: "2w ago", text: "Good first draft. Always needs a human pass for tone.", verified_team: true },
  ],
};

const RELATED = {
  "pr-reviewer": ["secret-scanner", "schema-migrator", "design-token-sync"],
  "spec-drafter": ["meeting-recap", "competitive-scan", "research-summarizer"],
  "csv-analyst": ["schema-migrator", "research-summarizer"],
  "deploy-agent": ["secret-scanner", "schema-migrator"],
  "research-summarizer": ["competitive-scan", "spec-drafter"],
  "incident-postmortem": ["meeting-recap", "deploy-agent"],
  "schema-migrator": ["csv-analyst", "deploy-agent"],
  "design-token-sync": ["ux-copy-editor", "pr-reviewer"],
  "meeting-recap": ["spec-drafter", "incident-postmortem"],
  "secret-scanner": ["pr-reviewer", "deploy-agent"],
  "ux-copy-editor": ["design-token-sync", "spec-drafter"],
  "competitive-scan": ["research-summarizer", "spec-drafter"],
};

const INSTALLED_IDS = ["pr-reviewer", "csv-analyst", "secret-scanner"];
const SAVED_IDS = ["spec-drafter", "research-summarizer"];

window.SKILLS = SKILLS;
window.SKILLS_BY_ID = Object.fromEntries(SKILLS.map(s => [s.id, s]));
window.COLLECTIONS = COLLECTIONS;
window.USE_CASE_ROWS = USE_CASE_ROWS;
window.TRENDING_IDS = TRENDING_IDS;
window.FEATURED_IDS = FEATURED_IDS;
window.REVIEWS = REVIEWS;
window.RELATED = RELATED;
window.INSTALLED_IDS = INSTALLED_IDS;
window.SAVED_IDS = SAVED_IDS;
