vendor-and-regen
Skill0 starsChanged 7 months agoMITArchived repositoryView on GitHub
Refresh the vendored Front OpenAPI spec from upstream and regenerate the Python client safely. Use when pulling upstream API changes, when a new endpoint is needed, or when debugging codegen drift. NEVER edit the vendored spec or generated files directly — patch scripts/vendor_spec.py instead.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- babysit-prsSkill
- new-verticalSkill
- open-prSkill
- review-prSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 74
Review the YAML diff: before regenerating. This is the load-bearing step.
- Distinctive: line 89
Note any schema changes that need hand-written follow-up: Keep a short list — you'll consult it after regen.
- Distinctive: line 92
Regenerate the client: Do not cancel.
- Very specific: line 114
Update the import in helpers/<resource>.py.
- Very specific: line 133
Upstream introduces a new codegen quirk: Add a rule to scripts/vendor_spec.py's sanitization pipeline.
- Very specific: line 160
The upstream URL changed: Update SPEC_URL in scripts/vendor_spec.py.
- Distinctive: line 164
If you patched the sanitization pipeline, mention it in the commit message so the next person hits a less surprising state.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Vendor + Regenerate the Client
Pull upstream changes from frontapp/front-api-specs, sanitize them, regenerate
the Python client, and surface anything that broke.
PURPOSE
Encode the spec-refresh workflow as a single safe motion. The pipeline has three steps with non-obvious failure modes: generation can succeed but produce broken Python, the spec diff can hide breaking changes, and hand-editing either the YAML or generated files is a footgun.
CRITICAL
- NEVER edit
docs/frontapp-openapi.yamldirectly. It's vendored output — any in-place edit is overwritten on the next refresh. If upstream introduces a quirk that breaks codegen, patch the sanitization pipeline inscripts/vendor_spec.pyinstead. - NEVER edit
frontapp_public_api_client/api/,frontapp_public_api_client/models/, orclient.py. They're regenerated output. The PreToolUse hook will block the attempt with regen instructions. uv run poe regenerate-clienttakes 1-2 minutes. Do not cancel. It appears to hang during the full-tree codegen but is processing.- Review the spec diff before regenerating. Spec changes may rename fields, remove endpoints, or shift response shapes — all of which can silently break hand-written helpers/domain code.
ASSUMES
- Working tree is clean (or you've stashed unrelated changes).
- You're on a feature branch, not
main. uv sync --all-extrashas run recently.- Upstream URL still points at
frontapp/front-api-specs→core-api/core-api.json(checkscripts/vendor_spec.pyif the user says it moved).
STANDARD PATH
- Refresh the vendored spec.
This downloads, sanitizes (path-param examples, binary downloads,uv run python scripts/vendor_spec.pyPROPERTY_DEFAULTS_TO_STRIP, Unicode confusables), and writesdocs/frontapp-openapi.yaml. - Review the YAML diff before regenerating. This is the load-bearing step.
(Pipe throughgit diff docs/frontapp-openapi.yamllessif the diff is large and your terminal supports it.) Look specifically for:- Removed paths — any hand-written helper that imports from that
api/<tag>/<module>.pywill break on regen. - Renamed schema components —
ConversationResponse→ something else means everyunwrap_as(response, ConversationResponse)call breaks. - Field type changes — e.g.
created_at: integer→created_at: stringwould break the epoch-second converter in the domain projection. - New required fields on request bodies — generated function signatures gain a positional arg, breaking existing callers.
- Removed paths — any hand-written helper that imports from that
- Note any schema changes that need hand-written follow-up. Keep a short list — you'll consult it after regen.
- Regenerate the client. Do not cancel.
Or, equivalently,uv run poe regenerate-clientuv run poe regenerate-allruns vendor-spec → regenerate → facts in one shot. - Regenerate the API facts index.
This rewritesuv run poe factsdocs/api-facts.yamlfrom the new generated tree. Skipping this step will leave the agent-facing fact index stale; CI'sfacts-checkwill catch it and fail. Always commitdocs/api-facts.yamlalongside the regenerated client — they are a single logical change. - Run agent-check to surface new errors.
Common fallout from a spec refresh:uv run poe agent-check- ImportError in helpers — a generated module was renamed or removed.
Update the import in
helpers/<resource>.py. - Type errors in domain projections — a field's type changed; update the Pydantic model and any converter.
- Test failures asserting old shapes — update the test fixture, do not update the test to match the broken behavior.
- ImportError in helpers — a generated module was renamed or removed.
Update the import in
- Fix at the source. No
noqa, notype: ignore, no skipped tests. If the upstream change is genuinely incompatible, raise it with the user before working around it. - Commit generated files separately from hand-written fixes. Two commits:
one labeled e.g.
chore(spec): refresh vendored OpenAPI spec(carryingdocs/frontapp-openapi.yaml, the regeneratedapi//models//client.py, AND the regenerateddocs/api-facts.yaml), one labeledfix(client): adapt helpers to <renamed-thing>. This keeps blame readable when someone bisects a future regression.
EDGE CASES
- Upstream introduces a new codegen quirk. Add a rule to
scripts/vendor_spec.py's sanitization pipeline. Examples already encoded:PATHS_TO_STRIP(binary downloads),PROPERTY_DEFAULTS_TO_STRIP(allOf inheritance defaults likeCreateDraft.mode), Unicode confusables. Do not hand-editdocs/frontapp-openapi.yaml. - New endpoint added with leading-underscore response field. openapi-python-client
renames
_resultstofield_results, etc. When wiring a helper, verify with thedomain-advisoragent or by reading the generatedapi/<tag>/list_*.pybefore assuming the field name. - Generated module name has an
_a_infix orremoves_prefix. Spec summaries that begin with "Update a …" / "Removes …" produceupdate_a_contact,removes_inbox_access, etc. Alwaysls frontapp_public_api_client/api/<tag>/before writing the import. agent-checktypecheck fails onapi/ormodels/files. Those paths are deliberately excluded fromtypecheck(see CLAUDE.md → "typecheck skips generated code deliberately"). Ifagent-checkis failing there, something about the typecheck configuration orpyproject.toml's task path list has drifted — investigate the config, not the generated files.- Generated test fixtures break. Tests should mock the httpx transport, not the helper methods, so they exercise the full unwrap path. If a test is asserting on a generated attrs model field that was renamed, update the fixture; do not pin to the old name.
- The upstream URL changed. Update
SPEC_URLinscripts/vendor_spec.py.
After
- If you patched the sanitization pipeline, mention it in the commit message so the next person hits a less surprising state.
- Open a PR with
/open-pr. Reviewers should sanity-check the YAML diff in isolation from the regenerated tree.
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.

