---
name: profileclaw
description: Connect to ProfileClaw career intelligence platform and access user's complete career profile including assessments, preferences, resume data, and AI-generated reports. Use when user asks to "connect ProfileClaw", "use my profile", or "based on my career data".
triggers:
  - "connect profileclaw"
  - "connect my profileclaw"
  - "use my profile"
  - "based on my career data"
  - "from my profile"
  - "read my resume"
requires:
  env:
    - PROFILECLAW_API_KEY
  apis:
    - https://profileclaw.cn/api/v1/context
version: "2.0.0"
author: ProfileClaw Team
license: MIT
---

# ProfileClaw Agent Skill

Use this file when the user wants you to connect ProfileClaw and continue working from the user's real career context.

Your job is not to stop at installation.
Your job is to connect, understand what is already available, and keep going.

## What success looks like

After reading this file, you should try to do all of the following:

1. Make sure ProfileClaw API is accessible in the current environment
2. Check whether the user is already authenticated
3. If authentication is missing, ask for the ProfileClaw API key
4. After authentication, load the user's available ProfileClaw data immediately
5. Summarize what you know, what is missing, and what you can do next
6. Continue the user's requested task if enough data is already available

Do not stop at "connected successfully" unless the user explicitly asks you to.

## Quick Reference

### API Endpoint Priority

| Endpoint | Purpose | Priority | When to Use |
|----------|---------|----------|-------------|
| `/api/v1/context` | Complete career context | **CRITICAL** | First connection, get overview |
| `/api/v1/context?view=full` | Full structured profile | HIGH | Need detailed assessments and resume |
| `/api/v1/context?expand=careerGraph&careerGraph=summary` | Compact career graph | HIGH | Need structure but control size |
| `/api/v1/context?expand=dynamicContext&query=...` | Query-related memories | MEDIUM | Specific question needs context |
| `/api/v1/career-match` | Career matching | MEDIUM | Recommend roles or assess fit |
| `/api/v1/similar-paths` | Similar career paths | LOW | Find career transition examples |

### Data Type Reference

| Data Type | Contains | How to Get |
|-----------|----------|------------|
| **summary** | Current role, industry, years of experience, profile completeness, top N skills, experience count, education count, assessment dominant types | Included by default in `/api/v1/context` |
| **careerGraph** | Complete user profile, assessment results, resume data | `expand=careerGraph` |
| **assessments** | RIASEC, Big Five, values assessment results | `expand=careerGraph` or `/api/v1/assessments` |
| **resume** | Skills list, work experience, education background | `expand=careerGraph` |
| **alerts** | Career alerts and notifications | `expand=alerts` |
| **careerHealth** | Career health report | `expand=careerHealth` |

## Default behavior

### Step 1: Check whether ProfileClaw API is ready

Check if environment variable `PROFILECLAW_API_KEY` exists.

If it doesn't exist, ask clearly for the API key:

> I can continue, but I need your ProfileClaw API key before I can read your career profile.
>
> You can create one at ProfileClaw website under Settings → API Keys.

### Step 2: Load profile data right away

After auth succeeds, do not wait for another user message.

Immediately call the API to load available data:

```bash
curl "https://profileclaw.cn/api/v1/context" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"
```

**Response structure:**

```json
{
  "data": {
    "user": {
      "id": "...",
      "email": "..."
    },
    "summary": {
      "currentJobTitle": "Senior Frontend Engineer",
      "currentIndustry": "Internet",
      "yearsOfExperience": 5,
      "profileCompleteness": 85,
      "resume": {
        "hasResume": true,
        "skillsTop": ["React", "TypeScript", "Node.js", ...],
        "experienceCount": 3,
        "educationCount": 2
      },
      "assessments": {
        "riasecDominantTypes": ["Investigative", "Artistic"],
        "valuesTop": ["Achievement", "Autonomy", "Innovation"],
        "bigFiveAvailable": true,
        "lastCompletedAt": "2024-03-15T10:30:00Z"
      },
      "lastUpdated": "2024-03-16T08:00:00Z"
    },
    "recommendedNextCalls": [...]
  },
  "metadata": {
    "view": "compact",
    "expanded": [],
    "durationMs": 45
  }
}
```

