agentsclimarketplace

Swagger spec baseline from git

Skill kjuhwa/skills-hub/skills/workflow/swagger-spec-baseline-from-git

Self-correcting knowledge corpus for Claude Code — 9 stable shape clusters, bias-correction pipeline baked into contribution flow. 47 papers, 45 techniques, 1.1k skills.

Install
npx -y skills add kjuhwa/skills-hub --skill swagger-spec-baseline-from-git

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Re-run spec-based optimization workflow on a clean branch without running the Spring Boot app — restore prior baseline artifacts (swagger-before.json + scripts) via `git show <sha>:<path>` from the commit on another branch that already captured them.

SKILL.md

2.4 KB, as published. Nobody here has run it

Baseline spec from git instead of a running app

Phase 1 of the swagger-ai-optimization workflow normally requires running the Spring Boot app to dump /v3/api-docs. On environments without DB/secrets/ports available — or when you've switched to a clean branch where a prior optimization run already exists on another branch — you can bootstrap without the app.

When to activate

  • You're on branch B; branch A already has a commit that includes docs/swagger-before.json, docs/swagger-after.json, and scripts/*.py.
  • Branch B's current code state matches (or is close enough to) the state branch A was at when it captured swagger-before.json.
  • You cannot or do not want to boot the Spring app in this environment.

Steps

  1. Find the artifact-carrying commit:

    git log --all --oneline --grep="<ticket-id>\|Swagger"
    
  2. Restore baseline + scripts into the current tree (do NOT merge the commit — just extract files):

    mkdir -p scripts docs
    for f in scripts/measure-tokens.py scripts/prune-swagger.py scripts/verify-swagger-ai.py scripts/prompt-caching-example.py docs/swagger-before.json; do
      git show <commit-sha>:$f > $f
    done
    
  3. Verify the baseline is still representative by measuring:

    python -X utf8 scripts/measure-tokens.py docs/swagger-before.json
    
  4. Proceed with Phase 2+. After your code changes, ask the user (in their dev environment with DB/app running) to dump the new spec:

    curl http://localhost:<port>/v3/api-docs > docs/swagger-after.json
    

Caveats

  • If branch B has diverged significantly in controller/DTO code since branch A, the restored swagger-before.json is no longer the true baseline — treat it as approximate and note the divergence in the final report.
  • Don't cherry-pick the Java code changes from branch A; only the generated artifacts + scripts. You want a fresh pass on current code.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.