AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
docs(pieces): recommend the piece-builder skill for building pieces (#15997)
mintlify[bot]e13c9d55e8d3
diff --git a/docs/build-pieces/building-pieces/build-with-ai.mdx b/docs/build-pieces/building-pieces/build-with-ai.mdxnew file mode 100644index 00000000000..abb813aa4a6--- /dev/null+++ b/docs/build-pieces/building-pieces/build-with-ai.mdx@@ -0,0 +1,149 @@+---+title: "Build Pieces with AI Using the Piece Builder Skill"+sidebarTitle: "Build with AI (Recommended)"+description: "Use the piece-builder skill with Claude Code or Cursor to research an API, scaffold a piece, write actions and triggers, and verify the build."+icon: "wand-magic-sparkles"+---++The fastest way to build an Activepieces piece is the `piece-builder` skill, which lives in the repository at [`.agents/skills/piece-builder`](https://github.com/activepieces/activepieces/tree/main/.agents/skills/piece-builder). It teaches your AI coding agent the Activepieces conventions so it can create a new piece, add actions or triggers to an existing one, or fix a bug, then build and lint it for you.++<Tip>+ This is the recommended way to build pieces. The [manual tutorial](/build-pieces/building-pieces/start-building) is still available if you want to learn the framework step by step.+</Tip>++## Before You Start++<Steps>+ <Step title="Fork and clone the repository">+ Follow [Fork Repository](/build-pieces/building-pieces/setup-fork) and [Development Setup](/build-pieces/building-pieces/development-setup) to get the mono-repo running locally.+ </Step>+ <Step title="Open the repo in your AI agent">+ The skill is picked up automatically. Both`.claude/skills` and `.cursor/skills` point to `.agents/skills`, so Claude Code and Cursor load it with no extra configuration.+ </Step>+ <Step title="Ask for a piece">+ In Claude Code, invoke the skill directly:++ ```bash+ /piece-builder "app name" # Build or extend a piece+ ```++ You can also just describe the work ("add a Create Invoice action to the Stripe piece"). The agent uses the skill whenever you ask to work on an Activepieces piece, connector, or integration.+ </Step>+</Steps>++## Task Modes++The skill picks a workflow based on what you ask for.++| Mode | What you're doing | What the agent does |+|---|---|---|+| **New piece** | Building an integration for an app that has no piece yet | Runs the full five-step workflow below |+| **Add action / trigger** | An existing piece needs another operation or event | Opens the existing piece, matches its conventions (its `common/` helpers, auth access, file naming, error handling), implements, wires, verifies, and bumps the piece version |+| **Fix a bug** | An existing action or trigger misbehaves | Reproduces, reads the offending file and its `common/` helpers, applies the smallest fix that matches the surrounding style, verifies, and bumps the piece version |++<Note>+ For existing pieces, the piece being edited is the source of truth, not the templates. The one exception is framework calls that silently drop data: for example, if a piece passes a hand-picked subset to `pollingHelper` instead of the whole `context`, the agent fixes every trigger in that piece while it is there.+</Note>++## Here's what the agent Piece Building workflow looks like.++<Steps>+ <Step title="Research">+ The agent finds the target app's REST API docs, identifies the auth method (API key, OAuth2, Basic Auth, or custom), lists endpoints, checks for webhook support, and notes the base URL, pagination, and rate limits.+ </Step>+ <Step title="Plan">+ It places the piece in `packages/pieces/community/` (or `packages/pieces/custom/` if you ask for a custom piece), chooses the auth type, and selects the most useful actions (CRUD, search, list) and triggers (webhook if supported, polling otherwise).++ The agent asks you before starting when OAuth2 URLs or scopes are missing from the docs, the auth method is unclear, more than 10 actions are possible, the API uses webhook signature verification, or test credentials are needed.+ </Step>+ <Step title="Scaffold">+ It creates the piece structure and copies the config files from the scaffold reference:++ ```text+ packages/pieces/community/<name>/+ src/+ index.ts+ lib/+ auth.ts # Auth always lives here, never inline in index.ts+ actions/ # One file per action+ triggers/ # One file per trigger+ common/ # Shared helpers (optional)+ package.json+ .eslintrc.json+ tsconfig.json+ tsconfig.lib.json+ ```+ </Step>+ <Step title="Implement">+ The agent writes auth, actions, and triggers using the vetted patterns in the skill's reference files rather than copying older, inconsistent pieces.+ </Step>+ <Step title="Wire and verify">+ It imports every action and trigger in `src/index.ts`, adds `createCustomApiCallAction`, adds AI metadata, registers the piece alphabetically in `tsconfig.base.json`, then runs:++ ```bash+ bun install # new pieces only, creates workspace symlinks+ npx turbo run build --filter=@activepieces/piece-<name>+ npx turbo run lint --filter=@activepieces/piece-<name>+ ```++ Both must pass. Lint failures block CI even when the build is green.+ </Step>+</Steps>++## Test Your Piece Locally++Add `AP_DEV_PIECES=<name>` to the repository-root `.env.dev`, start with `npm start`, and open `localhost:4200`.++## Benefits of The Piece Building Skill++<AccordionGroup>+ <Accordion title="Easy for non-technical users">+ - Dynamic dropdowns instead of asking users to type IDs.+ - Descriptions that teach (where to click, what to copy) instead of restating the field name.+ - `Property.MarkDown()` instructions for complex setup.+ - Sensible defaults, plain-language names ("Create Contact", "New Order"), and step-by-step auth descriptions.+ </Accordion>+ <Accordion title="Table-ready output">+ Outputs are flattened (`{ user_name: "Jo" }` rather than `{ user: { name: "Jo" } }`), list actions return arrays with consistent keys, and key names are human-readable so they map cleanly to Google Sheets and Activepieces Tables columns.+ </Accordion>+ <Accordion title="AI-ready metadata">+ Every hand-written action carries `audience`, `aiMetadata`, and `classification`. Every trigger carries `aiMetadata` and `classification: 'READ'`. See [AI Metadata](/build-pieces/piece-reference/ai-metadata).+ </Accordion>+ <Accordion title="Versioning">+ Every change to an existing piece bumps its `package.json` version. Removing an action, trigger, or prop, adding a required prop, or changing behavior is **MAJOR**. Adding an action, trigger, optional prop, or output attribute is **MINOR**; fixing a bug without changing the public surface is **PATCH**. See [Piece Versioning](/build-pieces/piece-reference/piece-versioning).+ </Accordion>+ <Accordion title="Gotchas">+ - Action and trigger `name` fields are permanent. Flows store them by name, so never change them after publishing.+ - Auth is imported by actions and triggers but never re-exported from `index.ts`.+ </Accordion>+</AccordionGroup>++## Reference Files++The agent opens these files from the skill folder when it needs a concrete example.++| File | Covers |+|---|---|+| `SKILL.md` | Entry point: task modes, workflow, quick auth and piece templates |+| `new-piece-scaffold.md` | The four config files for a new piece |+| `auth-patterns.md` | Auth wiring and connection identifiers |+| `action-patterns.md` | Full shape of an action file |+| `trigger-patterns.md` | Polling, webhook, handshake, and renewal triggers |+| `property-ui-selection.md` | Choosing prop components, display modes, and layout |+| `props-patterns.md` | Exact syntax for each prop type |+| `common-patterns.md` | Shared API helpers, pagination, and custom API calls |+| `ux-guidelines.md` | Advanced UX patterns |+| `output-quality.md` | Flattening nested API responses |+| `ai-metadata.md` | `audience`, `aiMetadata`, and `classification` rules |+| `piece-types.md` | Community, core, and custom pieces and `PieceCategory` values |++## Next Steps++<CardGroup cols={2}>+ <Card title="Share Your Piece" icon="share" href="/build-pieces/sharing-pieces/overview">+ Contribute it to the main repo or publish it privately.+ </Card>+ <Card title="Piece Reference" icon="book" href="/build-pieces/piece-reference/authentication">+ Review the framework APIs the agent uses.+ </Card>+</CardGroup>diff --git a/docs/build-pieces/building-pieces/create-trigger.mdx b/docs/build-pieces/building-pieces/create-trigger.mdxindex 92ea576c259..f59aa0bca68 100644--- a/docs/build-pieces/building-pieces/create-trigger.mdx+++ b/docs/build-pieces/building-pieces/create-trigger.mdx@@ -144,4 +144,4 @@ Once you have completed these configurations, you will be able to test webhook t</Warning>-\ No newline at end of file+diff --git a/docs/build-pieces/building-pieces/overview.mdx b/docs/build-pieces/building-pieces/overview.mdxindex b4f284420bf..626b2bc758e 100755--- a/docs/build-pieces/building-pieces/overview.mdx+++ b/docs/build-pieces/building-pieces/overview.mdx@@ -6,6 +6,10 @@ icon: 'hand-wave'Building pieces is fun and important; it allows you to customize Activepieces for your own needs.+<Card title="Build with AI (Recommended)" horizontal href="/build-pieces/building-pieces/build-with-ai">+ The fastest way to build a piece: let Claude Code or Cursor research the API, scaffold, implement, and verify it using the piece-builder skill.+</Card>+<Tip>We love contributions! In fact, most of the pieces are contributed by the community. Feel free to open a pull request.</Tip>diff --git a/docs/build-pieces/building-pieces/piece-authentication.mdx b/docs/build-pieces/building-pieces/piece-authentication.mdxindex 76d64d0ad67..5e898180faf 100644--- a/docs/build-pieces/building-pieces/piece-authentication.mdx+++ b/docs/build-pieces/building-pieces/piece-authentication.mdx@@ -35,4 +35,4 @@ export const gelato = createPiece({<Note>Use the value **test-key** as the API key when testing actions or triggers forGelato.-</Note>\ No newline at end of file+</Note>diff --git a/docs/build-pieces/building-pieces/start-building.mdx b/docs/build-pieces/building-pieces/start-building.mdxindex 318aa76755f..ae29062935b 100644--- a/docs/build-pieces/building-pieces/start-building.mdx+++ b/docs/build-pieces/building-pieces/start-building.mdx@@ -3,6 +3,11 @@ title: 'Start Building'icon: 'hammer'description: ''---++<Tip>+ Want to skip the manual steps? [Build with AI](/build-pieces/building-pieces/build-with-ai) using the piece-builder skill, the recommended way to build pieces.+</Tip>+This section guides you in creating a Gelato piece, from setting up your development environment to contributing the piece. By the end of this tutorial, you will have a piece with an action that fetches a random ice cream flavor and a trigger that fetches newly created ice cream flavors.<Info>diff --git a/docs/docs.json b/docs/docs.jsonindex 966942f03ce..55f14a3ae38 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -484,24 +484,31 @@{"group": "Build a Piece","pages": [- "build-pieces/building-pieces/overview",- "build-pieces/building-pieces/start-building",- "build-pieces/building-pieces/setup-fork",- "build-pieces/building-pieces/development-setup",- "build-pieces/building-pieces/piece-definition",- "build-pieces/building-pieces/piece-authentication",- "build-pieces/building-pieces/create-action",- "build-pieces/building-pieces/create-trigger",- {- "group": "Sharing Pieces",- "icon": "circle-7",- "pages": [- "build-pieces/sharing-pieces/overview",- "build-pieces/sharing-pieces/contribute",- "build-pieces/sharing-pieces/community",- "build-pieces/sharing-pieces/private"- ]- }+ "build-pieces/building-pieces/overview",+ "build-pieces/building-pieces/build-with-ai",+ {+ "group": "Build Manually",+ "pages": [+ "build-pieces/building-pieces/start-building",+ "build-pieces/building-pieces/setup-fork",+ "build-pieces/building-pieces/development-setup",+ "build-pieces/building-pieces/piece-definition",+ "build-pieces/building-pieces/piece-authentication",+ "build-pieces/building-pieces/create-action",+ "build-pieces/building-pieces/create-trigger"+ ],+ "icon": "hammer"+ },+ {+ "group": "Sharing Pieces",+ "icon": "share",+ "pages": [+ "build-pieces/sharing-pieces/overview",+ "build-pieces/sharing-pieces/contribute",+ "build-pieces/sharing-pieces/community",+ "build-pieces/sharing-pieces/private"+ ]+ }]},{