Skip to content

Commit 2e9d7d1

Browse files
fix(SOL-422): stackone-unified-connectors - update stale StackOne docs links and description (#44)
* fix(SOL-422): stackone-unified-connectors - update stale docs links and description - connector-engine links -> connector-building/stackone-cli - key urls: connector building, defined output schemas, yaml reference - llms.txt fallback - description no longer names uninstallable schema skills - skill version 2.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(SOL-422): map fields with action-level fieldConfigs - fieldConfigs replaces inline map_fields fields; map_fields/typecast take dataSource only - expressions relative to each record, no step prefix - drop schema inference troubleshooting entry - lower() replaces unsupported .toLowerCase() in enum matching Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(SOL-422): scope .md rule to urls not ending in .md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(SOL-422): align docs fallback with sibling skills - also covers pages that do not answer the question - contact support when docs do not cover it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d7b5010 commit 2e9d7d1

2 files changed

Lines changed: 105 additions & 119 deletions

File tree

‎plugins/integrations/stackone-unified-connectors/skills/stackone-unified-connectors/SKILL.md‎

Lines changed: 56 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
name: stackone-unified-connectors
3-
description: Baseline skill for building unified/schema-based connectors that transform provider data into standardized schemas. Use alongside domain-specific schema skills (e.g., unified-hris-schema, unified-crm-schema) that 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).
3+
description: 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).
44
license: MIT
55
compatibility: Requires StackOne CLI (@stackone/cli). Requires access to provider API documentation.
66
metadata:
77
author: stackone
8-
version: "2.1"
8+
version: "2.2"
99
---
1010

1111
# StackOne Unified Connectors
@@ -27,10 +27,16 @@ This separation allows you to maintain consistent schemas across all providers w
2727
## Important
2828

2929
Before building unified connectors:
30-
1. Read the CLI documentation: https://docs.stackone.com/guides/connector-engine/cli-reference
30+
1. Read the CLI documentation: https://docs.stackone.com/connector-building/stackone-cli.md
3131
2. Use `stackone help <command>` for command-specific details
3232
3. Always verify response structures with `--debug` before configuring mappings
3333

34+
When 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.
35+
36+
**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):
37+
- Fetch `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.
38+
- If the docs don't cover the question, say so and suggest contacting StackOne support. Don't invent an answer.
39+
3440
## Core Principles
3541

3642
These principles apply to ALL unified connector work. Violations cause silent failures or broken mappings.
@@ -68,30 +74,28 @@ stepFunction:
6874
version: '2' # REQUIRED - omitting causes empty results
6975
```
7076

71-
### 4. Use Inline Fields in map_fields Parameters
77+
### 4. Define Fields in Action-Level fieldConfigs
7278

73-
Pass `fields` directly in `map_fields` step parameters rather than action-level `fieldConfigs`. This avoids schema inference issues that cause build failures.
79+
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`.
7480

7581
```yaml
76-
# RECOMMENDED - Inline fields
77-
- stepId: map_data
78-
stepFunction:
79-
functionName: map_fields
80-
version: '2'
81-
parameters:
82-
fields:
83-
- targetFieldKey: email
84-
expression: $.email # Direct reference, NO step prefix
85-
type: string
86-
dataSource: $.steps.get_data.output.data
82+
fieldConfigs:
83+
- targetFieldKey: email
84+
expression: $.email # Relative to each record, NO step prefix
85+
type: string
86+
87+
steps:
88+
- stepId: map_data
89+
stepFunction:
90+
functionName: map_fields
91+
version: '2'
92+
parameters:
93+
dataSource: $.steps.get_data.output.data
8794
```
8895

89-
### 5. Expression Context Depends on Location
96+
### 5. Expressions Are Relative to Each Record
9097

91-
| Location | Expression Format | Example |
92-
|----------|------------------|---------|
93-
| Inline in `parameters.fields` | Direct field reference | `$.email`, `$.work.department` |
94-
| Action-level `fieldConfigs` | Step ID prefix required | `$.get_employees.email` |
98+
`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.
9599

96100
### 6. Never Suggest User-Side Mapping
97101

@@ -186,52 +190,44 @@ See `references/scope-patterns.md` for detailed patterns.
186190

187191
### Step 5: Map Fields to Schema
188192

189-
Use inline fields in map_fields parameters:
193+
Declare the mapping in action-level `fieldConfigs`, then run `map_fields` and `typecast` over the data:
190194

