api-onboarding – skill Lập trình cho agent AI
Giảm thời gian đến lần gọi API đầu tiên (TTFAC) bằng cách tối ưu từng bước trong hành trình làm quen của lập trình viên. Kỹ năng này bao gồm đơn giản hóa xác thực, môi trường sandbox, tài liệu tương tác, và xác định cũng như loại bỏ các điểm lỗi phổ biến.
Cài skill api-onboarding bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/api-onboarding-1e339.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /api-onboarding – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/api-onboarding-1e339.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $api-onboarding – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/api-onboarding-1e339.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /api-onboarding – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/api-onboarding-1e339.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /api-onboarding – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Reducing Time-to-First-API-Call
When to Use
Use this skill when you need reduce time-to-first-API-call (TTFAC) by optimizing every step of the developer onboarding journey. This skill covers authentication simplification, sandbox environments, interactive documentation, and identifying and eliminating common failure points. Trigger phrases: "API...
The time between a developer discovering your API and successfully making their first call is the most critical window in your entire developer journey. Every minute of friction here costs you potential users.
Overview
Time-to-First-API-Call (TTFAC) is a useful onboarding metric to compare with activation and retention. Developers who succeed quickly become active users. Developers who struggle leave—often silently.
This skill covers:
- Measuring and optimizing TTFAC
- Removing authentication friction
- Creating effective sandbox environments
- Building interactive documentation
- Identifying and fixing common failure points
Examples are illustrative API/SDK sketches. Sandbox status must be enforced server-side with isolated keys/accounts; a caller-controlled sandbox boolean is not a security boundary. Test card numbers are provider-specific and only valid in the documented test environment. Confirm provider behavior instead of claiming universal success. Instrument consented, pseudonymous event IDs and stable start/success definitions; include abandoned attempts and exclude API keys, payloads, replay captures and personal data. Package-download counts do not establish an individual SDK installation.
Before You Start
Review the developer-audience-context skill to understand:
- What's the typical technical sophistication of your developers?
- What tools and environments do they commonly use?
- What alternative products have they tried? What was their experience?
- What's their urgency level? (Evaluating vs. building immediately)
Your onboarding should meet developers where they are.
Understanding TTFAC
What TTFAC Measures
Time-to-First-API-Call measures the elapsed time from a developer's first interaction to their first successful API response. This includes:
1. Discovery time: Finding the "Get Started" content
2. Signup time: Creating an account
3. Credential time: Obtaining API keys
4. Setup time: Installing SDK, configuring environment
5. Execution time: Running first request
6. Success time: Receiving successful response
Illustrative TTFAC Targets
| Rating | TTFAC | Developer Experience |
|--------|-------|---------------------|
| Excellent | < 5 min | "This is amazing" |
| Good | 5-15 min | "Pretty straightforward" |
| Acceptable | 15-30 min | "Got there eventually" |
| Poor | 30-60 min | "This is frustrating" |
| Failing | > 60 min | "I'll try something else" |
Measuring TTFAC
Instrumentation points:
// Track these events with timestamps
analytics.track('docs_quickstart_viewed');
analytics.track('signup_started');
analytics.track('signup_completed');
analytics.track('api_key_created');
analytics.track('sdk_installed'); // Via package manager data
analytics.track('first_api_call'); // Via API logs
analytics.track('first_successful_call');Calculate:
- Median TTFAC (more useful than average)
- TTFAC by developer segment
- Drop-off rates at each step
- Success rates within time windows (5 min, 15 min, 60 min)
Authentication Simplification
Measure authentication friction in your own funnel. Preserve the security and abuse controls required by the product.
The Ideal Auth Flow
1. Developer signs up (< 2 minutes)
2. API key visible immediately (not buried in settings)
3. Key works immediately (no activation delay)
4. Copy-paste into example code
5. Success
Auth Anti-Patterns to Avoid
The Approval Queue
❌ "Your API access request has been submitted.
You'll receive access within 2-3 business days."Developers leave and find an alternative.
The Hidden Key
❌ Settings → Team → API → Credentials → Keys → Show KeyMake keys visible on dashboard home.
The Complex Token
❌ OAuth flow requiring:
- Client ID
- Client secret
- Redirect URI configuration
- Token exchange
- Token refresh handlingChoose auth for the threat model; delegated user access may require OAuth from the first call. Provide a mock/demo flow when production authentication cannot safely be simplified.
The Verification Gauntlet
❌ Sign up → Verify email → Verify phone →
Add payment → Verify payment → Then API keyMinimize friction for first API call.
Auth Simplification Strategies
Provide Test Keys Immediately
✅ "Here's your test API key: sk_test_abc123...
Use this in sandbox mode—no charges, no setup."Support Multiple Auth Methods
✅ Quickstart: API key header
Production: OAuth when they need itPre-populate Examples
✅ # Secret supplied by the approved environment, not embedded in copied docs
curl -H "Authorization: Bearer $API_KEY" https://sandbox-api.example.com/statusDelay Production Requirements
✅ Test mode: Instant access
Production mode: Add payment, verify identity (later)Sandbox Environments
A sandbox removes the fear of "breaking something" and lets developers experiment freely.
Sandbox Requirements
Instant Access: No approval, no payment, no complex setup
Realistic Behavior: Same API, same responses, same errors
Clear Boundaries: Obvious when in sandbox vs. production
Reset Capability: Easy way to start fresh
Bounded Limits: Provide documented sandbox quotas, rate limits, isolation and reset controls.
Sandbox Implementation Patterns
Separate Endpoints
Production: api.example.com
Sandbox: sandbox-api.example.comKey Prefixes
Production key: sk_live_abc123...
Sandbox key: sk_test_xyz789...Environment Parameter
curl -X POST https://api.example.com/v1/messages \
-H "Authorization: Bearer $API_KEY" \
-d '{"sandbox": true, ...}'Sandbox Data
Pre-populated Test Data
// Sandbox comes with test users
const testUsers = await client.users.list();
// Returns: [
// { id: "usr_test_alice", name: "Alice (Test)" },
// { id: "usr_test_bob", name: "Bob (Test)" }
// ]Magic Values
// Special values trigger specific behaviors
client.payments.create({
amount: 1000,
card: "4242424242424242" // Always succeeds
});
client.payments.create({
amount: 1000,
card: "4000000000000002" // Always declines
});Documented Test Scenarios
## Test Card Numbers
| Number | Behavior |
|-----------------|----------------------|
| 4242424242424242 | Successful charge |
| 4000000000000002 | Declined |
| 4000000000009995 | Insufficient funds |
| 4000000000000069 | Expired card |Interactive Documentation
Let developers make API calls without leaving the browser.
"Try It" Functionality
Essential Features:
- Authenticated with short-lived, least-privilege sandbox credentials; never expose server secrets
- Pre-filled with working example data
- Editable request parameters
- Real API responses (not mocked)
- Copy as cURL/code option
Implementation:
<div class="api-explorer">
<h3>Try it: Send a Message</h3>
<div class="request-editor">
<label>To Phone Number</label>
<input type="text" value="+15551234567" />
<label>Message Body</label>
<textarea>Hello from the API Explorer!</textarea>
<button onclick="sendRequest()">Send Request</button>
</div>
<div class="response-viewer">
<h4>Response</h4>
<pre><code id="response"></code></pre>
</div>
</div>Interactive Docs Tools
OpenAPI-Based:
- Swagger UI
- Redoc
- Stoplight Elements
Custom Platforms:
- ReadMe.io
- Postman Published Docs
- Custom React components
Interactive Examples
Go beyond single requests:
## Interactive Tutorial: Send Your First Message
### Step 1: Check your balance
<api-explorer endpoint="GET /account/balance" />
### Step 2: Send a message
<api-explorer endpoint="POST /messages"
body='{"to": "+15551234567", "body": "Hello!"}' />
### Step 3: Check message status
<api-explorer endpoint="GET /messages/{id}"
params='{"id": "{{previous.id}}"}' />Common Failure Points
Failure Point Analysis
Track where developers fail and why:
// Instrument error events
api.on('request_error', (error, request) => {
analytics.track('api_error', {
error_type: error.type,
error_code: error.code,
endpoint: request.endpoint,
time_since_signup: timeSinceSignup(),
is_first_call: isFirstCall()
});
});Most Common First-Call Failures
1. Authentication Errors
Problem: Wrong key, malformed header, missing auth
Fix:
- Clearer error messages: "API key sho… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- api-patterns – Nguyên tắc thiết kế API và cách ra quyết định. Lựa chọn REST vs GraphQL vs tRPC, định…
- api-rate-limit-handler – Triển khai cơ chế giới hạn tần suất API (throttling) có giới hạn, nhận biết idempotency…
- api-sdk-generator – Tạo mã SDK client, thư viện wrapper cho API, model request/response và cách dùng theo…
- api-security-best-practices – Triển khai các mẫu thiết kế API an toàn gồm xác thực, phân quyền, kiểm tra đầu vào, giới…
- api-security-testing – Quy trình kiểm thử bảo mật cho REST và GraphQL API, bao gồm xác thực, phân quyền, rate…
- dotnet-backend-patterns – Nắm vững các mẫu phát triển backend C#/.NET để xây dựng API, MCP server và ứng dụng…
- e2e-testing-patterns – Nắm vững kiểm thử end-to-end với Playwright và Cypress để xây dựng bộ test đáng tin cậy…
- cco-review – /c-level-agents:cco-review [plan] — Chief Customer Officer ám ảnh về việc giữ chân khách…