check-sdk-wiring
Creates and verifies cross-file source contracts from handwritten SDK services to generated request builders. Use when preserving validation labels, client method wiring, HTTP methods, URL templates, headers, or idempotency behavior.
- License 许可
- Apache-2.0
- 所属仓库
- reoring/shepherd
- 最近更新
- 2026-08-18
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- check-sdk-wiring
- description
- Creates and verifies cross-file source contracts from handwritten SDK services to generated request builders. Use when preserving validation labels, client method wiring, HTTP methods, URL templates, headers, or idempotency behavior.
03 SKILL.md 正文
Check SDK Wiring
Outcome
Verify that a handwritten SDK method remains connected to the intended generated request builder and that the generated request shape preserves the declared HTTP method, path template, and critical headers.
Existing Contract Fast Path
When the user supplies an existing contract, do not begin with broad repository search.
The commands below are authoritative. Do not search for the skill, checker, or source before running the preflight.
- Run
shepherd check "$REPO" --contract "$CONTRACT" --json. - If the installed bin is unavailable in this checkout, run
node src/shepherd-cli.ts check "$REPO" --contract "$CONTRACT" --jsonfrom the repository root. - Do not invent flags such as
--context. - On PASS, use returned grounded facts and inspect only source paths needed for the requested risk review.
- On FAIL, inspect only failed facts and their bounded source paths before changing the contract.
- Treat
check-source-contractas the deterministic authority. If the user also requests an answer, hand the passing contract toquery-large-source; do not reconstruct the answer in this skill.
Use When
- A handwritten service delegates to a generated client.
- The generated file is too large to send directly to a model.
- A small set of cross-file request facts must remain aligned.
- Generated code changes frequently but the public SDK contract is stable.
Do not edit generated code to satisfy the contract. Change the owning schema/generator or intentionally update the contract after regeneration.
Workflow
- Locate the handwritten service method and its exact generated raw method call.
- Locate the generated request-builder symbol, not a broad path literal hit.
- Keep each semantic output as a separate fact.
- Use one bounded service slice for validation label and raw method.
- Use one bounded generated-builder slice for HTTP method, URL template, and headers.
- Keep the slice short enough not to include the next generated function.
- Use quoted captures for strings and
identifier-afterfor generated method names. - Finalize only after every cross-file fact is grounded.
Recommended Facts
validation-label
raw-method
http-method
url-template
idempotency-header
Extractor Patterns
Validation label:
{
"select": {"kind": "contains-all", "literals": ["requireNonEmpty(", "id)"]},
"capture": {"kind": "quoted-string", "index": 0},
"reduce": {"kind": "single", "exactCount": 1}
}
Generated raw method:
{
"select": {"kind": "contains-all", "literals": ["client.raw.", "WithBodyWithResponse("]},
"capture": {"kind": "identifier-after", "literal": "client.raw."},
"reduce": {"kind": "single", "exactCount": 1}
}
Generated request facts:
{
"select": {"kind": "contains-all", "literals": ["http.NewRequest("]},
"capture": {"kind": "quoted-string", "index": 0},
"reduce": {"kind": "single", "exactCount": 1}
}
Use separate selectors for operationPath := fmt.Sprintf( and critical Header.Set( lines.
Bounded Generated Source
Generated files often contain adjacent functions with identical request construction lines. If exactCount is unexpectedly greater than one:
- Reduce
afterto the target function body. - Add a stable scope end if available.
- Do not select the first request line from a large generated window.
Failure Policy
CARDINALITY_MISMATCHin generated source often means the slice includes the next function.SOURCE_NOT_FOUNDafter regeneration requires checking the owning API operation name.- A changed HTTP method/path/header is a public contract review, not automatic repair.
- Never encode the expected generated method/path/header value into selector literals merely to force a pass.
Acceptance
- Handwritten and generated facts are grounded separately.
- The contract contains structure but no oracle output values.
- Regeneration with an intentional API change fails until reviewed.
- Check mode performs zero model calls.
04 同仓库更多 Skills
query-large-source
Orchestrates conversational questions over large source through direct inspection tools and bounded Shepherd evidence queries.
check-source-contract
Validates a versioned source-fact contract deterministically with zero model calls. Use in local development or CI to detect extraction, grounding, finalization, answer-pattern, and source drift failures.
check-registration-inventory
Creates and verifies source contracts for plugin, controller, route, provider, or handler inventories. Use when an exact registration list, order, or cardinality is an architectural invariant checked locally or in CI.
check-generated-code
Creates bounded source contracts for important facts inside large generated files. Use when verifying request shapes, route tables, bindings, operation names, or headers without loading the full generated artifact into model context.
check-config-mappings
Creates and verifies source contracts for configuration defaults and constructor wiring. Use when checking zero-value defaults, config field assignments, timeout/retry settings, environment option mapping, or production constructor fields.
check-cli-registrations
Creates and verifies source contracts for CLI root and subcommand registrations. Use when preserving constructor wiring, source order, exact registration cardinality, or detecting command additions, removals, renames, and duplicates.