{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/nps-analyzer",
  "slug": "adapters/domain/nps-analyzer",
  "kind": "capabilities",
  "bucket": "package",
  "title": "nps-analyzer",
  "name": "Nps Analyzer",
  "eyebrow": null,
  "chip": null,
  "summary": "Customer-feedback and experience-analytics pack for survey score data: compute Net Promoter Score (NPS) from 0-10 recommend ratings with promoter/passive/detractor breakdown, CSAT (customer...",
  "keywords": [
    "nps-analyzer",
    "customer-feedback",
    "experience-analytics",
    "promoter",
    "0-10",
    "detractor",
    "1-10",
    "survey"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# nps-analyzer\n\nCustomer-feedback & experience-analytics adapter pack. Turns raw survey score arrays into the\nmetrics a CX / Customer Success team actually reports — NPS, CSAT, CES, distributions, cohort\ncomparison, industry benchmarking, and verbatim theme mining.\n\nIntelligent microservice: every tool has a deterministic core that runs fully **offline** with no\nmodel. `themes` additionally tries an optional LLM to cluster comments into named themes and\n**silently falls back** to the keyword heuristic when no model is reachable (`mode: 'heuristic' | 'llm'`).\n\n## Tools\n\n| Tool | In → Out |\n|---|---|\n| `nps` | `{ scores }` (0-10) → Net Promoter Score, promoter/passive/detractor counts + %, average, rating band |\n| `csat` | `{ scores }` (1-5 or 1-10) → CSAT % (top-box), average, normalized 0-100 |\n| `ces` | `{ scores }` (1-5 or 1-7) → Customer Effort Score, ease %, high-effort %, interpretation |\n| `distribution` | `{ scores }` → histogram buckets + min/max/mean/median/stdDev + most common range |\n| `segment` | `{ segments }` (map or array of cohorts) → NPS per cohort, ranked, spread, weighted overall |\n| `benchmark` | `{ score, metric, industry }` → industry-band rating + gap-to-good + percentile hint |\n| `themes` | `{ verbatims }` (comments) → keyword themes, mentions, tone, sentiment tally (+ optional LLM `namedThemes`) |\n\n## Usage\n\n```js\nimport pack from './index.js';\n\npack.adapters.nps({ scores: [10, 9, 8, 7, 6, 10, 9, 3] });\n// → { nps: 25, responses: 8, promoters: 3, passives: 2, detractors: 3, ..., rating: 'good' }\n\npack.adapters.csat({ scores: [5, 4, 5, 3, 4], options: { scale: 5 } });\n// → { csat: 80, scale: 5, averageScore: 4.2, normalizedScore: 84, ... }\n\npack.adapters.segment({ segments: { enterprise: [10, 9, 9], smb: [7, 6, 5] } });\n// → ranked NPS table + spread + weightedOverallNps\n\nawait pack.adapters.themes({ verbatims: ['Support was slow and confusing', 'Love the fast UI'] });\n// → { mode: 'heuristic', themes: [...], sentiment: {...} }  (mode: 'llm' if a model is reachable)\n```\n\n## Input coercion\n\n`scores` accepts an array, a JSON string, or a comma / newline / semicolon separated string. Non-numeric\nentries are dropped. `verbatims` accepts an array or a newline-joined block. All tools validate and throw\n`TypeError` with a clear message on empty / non-numeric input.\n\n## DRY boundaries\n\n- Survey-**score** analytics only (NPS/CSAT/CES formulae + CX benchmarking). Generic descriptive\n  statistics (mean, percentile, z-score, anomaly) belong to `statistics` / `numbers` — not duplicated here.\n- The theme miner is a small self-contained CX keyword tally, **not** a general NLP engine; full\n  tokenizing / sentiment models live in `nlp`.\n- No cross-pack imports except `../_shared/llm.js`. Pure ESM, Node built-ins, zero npm deps.\n",
  "source": {
    "path": "shared/engines/adapters/domain/nps-analyzer/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 3022,
    "hash": "eff661fb9fa9387ed05091b54881aed034641764"
  },
  "urls": {
    "html": "/p/adapters/domain/nps-analyzer",
    "json": "/docs/adapters/domain/nps-analyzer.json",
    "md": "/docs/adapters/domain/nps-analyzer.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
