persona-core-workflow-a
Build a complete KYC verification flow with Persona inquiries and embedded UI. Use when implementing identity verification, building KYC onboarding, or integrating Persona's hosted flow into your application. Trigger with phrases like "persona KYC flow", "identity verification", "persona inquiry workflow", "onboarding verification".
What this skill does
# Persona Core Workflow A — KYC Inquiry Flow
## Overview
Build a complete KYC onboarding flow: create an inquiry from a template, embed the Persona verification UI in your web app, handle completion callbacks, and store verification results.
## Prerequisites
- Completed `persona-install-auth` setup
- Inquiry Template configured in Persona Dashboard
- Web application with a frontend (React, HTML, etc.)
## Instructions
### Step 1: Backend — Create Inquiry Endpoint
```typescript
// server.ts — Express endpoint to create inquiries
import express from 'express';
import axios from 'axios';
const app = express();
app.use(express.json());
const persona = axios.create({
baseURL: 'https://withpersona.com/api/v1',
headers: {
'Authorization': `Bearer ${process.env.PERSONA_API_KEY}`,
'Persona-Version': '2023-01-05',
},
});
app.post('/api/verify', async (req, res) => {
const { userId, email } = req.body;
const { data } = await persona.post('/inquiries', {
data: {
attributes: {
'inquiry-template-id': process.env.PERSONA_TEMPLATE_ID,
'reference-id': userId,
'fields': {
'email-address': { type: 'string', value: email },
},
},
},
});
res.json({
inquiryId: data.data.id,
sessionToken: data.data.attributes['session-token'],
});
});
```
### Step 2: Frontend — Embed Persona Flow
```html
<!-- Include Persona's JavaScript SDK -->
<script src="https://cdn.withpersona.com/dist/persona-v5.0.0.js"></script>
<button id="verify-btn">Verify Identity</button>
<script>
document.getElementById('verify-btn').addEventListener('click', async () => {
// Get inquiry from your backend
const resp = await fetch('/api/verify', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ userId: 'user-123', email: '[email protected]' }),
});
const { inquiryId, sessionToken } = await resp.json();
// Launch Persona embedded flow
const client = new Persona.Client({
inquiryId,
sessionToken,
onComplete: ({ inquiryId, status }) => {
console.log(`Verification ${status} for inquiry ${inquiryId}`);
// Notify your backend
fetch(`/api/verify/${inquiryId}/complete`, { method: 'POST' });
},
onCancel: ({ inquiryId }) => {
console.log('User cancelled verification');
},
onError: (error) => {
console.error('Persona error:', error);
},
});
client.open();
});
</script>
```
### Step 3: Backend — Handle Completion
```typescript
app.post('/api/verify/:inquiryId/complete', async (req, res) => {
const { inquiryId } = req.params;
// Fetch the completed inquiry from Persona
const { data } = await persona.get(`/inquiries/${inquiryId}`);
const attrs = data.data.attributes;
const result = {
inquiryId,
status: attrs.status, // completed, approved, declined
referenceId: attrs['reference-id'], // your user ID
createdAt: attrs['created-at'],
completedAt: attrs['completed-at'],
};
// Store in your database
await db.users.update(result.referenceId, {
kycStatus: result.status,
kycInquiryId: result.inquiryId,
kycCompletedAt: result.completedAt,
});
res.json({ status: result.status });
});
```
### Step 4: Resume Incomplete Inquiries
```typescript
app.get('/api/verify/resume/:userId', async (req, res) => {
// Find existing incomplete inquiry for this user
const { data } = await persona.get('/inquiries', {
params: {
'filter[reference-id]': req.params.userId,
'filter[status]': 'created',
'page[size]': 1,
},
});
if (data.data.length > 0) {
const inquiry = data.data[0];
// Resume the existing inquiry instead of creating a new one
const resumeResp = await persona.post(`/inquiries/${inquiry.id}/resume`);
res.json({
inquiryId: inquiry.id,
sessionToken: resumeResp.data.data.attributes['session-token'],
});
} else {
res.json({ message: 'No pending inquiry' });
}
});
```
## Output
- Backend endpoint creating inquiries from templates
- Embedded Persona verification UI in web app
- Completion callback storing verification results
- Resume flow for incomplete verifications
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| `422 Invalid template` | Wrong template ID | Verify `itmpl_*` in Dashboard |
| SDK not loading | CSP blocking CDN | Add `cdn.withpersona.com` to CSP |
| `onComplete` not firing | User abandoned flow | Use `onCancel` handler |
| Stale session token | Token expired | Create new inquiry or resume |
## Resources
- [Inquiries Overview](https://docs.withpersona.com/inquiries)
- [Embedded Flow Integration](https://docs.withpersona.com/api-quickstart-tutorial)
- [Resume Inquiry](https://docs.withpersona.com/accessing-inquiry-status)
## Next Steps
- Add verification checks: `persona-core-workflow-b`
- Set up webhooks: `persona-webhooks-events`
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.