divine-mobile: Skill for Claude Code

.agents/skills/denormalized-priority-column-staleness/SKILL.md

denormalized-priority-column-staleness is a skill for Claude Code, Codex from divinevideo/divine-mobile. It costs 137 tokens per session (1,186 once invoked), scanned A, original, MPL-2.0.

A guide to correcting priority order when a database stores copied totals or counts for faster sorting. These copied values are called denormalized columns.

In plain words
What is it for?
It helps find stale aggregate values, calculate totals from source data when needed, and backfill or update the stored columns.
Why use it?
The copied totals can be missing or out of date, so sorting by them processes records in the wrong order.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents).

This is divinevideo/divine-mobile's own configuration. It tells Claude Code and Codex how to work on divine-mobile itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything divine-mobile configures →

Reuse

Borrowing it

Nothing to install: this file belongs to divinevideo/divine-mobile. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/divinevideo/divine-mobile/main/.agents/skills/denormalized-priority-column-staleness/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/divinevideo/divine-mobile

Made for: Claude Code, Codex.

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 denormalized-priority-column-staleness

README.md
[![agentmods](https://agentmods.dev/badge/skills/divinevideo/divine-mobile/denormalized-priority-column-staleness/github.svg)](https://agentmods.dev/skills/divinevideo/divine-mobile/denormalized-priority-column-staleness)
Your own site
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/denormalized-priority-column-staleness"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/denormalized-priority-column-staleness/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 denormalized-priority-column-staleness

Your own site · 80×15
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/denormalized-priority-column-staleness"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/denormalized-priority-column-staleness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,186 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00137 $0.01186
Opus 5 $0.00068 $0.00593
Sonnet 5 $0.00027 $0.00237
Haiku 4.5 $0.00014 $0.00119

Measured 11d ago against content hash 156d5b8baf66, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

denormalized-priority-column-staleness 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 11d ago.

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.

.agents/skills/denormalized-priority-column-staleness/SKILL.md · 147 lines

How it starts

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

Denormalized Priority Column Staleness

Problem

When ordering records by denormalized aggregate columns (like total_loops, vine_count, order_count), the query returns items in the wrong priority order because the denormalized values are stale, unpopulated, or incorrect.

Context / Trigger Conditions

  • A batch job processes items in unexpected order
  • Top items (by some aggregate metric) are processed last or skipped
  • ORDER BY aggregate_column DESC doesn't return expected results
  • Aggregate columns show 0 or NULL for records that should have high values
  • Only a subset of records have the aggregate column populated
  • Backfill scripts may have run for some records but not others

Root Cause

Denormalized columns (copies of aggregated data stored for query performance) can become stale when:

  1. Initial data migration didn't populate them
  2. Backfill scripts only ran for some records
  3. New source records were added without updating the denormalized column
  4. The aggregation logic changed but the column wasn't recalculated

Solution

Option 1: Compute at Query Time (Immediate Fix)

Join with the source table to compute actual aggregates:

-- BEFORE (broken): Uses potentially stale denormalized column
SELECT user_id, username
FROM users
WHERE status = 'pending'
ORDER BY total_loops DESC NULLS LAST;

-- AFTER (fixed): Computes actual aggregate from source
SELECT u.user_id, u.username,
       COALESCE(SUM(vm.loops), 0) as actual_total_loops
FROM users u
LEFT JOIN vine_metadata vm ON u.user_id = vm.user_id
WHERE u.status = 'pending'
GROUP BY u.user_id, u.username
ORDER BY actual_total_loops DESC;

Option 2: Backfill the Denormalized Column (Permanent Fix)

Update the denormalized column from the source data:

UPDATE users u
SET total_loops = subq.actual_loops
FROM (
    SELECT user_id, COALESCE(SUM(loops), 0) as actual_loops
    FROM vine_metadata
    GROUP BY user_id
) subq
WHERE u.user_id = subq.user_id;

Option 3: Use Materialized Views (Best of Both)

Create a materialized view for the aggregates:

Read the full file on GitHub · 147 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. 11d ago First seen · 147 lines · 137 tokens per session scan A 156d5b8baf66

Subscribe to this mod's changes

denormalized-priority-column-staleness is a skill published in the GitHub repository divinevideo/divine-mobile (265 stars, last pushed today), licensed MPL-2.0. It adds 137 tokens to every session and 1,186 once invoked, about $0.0007 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-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens