Skip to content

feat(instantsearch): add Source-of-truth check workflow step (1/4)#22

Open
vascobettencourt wants to merge 2 commits into
mainfrom
feat/instantsearch-source-of-truth
Open

feat(instantsearch): add Source-of-truth check workflow step (1/4)#22
vascobettencourt wants to merge 2 commits into
mainfrom
feat/instantsearch-source-of-truth

Conversation

@vascobettencourt
Copy link
Copy Markdown
Member

@vascobettencourt vascobettencourt commented May 18, 2026

What does this skill do?

Foundation PR splitting up the InstantSearch skill expansion. Adds the Source-of-truth check as a mandatory new workflow step (between Discover and Build) that requires the agent to (1) read installed .d.ts types, (2) fetch live Algolia docs at canonical URLs, and (3) grep installed CSS for class names — before writing any code not covered by a baked pattern. This single workflow change closes the long tail of training-data drift (renderState shapes, future.* flags, recently shipped widgets, helper APIs) without baking every prop into the skill.

This is part 1 of 4. PRs 2, 3, 4 stack on this one.

Stack

  • PR 1 (this one): Source-of-truth workflow + cross-cutting React doc updates
  • PR 2: React search results page pattern (stacks on this) → #TBD
  • PR 3: React custom widgets, middleware, SSR (stacks on this) → #TBD
  • PR 4: Vue + JS phase-2 stubs + version bump 1.1 (stacks on this) → #TBD

What's in this PR

  • New references/react/source-of-truth.md with concrete .d.ts paths and doc URL patterns.
  • SKILL.md workflow restructured: insert Source-of-truth as Step 2, renumber Build/Style/Review.
  • references/react/technology-rules.md: add the source-of-truth rule, future.* flag rule, SSR-by-framework rule, middleware rule, and three new "Never" rules (no rebuild-via-hooks, no guessed renderState, no legacy fallbacks).
  • references/react/anti-patterns.md: rebuild-via-hooks, guessed prop shapes, custom widget when widget+classNames suffices, middleware-overlap-with-routing, App-Router-doubling-with-getServerState, training-data future flags.
  • references/react/glossary.md: renderState, middleware, getServerState/SSR provider, virtual widget, dynamic widgets, future flags, InstantSearch instance, Insights.
  • evals/evals.json: adds eval 10 (future.* flags lookup) — the cleanest test that the new workflow fires.

Checklist

  • python3 scripts/validate_skills.py . passes (31/31)
  • Skill description under 1024 chars (602/1024) and includes WHEN / WHEN NOT
  • evals/evals.json exists with 6 prompts (5 original + eval 10)
  • Skill is self-contained — no ../other-skill/ references
  • Registered in .claude-plugin/marketplace.json (new skills only) — N/A, already registered
  • Goes in skills/

Behavioral test

Eval 10 was exercised against this PR's content via a fresh subagent. The agent refused to name future.* flags from training-data recall, named the exact .d.ts paths and the upgrade-guide URL, and asked for permission to do the lookup or for the type chunk to be pasted — exactly the behavior the workflow change was designed to produce. 5/5 expectations met.

Inserts a mandatory Source-of-truth check between Discover and Build that
requires reading installed types, fetching live Algolia docs, and grepping
installed CSS before writing any code not covered by a baked pattern. This
closes the long tail of training-data drift (renderState shapes, future.*
flags, recently shipped widgets) without baking every prop into the skill.

Adds references/react/source-of-truth.md with concrete .d.ts paths and doc
URL patterns. Updates technology-rules, anti-patterns, and glossary with
the matching rules and terms (renderState, middleware, SSR, virtual/dynamic
widgets, future flags, InstantSearch instance). Adds eval 10 to exercise
the new workflow on future-flag setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread skills/instantsearch/references/react/technology-rules.md Outdated
Comment thread skills/instantsearch/references/react/technology-rules.md Outdated
Comment thread skills/instantsearch/references/react/technology-rules.md Outdated
Comment thread skills/instantsearch/references/react/technology-rules.md Outdated
Comment thread skills/instantsearch/references/react/source-of-truth.md Outdated
Comment thread skills/instantsearch/references/react/source-of-truth.md Outdated
- source-of-truth.md: append `.md` to canonical Algolia doc URLs so
  agents fetch markdown (no HTML chrome). Replace the duplicated CSS
  grep section with a one-liner pointing to styling.md.
- technology-rules.md: append `.md` to the Upgrade-guides link. Fold
  all Next.js / SSR guidance into the v7 import rule (App Router,
  Pages Router, Remix/SSR, CSR-only). Drop the legacy-libraries rule
  (overlaps with v6 rule and autocomplete/anti-patterns.md). Drop the
  middleware rule and the `[custom-widgets.md]` cross-ref (those land
  with PR 3 alongside the dedicated reference files).
- anti-patterns.md: drop the SSR-doubling and middleware-specific
  entries; they belong with PR 3 alongside ssr.md / middleware.md.
- glossary.md: keep the new terms but drop the cross-reference links
  to middleware.md / ssr.md (added back in PR 3).

Net effect: PR 1 is now self-contained — all internal links resolve
on this branch alone — and stops restating rules that already live
in autocomplete/anti-patterns.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vascobettencourt
Copy link
Copy Markdown
Member Author

vascobettencourt commented May 18, 2026

Thanks for the review @sarahdayan! Pushed 8eb583d addressing all six comments. The stacked PRs (#23, #24, #25) are rebased onto the new head.

@Haroenv Haroenv removed their request for review May 18, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants