con un clic
documentation-robotics-viewer-api-sync
Sync OpenAPI specs and generate TypeScript types
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Sync OpenAPI specs and generate TypeScript types
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Start Storybook server and list available stories
Display architectural overview and critical file locations
Run Vite build and check bundle size
Build Docker image and run deployment checks
Show coding patterns for React Flow nodes, Zustand, and Tailwind
Run Playwright tests and Storybook validation
| name | documentation_robotics_viewer-api-sync |
| description | Sync OpenAPI specs and generate TypeScript types |
| user_invocable | true |
| args | null |
| generated | true |
| generation_timestamp | "2026-02-23T16:10:03.055Z" |
| generation_version | 2.0 |
| source_project | documentation_robotics_viewer |
| source_codebase_hash | 00a2f9723e9a7f64 |
Quick-reference skill for documentation_robotics_viewer - syncs OpenAPI specs from DR CLI server and generates TypeScript types.
/documentation_robotics_viewer-api-sync
Synchronize OpenAPI specifications from the Documentation Robotics CLI server (REST API endpoints) and generate TypeScript type definitions for:
/api/model, /api/validate, /api/changeset/*, etc.)This ensures type safety across the src/apps/embedded/services/ integration layer and src/core/types/ model definitions.
# Ensure DR CLI server is running (default: http://localhost:3090)
curl http://localhost:3090/api/openapi.json -o openapi.json
# Or use the WebSocket endpoint for real-time schema
# ws://localhost:3090/ws (JSON-RPC 2.0)
# Using openapi-typescript (if installed)
npx openapi-typescript openapi.json -o src/core/types/generated/dr-cli-api.ts
# Or using custom type generation script
npm run types:generate
# Run TypeScript compiler to check for type errors
npx tsc --noEmit
# Run type-related tests
npm test -- tests/unit/types
Update imports in integration files:
src/apps/embedded/services/apiClient.ts - REST API client typessrc/apps/embedded/services/websocketClient.ts - WebSocket message typessrc/core/types/model.ts - Core model element typessrc/core/stores/modelStore.ts - Store state typessrc/core/types/model.ts - Core MetaModel types (Element, Relationship, Layer)src/core/types/reactflow.ts - React Flow node data interfaces (extends BaseNodeData)src/apps/embedded/services/apiClient.ts - DR CLI REST clientsrc/apps/embedded/services/websocketClient.ts - DR CLI WebSocket clientsrc/apps/embedded/stores/authStore.ts - Authentication state types# 1. Start DR CLI server (in separate terminal)
dr-cli serve --port 3090
# 2. Run the skill
/documentation_robotics_viewer-api-sync
# 3. Verify types compile
npx tsc --noEmit
# 4. Run integration tests
npm test -- tests/integration/api
When the DR CLI server adds new endpoints (e.g., /api/security/analyze):
# 1. Update OpenAPI spec
curl http://localhost:3090/api/openapi.json -o openapi.json
# 2. Regenerate types
/documentation_robotics_viewer-api-sync
# 3. Update consuming code
# Edit src/apps/embedded/services/apiClient.ts to use new types
# 4. Add tests for new endpoint
# Create tests/integration/api/security-analyze.spec.ts
After regenerating types, use them in WebSocket handlers:
// src/apps/embedded/services/websocketClient.ts
import type { ModelUpdateNotification, ValidationEvent } from '@/core/types/generated/dr-cli-api';
// Now fully type-safe
socket.on('model.updated', (msg: ModelUpdateNotification) => {
modelStore.getState().updateElement(msg.elementId, msg.changes);
});
documentation/DR_CLI_INTEGRATION_GUIDE.md (400+ lines)documentation/WEBSOCKET_JSONRPC_IMPLEMENTATION.mdsrc/core/types/model.ts, src/core/types/reactflow.tssrc/apps/embedded/services/apiClient.tsCheck:
curl http://localhost:3090/health)jq . openapi.json)Solution:
src/core/types/model.ts for manual type definitionssrc/core/types/generated/Solution:
# Update test fixtures with new types
npm test -- tests/fixtures/
# Regenerate mock data
npm run test:fixtures:update
This skill was automatically generated for the documentation_robotics_viewer project (TypeScript 5.9.3, React 19.2.0, @xyflow/react 12.9.3).