/platform:upload-artifactfrom platform
Uploads a file as a ClosedLoop document (PRD, implementation plan, feature, or template) via MCP without consuming conversation context. Supports creating new versions of existing documents.
Ships in platform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Upload file content as a ClosedLoop MCP artifact. Two modes:
Script mode (preferred) — uses a standalone Python script that reads the
file and calls MCP directly over Streamable HTTP. No conversation context
consumed for file content. Requires CLOSEDLOOP_API_KEY and
NEXT_PUBLIC_MCP_SERVER_URL to already be present in the current shell
environment.
MCP fallback — reads the file into context and calls mcp__closedloop__create-document
directly. Uses Claude Code's existing MCP auth. Used when the required
script-mode environment variables are not available.
Follow these steps in order:
Read these values from the current shell environment. Do not read, source, or
otherwise rely on a .env.local file in the current working directory:
CLOSEDLOOP_API_KEY — the API key (starts with sk_live_)NEXT_PUBLIC_MCP_SERVER_URL — the MCP server URLIf both exist → use script mode (Steps 2a–5a). If either variable is missing → use MCP fallback (Steps 2b–5b).
Run the script with --list-projects:
uv run --with 'mcp[cli]>=2,<3' ${CLAUDE_SKILL_DIR}/scripts/upload_artifact.py \
--url "$NEXT_PUBLIC_MCP_SERVER_URL" \
--api-key "$CLOSEDLOOP_API_KEY" \
--list-projects
Parse the JSON output. Extract the items array. Each item has id and name.
Use AskUserQuestion to present the projects to the user:
If only one project exists, skip the question and use it automatically.
Use AskUserQuestion to collect any parameters the user hasn't already specified:
Only ask for parameters the user hasn't already specified. For example, if they said "upload /tmp/my-prd.txt as a PRD", you already have the file path and type — only ask for the title.
uv run --with 'mcp[cli]>=2,<3' ${CLAUDE_SKILL_DIR}/scripts/upload_artifact.py \
--url "$NEXT_PUBLIC_MCP_SERVER_URL" \
--api-key "$CLOSEDLOOP_API_KEY" \
--file <FILE_PATH> \
--title "<TITLE>" \
--type <TYPE> \
--project-id <PROJECT_ID>
Add --verify if the user requested verification or if testing limits.
Add --artifact-id <ID_OR_SLUG> instead of --title/--type/--project-id
when creating a new version of an existing document. The flag accepts a UUID
or a user-facing slug (PRD-*, PLN-*, FEA-*); the server resolves it.
Parse the JSON output and report to the user:
PLN-376) and IDoperationReceipt.operationId, a clop_ id), only when the
output has an operationReceipt; the server omits it when receipts are off--verify was used)Call mcp__closedloop__list-projects to get available projects.
Use AskUserQuestion to let the user pick a project (skip if only one).
Same as Step 3a — use AskUserQuestion for any missing file_path, title, or type.
Read the file content with the Read tool, then call:
mcp__closedloop__create-document for new documents (pass title, type,
content, and projectId). type is one of PRD, IMPLEMENTATION_PLAN,
FEATURE, or TEMPLATE.mcp__closedloop__create-document-version for new versions (pass
documentId and content). documentId accepts a UUID or a user-facing
slug (PRD-*, PLN-*, FEA-*).Note: the file content will be loaded into conversation context in this mode.
Report the document slug (PRD-*, PLN-*, FEA-*) and ID from the MCP tool response.
| Flag | Required | Description |
|---|---|---|
--url | No | MCP server URL (default: http://localhost:3010/mcp) |
--api-key | Yes | ClosedLoop API key (sk_live_...) |
--list-projects | No | List projects and exit |
--file | Upload | Path to content file |
--title | Create | Document title |
--type | Create | PRD, IMPLEMENTATION_PLAN, FEATURE, or TEMPLATE |
--project-id | No | Project ID or slug (PRO-*) |
--workstream-id | No | Workstream ID or slug (WRK-*) |
--artifact-id | Version | Existing document ID or slug (PRD-*/PLN-*/FEA-*) for new version |
--verify | No | Fetch back after upload and compare lengths |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/claude-code-expertThis skill should be used when working with Claude Code infrastructure including agents, skills, slash commands, hooks, plugins, settings.json, or CLAUDE.md files. Triggers on YAML frontmatter, .claude/ directory files, Task tool configuration, or hook debugging. Do NOT use for creating NEW skills from scratch - use claude-creator instead./skill-creatorGuide for creating NEW skills from scratch. This skill should be used when users want to create a new skill or scaffold a skill directory. Triggers on "create a skill", "new skill", or "scaffold skill". Do NOT use for updating existing skills - use claude-code-expert instead./context-engineeringnpx claudepluginhub closedloop-ai/claude-plugins --plugin platformOther plugins' skills for the same job