191195
```yaml
196+
fieldConfigs:
197+
- targetFieldKey: id
198+
expression: $.id
199+
type: string
200+
- targetFieldKey: email
201+
expression: $.email
202+
type: string
203+
- targetFieldKey: department
204+
expression: $.work.department # Nested field
205+
type: string
206+
- targetFieldKey: status
207+
expression: $.status
208+
type: enum
209+
enumMapper:
210+
matcher:
211+
- matchExpression: '{{$.status == "Active"}}'
212+
value: active
213+
- matchExpression: '{{$.status == "Inactive"}}'
214+
value: inactive
215+
- matchExpression: '{{$.status == null}}'
216+
value: unknown
217+
192218
steps:
193219
- stepId: map_data
194220
stepFunction:
195221
functionName: map_fields
196222
version: '2'
197223
parameters:
198-
fields:
199-
- targetFieldKey: id
200-
expression: $.id
201-
type: string
202-
- targetFieldKey: email
203-
expression: $.email
204-
type: string
205-
- targetFieldKey: department
206-
expression: $.work.department # Nested field
207-
type: string
208-
- targetFieldKey: status
209-
expression: $.status
210-
type: enum
211-
enumMapper:
212-
matcher:
213-
- matchExpression: '{{$.status == "Active"}}'
214-
value: active
215-
- matchExpression: '{{$.status == "Inactive"}}'
216-
value: inactive
217-
- matchExpression: '{{$.status == null}}'
218-
value: unknown
219224
dataSource: $.steps.get_data.output.data
220225
221226
- stepId: typecast_data
222227
stepFunction:
223228
functionName: typecast
224229
version: '2'
225230
parameters:
226-
fields:
227-
- targetFieldKey: id
228-
type: string
229-
- targetFieldKey: email
230-
type: string
231-
- targetFieldKey: department
232-
type: string
233-
- targetFieldKey: status
234-
type: enum
235231
dataSource: $.steps.map_data.output.data
236232
237233
result:
@@ -329,7 +325,7 @@ Actions:
329325
3. **If no skill**: Ask for schema, recommend creating `unified-hris-schema` skill for consistency across HRIS providers
330326
4. Research BambooHR endpoints: `/v1/employees`, `/v1/employees/directory`, custom reports
331327
5. Present options with trade-offs (field coverage, scopes, deprecation)
332-
6. After user selects, implement map_fields with inline fields using schema from skill
328+
6. After user selects, declare `fieldConfigs` using schema from skill and add map_fields and typecast steps
333329
7. Configure pagination with cursor support
334330
8. Test with `--debug`, verify field names match schema
335331
9. Document coverage
@@ -356,7 +352,7 @@ User says: "My unified connector returns provider field names instead of my sche
356352
Actions:
357353
1. Check if `targetFieldKey` uses YOUR schema names (not provider names)
358354
2. Verify `version: '2'` is specified on map_fields and typecast
359-
3. Check expression context - inline fields should NOT have step prefix
355+
3. Check expression context - `fieldConfigs` expressions should NOT have a step prefix
360356
4. Run with `--debug` to see raw response structure
361357
5. Verify dataSource path is correct
362358

@@ -383,20 +379,16 @@ Result: Working pagination with correct cursor handling.
383379

384380
### Mapping produces empty results
385381
**Cause**: Missing `version: '2'` or wrong expression context.
386-
**Fix**: Add `version: '2'` to map_fields and typecast. For inline fields, use direct references (`$.email`) without step prefix.
382+
**Fix**: Add `version: '2'` to map_fields and typecast. In `fieldConfigs`, use direct references (`$.email`) without step prefix.
387383

388384
### Enum values not translating
389385
**Cause**: `matchExpression` doesn't match provider values (case-sensitive).
390-
**Fix**: Check exact provider values with `--debug`. Use `.toLowerCase()` for case-insensitive matching. Always include null/unknown fallback.
386+
**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.
391387

392388
### Pagination returns same records
393389
**Cause**: Cursor not being sent or extracted correctly.
394390
**Fix**: Verify `iterator.key` matches API's expected parameter name. Check `nextKey` path against raw response. Verify `iterator.in` is correct (query/body/headers).
395391

396-
### Build fails with schema inference errors
397-
**Cause**: Action-level `fieldConfigs` triggering unwanted schema inference.
398-
**Fix**: Use inline fields in `map_fields` parameters instead of action-level `fieldConfigs`.
399-
400392
### Dynamic inputs resolve to undefined
401393
**Cause**: Using `paginated_request` which doesn't handle `$.inputs.*` well.
402394
**Fix**: Use standard `request` function with dual-condition pattern for defaults.
@@ -406,8 +398,10 @@ Result: Working pagination with correct cursor handling.
406398
| Resource | URL |
407399
|----------|-----|
408400
| CLI Package | https://www.npmjs.com/package/@stackone/cli |
409-
| Connector Engine Docs | https://docs.stackone.com/guides/connector-engine |
410-
| CLI Reference | https://docs.stackone.com/guides/connector-engine/cli-reference |
401+
| Connector Building Docs | https://docs.stackone.com/connector-building/overview.md |
402+
| CLI Reference | https://docs.stackone.com/connector-building/stackone-cli.md |
403+
| Defined Output Schemas | https://docs.stackone.com/connector-building/defined-output-schemas.md |
404+
| Connector YAML Reference | https://docs.stackone.com/connector-yaml-reference/overview.md |
411405

412406
## Creating Domain-Specific Schema Skills
413407

0 commit comments

Comments
 (0)