piece-builder skill, which lives in the repository at .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.
Before You Start
1
Fork and clone the repository
Follow Fork Repository and Development Setup to get the mono-repo running locally.
2
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.3
Ask for a piece
In Claude Code, invoke the skill directly: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.
Task Modes
The skill picks a workflow based on what you ask for.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.Here’s what the agent Piece Building workflow looks like.
1
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.
2
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.3
Scaffold
It creates the piece structure and copies the config files from the scaffold reference:
4
Implement
The agent writes auth, actions, and triggers using the vetted patterns in the skill’s reference files rather than copying older, inconsistent pieces.
5
Wire and verify
It imports every action and trigger in Both must pass. Lint failures block CI even when the build is green.
src/index.ts, adds createCustomApiCallAction, adds AI metadata, registers the piece alphabetically in tsconfig.base.json, then runs:Test Your Piece Locally
AddAP_DEV_PIECES=<name> to the repository-root .env.dev, start with npm start, and open localhost:4200.
Benefits of The Piece Building Skill
Easy for non-technical users
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.
Table-ready output
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.AI-ready metadata
AI-ready metadata
Every hand-written action carries
audience, aiMetadata, and classification. Every trigger carries aiMetadata and classification: 'READ'. See AI Metadata.Versioning
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.Gotchas
Gotchas
- Action and trigger
namefields 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.
Reference Files
The agent opens these files from the skill folder when it needs a concrete example.Next Steps
Share Your Piece
Contribute it to the main repo or publish it privately.
Piece Reference
Review the framework APIs the agent uses.