/stackone-unified-connectors:stackone-unified-connectorsfrom stackone-unified-connectors
Baseline skill for building unified/schema-based connectors that transform provider data into standardized schemas. Use alongside domain-specific schema skills that you create to define your organization's standard schemas. Use when user says "start unified build for [provider]", "build a schema-based connector", "map fields to schema", "test unified connector", or asks about field mapping, enum mapping, pagination configuration, or scope decisions. This skill provides implementation patterns; schema skills provide field definitions. Do NOT use for agentic/custom connectors (use stackone-cli), discovering existing connectors (use stackone-connectors), or building AI agents (use stackone-agents).
Ships in stackone-unified-connectors. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Build connectors that transform provider-specific data into standardized schemas with consistent field names, enum values, and pagination.
This is a baseline skill that provides the core workflow and patterns for building unified connectors. It is designed to work alongside domain-specific schema skills that you create for your organization's specific use cases.
Recommended approach:
unified-hris-schema, unified-messaging-schema, unified-crm-schema)This separation allows you to maintain consistent schemas across all providers within a category while leveraging the shared technical patterns from this baseline skill.
Before building unified connectors:
stackone help <command> for command-specific details--debug before configuring mappingsWhen fetching a docs.stackone.com page whose URL doesn't already end in .md, append .md to get it as markdown. llms.txt is already plain text, so fetch it as is.
If any URL in this skill returns 404, or a page doesn't cover what you need (StackOne reorganizes its docs from time to time):
https://docs.stackone.com/llms.txt, which indexes every docs page by title and description. Search it for the page's topic (e.g. "StackOne CLI", "Defined Output Schemas", "Connector YAML Reference") and use the URL listed there.These principles apply to ALL unified connector work. Violations cause silent failures or broken mappings.
Every YAML configuration field uses camelCase, not snake_case:
# CORRECT
scopeDefinitions: fieldConfigs: targetFieldKey:
enumMapper: matchExpression: dataKey:
nextKey: pageSize: indexField:
stepFunction: functionName: dataSource:
# WRONG - causes validation errors or silent failures
scope_definitions: field_configs: target_field_key:
While config fields are camelCase, targetFieldKey values match YOUR schema (often snake_case):
fieldConfigs:
- targetFieldKey: first_name # YOUR schema field
expression: $.firstName # Provider's field
stepFunction:
functionName: map_fields
version: '2' # REQUIRED - omitting causes empty results
Declare the field mapping once in the action's fieldConfigs. The map_fields and typecast steps then take only a dataSource and apply those fieldConfigs.
fieldConfigs:
- targetFieldKey: email
expression: $.email # Relative to each record, NO step prefix
type: string
steps:
- stepId: map_data
stepFunction:
functionName: map_fields
version: '2'
parameters:
dataSource: $.steps.get_data.output.data
fieldConfigs expressions are evaluated against each record of the map_fields dataSource, so reference the record's fields directly: $.email, $.work.department. Do not prefix them with a step ID.
The entire purpose of unified connectors is standardized output. Never suggest users handle mapping in application code.
Never assume response structure. Always run with --debug first:
stackone run --debug --connector <file> --credentials <file> --action-id <action>
Check for a domain-specific schema skill first.
Domain-specific schema skills (e.g., unified-hris-schema, unified-crm-schema) should define your organization's standard schema for that category. These skills complement this baseline skill by providing:
If schema skill exists:
If no schema skill exists:
What a schema skill should contain:
# Example: unified-hris-schema skill structure
# - Field definitions with types
# - Enum values (e.g., employment_status: active, inactive, terminated)
# - Required fields marked
# - Nested structures documented
Creating domain-specific schema skills prevents drift between providers and reduces repeated schema discussions.
Do not skip this step. Research ALL available endpoints before proceeding.
For each endpoint, document:
Present a comparison table and get explicit user approval before implementing:
| Option | Endpoint | Field Coverage | Permissions | Status |
|--------|----------|----------------|-------------|--------|
| A | GET /v2/employees | 70% | Narrow | Active |
| B | POST /reports | 100% | Moderate | Active |
| C | POST /v1/data | 100% | Broad | Deprecated |
Recommendation: Option B - Full coverage, not deprecated
Do not proceed without user selection.
Use scopeDefinitions (not scope_definitions):
scopeDefinitions:
employees:read:
description: Read employee data
employees:extended:read:
description: Extended employee data
includes: employees:read # Scope inheritance
Principles:
See references/scope-patterns.md for detailed patterns.
Declare the mapping in action-level fieldConfigs, then run map_fields and typecast over the data:
fieldConfigs:
- targetFieldKey: id
expression: $.id
type: string
- targetFieldKey: email
expression: $.email
type: string
- targetFieldKey: department
expression: $.work.department # Nested field
type: string
- targetFieldKey: status
expression: $.status
type: enum
enumMapper:
matcher:
- matchExpression: '{{$.status == "Active"}}'
value: active
- matchExpression: '{{$.status == "Inactive"}}'
value: inactive
- matchExpression: '{{$.status == null}}'
value: unknown
steps:
- stepId: map_data
stepFunction:
functionName: map_fields
version: '2'
parameters:
dataSource: $.steps.get_data.output.data
- stepId: typecast_data
stepFunction:
functionName: typecast
version: '2'
parameters:
dataSource: $.steps.map_data.output.data
result:
data: $.steps.typecast_data.output.data
See references/field-mapping-patterns.md for enum mapping, nested objects, and transformations.
For list endpoints, use cursor pagination with the request function:
cursor:
enabled: true
pageSize: 50
inputs:
- name: page_size
type: number
in: query
required: false
- name: cursor
type: string
in: query
required: false
steps:
- stepId: get_data
stepFunction:
functionName: request
parameters:
url: /items
method: get
args:
# Dual-condition pattern for defaults
- name: limit
value: $.inputs.page_size
in: query
condition: "{{present(inputs.page_size)}}"
- name: limit
value: 50
in: query
condition: "{{!present(inputs.page_size)}}"
- name: cursor
value: $.inputs.cursor
in: query
condition: "{{present(inputs.cursor)}}"
result:
data: $.steps.get_data.output.data
next: $.steps.get_data.output.data.meta.nextCursor
Important: Use request function (not paginated_request) when you need dynamic inputs like page_size. The paginated_request function can have issues with $.inputs.* resolving to undefined.
See references/pagination-patterns.md for detailed configuration.
stackone validate connectors/<provider>/<provider>.connector.s1.yaml
Phase 1: Raw Response
stackone run --debug --connector <file> --credentials <file> --action-id <action>
Phase 2: Field Mapping - Verify all fields use YOUR schema names, not provider names
Phase 3: Pagination - Test first page, next page, last page, empty results
Phase 4: Schema Completeness - All required fields present and populated
Create a coverage document listing:
User says: "start unified build for BambooHR"
Actions:
unified-hris-schema)unified-hris-schema skill for consistency across HRIS providers/v1/employees, /v1/employees/directory, custom reportsfieldConfigs using schema from skill and add map_fields and typecast steps--debug, verify field names match schemaResult: Working unified connector with standardized employee schema that matches other HRIS connectors.
User says: "build a unified messaging connector for Slack"
Actions:
unified-messaging-schema skill - none existsunified-messaging-schema skill so future messaging connectors (Teams, Discord) use the same schema."Result: New schema skill created, connector built, future messaging connectors will use same schema.
User says: "My unified connector returns provider field names instead of my schema"
Actions:
targetFieldKey uses YOUR schema names (not provider names)version: '2' is specified on map_fields and typecastfieldConfigs expressions should NOT have a step prefix--debug to see raw response structureResult: Fields correctly mapped to user's schema.
User says: "Pagination cursor isn't being passed correctly"
Actions:
--debug to see raw response structuredataKey path matches actual response (e.g., data.employees not just employees)nextKey path points to cursor valuepaginated_request with dynamic inputs - switch to request with dual-condition patternresult.next returns the cursor valueResult: Working pagination with correct cursor handling.
Cause: Missing or incorrect field mapping configuration.
Fix: Ensure targetFieldKey uses YOUR schema field names, not provider names. Verify map_fields step is present and dataSource is correct.
Cause: Missing version: '2' or wrong expression context.
Fix: Add version: '2' to map_fields and typecast. In fieldConfigs, use direct references ($.email) without step prefix.
Cause: matchExpression doesn't match provider values (case-sensitive).
Fix: Check exact provider values with --debug. Use the lower() function for case-insensitive matching (e.g. '{{lower($.status) == "active"}}'). Always include null/unknown fallback.
Cause: Cursor not being sent or extracted correctly.
Fix: Verify iterator.key matches API's expected parameter name. Check nextKey path against raw response. Verify iterator.in is correct (query/body/headers).
Cause: Using paginated_request which doesn't handle $.inputs.* well.
Fix: Use standard request function with dual-condition pattern for defaults.
| Resource | URL |
|---|---|
| CLI Package | https://www.npmjs.com/package/@stackone/cli |
| Connector Building Docs | https://docs.stackone.com/connector-building/overview.md |
| CLI Reference | https://docs.stackone.com/connector-building/stackone-cli.md |
| Defined Output Schemas | https://docs.stackone.com/connector-building/defined-output-schemas.md |
| Connector YAML Reference | https://docs.stackone.com/connector-yaml-reference/overview.md |
To maintain consistency across providers, create schema skills for each category you work with. A domain-specific schema skill should include:
Required content:
string, number, boolean, datetime_string, enum)Example skill structure:
# Unified HRIS Schema
## Employee Resource
### Required Fields
| Field | Type | Description |
|-------|------|-------------|
| id | string | Unique identifier |
| email | string | Primary email address |
| first_name | string | Employee first name |
| last_name | string | Employee last name |
| employment_status | enum | Current employment status |
### Enum: employment_status
| Value | Description |
|-------|-------------|
| active | Currently employed |
| inactive | On leave or suspended |
| terminated | No longer employed |
### Optional Fields
| Field | Type | Description |
|-------|------|-------------|
| department | string | Department name |
| hire_date | datetime_string | Date of hire |
Naming convention: unified-{category}-schema (e.g., unified-hris-schema, unified-crm-schema, unified-messaging-schema)
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub stackonehq/agent-plugins --plugin stackone-unified-connectors