Back to Prompt Library
implementation
External Skill Verification Tool Development
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: SkillProof Document Agent
Format
Code-aware
Lines
26
Sections
4
Linked challenge
SkillProof Document Agent
Prompt source
Original prompt text with formatting preserved for inspection.
26 lines
4 sections
No variables
1 code block
Create a Mastra AI tool named 'verify_ai_proficiency' that simulates an external service verifying a skill. This tool should accept `skill_name` and `proficiency_level` and return a mock `verification_status` ('Verified'/'Unverified') and `verification_score` (0-1). Demonstrate how your Mastra AI agent would call this tool to verify a generated SkillProof document and update its status.
```typescript
import { createTool } from '@mastra-ai/core';
const verifyAIProficiencyTool = createTool({
name: 'verifyAIProficiency',
description: 'Simulates external verification of AI proficiency.',
input: { type: 'object', properties: { skillName: { type: 'string' }, proficiencyLevel: { type: 'string' } } },
output: { type: 'object', properties: { verificationStatus: { type: 'string' }, verificationScore: { type: 'number' } } },
async handler({ skillName, proficiencyLevel }) {
// Mock logic for verification
const score = proficiencyLevel === 'Expert' ? 0.9 + Math.random() * 0.1 : 0.5 + Math.random() * 0.2;
const status = score > 0.7 ? 'Verified' : 'Unverified';
return { verificationStatus: status, verificationScore: parseFloat(score.toFixed(2)), verifiedBy: 'MockAIProficiencyService' };
},
});
// Mastra AI agent would have a flow like this:
// agent.onIntent('verify_document', async ({ state }) => {
// const doc = state.get('skillProofDocument');
// if (doc) {
// const verificationResult = await agent.runTool(verifyAIProficiencyTool, { skillName: doc.skillName, proficiencyLevel: doc.proficiencyLevel });
// state.set('skillProofDocument', { ...doc, verification: verificationResult });
// return `Verification complete: ${verificationResult.verificationStatus}`;
// }
// return 'No document to verify.';
// });
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.