
artifact-publisher
by oimiragieo
SKILL.md
name: artifact-publisher version: 1.0.0 description: Publish and share Claude Artifacts with Projects, Cursor, and downstream agents. Use when a user wants to "save", "share", or "finalize" a generated artifact. allowed-tools: create_artifact, share_artifact, publish_artifact publish_policy: manual # Options: manual, auto-on-pass, auto-on-complete retry_config: max_attempts: 3 backoff_strategy: exponential initial_delay_ms: 1000 max_delay_ms: 8000 validation_required: true # Only publish artifacts with validation_status: 'pass' unless override
Platform Support: This skill works across Claude (and optionally Cursor) with platform-specific invocation methods but consistent metadata structure.
-
Creation: Use
create_artifactto finalize a code block or document into a persistent artifact.- Include metadata:
workflow_id,step_number,dependenciesfrom registry - Add validation status from gate file if available
- Include metadata:
-
Distribution: Use
share_artifactto push the artifact to the Claude Project feed or external integrations.- Publish to targets specified in registry metadata or default to
["project_feed"]
- Publish to targets specified in registry metadata or default to
-
Publishing: Use
publish_artifactto formally publish an artifact, updating itspublishedstatus andpublished_attimestamp in the artifact registry.- This is the formal publishing step that marks an artifact as published
- Updates registry metadata with publishing status
-
Update Registry: After publishing (success or failure):
- Use
updateArtifactPublishingStatus(runId, artifactName, status)from.claude/tools/run-manager.mjs - Update
published: true/falsein registry metadata - Set
published_attimestamp on success - Update
publish_status: 'success' or 'failed' - Record
publish_errorif publication failed - Add to
publish_attemptsarray for retry tracking - Example call:
await updateArtifactPublishingStatus(runId, artifactName, { published: true, published_at: new Date().toISOString(), publish_status: 'success', attempt: { timestamp: new Date().toISOString(), status: 'success', target: 'project_feed' } });
- Use
-
Error Handling & Retry:
- Retry Logic: If publication fails, retry up to
max_attempts(default: 3) with exponential backoff - Backoff Strategy: Use delays from
retry_config: initial_delay_ms (1000ms), then 2x, 4x, up to max_delay_ms (8000ms) - Status Tracking: Track each attempt in
publish_attemptsarray with timestamp and error usingupdateArtifactPublishingStatus() - Validation Check: Only publish artifacts with
validation_status: 'pass'unlessvalidation_required: falseoverride - Notifications: Log publishing success/failure; include in gate file if available
- Fallback: If all retries fail, mark as
publish_status: 'failed'and log error for manual intervention - Retry Implementation:
async function publishWithRetry(artifact, runId, maxRetries = 3) { const delays = [1000, 2000, 4000]; // From retry_config for (let attempt = 0; attempt < maxRetries; attempt++) { try { await publishArtifact(artifact); await updateArtifactPublishingStatus(runId, artifact.name, { status: 'success', published: true, published_at: new Date().toISOString(), attempt: { timestamp: new Date().toISOString(), status: 'success' } }); return; } catch (error) { await updateArtifactPublishingStatus(runId, artifact.name, { status: attempt === maxRetries - 1 ? 'failed' : 'pending', publish_error: error.message, attempt: { timestamp: new Date().toISOString(), status: 'failed', error: error.message } }); if (attempt < maxRetries - 1) { await new Promise(resolve => setTimeout(resolve, delays[attempt])); } } } throw new Error(`Publishing failed after ${maxRetries} attempts`); }
- Retry Logic: If publication fails, retry up to
</execution_process>
<error_handling> Publishing Failures:
-
Transient Errors (network, rate limits):
- Retry with exponential backoff: 1s, 2s, 4s
- Maximum 3 retries
- Log each attempt in registry metadata
-
Permanent Errors (invalid artifact, permission denied):
- Fail immediately (no retry)
- Log error in registry:
publish_error - Set
publish_status: 'failed' - Include error details in gate file if available
-
Status Tracking:
metadata: { publish_attempts: [ { timestamp: "2025-11-29T10:00:00Z", status: "failed", error: "Network timeout" }, { timestamp: "2025-11-29T10:00:01Z", status: "success" } ], publish_status: "success" | "failed" | "pending", publish_error: null | "Error message" } -
Notifications:
- Log success: "✅ Artifact published successfully to project_feed"
- Log failure: "❌ Artifact publishing failed after 3 retries: [error]"
- Include in gate file validation results if available </error_handling>
<workflow_integration>
- Post-Tool Trigger: This skill is often invoked automatically after a
PostToolUsehook to snapshot the results of a tool execution. - Publishing Policy: The
publish_policyin the frontmatter dictates when artifacts are automatically published:manual: Requires explicitpublish_artifactcall.auto-on-pass: Automatically publishes if the artifact's validation status is 'pass'.auto-on-complete: Automatically publishes upon workflow completion.
- Artifact Registry Integration:
- Use
readArtifactRegistry(runId)from.claude/tools/run-manager.mjsto check registry - Check artifact registry for
publishable: truemetadata to auto-publish - Use
updateArtifactPublishingStatus(runId, artifactName, status)to update registry after publication - Read
workflow_idandstep_numberfrom registry metadata - Track publishing attempts and errors in registry via
publish_attemptsarray - Migration Note: Prefer run-manager.mjs over artifact-registry.mjs (deprecated)
- Use
Publishing Policy Examples:
-
Manual Publishing (
publish_policy: manual):# In workflow YAML or skill frontmatter publish_policy: manual- Artifacts are only published when explicitly requested
- Use: "Publish this artifact" or
publish_artifacttool call - Example: User reviews artifact, then explicitly publishes it
-
Auto-on-Pass (
publish_policy: auto-on-pass):# In workflow YAML or skill frontmatter publish_policy: auto-on-pass- Artifacts are automatically published when validation status is 'pass'
- Use: When you want to publish all validated artifacts automatically
- Example: After gate file validation passes, artifact is automatically published
- Implementation:
// After gate validation passes if (artifact.validationStatus === 'pass' && publishPolicy === 'auto-on-pass') { await publishArtifact(artifact); await updateArtifactPublishingStatus(runId, artifact.name, { published: true, published_at: new Date().toISOString(), publish_status: 'success', }); } -
Auto-on-Complete (
publish_policy: auto-on-complete):# In workflow YAML or skill frontmatter publish_policy: auto-on-complete- Artifacts are automatically published when workflow completes
- Use: When you want to publish all artifacts at workflow end
- Example: At workflow completion, all artifacts with
publishable: trueare published - Implementation:
// At workflow completion if (workflowStatus === 'completed' && publishPolicy === 'auto-on-complete') { const registry = await readArtifactRegistry(runId); for (const [name, artifact] of Object.entries(registry.artifacts)) { if (artifact.publishable && !artifact.published) { await publishArtifact(artifact); await updateArtifactPublishingStatus(runId, name, { published: true, published_at: new Date().toISOString(), publish_status: 'success', }); } } }
Configuring Publish Targets Per Artifact:
// When registering artifact
await registerArtifact(runId, {
name: 'plan-123.json',
step: 0,
agent: 'planner',
publishable: true,
publish_targets: ['project_feed', 'cursor'], // Multiple targets
// ... other fields
});
Handling Publishing Failures in Workflows:
- If publishing fails, workflow continues (non-blocking)
- Publishing errors are logged in registry:
publish_error - Failed artifacts can be retried manually or in next workflow run
- Gate files include publishing status for visibility </workflow_integration>
<platform_invocation> Claude (this platform):
- Use
create_artifactandshare_artifacttools directly - Invoke: "Use artifact-publisher skill to publish this artifact"
Cursor:
- Use
@artifact-publishermention - Invoke: "Use @artifact-publisher to publish this plan"
Metadata: All invocations should use consistent metadata structure:
{
"id": "artifact-{timestamp}-{sequence}",
"type": "plan|architecture|specification|implementation|test-results",
"title": "Artifact Title",
"created": "ISO 8601 timestamp",
"workflow_id": "workflow-id",
"step_number": 0,
"agent": "agent-name",
"dependencies": ["artifact1.json", "artifact2.json"],
"validation_status": "pass|fail|pending",
"tags": ["tag1", "tag2"],
"publish_targets": ["project_feed", "cursor"],
"published": true,
"published_at": "ISO 8601 timestamp"
}
</platform_invocation>
create_artifact --title "System Architecture" --type "markdown" --content "..."
share_artifact --id <artifact_id> --target "project_feed"
</usage_example>
<usage_example> Publishing a Plan (Cursor):
Use @artifact-publisher to publish this plan
</usage_example>
<usage_example> Publishing a Spec (Factory):
Run Task tool with skill artifact-publisher to publish this spec
</usage_example>
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です