### Step 3: Always give a short post-connect summary

Use a format close to this:

```txt
I've connected to your ProfileClaw.

What I've loaded:
- Your current role: Senior Frontend Engineer (Internet, 5 years experience)
- Your RIASEC assessment results (dominant types: Investigative, Artistic)
- Your Big Five personality traits and values preferences
- Your resume data (12 skills, 3 work experiences, 2 education entries)
- Profile completeness: 85%

What's still missing:
- Nothing critical - the profile is complete enough to start

What I can do next:
1. Recommend best-fit career directions based on your IA type and skill set
2. Analyze feasibility of transitioning to product management or tech leadership
3. Identify strengths and potential risks in your current career path

Recommended next step: Let me summarize your core strengths and best-fit career directions, then we can decide the next action together. Which would you like to explore first?
```

Keep it short, useful, and action-oriented.

## If the user asks for help from the full profile

If the user says something like:

> connect my ProfileClaw, then continue helping me from my full profile

use this order:

1. Connect ProfileClaw
2. Load everything already available (use `view=full` or `expand=careerGraph`)
3. Summarize what the profile already contains
4. Suggest the most useful next actions based on what is already present
5. Only ask for missing inputs when they are truly needed for the requested task

Do not reply with only a status update such as:

> connected successfully

Instead:

- first confirm what you already know about the user
- then explain what is still missing, if anything
- then suggest the next best step

## API Usage Examples

### Example 1: Get Compact Context (Recommended for First Call)

```bash
curl "https://profileclaw.cn/api/v1/context" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"
```

**When to use:** First connection, quick overview

**Returns:** `data.summary` contains core information, sufficient for most tasks

### Example 2: Get Structured Career Graph (Compact Version)

```bash
curl "https://profileclaw.cn/api/v1/context?expand=careerGraph&careerGraph=summary&resumeSkillsLimit=20" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"
```

**When to use:** Need more structured data but control response size

**Returns:** `data.sections.careerGraph` contains compact profile, assessments, resume data

### Example 3: Get Full Profile

```bash
curl "https://profileclaw.cn/api/v1/context?view=full" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"
```

**When to use:** Need complete assessment results and resume details

**Returns:** Full careerGraph with all assessment dimensions and resume entries

### Example 4: Query-Related Memories and Timeline

```bash
curl "https://profileclaw.cn/api/v1/context?expand=dynamicContext&query=product%20manager&timeRange=recent" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"
```

**When to use:** User asks about specific role or transition decision

**Returns:** Query-related memories and recent career timeline

## Error Handling

| Status | Error Type | Cause | Solution |
|--------|-----------|-------|----------|
| 400 | `validation.bad_request` | Invalid parameters | Check view, expand parameters |
| 401 | `auth.api_key_invalid` | Invalid API key | Ask user for valid API key |
| 403 | `auth.insufficient_scope` | Insufficient permissions | Current key lacks required scope |
| 404 | `context.not_found` | User profile doesn't exist | Guide user to complete profile |
| 429 | `rate_limit.exceeded` | Request rate exceeded | Wait 60s and retry, or use smaller request |
| 500 | `server.internal` | Server error | Retry once, report if still fails |

**Error response example:**

```json
{
  "error": "Rate limit exceeded",
  "type": "rate_limit.exceeded"
}
```

**Handling recommendations:**

1. Check `type` field first, not `error` message
2. For 429 errors, try reducing request scope (remove expand parameters)
3. For 401/403 errors, clearly tell user to re-authenticate
4. For 500 errors, retry once max, then report to user

## Real Conversation Examples

### Scenario 1: First Connection

**User**: "connect my ProfileClaw, then continue helping me from my full profile"

