docs: trim SKILL.md inline handlers to verification core; point to examples#56
Merged
Merged
Conversation
…amples Adds a normative rule in AGENTS.md "Content Guidelines" and the generator prompt: `SKILL.md` should carry only the verification core (algorithm + header parse + timing-safe compare, ~10-20 lines per language). The full Express/Next.js/FastAPI handler — route wiring, event dispatch, error responses — lives in `examples/`, which are CI-tested. `SKILL.md` then links to the example directories instead of duplicating their code. Why: - Two recent bug classes in this repo trace back to inline-handler drift. The Stripe SDK 15+ break (stripe.Webhook.construct_event now requiring an `object` field on the event) was caught only by the example's test suite; if the example had been duplicated into SKILL.md, the inline copy would have rotted silently. The Hookdeck CLI convention shift touched 93 files because the same command line was repeated across every skill's docs. - A pointer-only SKILL.md would force agents to load an example file for every "how do I verify X?" query, which is the most common skill query. Keeping the verification snippet inline preserves that fast-path while removing the duplicated handler that's the real drift surface. Applies the trim to the three reference skills the generator prompt explicitly tells new generations to mimic — stripe-webhooks, github-webhooks, shopify-webhooks — so the visible pattern is consistent with the spec. The remaining existing skills (~16) and the 13 currently open feat PRs (#41-#52, #55) can be swept in a follow-up if review of this pattern goes well. No lint script: a length-only threshold (e.g. "no code fence > 25 lines") is too coarse to be useful — legitimate verification cores can hit that limit while compact-but-duplicated handlers slip under. A content-match lint ("SKILL.md snippet appears verbatim in examples/*") would be a better signal, but is enough scope to defer until we see whether this spec + the generator prompt rule actually holds in practice. https://claude.ai/code/session_01NNTgQRJss1V7gyzzJ9rjnB
This was referenced May 11, 2026
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.
Summary
Trims inline handler code from the three reference
SKILL.mdfiles (stripe-webhooks,github-webhooks,shopify-webhooks) to leave only the verification core (~10-20 lines per language), with explicit pointers to the runnableexamples/for the full Express/Next.js/FastAPI handlers. Bakes the rule intoAGENTS.mdand the generator prompt so future skills follow the same pattern.Why
Two recent bug classes in this repo trace back to inline-handler drift between
SKILL.mdandexamples/:stripe.Webhook.construct_eventstarted requiring anobjectfield on event payloads. The example's CI test caught it; if the example had been mirrored intoSKILL.md, the inline copy would have rotted silently.Pure pointer-only
SKILL.md(no inline code at all) would force agents to load an example file for every "how do I verify X?" query, which is the most common skill query. Keeping the verification snippet inline preserves that fast path while removing the duplicated handler that's the real drift surface.Changes
Spec:
AGENTS.md"Content Guidelines" — adds a normative rule:SKILL.mdinline code is for the verification core only (~25 lines), point toexamples/for the full handler. Includes a worked example of the pattern.scripts/skill-generator/prompts/generate-skill.md— adds the same rule to the generator's "Important Guidelines" so new skills follow it deterministically. Also relaxes the existing "Consistency Checks" entry — the verification snippet is what must match the example, not the full handler.Reference skills (~140 lines net removed):
stripe-webhooks/SKILL.mdgithub-webhooks/SKILL.mdshopify-webhooks/SKILL.mdIn each, the "Essential Code" block (full Express + FastAPI handlers) becomes a "Verification (core)" block (HMAC compute + timing-safe compare, ~10-20 lines per language) followed by:
Scope deliberately kept narrow
SKILL.mdsnippet appears verbatim inexamples/*") would be a better signal but is enough scope to defer until we see whether this spec + the generator prompt rule holds in practice.main. The three reference skills are the ones the generator prompt explicitly tells the AI to mimic — those carry the pattern. A follow-up PR can sweep the rest once we agree the trim style reads well in review.Test plan
SKILL.mdfiles for stripe / github / shopify still answer "how do I verify a $PROVIDER webhook?" cold, without loading the examplesexamples/{express,nextjs,fastapi}/tests still pass for the three providers (no behavioral change there — only docs trimmed)https://claude.ai/code/session_01NNTgQRJss1V7gyzzJ9rjnB
Generated by Claude Code