adding-today-highlights
Skill727 starsChanged yesterdayMITView on GitHub
Add a "For you today" highlight source, the rule that turns a product's facts into items on the Today home page (firing alerts, flags that lose reach, ticket SLA breaches, workflow failures). Use when asked to "add a Today highlight", "show X in For you today", "surface X on the home page", or when changing an existing source's query, thresholds, copy or icon. Covers where the rule and its declaration live, the Today facade contract, scopes, caching, ranking inputs, tests, tach, and the frontend icon.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Write the rule in the product's internals, for example products/<x>/backend/today_highlights.py, or a package of that name when the product …
- Distinctive: line 19
Read the facts through the product's own code.
- Very specific: line 32
Add "products.today" to the product's depends_on in the root tach.toml, with a # Facade-only: comment like the other products have.
- Very specific: line 33
Test the rule in the product with products.today.backend.facade.testing.highlight_context.
- Distinctive: line 42
Import only from Today's facade:
- Distinctive: line 71
Only Today's own pulse tiles can be pinned.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Adding a Today highlight source
Today ranks facts that other products find and shows the best few in "For you today". The product that owns the data owns its source: the query, the thresholds, and the copy. Today owns the contract, the ranking, the shared helpers, and its own pulse (routine and key-metric tiles, pinned numbers, home dashboard).
A source lives in its own product, never in products/today/.
Today has no list of sources to edit. It finds each product's declaration by module name.
Steps
- Write the rule in the product's internals, for example
products/<x>/backend/today_highlights.py, or a package of that name when the product has several sources. The rule takes aHighlightContextand returnsHighlightFindings. Read the facts through the product's own code. Read other products only through their facades. Declare it in
products/<x>/backend/facade/today_highlights.py:"""<Product>'s sources for the "For you today" list. Today finds this module by name.""" from products.today.backend.facade.contracts import HighlightSource from ..today_highlights import find_stale_things HIGHLIGHT_SOURCES = (HighlightSource(name="stale_things", find=find_stale_things, scopes=("thing:read",)),)- Add
"products.today"to the product'sdepends_onin the roottach.toml, with a# Facade-only:comment like the other products have. Today gets no new dependency. - Test the rule in the product with
products.today.backend.facade.testing.highlight_context.products/alerts/backend/tests/test_alert_today_highlights.pyis a short example. A test folder without__init__.pyneeds a product-specific file name, so pytest does not collide ontest_today_highlights.py. - The row icon comes from the product. If
PRODUCT_ICONSinfrontend/src/scenes/project-homepage/today/todayRowIcons.tsxhas no entry for the product yet, add one. That file is Today's, so team-surfaces reviews it.
products/feature_flags/backend/today_highlights.py is a complete source with a reach drop and a cleanup item.
Contract
Import only from Today's facade:
facade/contracts.py:HighlightCandidate,HighlightFindings,HighlightContext,HighlightSource,HighlightMetric,DailyValueNotReadyfacade/enums.py:HighlightLabel,HighlightUnit,HighlightIntervalfacade/highlight_helpers.py: number and text formatting,uses_product, and trend detection
Rules that are easy to get wrong:
- The source name is a stable key. Today stores results and analytics under it, so a rename breaks them. The registry raises when two products use the same name.
scopeslists the API scopes the viewer needs. Today skips the source when the viewer's scopes or access controls do not cover them.context.daily(name, compute)caches one value per team, property restrictions and day, and every viewer with the same restrictions shares it. Never compute a per-viewer value there. Prefixnamewith the source name.context.guard(name, provider, default)records a failure and returns the default instead of failing the whole list. Use it around each call that can fail on its own.- Raise
DailyValueNotReadywhen a value the source needs is still computing. Today retries the source soon.
Ranking inputs
Each HighlightCandidate carries what Today ranks on:
label:riskwhen something got worse or broke,opportunitywhen the person can act to gain.importancefrom 0 to 1, andrelevancefrom 0 to 1 for how much this viewer cares. Compare with existing sources before you pick a number: suspended email sending is 0.95, a firing alert 0.85, a flag that lost reach 0.6, a cleanup suggestion 0.3.family: Today shows at most two items of one family.ref: items of different families that share a ref are about the same object, so Today shows one of them.key: stable for the same fact on the same day, for exampleflag_reach_drop:<id>.
Copy follows /writing-user-facing-copy: one sentence with numbers in title, the comparison and the next action in detail.
Limits
- A row looks the same for every source. A source that needs its own row or preview still needs a change in Today's frontend.
- Only Today's own pulse tiles can be pinned.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- hog/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- .cursor/rules/django-python.mdcCursor rule
- .cursor/rules/react-typescript.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- adding-activity-loggingSkill
- adding-api-scopesSkill
- adding-inbound-webhooksSkill
- adding-inbox-sourcesSkill
- adding-ingestion-warningsSkill
- adding-mcp-store-serversSkill
- adding-personhog-rpcSkill
- adding-product-alertingSkill
- adding-project-secret-api-key-authSkill
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- analyzing-insights-across-teamsSkill
- announcing-behavior-changesSkill
- auditing-llm-gateway-paritySkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- building-product-empty-statesSkill
- building-the-toolbarSkill
- clickhouse-migrationsSkill
- debugging-ci-failuresSkill
- debugging-local-replaySkill
- debugging-local-task-agent-runsSkill
- debugging-mcp-analyticsSkill
- debugging-signals-pipelineSkill
- debugging-table-access-deniedSkill
- depot-ciSkill
- depot-container-buildsSkill
- depot-github-runnersSkill
- developing-subscriptionsSkill
- django-migrationsSkill
- django-startup-timeSkill
- documenting-warehouse-sourcesSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- finding-llm-gateway-migration-candidatesSkill
- fixing-flaky-testsSkill
- formatting-slack-messagesSkill
- gating-production-deploysSkill
- gating-sensitive-actionsSkill
- generating-clickhouse-query-performance-reportsSkill
- hogliSkill
- implementing-mcp-toolsSkill
- implementing-mcp-ui-appsSkill
- implementing-warehouse-sourcesSkill
- improving-drf-endpointsSkill
- improving-mcp-toolsSkill
- ingestion-pipeline-doctor-nodejsSkill
- instrumenting-first-party-metricsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

