AgentSkillsCN

create-resource

从已分析的提案中创建资源笔记。当分诊协调器将提案路由至 proposed_template=resource 时,可使用此技能。它会通过 para_create 完成 frontmatter 的设置,并清理原始文件。

SKILL.md
--- frontmatter
name: create-resource
description: Create resource notes from analyzed proposals. Use when triage orchestrator routes a proposal with proposed_template=resource. Handles frontmatter setup and original file cleanup via para_create.
user-invocable: false
allowed-tools: mcp__plugin_para-obsidian_para-obsidian__para_create, mcp__plugin_para-obsidian_para-obsidian__para_delete, mcp__plugin_para-obsidian_para-obsidian__para_rename, mcp__plugin_para-obsidian_para-obsidian__para_template_fields

Create Resource

Create a resource note from an analyzed proposal.

Input

You receive a proposal object from an analyzer skill:

json
{
  "file": "00 Inbox/✂️ Article Title.md",
  "type": "clipping|transcription|attachment",
  "proposed_title": "Meaningful Title",
  "proposed_template": "resource",
  "summary": "2-3 sentence summary",
  "categorization_hints": ["hint1", "hint2", "hint3"],
  "area": "[[🌱 Area Name]]",
  "project": "[[🎯 Project Name]]",
  "resourceType": "article|tutorial|reference|thread|video|idea",
  "source_format": "article|video|thread|document|audio",
  "author": "Author Name",
  "source_url": "https://..."
}

Output

Create the resource note and handle the original file.

Workflow

Step 0: Discover Template Metadata

Before creating the note, query the resource template for its current structure:

code
para_template_fields({ template: "resource", response_format: "json" })

Extract from response:

  • validArgs → which args to pass to para_create
  • creation_meta.dest → destination folder
  • creation_meta.contentTargets → section headings for content injection (e.g., ["Layer 1: Captured Notes"])
  • creation_meta.sections → all body section headings

Step 1: Create Resource Note

CRITICAL: Use frontmatter-only approach. ALL data in args, NEVER in content.

Use discovered validArgs for field names and creation_meta.dest for destination:

code
para_create({
  template: "resource",
  title: proposal.proposed_title,
  dest: "<discovered-dest>",
  args: {
    summary: proposal.summary,
    source: proposal.source_url,
    resource_type: proposal.resourceType,
    source_format: proposal.source_format,  // Enables 📚🎬 emoji prefix (video, thread, etc.)
    // Single area: pass string directly — "[[🌱 Area]]"
    // Multiple areas: pass JSON array string — '["[[🌱 Area 1]]", "[[🌱 Area 2]]"]'
    areas: Array.isArray(proposal.area) ? JSON.stringify(proposal.area) : proposal.area,
    projects: Array.isArray(proposal.project) ? JSON.stringify(proposal.project) : proposal.project,
    author: proposal.author || null,
    distilled: "false"
  },
  response_format: "json"
})

Note: para_create parses JSON array strings automatically via tryParseJsonArray(). Single wikilink strings are backward-compatible (stored as-is in frontmatter).

Step 2: Handle Original File

Note: During triage (/para-obsidian:triage), cleanup is owned by the coordinator's Phase 5 — not this skill. The triage-worker creates notes inline and the coordinator handles deletion/archival after user approval. This step only applies when create-resource is used as a standalone skill outside triage.

Based on the original file type:

TypeAction
clippingDelete: para_delete({ file, confirm: true })
transcriptionArchive: para_rename({ from, to: "04 Archives/Transcriptions/..." })
attachmentKeep in place (referenced via source link)

Step 3: Return Result

Return success with created file path:

json
{
  "success": true,
  "created": "03 Resources/Meaningful Title.md",
  "original_action": "deleted|archived|kept"
}

Frontmatter Fields

Use validArgs from Step 0 to determine accepted fields. The resource template typically accepts these frontmatter fields, but always verify against discovered validArgs:

FieldRequiredDescription
summaryYes2-3 sentence description
sourceYesOriginal URL or file link
resource_typeYesarticle, tutorial, reference, thread, video, idea
source_formatNoarticle, video, thread, document, audio
areasYesWikilink string or JSON array of wikilinks (e.g., '["[[A1]]", "[[A2]]"]')
projectsNoWikilink string or JSON array of wikilinks
authorNoContent author if known
distilledYesAlways "false" for new resources

Error Handling

If para_create fails:

  1. Do NOT proceed to delete/archive original
  2. Return error with details
  3. Let coordinator decide retry strategy
json
{
  "success": false,
  "error": "Template validation failed: missing required field 'areas'",
  "proposal": { ... }
}

Layer 1 Content Injection

This skill does NOT inject Layer 1 content. It only creates the note with frontmatter.

Layer 1 injection (populating the content target section discovered via creation_meta.contentTargets[0] in Step 0, typically "Layer 1: Captured Notes") is the calling subagent's responsibility. The triage subagent has the enriched content in its context and calls para_replace_section after para_create. See subagent-prompts.md Step 4 for details.

Why This Skill Exists

Extracted from triage orchestrator Phase 5 to enable:

  1. Reuse - Other workflows can create resources without full triage
  2. Testing - Worker can be tested independently
  3. Single responsibility - Knows only about resource creation, not analysis