Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill covers patterns for fetching and managing API data. Trigger: When working with API interactions in the frontend.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -50% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -27% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -57% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -56% | 0% |
<!-- L1:START -->
This skill covers patterns for fetching and managing API data.
Trigger: When working with API interactions in the frontend. <!-- L1:END -->
<!-- L2:START -->
| Task | Pattern | |------|---------| | Fetch API data | fetchApi | | Start a generation process | startGeneration |
fetchApi to retrieve data from the API.startGeneration to initiate a data generation process.<!-- L2:END -->
<!-- L3:START -->
Use fetchApi to retrieve data from the API, handling errors with ApiError.
typescriptimport { fetchApi, ApiError } from './lib/api'; async function getData() { try { const data = await fetchApi('/endpoint'); console.log(data); } catch (error) { if (error instanceof ApiError) { console.error('API Error:', error.message); } } }
Utilize startGeneration to initiate a data generation process, allowing for real-time updates.
typescriptimport { startGeneration } from './lib/api'; function initiateGeneration() { startGeneration({ type: 'example' }) .then(response => console.log('Generation started:', response)) .catch(error => console.error('Error starting generation:', error)); }
bashdocker-compose up python repoforge/cli.py fetch-data
Ignoring ApiError can lead to unhandled exceptions and poor user experience.
typescript// BAD async function getData() { const data = await fetchApi('/endpoint'); // No error handling console.log(data); }
<!-- L3:END -->
Other measured skills in the registry, with their headline benchmark lift.