From prisme-ai
Build or audit Prisme.ai App+MCP consumer DSUL workspaces that consolidate tests for a target App surface and its MCP server through Agent Factory agents. Use when implementing, recreating, or assessing connector consumer workspaces.
How this skill is triggered — by the user, by Claude, or both
Slash command
/prisme-ai:app-mcp-build-consumerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill to implement or assess a Prisme.ai `*-consumer` workspace. Consumer workspaces are thin integration-test workspaces: they configure credentials, call imported App surfaces, create temporary Agent Factory agents for MCP tool calls, and assert contracts. They must not duplicate product logic from the target App or MCP workspace.
Use this skill to implement or assess a Prisme.ai *-consumer workspace. Consumer workspaces are thin integration-test workspaces: they configure credentials, call imported App surfaces, create temporary Agent Factory agents for MCP tool calls, and assert contracts. They must not duplicate product logic from the target App or MCP workspace.
docs/{workspace}/automations.md.workspaces/{workspace}/**/*.ymlslug{{secret.*}} in automations/imports# comments in automationsfetch transport-contract test is allowed and expected for initialize, notifications/initialized, and tools/list HTTP status/body compliance.| Item | Convention |
|---|---|
| Workspace folder | kebab-case {service}-consumer |
| Workspace slug | kebab-case {service}-consumer |
| Workspace name | {Service} Consumer |
| Labels | lower-case domain labels plus consumer, test |
| Import alias | PascalCase, no spaces |
| Import file | Same as import alias |
| Automation slug/file | camelCase, exact match |
| Test slug/file | test{Operation} or testMcp{Tool} |
| Agent helper | _call{Service}McpWithAgent or _runMcpToolWithAgent |
| Fixture helper | leading underscore, private |
| Aggregator | testRunAll |
| Secret key | lowerCamel |
| Config field | lowerCamel |
| Test fixture config | lowerCamel under test |
Keep the leading underscore only for private helpers. Do not copy existing kebab-case consumer automation names unless the workspace already requires them for compatibility.
workspaces/{service}-consumer/
+-- index.yml
+-- security.yml
+-- .import.yml
+-- imports/
| +-- {AppAlias}.yml
| +-- {AgentFactoryAlias}.yml
+-- automations/
+-- {operationName}.yml
+-- test{OperationName}.yml
+-- _runMcpToolWithAgent.yml
+-- testMcp{ToolName}.yml
+-- testRunAll.yml
docs/{service}-consumer/
+-- automations.md
Operation wrappers are optional, but useful when tests should read as a stable consumer API.
Discover current coverage from local files before writing final tests:
Do not require remote metadata fields that appear only after publishing, such as workspace IDs, checksums, export timestamps, or equivalent generated import metadata. Minimal security.yml forms are acceptable when they preserve the same local behavior as nearby consumers.
Declare secrets in index.yml under secrets.schema, reference them from config.value, and read only {{config.*}} in automations/imports.
config:
value:
serviceMcpSlug: service-mcp
serviceMcpApiKey: '{{secret.serviceMcpApiKey}}'
agentFactoryApiKey: '{{secret.agentFactoryApiKey}}'
secrets:
schema:
serviceMcpApiKey:
type: string
title: Service MCP API Key
ui:widget: password
agentFactoryApiKey:
type: string
title: Agent Factory API Key
ui:widget: password
Do not use {{secret.*}} inside automations or import files.
For every supported App operation:
testsSkipped, testsPassed: 0, and a clear skippedReason.Mutation tests must not mutate shared fixtures unless explicitly marked destructive and requested by the user.
For every supported MCP tool, create a test that proves Agent Factory can call that tool.
Required flow:
sendResult.task.status.state == "completed".sendResult.task.tool_calls exists and is non-empty.completed or another success value documented for that platform response.Do not pass an MCP test based on final natural-language answer text. The tool-call trace is the source of truth.
Use one shared private helper for the repeated Agent Factory setup/send/cleanup flow when more than one MCP tool is tested. Individual testMcp{ToolName} automations should prepare tool arguments, call the helper, and assert the returned tool-call trace plus any structured result that is available.
Required cleanup shape:
- set:
name: agentId
value: ''
- try:
do:
- AgentFactory.createAgent:
output: createdAgent
- set:
name: agentId
value: '{{createdAgent.id}}'
- AgentFactory.addTool:
agent_id: '{{agentId}}'
output: addedTool
- AgentFactory.sendMessage:
agent_id: '{{agentId}}'
output: sendResult
catch:
- set:
name: errors
type: push
value: 'Agent MCP test crashed: {{$error.message}}'
- conditions:
'{{agentId}}':
- try:
do:
- AgentFactory.deleteAgent:
agent_id: '{{agentId}}'
output: deleteAgentResult
catch:
- set:
name: errors
type: push
value: 'Cleanup failed for temporary agent {{agentId}}: {{$error.message}}'
Adapt the import alias to the local Agent Factory import, but keep the workflow and assertions.
Consumer workspaces should include a direct webhook transport test for the target MCP endpoint, using DSUL fetch, in addition to Agent Factory tool-call coverage.
The transport test must call the deployed MCP webhook and assert the actual HTTP status/body contract:
initialize with a JSON-RPC id returns HTTP 200 and a JSON-RPC result.notifications/initialized without an id returns HTTP 202 and an empty body.tools/list with a JSON-RPC id returns HTTP 200 and result.tools.Do not use direct MCP JSON-RPC tests as the only MCP coverage. Agent Factory tests remain required for tool-call behavior. The direct fetch test exists only to catch HTTP transport regressions that execute_automation and Agent Factory tool assertions can hide, especially webhook serialization bugs like empty notification responses being coerced to {}.
Prefer disposable resources for mutating tests.
Every consumer should expose testRunAll. It must:
results, totalRun, totalPassed, totalFailed, totalSkipped, and allErrors;try/catch;Full testRunAll runs may take longer than the client timeout, especially when many Agent Factory MCP tests are included. A client timeout does not automatically mean the execution failed.
When a full run times out, inspect the activity feed/events for the run correlation ID after the execution finishes. Use the trace to recover the completed suite result, failed step, and final output.
Create or update docs/{workspace}/automations.md with:
testRunAll;comment: instructions, not YAML # comments.set: type: push for array appends.string, number, object, array, boolean.required: true and properties on the same argument node.private: true for helpers and internal test suites.{{variable}} for substitution and {% expression %} for computed values.matches, and, and or in condition keys, not inside {% %} expressions.npx claudepluginhub prismeai/prismeai-mcp --plugin prisme-aiGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.