jmservera/aithena/api-contract-alignment

Claude Code and agent skill by jmservera/aithena

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Keep frontend/backend API contracts in sync to prevent path mismatches

Install

npx vskill@latest install jmservera/aithena/api-contract-alignment

SKILL.md

The same SKILL.md was published earlier as jmservera/aithena/api-contract-alignment.

Context

Use when adding or modifying API endpoints in solr-search/ or consuming them in aithena-ui/. The /v1/search/ vs /search mismatch cost multiple debugging sessions.

Patterns

1. Single source of truth for API paths

The backend (solr-search/main.py) defines canonical routes. The frontend must derive paths from the same prefix constant.

Backend convention:

python
API_PREFIX = "/v1"
app.include_router(router, prefix=API_PREFIX)

Frontend convention (`aithena-ui/src/api.ts`):

typescript
const API_PREFIX = "/v1";
export const searchUrl = (params: string) => `${baseUrl}${API_PREFIX}/search/?${params}`;
2. Verify contract on both sides after changes

After changing any API route:

bash
# Backend: confirm routes
cd solr-search && python3 -c "from main import app; print([r.path for r in app.routes])"
# Frontend: search for API calls
grep -rn '/v1/' aithena-ui/src/
3. Use the nginx proxy as the integration point

In production, nginx proxies /v1/ to solr-search:8080. In dev, Vite proxies /v1 to http://localhost:8080. Both must agree on the prefix.

Vite proxy (`vite.config.ts`):

typescript
proxy: {
'/v1': { target: 'http://localhost:8080' },
'/documents': { target: 'http://localhost:8080' }
}
4. API versioning discipline
  • All public endpoints live under /v1/
  • Health and info endpoints: /v1/health, /v1/info
  • Search endpoints: /v1/search/, /v1/facets/
  • Document endpoints: /v1/documents/{token}
  • Never expose unversioned public routes

Anti-Patterns

  • Don't hardcode full URLs in frontend components — use the shared api.ts module
  • Don't add backend routes without the version prefix — breaks nginx and Vite proxy rules
  • Don't change route paths without grep-checking both frontend and backend
  • Don't rely on `VITE_API_URL` env var alone — it broke in production when set to "."

References

  • solr-search/main.py — backend routes
  • aithena-ui/src/api.ts — frontend URL builder
  • aithena-ui/vite.config.ts — dev proxy config
  • nginx/ — production proxy config

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
Repository forks
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jmservera/aithena/api-contract-alignment/badge)](https://verified-skill.com/skills/jmservera/aithena/api-contract-alignment)

Something wrong with this skill or its page? Tell us.