Automated summary
Generates the full skeleton of Segment action-destination code (destination index, per-action folders, tests) from an OpenAPI or web analysis document and a user-selected list of actions.
Strengths
- Automates directory scaffolding and index files for the destination and each selected action
- Ships ready-made authentication templates (custom API key, basic auth, managed OAuth) including testAuthentication and extendRequest
- Pulls endpoints, request body schemas, batch support, and default subscription details out of the analysis spec
- Relies on a standardized analysis format, making generation repeatable across APIs
Limitations
- Assumes an analysis document already exists in the Standard Analysis Format; it does not perform the analysis itself
- Only creates placeholder generated-types.ts files that must be generated later
- Emitted tests are basic scaffolds that need manual expansion
- Tightly coupled to the Segment action-destinations repo layout and conventions
Use it once an API analysis document is ready and you want to quickly scaffold a new Segment destination with several actions.
Skip it if you lack a conforming analysis document, or if you are building an integration outside the Segment action-destinations ecosystem.
Security analysis
CautionThis is a legitimate code-generation workflow for Segment destinations. It contains no destructive, exfiltrating, or obfuscated instructions, but it grants powerful file-editing/shell tools and uses user-provided paths/slugs for file operations, so caution is appropriate.
- •Declares Bash, Write, and Edit tools, enabling repository file creation and modification; no destructive commands are specified.
- •User-supplied analysis path and destination slug are used for filesystem operations without explicit sanitization guidance, so malformed input could affect unintended paths.
- •Generated code may call API endpoints for authentication/testing, but the skill itself does not exfiltrate secrets or obfuscate payloads.
Examples
Use the analysis at packages/destination-actions/.claude/openapi-analyses/acme-marketing.md to implement a destination called "Acme Marketing" (slug acme-marketing). Generate the destination index.ts plus the createOrUpdateContact and trackEvent actions.From the analysis document at .claude/openapi-analyses/braze.md, generate only the sendEmail and identifyUser actions for the braze destination, using the API-key-in-header auth scheme.Implement the destination slug acme-marketing from its analysis doc for actions createOrder, updateOrder, and deleteOrder, including the destination test and a basic test file for each action.name: implement-destination description: Generate destination code from analysis documents (OpenAPI or web-based) and user-selected actions version: 1.0.0 allowed-tools:
- Read
- Write
- Edit
- Bash
- Glob
- Grep
- AskUserQuestion disable-model-invocation: false
Destination Implementation Generator
This skill generates complete Segment action-destination code from analysis documents and user-selected actions.
Supported Analysis Sources:
- OpenAPI specifications (via
/openapi-analyze) - Website documentation (via
/web-analyze) - Any analysis document following the Standard Analysis Format
All analysis documents must follow the format defined in .claude/skills/implement-destination/analysis-format.md.
Instructions
Step 1: Gather Inputs
Ask the user for the following information:
- Analysis Document Path - Path to the analysis markdown file (should be in
packages/destination-actions/.claude/openapi-analyses/) - Destination Name - Human-readable name (e.g., "Acme Marketing", "Braze")
- Destination Slug - Auto-suggest based on name (e.g., "acme-marketing" from "Acme Marketing")
- Remove "actions-" prefix if user includes it - this is added automatically to the path
- Use lowercase, hyphens instead of spaces
- Selected Actions - Comma-separated list of action names to implement (from the analysis doc)
Step 2: Parse Analysis Document
Read the analysis markdown file and extract:
- API name, version, base URL
- Authentication scheme and required fields
- Test authentication endpoint
- Selected action specifications:
- Endpoint path and method
- Operation ID
- Description
- Field mappings table
- Request body schema
- Batch support
- Default subscription
Step 3: Create Destination Structure
Create the following directory structure:
packages/destination-actions/src/destinations/[slug]/
├── index.ts # Destination definition
├── generated-types.ts # Placeholder (auto-generated later)
├── [action-1]/
│ ├── index.ts # Action definition
│ ├── generated-types.ts # Placeholder
│ └── __tests__/
│ └── index.test.ts # Basic test
├── [action-2]/
│ └── ... (same structure)
└── __tests__/
└── index.test.ts # Destination test
Step 4: Generate Destination index.ts
Read the template at .claude/skills/implement-destination/templates/destination-index.md and customize it with:
- Destination name and slug
- Description from OpenAPI
- Authentication scheme and fields
- Test authentication endpoint (or TODO if not found)
- Import statements for all selected actions
- extendRequest implementation with proper headers
- Regional endpoint handling if applicable
Authentication Scheme Templates:
Custom (API Key in Header):
authentication: {
scheme: 'custom',
fields: {
apiKey: {
label: 'API Key',
description: 'Your [API Name] API key',
type: 'password',
required: true
}
},
testAuthentication: (request, { settings }) => {
return request('[TEST_ENDPOINT]', {
method: 'GET'
})
}
},
extendRequest({ settings }) {
return {
headers: {
Authorization: `Bearer ${settings.apiKey}`,
'Content-Type': 'application/json'
}
}
}
Basic Auth:
authentication: {
scheme: 'basic',
fields: {
username: {
label: 'Username',
description: 'Your [API Name] username',
type: 'string',
required: true
},
password: {
label: 'Password',
description: 'Your [API Name] password',
type: 'password',
required: true
}
},
testAuthentication: (request) => {
return request('[TEST_ENDPOINT]', {
method: 'GET'
})
}
}
OAuth2 Managed:
authentication: {
scheme: 'oauth-managed',
fields: {
// No additional fields needed for managed OAuth
},
testAuthentication: (request) => {
return request('[TEST_ENDPOINT]', {
method: 'GET'
})
}
}
Step 5: Generate Action Files
For each selected action, generate three files:
5.1: Action index.ts
Read the template at .claude/skills/implement-destination/templates/action-index.md and customize with:
- Action title and description
- Default subscription from analysis
- Fields from the field mappings table:
- Convert each field to an InputField definition
- Set type, label, description, required
- Add default path where suggested
- Handle special types (objects, arrays, datetime)
- Perform function with request to API endpoint
- PerformBatch function if batch is supported
Field Type Conversions:
// String field
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'string',
required: [true|false],
default: { '@path': '$.path.to.field' }
}
// Integer/Number field
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'integer', // or 'number'
required: [true|false]
}
// Boolean field
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'boolean',
required: [true|false],
default: false
}
// Object field
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'object',
required: [true|false],
properties: {
nestedField: {
label: '[Nested Label]',
type: 'string'
}
}
}
// Array field (multiple values)
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'string', // or object
multiple: true,
required: [true|false]
}
// Datetime field
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'datetime',
required: [true|false],
default: { '@path': '$.timestamp' }
}
// Enum field
fieldName: {
label: '[Label]',
description: '[Description]',
type: 'string',
required: [true|false],
choices: [
{ label: 'Option 1', value: 'option1' },
{ label: 'Option 2', value: 'option2' }
]
}
Perform Function Template:
perform: (request, { payload, settings }) => {
return request('[API_ENDPOINT]', {
method: '[POST|PUT|PATCH]',
json: {
// Map payload fields to API fields
[apiField]: payload.[segmentField],
// ... more mappings
}
})
}
PerformBatch Function Template (if supported):
performBatch: (request, { payload, settings }) => {
return request('[API_ENDPOINT]', {
method: 'POST',
json: payload.map(event => ({
[apiField]: event.[segmentField],
// ... more mappings
}))
})
}
5.2: Action generated-types.ts
Create placeholder file:
// This file is generated automatically by the CLI
// Run: ./bin/run generate:types --path packages/destination-actions/src/destinations/[slug]/index.ts
export interface Payload {
// Types will be generated from the action definition
}
5.3: Action Test File
Read the template at .claude/skills/implement-destination/templates/test-template.md and customize with:
- Action name
- Event type (track/identify/group)
- Sample event data
- Field mappings for test
- Assertions
Step 6: Generate Destination-Level Files
6.1: Destination generated-types.ts
// This file is generated automatically by the CLI
// Run: ./bin/run generate:types --path packages/destination-actions/src/destinations/[slug]/index.ts
export interface Settings {
// Types will be generated from the destination definition
}
6.2: Destination Test File
import { createTestIntegration } from '@segment/actions-core'
import Destination from '../index'
const testDestination = createTestIntegration(Destination)
describe('[Destination Name]', () => {
describe('testAuthentication', () => {
it('should validate authentication inputs', async () => {
const authData = { [authField]: 'test_value' }
await expect(testDestination.testAuthentication(authData)).resolves.not.toThrowError()
})
})
})
Step 7: Generate TypeScript Types
Run the CLI command to generate proper types:
./bin/run generate:types --path packages/destination-actions/src/destinations/[slug]/index.ts
Step 8: Create Implementation Notes
Generate a markdown file at packages/destination-actions/src/destinations/[slug]/IMPLEMENTATION_NOTES.md:
# [Destination Name] Implementation Notes
**Generated:** [date]
**From OpenAPI Analysis:** [analysis file path]
## Summary
This destination was generated from an OpenAPI specification analysis. The generated code provides ~70-80% of the implementation with clear TODOs for completion.
## Generated Files
- `index.ts` - Destination definition with [auth-type] authentication
[For each action:]
- `[action-name]/index.ts` - [Action description]
- `[action-name]/__tests__/index.test.ts` - Basic test for [action-name]
## TODO: Required Completions
### 1. Authentication
- [ ] Test `testAuthentication` with real API credentials
- [ ] Verify `extendRequest` headers are correct for API
- [ ] Confirm authentication error handling works
### 2. Actions
[For each action:]
- [ ] **[Action Name]:**
- [ ] Review field mappings accuracy
- [ ] Customize request body transformation if needed
- [ ] Add error handling for API-specific errors
- [ ] Test with real API (credentials required)
### 3. Testing
- [ ] Add comprehensive unit tests with mock API responses
- [ ] Test error scenarios (network errors, API errors, validation errors)
- [ ] Test batch operations (if applicable)
- [ ] Add integration tests
### 4. Documentation
- [ ] Update field descriptions with user-friendly language
- [ ] Add examples for complex fields
- [ ] Document any prerequisites or setup steps
- [ ] Add troubleshooting notes
## Next Steps
1. **Build and verify types:**
```bash
./bin/run generate:types --path packages/destination-actions/src/destinations/[slug]/index.ts
yarn build
```
-
Run tests:
yarn test packages/destination-actions/src/destinations/[slug] -
Fix TypeScript errors (if any)
-
Complete TODO items above
-
Test with real API:
- Obtain test credentials
- Configure destination in local development
- Send test events
- Verify API receives correct data
-
Code review and polish:
- Review generated code for any OpenAPI-specific quirks
- Add any missing edge case handling
- Ensure error messages are helpful
Known Limitations of Generated Code
- Error handling: Generic errors are thrown - customize for API-specific error codes
- Complex schemas: Nested objects may need manual refinement
- Dynamic fields: Cannot auto-generate dynamic field implementations
- Rate limiting: No automatic rate limit handling - add if needed
- Retries: No retry logic - add if API recommends it
API Documentation
- Base URL: [base URL]
- API Docs: [link if available]
- Support: [support contact if available]
### Step 9: Serve the Destination Locally
After generating the code, run the destination locally so the user can test it immediately:
```bash
./bin/run serve packages/destination-actions/src/destinations/[slug]
This starts a local HTTP server that exposes the destination's actions as endpoints. The user can send test requests directly to verify the destination behaves as expected before completing the TODO items.
If the serve command fails (e.g., due to TypeScript errors), inform the user and suggest running yarn build first to surface compilation errors.
Step 10: Present Results
Show the user a summary:
✓ Created destination: [Destination Name]
✓ Location: packages/destination-actions/src/destinations/[slug]/
✓ Generated [N] actions:
- [action-1]: [one-line description]
- [action-2]: [one-line description]
✓ Generated TypeScript type definitions
✓ Created test files
✓ Created IMPLEMENTATION_NOTES.md
✓ Destination server started
The destination is now running locally. Send test requests to verify behavior.
Next steps:
1. Review generated code in packages/destination-actions/src/destinations/[slug]/
2. Complete TODOs in IMPLEMENTATION_NOTES.md
3. Run: yarn test packages/destination-actions/src/destinations/[slug]
4. Test with real API credentials
5. To restart the server: ./bin/run serve packages/destination-actions/src/destinations/[slug]
Tips
- Always generate well-formatted, idiomatic TypeScript
- Follow existing destination patterns in the codebase
- Use proper imports from '@segment/actions-core'
- Leave clear TODO comments for manual work
- Ensure all files have proper error handling imports even if not fully implemented
- Keep perform functions simple - map payload to API request
- For complex transformations, add TODO comments explaining what's needed
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/destination-implementation-generator-mmio71yr' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/destination-implementation-generator-mmio71yr/download' --output '.skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md.part' && mv '.skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md.part' '.skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md' && test -s '.skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/implement-destination' && cp -R '.skill-downloads/destination-implementation-generator-mmio71yr' '.claude/skills/implement-destination'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/destination-implementation-generator-mmio71yr'openskills read 'destination-implementation-generator-mmio71yr'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/destination-implementation-generator-mmio71yr/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.