Skip to content

docs: harden destination-generator skill from PR feedback + document /orchestrate#3852

Open
mdkhan-tw wants to merge 1 commit into
mainfrom
mz-skill-fix
Open

docs: harden destination-generator skill from PR feedback + document /orchestrate#3852
mdkhan-tw wants to merge 1 commit into
mainfrom
mz-skill-fix

Conversation

@mdkhan-tw

@mdkhan-tw mdkhan-tw commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the Claude Code destination-generator skill and its docs. No product/destination code changes — this is tooling + documentation only (.claude/ skills and READMEs).

Two things:

  1. Encodes real PR-review feedback into the /generate-destination skill so future generated destinations follow repo conventions by default.
  2. Documents the /orchestrate one-command pipeline for end users (root README + skills README/QUICK_START).

All patterns were verified against existing destinations in the repo (klaviyo, reddit-conversions-api, iterable, ms-bing-capi, s3, trackey) before being written into the skill.

Feedback incorporated into generate-destination.md

# Feedback Change
1 Enable batching with batch_keys + implement performBatch New Batching (REQUIRED) section: enable_batching / batch_size / batch_keys field defs + perform/performBatch delegating to a shared utils.ts helper. Added to constraints & checklist.
2 Avoid registering the destination ID in destinations/index.ts Step 6 rewritten to "Do NOT register a destination ID" — leave the registry untouched and record it as a PR TODO for the production-assigned metadata ID (IDs must match across environments, synced via sprout).
3 Every request/response object should be typed New Typed Requests and Responses (REQUIRED) section: interfaces in types.ts, annotated request bodies, request<ResponseType>(...).
4 Separate types.ts, constants.ts, utils.ts for send logic Updated folder structure + file-generation order + a file-organization rule (endpoints/enums → constants.ts, interfaces → types.ts, send logic → utils.ts; actions are thin wrappers).
5 Snapshot tests were missing New Snapshot Tests (REQUIRED) section with the shared generateTestData boilerplate; snapshot.test.ts added to structure & checklist.

Also fixed the documented test command to use the package-local Jest binary (avoids the root Jest 30 bind crash).

/orchestrate documentation

  • Root README.md — new concise, end-user-facing "Generate a Destination with Claude Code" section (+ TOC entry).
  • .claude/skills/README.md — "🚀 Start here: /orchestrate" section with the 7-step pipeline and conventions callout.
  • .claude/skills/QUICK_START.md/orchestrate fastest-path at the top + pipeline commands in the file-locations table.

Files changed

  • .claude/commands/generate-destination.md
  • .claude/skills/README.md
  • .claude/skills/QUICK_START.md
  • README.md

Testing

Docs/skill-definition changes only — no runtime code affected. All patterns cross-checked against existing destinations for accuracy.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 3, 2026 06:25
@mdkhan-tw mdkhan-tw changed the title updating skills docs: harden destination-generator skill from PR feedback + document /orchestrate Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds and expands documentation around using Claude Code “skills” to scaffold Segment action-destinations, including a new /orchestrate end-to-end flow and stronger guidance for batching, typing, snapshots, and registration conventions.

Changes:

  • Adds a new top-level README section introducing Claude Code scaffolding commands.
  • Expands .claude/skills docs with an /orchestrate quick path and updated generated file conventions.
  • Updates the /generate-destination command guidance (batching, typed I/O, snapshot tests, and avoiding placeholder destination IDs).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
README.md Adds a “Generate a Destination with Claude Code” section and command list.
.claude/skills/README.md Adds /orchestrate documentation and updates generated destination structure/conventions.
.claude/skills/QUICK_START.md Adds an /orchestrate fast path and updates the file map.
.claude/commands/generate-destination.md Adds detailed generator rules for file organization, batching, typed requests/responses, and snapshot testing.

Comment thread README.md
Comment on lines +54 to +59
| Command | What it does |
| ----------------------- | ----------------------------------------------- |
| `/refined-actions` | Turn a PRD or API docs into a list of actions |
| `/endpoint-mapping` | Map those actions to API endpoints and fields |
| `/spec-generator` | Produce a full destination spec document |
| `/generate-destination` | Generate the destination code, types, and tests |
Comment thread .claude/skills/README.md
Comment on lines +21 to +29
| Step | Skill | Output |
| ----------------- | ----------------------- | --------------------------------------------------------------- |
| 1. Refine | `/refined-actions` | `refined-actions.md` / `.json` |
| 2. Map | `/endpoint-mapping` | `endpoint-mapping.md` / `.json` |
| 3. Spec | `/spec-generator` | `final-spec.md` |
| 4. Generate | `/generate-destination` | code in `packages/destination-actions/src/destinations/<slug>/` |
| 5. Test (local) | `/test-destination-e2e` | local e2e results |
| 6. Deploy | `/deploy-staging` | staging deploy |
| 7. Test (staging) | `/test-destination-e2e` | staging e2e results |
Comment thread .claude/skills/README.md
Comment on lines +27 to +29
| 5. Test (local) | `/test-destination-e2e` | local e2e results |
| 6. Deploy | `/deploy-staging` | staging deploy |
| 7. Test (staging) | `/test-destination-e2e` | staging e2e results |
Comment on lines +126 to +130
| Spec Auth Type | Code Pattern |
| -------------- | -------------------------------------------- |
| OAuth 2.0 | `scheme: 'oauth2'` with `refreshAccessToken` |
| API Key | `scheme: 'custom'` with key in `fields` |
| Basic Auth | `scheme: 'basic'` with username/password |

Run tests: `yarn cloud jest --testPathPattern="<destination-slug>"`
Run tests. Note the repo has a Jest version quirk: the `yarn cloud jest` wrapper may resolve to an incompatible root Jest. If you hit a `Cannot read properties of undefined (reading 'bind')` error, run the package-local binary directly instead:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants