mrdulasolutions/devlearn/devlearn-apis

Claude Code and agent skill by mrdulasolutions/devlearn

Trust tier 3
  • community
Source check pending

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

Teaches APIs, REST, JSON, env vars, auth basics, and error handling while wiring real client-server or localStorage persistence. Use when the user wants to save data, fetch from a server, login, fix CORS, or curriculum routes here. Proactively suggest when adding fetch, routes, .env, or API handlers and DEVLEARN.md is enabled.

Install

npx vskill@latest install mrdulasolutions/devlearn/devlearn-apis

SKILL.md

DevLearn: APIs

Iron law

Teach without blocking ship. Get data flowing end-to-end; explain the request/response story at each layer.

Voice

Follow ../shared/voice.md. Viber → lesson-block. Seasoned → decision-block for auth architecture, CORS proxy choice, session vs JWT.

Context

An API is how programs talk across a boundary (browser ↔ server, app ↔ database). Vibe coders hit CORS, 404, and "where did my data go" — teach the mental model, not HTTP RFC numbers.

Prerequisites

  • devlearn-javascript (DOM + fetch preview) or equivalent
  • Optional: simple static page to wire up

Before you start

  1. DEVLEARN.md depth (default curious; deep for auth)
  2. Step 0: localStorage only vs real backend? framework (Express, Next route handlers)?
  3. Never commit secrets — teach .env + .env.example

Phase 0: Persistence ladder (pick one)

LevelTeach whenUser gets
localStorageFastest save across refreshData on one browser
REST APIShare data / multi-deviceServer owns truth
AuthPrivate per-user dataSessions/tokens

Start at user's requested level; mention ladder in one sentence.

Phase 1: REST mental model

Teach before coding:

Client --HTTP request--> Server
<--HTTP response--
MethodPlain EnglishTodo example
GETRead listGET /api/todos
POSTCreatePOST /api/todos { text }
PUT/PATCHUpdatePATCH /api/todos/:id
DELETERemoveDELETE /api/todos/:id

Term: endpoint — URL + method that does one job

Term: JSON — text format for { "text": "Buy milk" }

Phase 2: Server route (minimal)

Build: One route returning JSON (framework-appropriate).

Example shape (adapt to stack):

javascript
// GET /api/todos → [{ id, text }]
// POST /api/todos body { text } → created todo

Teach: Server reads request, touches data store, sends JSON response.

Anchor: route file:line

Phase 3: Client fetch

Build: fetch calls matching server routes; update JS state + render.

javascript
const res = await fetch('/api/todos', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text }),
});

Teach: headers tell server body format; body is stringified JSON.

Terms: request, response, status code (200 ok, 404 missing, 500 server broke)

Phase 4: Environment variables

Build: .env.example with API_URL or DATABASE_URL; read via platform pattern.

Teach: Secrets and URLs differ local vs production; never commit .env.

Term: environment variable

Phase 5: Errors & CORS

When browser blocks cross-origin:

Teach CORS in one paragraph: Browser protects you — page at a.com can't read b.com unless b.com sends allow headers. Fix: same origin, proxy, or server CORS config — pick simplest for stack.

Build: User-visible error message on failed fetch; log status in console.

STOP if CORS: explain origin mismatch before random header spam.

Phase 6: Auth preview (deep / on request)

Teach layers:

LayerPlain English
Session cookieBrowser sends cookie; server knows who you are
JWTSigned token in header
API keySecret for server-to-server (not in frontend!)

Rule: Don't put long-lived secrets in frontend code.

Hand off production hardening to devlearn-security before ship.

Lifecycle handoffs

SituationSuggest
Auth added/devlearn-security
Ready to release/devlearn-pre-ship
Live API URL/devlearn-post-ship smoke on endpoints
CORS recurringdocument origin decision in .devlearn/decisions.md

Domain glossary

TermDefinition
APIInterface for programs to request data/actions
RESTStyle using URLs + HTTP methods
JSONText format for objects/arrays
endpointURL + method for one operation
CORSBrowser cross-origin security gate
env varConfig from environment not source code
status codeNumber summarizing response result
headerRequest/response metadata key-value
payloadBody data sent or received

Common mistakes

MistakeSymptomFix
API key in frontendStolen keyServer-side only
No Content-TypeServer can't parse bodyapplication/json
Wrong URL404Match route path + method
CORS panicBlocked in consoleSame origin or server headers
Swallow errorsBlank UIShow message + log status

STOP checkpoint

After first successful POST:

"Where does the todo live now — browser memory, localStorage, or server database?"

Wrong answer → one-sentence correction with diagram.

Lesson integration

Teach one network concept per lesson block in vibe mode (CORS gets its own block when it happens).

Required footer

markdown
---
DevLearn status: DONE
Persistence level: [localStorage|REST|auth]
Suggested next: /devlearn-deploy | /devlearn-explain-diff
---

Additional resources

  • Request/response examples → reference.md
  • Client patterns → devlearn-javascript/examples.md

Security

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

Quality evaluation

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

Source

Popularity

7-day trend score
0

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/mrdulasolutions/devlearn/devlearn-apis/badge)](https://verified-skill.com/skills/mrdulasolutions/devlearn/devlearn-apis)

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