**Agent**:
```
Connecting to your ProfileClaw...

✓ Environment check complete
✓ API authentication successful
✓ Loading profile data...

I've connected to your ProfileClaw.

What I've loaded:
- Your current role: Senior Frontend Engineer (Internet, 5 years experience)
- Your RIASEC assessment results (dominant types: Investigative, Artistic)
- Your Big Five personality traits and values preferences
- Your resume data (12 skills, 3 work experiences, 2 education entries)
- Profile completeness: 85%

What's still missing:
- Nothing critical - the profile is complete enough to start

What I can do next:
1. Recommend best-fit career directions based on your IA type and skill set
2. Analyze feasibility of transitioning to product management or tech leadership
3. Identify strengths and potential risks in your current career path

Recommended next step: Let me summarize your core strengths and best-fit career directions, then we can decide the next action together. Which would you like to explore first?
```

### Scenario 2: Specific Question

**User**: "I want to transition to product management, help me analyze"

**Agent**:
```
Let me analyze this transition based on your ProfileClaw profile...

[API call: /api/v1/context?expand=dynamicContext&query=product%20manager]

Based on your profile:

Your strengths:
- RIASEC type Investigative + Artistic highly matches PM core competencies
- 5 years frontend experience gives you deep understanding of UX and technical implementation
- Your top values "Innovation" and "Achievement" align with product role requirements

Skills to develop:
- Business analysis and data-driven decision making (recommend learning SQL and data analysis)
- Cross-functional communication and project management experience
- Market research and user research methodologies

Recommended actions:
1. First seek opportunities to participate in product decisions at current company
2. Systematically learn product methodologies (recommend "Inspired" and "The Elements of User Experience")
3. Consider internal transfer or external opportunities after 3-6 months

Which part would you like me to expand on?
```

### Scenario 3: Missing API Key

**User**: "connect my ProfileClaw"

**Agent**:
```
I can continue, but I need your ProfileClaw API key before I can read your career profile.

You can get one by:
1. Visit ProfileClaw website
2. Go to Settings → API Keys
3. Click "Create New Key"
4. Copy the generated key

Once you have it, you can:
- Set environment variable: export PROFILECLAW_API_KEY=your_key
- Or tell me the key directly, I'll use it for this session

Let me know when you're ready, and I'll connect and load your profile immediately.
```

## Tone and UX rules

- Reply in the user's current conversation language
- Prefer next actions over status-only updates
- Do not make the user manually orchestrate the workflow
- If enough data is available, continue the task immediately
- If data is missing, summarize the known profile first, then point out the missing input
- Sound like a capable operator: calm, clear, helpful, and concise

## Advanced Usage

### Control Response Size

```bash
# Limit skills count
curl "https://profileclaw.cn/api/v1/context?expand=careerGraph&resumeSkillsLimit=10" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"

# Limit alerts count
curl "https://profileclaw.cn/api/v1/context?expand=alerts&alertsLimit=5" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"
```

### Use ETag Caching

```bash
# First request, get ETag
curl -I "https://profileclaw.cn/api/v1/context" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY"

# Subsequent requests, use If-None-Match
curl "https://profileclaw.cn/api/v1/context" \
  -H "Authorization: Bearer $PROFILECLAW_API_KEY" \
  -H 'If-None-Match: "etag-value"'
```

If data hasn't changed, returns 304 Not Modified, saving bandwidth and time.

## Related Resources

- **API Documentation**: https://profileclaw.cn/docs/api/context
- **Authentication Guide**: https://profileclaw.cn/docs/agents/auth
- **Quickstart**: https://profileclaw.cn/docs/agents/quickstart
- **Error Handling**: https://profileclaw.cn/docs/agents/retries
- **OpenAPI Spec**: https://profileclaw.cn/.well-known/openapi.json

## Security Notes

- Never expose API keys in logs
- API keys are user-specific - each user gets their own
- Rate limited to 100 requests/hour (free tier)
- If key leakage is suspected, immediately advise user to delete and regenerate
