Prismatic-skills component-patterns
Architecture patterns, code generation guides, and reference documentation for building Prismatic custom components.
install
source · Clone the upstream repo
git clone https://github.com/prismatic-io/prismatic-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/prismatic-io/prismatic-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/component-patterns" ~/.claude/skills/prismatic-io-prismatic-skills-component-patterns && rm -rf "$T"
manifest:
skills/component-patterns/SKILL.mdsource content
Component Patterns
Reference documentation for building Prismatic custom components.
<disallowed-tools> Do NOT use these MCP tools — they return incomplete data that causes broken scaffolds and missing connections downstream. A hook will deny them, but avoid the wasted round trip.
— Usemcp__prism__prism_components_list
insteadrun.ts find-components <keyword>
— Usemcp__prism__prism_components_init
insteadrun.ts scaffold-component
— Usemcp__prism__prism_components_publish
insteadrun.ts publish-component
— Manifests are auto-generated during scaffoldingmcp__prism__prism_components_generate_manifest
— Handled bymcp__prism__prism_install_component_manifestrun.ts scaffold-project --components
— Handled bymcp__prism__prism_install_legacy_component_manifest
</disallowed-tools>run.ts scaffold-project --components
Architecture Patterns
Connector Components
- Wrap external APIs (Salesforce, Canny, HubSpot, etc.)
- Support OAuth2, API Key, Bearer Token, Basic Auth
- Define connections, actions, triggers, and data sources
- Installed via Prism CLI
Utility Components
- Provide helper actions (data transformation, formatting, etc.)
- No external connections needed
- Define only actions with typed inputs
Config Mantra
Components define their own inputs — not
configVar() wrappers. Each action uses input() definitions directly:
for typed action inputs (label, type, required, comments, default)input()
for auth field definitions (key, label, inputs)connection()- Use
for input type constantsutil.types - See
for connection field patternsreferences/authentication-patterns.md
Phase: API Research
When the
on_answer trigger fires for api_docs_url, the agent spawns the external-api-researcher
agent with the URL. The researcher fetches and analyzes the API docs, producing a structured JSON
spec at {session_dir}/api-research.json. The component builder waits for results before proceeding.
- See
for the output format and research strategiesreferences/api-research-guide.md - Research results inform
,auth_type
,confirm_resources
,webhook_supportbase_url
Phase-Specific References
Load only the references relevant to your current workflow phase. This keeps context focused and avoids attention budget waste.
Phase 2: Requirements Gathering
- Spec items carry
(narration backbone),agent_context
(per-option consequence maps), andimplications
(Prismatic doc URLs). The agent uses these inline — no external references needed for most questions. Docs are fetched on demand only when agent_context is insufficient or the user asks a follow-up beyond what the curated content covers.docs
- How to research external APIs (load whenreferences/api-research-guide.md
is answered)api_docs_url
Phase 3: Scaffold
- Component directory structurereferences/component-architecture.md
- Spectral SDK basicsreferences/spectral-component-quickstart.md
Phase 4: Code Generation (PRIMARY PHASE)
See the
<spec-loading> block in component-builder.md for progressive disclosure rules.
The references below are the full set available — load per the agent's guidance.
- LOAD FIRST — Maps component.yaml answers directly to TypeScript code snippets. Spec items withreferences/answer-to-code-cookbook.md
fields point to specific headings in this file — Grep for those headings to find exact patterns, especially after context compaction.cookbook_section
- File generation patterns and component structurereferences/code-generation-guide.md
- API Key, OAuth2, Bearer Token, Basic Auth patternsreferences/authentication-patterns.md- Templates:
- Structural templates for all source files${CLAUDE_PLUGIN_ROOT}/templates/component/
Conditional references for Phase 4 (load based on requirements):
- If webhook triggers:
- Webhook trigger lifecycle and implementationreferences/trigger-patterns.md - If polling triggers:
- Polling trigger withreferences/trigger-patterns.md
,pollingTrigger()
state managementcontext.polling - If OAuth2 auth:
- Deep dive on OAuth2 connections (usereferences/oauth2-connection-guide.md
from spectral, NOToauth2Connection()
)connection() - If data sources:
- Data source implementation patternsreferences/data-source-patterns.md - Always for connectors:
- HTTP client helper patternsreferences/client-patterns.md
Phase 5: Build & Publish
- Build/publish failure solutionsreferences/troubleshooting-errors.md
Examples (consult during code generation)
- Complete utility examplereferences/examples/utility-component/
- Connector with API Key authreferences/examples/apikey-connector/
- Connector with OAuth2 authreferences/examples/oauth2-connector/
All References
Full reference list for manual lookup:
- Maps component.yaml answers to TypeScript codereferences/answer-to-code-cookbook.md
- How to research external APIsreferences/api-research-guide.md
- Component directory structurereferences/component-architecture.md
- File generation patternsreferences/code-generation-guide.md
- API Key and OAuth2 patternsreferences/authentication-patterns.md
- Deep dive on OAuth2 connectionsreferences/oauth2-connection-guide.md
- Spectral SDK basicsreferences/spectral-component-quickstart.md
- Webhook trigger lifecyclereferences/trigger-patterns.md
- Data source patternsreferences/data-source-patterns.md
- HTTP client helper patternsreferences/client-patterns.md
- Build/publish failure solutionsreferences/troubleshooting-errors.md
- Complete utility examplereferences/examples/utility-component/
- Connector with API Key authreferences/examples/apikey-connector/
- Connector with OAuth2 authreferences/examples/oauth2-connector/
Component Key Patterns
- Function-based client:
returningcreateClient(connection, debug)
from spectral — NOT class-basedHttpClient - Error hook: Every component MUST include
— re-throwhooks: { error: (error) => { ... } }
as-is, wrap others inConnectionErrornew Error() - rawRequest action: REQUIRED in every component at
actions/misc/rawRequest.ts - Folder-based structure:
,actions/<resource>/
,inputs/
,examplePayloads/
,dataSources/triggers/ - examplePayload: Every action must have one, imported from
, verified against APIsrc/examplePayloads/ - Clean functions: Every non-connection input needs
(or toBool, toNumber, etc.)clean: util.types.toString - Input requirements:
,comments
,placeholder
on every string inputexample - Data source elements:
format (NOT{ label, key }
) — type is{ label, value }
from spectralElement - Debug wiring:
→context.debug.enabled
in actions,createClient(connection, debug)
in lifecycle hooksfalse - ConnectionError: Thrown in client.ts for connection type mismatches, NOT in actions
- Webhook URL:
in lifecycle hookscontext.webhookUrls[context.flow.name] - Connection keys: Simple names (
,"apiKey"
) — NOT"oauth2""component-api-key" - Action return: Always
. DataSource return:{ data: <result> }{ result: Element[] }