The Nango Function Builder allows users to create and modify Nango functions either as actions or syncs. It is designed for developers working with Nango to ensure their functions follow repeatable patterns and include necessary validation steps.
$ npx skills add https://github.com/nangohq/skills --skill nango-function-builderThe Nango Function Builder skill enables developers to create and modify Nango functions following established patterns for both actions and syncs. It provides structured guidance for building functions that include necessary validation steps, ensuring consistency across integrations. The skill supports multiple implementation approaches including local and remote building workflows, plus migration patterns for deletion detection, checkpoints, and zero-YAML configurations. Developers can use it to accelerate function development while maintaining code quality and reliability across their Nango ecosystem.
Install the skill using the command provided.
Build a new Nango function
Modify an existing Nango function
Create a sync in Nango
Build an action in Nango
$ npx skills add https://github.com/nangohq/skills --skill nango-function-buildergit clone https://github.com/nangohq/skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
I need to create a Nango function for [COMPANY]'s [INDUSTRY] integration. The function should be an [ACTION/SYNC] that performs [SPECIFIC_TASK] using [DATA]. Ensure it follows Nango's best practices for [ERROR_HANDLING/VALIDATION/STRUCTURE]. Please provide the complete function code with clear comments and validation steps.
## Nango Function: Sync CRM Contacts to Marketing Platform
```javascript
// Nango Sync Function: Sync CRM contacts to HubSpot marketing platform
// Date: 2024-05-15
// Author: Dev Team
// Version: 1.2
import { NangoSync } from './sdk';
export default async function syncContacts(nango: NangoSync) {
try {
// 1. Fetch contacts from CRM API with pagination
const contacts = await nango.get('/api/contacts', {
params: {
limit: 100,
offset: 0,
lastModifiedAfter: nango.lastSyncDate
}
});
// 2. Validate contact data structure
const invalidContacts = contacts.filter(contact =>
!contact.email || typeof contact.email !== 'string'
);
if (invalidContacts.length > 0) {
nango.log(`Warning: ${invalidContacts.length} contacts have invalid email format`);
}
// 3. Transform and batch contacts for HubSpot API
const hubspotPayload = contacts.map(contact => ({
email: contact.email,
firstName: contact.firstName,
lastName: contact.lastName,
company: contact.company,
tags: ['crm-sync']
}));
// 4. Sync to HubSpot with error handling
const syncResult = await nango.post('/marketing/contacts/batch', {
contacts: hubspotPayload
});
// 5. Update sync metadata
nango.setLastSyncDate(new Date().toISOString());
nango.log(`Successfully synced ${contacts.length} contacts to HubSpot`);
return {
success: true,
processed: contacts.length,
synced: syncResult.data.length,
errors: []
};
} catch (error) {
nango.log(`Sync failed: ${error.message}`);
return {
success: false,
processed: 0,
synced: 0,
errors: [error.message]
};
}
}
```
### Key Validation Steps Included:
- ✅ CRM API response validation
- ✅ Contact data structure validation
- ✅ HubSpot API response handling
- ✅ Error logging and recovery
- ✅ Sync metadata trackingTake a free 3-minute scan and get personalized AI skill recommendations.
Take free scan