Invert shopify skill to validate-first, search-on-failure#8158
Merged
craigmichaelmartin merged 4 commits intoJul 22, 2026
Merged
Conversation
Flip the methodology from "search the docs first, validate last" to "attempt from knowledge, validate, and search only when validation fails." A passing validator proves recall was current, so a forced up-front search is wasted work; a failing validator is the signal that training data is stale and must be corrected from the docs, then re-validated in a loop. Validation is now the mandatory ground-truth gate; doc search is the failure-triggered remediation. The one exception is an outcome with no `shopify validate` surface (merchant onboarding guidance, App Store review analysis, UCP flows, bare doc questions), which is grounded in an up-front search since the safety net can't run. Preserves the CLI command-discovery pattern, the family table, the full --api-name valid set, the Outcome A/B validation rules, and the store-safety gotchas. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
doc fetch pulls the entire document, which is token-expensive. Prefer the ranked chunks from `shopify doc search`; only fetch a full page when it is genuinely needed verbatim and doing so is cheaper than several follow-up searches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There are exactly four `shopify validate` topics — theme, graphql, functions, and components (graphql/functions/components take --api). State this in step 2 and the family table, and run `shopify validate --help` to confirm. Reconcile the table and examples, which referenced ~10 topics that don't exist (admin, customer, checkout-extension, config, ucp, app-store-review, ...). Each family now maps to a real topic (graphql --api, functions, theme, components --api) or is marked as having no validator. Families with no validator — onboarding guidance, CLI config (use `shopify app config validate`), UCP flows, Hydrogen recipe code, App Store review — are grounded with an up-front doc search per the no-validator exception. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…' into skill-validate-first-search-fallback # Conflicts: # .agents/skills/shopify/SKILL.md
craigmichaelmartin
merged commit Jul 22, 2026
5785bad
into
feature/shopify-validate-command
9 of 25 checks passed
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/metadata.d.ts@@ -34,7 +34,7 @@ export type SensitiveSchema<T> = T extends RuntimeMetadataManager<infer _TPublic
* @returns A container for the metadata.
*/
export declare function createRuntimeMetadataContainer<TPublic extends AnyJson, TSensitive extends AnyJson = Record<string, never>>(defaultPublicMetadata?: Partial<TPublic>): RuntimeMetadataManager<TPublic, TSensitive>;
-type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_create_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_theme_'> & PickByPrefix<MonorailEventPublic, 'store_'> & PickByPrefix<MonorailEventPublic, 'env_auto_upgrade_'>;
+type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_create_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_theme_'> & PickByPrefix<MonorailEventPublic, 'cmd_validate_'> & PickByPrefix<MonorailEventPublic, 'store_'> & PickByPrefix<MonorailEventPublic, 'env_auto_upgrade_'>;
declare const coreData: RuntimeMetadataManager<CmdFieldsFromMonorail, {
commandStartOptions: {
startTime: number;
packages/cli-kit/dist/public/node/monorail.d.ts@@ -77,6 +77,11 @@ export interface Schemas {
cmd_app_validate_valid?: Optional<boolean>;
cmd_app_validate_issue_count?: Optional<number>;
cmd_app_validate_file_count?: Optional<number>;
+ cmd_validate_subcommand?: Optional<string>;
+ cmd_validate_result?: Optional<string>;
+ cmd_validate_api?: Optional<string>;
+ cmd_validate_api_version?: Optional<string>;
+ cmd_validate_json?: Optional<boolean>;
cmd_dev_tunnel_type?: Optional<string>;
cmd_dev_tunnel_custom_hash?: Optional<string>;
cmd_dev_urls_updated?: Optional<boolean>;
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Inverts the
shopifymaster skill's core methodology from search-first, validate-last to validate-first, search-only-on-failure.Stacked on top of #8142 (which introduces
.agents/skills/shopify/SKILL.md), so this PR's diff is only the methodology change. Base:feature/shopify-validate-command.Why
The old skill mandated a doc search before every task. But if the agent can produce an artifact that passes
shopify validate, its recall was already current — the up-front search was wasted work. The reliable signal that training data is stale is a failing validator. So:The new flow
shopify validate [topic]. Outcome A (a chat example) → temp-file-validate; Outcome B (files changed) → validate every touched surface. Pass ⇒ done.shopify doc search/doc fetch, correct, and loop.Edge case
Outcomes with no
shopify validatesurface (merchant-onboarding guidance, App Store review's read-only analysis, UCP flows, a bare docs question) have no validator to catch stale recall, so they are grounded with an up-front search — scoped explicitly as "the narrow exception the missing safety net demands, not a general rule."Preserved
CLI command-discovery pattern, the family table (re-captioned to map family → validate topic → on-failure doc-search scope), the full 14-name
--api-namevalid set, the Outcome A/B validation rules, and the store-safety / read-only gotchas.How it was produced
Three independent candidate rewrites (minimal-diff, loop-centered, validation-as-contract framings) were drafted and put through two adversarial reviewers each — checking for residual search-first language, faithful inversion, and coherent handling of the no-validator case. The minimal-diff candidate scored highest (no residual mandates, nothing lost, on-length); the intro was then softened to reconcile "mandatory" with the no-validator exception. Verified:
grepfinds no "search first / before producing any answer / both brackets" language remaining.🤖 Generated with Claude Code