claudinho / rules
Cursor rule30 starsChanged 56 days agoMITView on GitHub
Bundle, bracket, and live-data invariants before opening a PR
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/change-discipline.mdcCursor rule
- .cursor/rules/release-discipline.mdcCursor rule
- .cursor/rules/surface-parity.mdcCursor rule
- .cursor/rules/trust-boundary.mdcCursor rule
The file
We split this bundle-bracket-pr.mdc into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Before marking a data-heavy feature merge-ready, run pnpm -r build && pnpm -r typecheck && pnpm -r test && pnpm lint (mirror CI — build …
- Very specific: line 20
Test degraded getBracket() on the bundle: seed/winner slots stay tbd, never confirmed.
- Very specific: line 25
Always test FT draw + winnerCode — routine in knockouts.
- Very specific: line 35
Keep the disagreeing-feeder P1 GUARD in packages/core/test/bracket-resolve.test.ts green, and cover the feeder fallback when the target …
- Very specific: line 40
When knockout fetch fails but standings succeed: set source from standings provider.
- Very specific: line 47
After pnpm -r build, run pnpm release:qa (scripts/release-qa.sh).
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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
---
description: Bundle, bracket, and live-data invariants before opening a PR
globs: packages/core/**/*
alwaysApply: false
---
# Bundle & bracket PR readiness
Before marking a data-heavy feature merge-ready, run **`pnpm -r build && pnpm -r typecheck && pnpm -r test && pnpm lint`** (mirror CI — build first because cli/mcp import `@claudinho/core` from dist; `build` alone does not typecheck).
## Bundled schedule invariant
`schedule.*.json` is a **resultless skeleton**: no scores/status, no confirmed nations in knockout slots.
- `sanitizeBundledFixture` must restore topology placeholders for KO home/away.
- `gen:schedule` must **fail** if any knockout fixture carries a real nation flag, and at once,
writing nothing, on a window that failed, carried no account, was not whole, or stated another
season (or none), and on a fixture served by two windows; its expected counts are named facts (`GROUPS`, `TEAMS_PER_GROUP`) and core's
`EXPECTED_KNOCKOUT_COUNTS`, never literals or this run's own topology.
- Test degraded `getBracket()` on the bundle: seed/winner slots stay `tbd`, never `confirmed`.
## Knockout resolution
- Advance winners from **score OR `winnerCode`** (ESPN `competitor.winner` for penalties).
- Always test FT draw + `winnerCode` — routine in knockouts.
- Group slots project from live standings once **≥1 match played** (`hasGroupStarted`); **`confirmed`** when every team has played a full round-robin (`played >= n - 1` for `n` teams); **`(proj.)`** only mid-group. TBD at 0 games or when standings are degraded.
## Topology indexing
- Assign each bundled match's 1-based index within its stage by ascending numeric ESPN event id
(`orderByBracketIndex` in `packages/core/src/bracket/build.ts`), never by kickoff sort order.
- **The live fixture's pairing wins.** ESPN's bundled placeholder winner/loser refs do not
reliably describe its actual feeder assignment. Use the participant served for that fixture;
project from a bundled feeder ref only when the target fixture is absent from the merged set.
- Keep the disagreeing-feeder `P1 GUARD` in `packages/core/test/bracket-resolve.test.ts` green,
and cover the feeder fallback when the target fixture is absent. See `AGENTS.md` → Conventions.
## Live hybrid paths
- When knockout fetch fails but standings succeed: set `source` from standings provider.
- Share/MCP: inner `formatBracketList({ footer: false })`, outer layer adds attribution/notices **once**.
- CLI/MCP wrappers: option types must match the formatter (`ShareBracketOptions`, not `ShareSnippetOptions`).
- **Surface parity:** see `.cursor/rules/surface-parity.mdc` — every bracket formatter path passes `tz` + `locale`; statusline knockouts indirect-resolve via cached `getKnockoutFixtures` (hot path fail-closed).
## Pre-merge QA
After `pnpm -r build`, run **`pnpm release:qa`** (`scripts/release-qa.sh`). Eyeball every section; tripwires at the end encode the 0.8.x bracket regressions (calendar month, tz threading, share disclaimer).
## Adversarial tests (add when touching bracket/schedule)
| Scenario | Assert |
|----------|--------|
| FT level + `winnerCode` | Winner advances |
| `fetchWindow` throws, standings OK | Projected groups + `source` set |
| Bundle-only bracket | No real flags in R32+ slots |
| Group at 0 games played | Slots stay `tbd`, no `(proj.)` |
| Group at 2/3 played, standings live | Leaders show flags + `(proj.)` |
| Group fully played (round-robin complete) | Winner + runner-up `confirmed`, no `(proj.)` |
| `toolGetBracket` `tz: UTC` vs `America/Mexico_City` | Calendar date/time differs on cross-midnight kickoff |
| Knockout kickoffs span >1 week | Output includes month + day (not weekday-only) |
| `formatShareBracket` social + compact | Same date format as CLI list |
| `formatShareBracket` / `toolGetBracket` | Each disclaimer line once |
| Statusline knockout countdown (cached fixtures) | Real nations or `⚽ —`; never `🏳️` |
| Statusline stale cache during live KO | `live · syncing…` without `🏳️`; resolved pairing when cache has it |
| Empty fixtures cache at phase boundary | Re-polls after short TTL (~60s), not 15min |
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.

