widget-coherence

widget-coherence is a skill for Claude Code from serac-labs/serac. It costs 41 tokens per session (1,067 once invoked), scanned A, original, Apache-2.0.

A development guide for ServiceNow Service Portal widgets, which are small web components with server code, browser code, and an HTML template. It explains how these three parts share data and actions using Angular.

In plain words
What is it for?
Use it to build or check widget data initialization, button actions, server requests, controller methods, and Angular bindings.
Why use it?
It helps prevent widgets from breaking when the template expects missing data, buttons call missing methods, or client requests do not match server handlers.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the servicenow plugin — 70 skills shipped together

Good fit Use it to build or check widget data initialization, button actions, server requests, controller methods, and Angular bindings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/serac-labs/serac/widget-coherence
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add serac-labs/serac --skill widget-coherence
Clone the repo
git clone --depth 1 https://github.com/serac-labs/serac

Made for: Claude Code.

Or install servicenow, the plugin that ships this one along with the rest of its 70 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for widget-coherence

README.md
[![agentmods](https://agentmods.dev/badge/skills/serac-labs/serac/widget-coherence/github.svg)](https://agentmods.dev/skills/serac-labs/serac/widget-coherence)
Your own site
<a href="https://agentmods.dev/skills/serac-labs/serac/widget-coherence"><img src="https://agentmods.dev/badge/skills/serac-labs/serac/widget-coherence/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for widget-coherence

Your own site · 80×15
<a href="https://agentmods.dev/skills/serac-labs/serac/widget-coherence"><img src="https://agentmods.dev/badge/skills/serac-labs/serac/widget-coherence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,067 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01067
Opus 5 $0.00020 $0.00534
Sonnet 5 $0.00008 $0.00213
Haiku 4.5 $0.00004 $0.00107

Measured today against content hash b461dd9996fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

widget-coherence scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/skills/widget-coherence/SKILL.md · 173 lines

How it starts

The opening of the file, as written. The whole thing — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Widget Coherence for ServiceNow Service Portal

Service Portal widgets MUST have perfect communication between Server Script, Client Controller, and HTML Template. This is not optional - widgets fail when these components don't talk to each other correctly.

The Three-Way Contract

Every widget requires synchronized communication:

1. Server Script Must:

  • Initialize ALL data.* properties that HTML will reference
  • Handle EVERY input.action that client sends via c.server.get()
  • Return data in the format the client expects

2. Client Controller Must:

  • Implement EVERY method called by ng-click in HTML
  • Use c.server.get({action: 'name'}) for server communication
  • Update c.data when server responds

3. HTML Template Must:

  • Only reference data.* properties that server provides
  • Only call methods defined in client controller
  • Use correct Angular directives and bindings

Data Flow Patterns

Server → Client → HTML

// SERVER SCRIPT
;(function () {
  data.incidents = []
  data.loading = true

  var gr = new GlideRecord("incident")
  gr.addQuery("active", true)
  gr.setLimit(10)
  gr.query()

  while (gr.next()) {
    data.incidents.push({
      sys_id: gr.getUniqueValue(),
      number: gr.getValue("number"),
      short_description: gr.getValue("short_description"),
    })
  }
  data.loading = false
})()
// CLIENT CONTROLLER
api.controller = function ($scope) {
  var c = this

  c.selectIncident = function (incident) {
    c.selectedIncident = incident
  }
}
<!-- HTML TEMPLATE -->
<div ng-if="data.loading">Loading...</div>
<div ng-if="!data.loading">
  <div ng-repeat="incident in data.incidents" ng-click="c.selectIncident(incident)">
    {{incident.number}}: {{incident.short_description}}
  </div>
</div>

Client → Server (Actions)

// CLIENT CONTROLLER
c.saveIncident = function () {
  c.server
    .get({
      action: "save_incident",
      incident_data: c.formData,
    })
    .then(function (response) {
      if (response.data.success) {
        c.data.message = "Saved successfully"
      }
    })
}

Read the full file on GitHub · 173 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 173 lines · 41 tokens per session scan A b461dd9996fc

Subscribe to this mod's changes

widget-coherence is a skill published in the GitHub repository serac-labs/serac (78 stars, last pushed yesterday), licensed Apache-2.0. It adds 41 tokens to every session and 1,067 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-11.

Related

Other skills, from other repositories