# Wiki Collaboration Skill Configuration
# Standard YAML format for agentskills.io

name: "wiki-collaboration"
version: "1.0.0"
description: "Enables multi-agent wiki collaboration with version control and review workflows"

metadata:
  category: "collaboration"
  tags: ["wiki", "collaboration", "version-control", "multi-agent"]
  author: "DAIP-LIVE Team"
  license: "MIT"
  homepage: "https://github.com/daip-live/daip-live-opencode-plugin"

execution:
  type: "script"
  language: "javascript"
  path: "./wiki-skill.js"
  function: "handleWikiAction"
  timeout: 30000  # 30 seconds timeout

parameters:
  action:
    type: "string"
    description: "Action to perform on the wiki"
    enum: ["create", "update", "get", "search", "list", "collaborate"]
    required: true
  
  title:
    type: "string"
    description: "Title of the wiki page (for create/update/get)"
    required: false
  
  content:
    type: "string"
    description: "Content of the wiki page (for create/update)"
    required: false
  
  page_id:
    type: "string"
    description: "ID of the wiki page (for update/search/get)"
    required: false
  
  author:
    type: "string"
    description: "Author of the action"
    required: false
  
  changelog:
    type: "string"
    description: "Change log for updates"
    required: false
  
  query:
    type: "string"
    description: "Search query (for search action)"
    required: false

input_format:
  type: "json"
  schema:
    type: "object"
    properties:
      action:
        type: "string"
        enum: ["create", "update", "get", "search", "list", "collaborate"]
      title:
        type: "string"
      content:
        type: "string"
      page_id:
        type: "string"
      author:
        type: "string"
      changelog:
        type: "string"
      query:
        type: "string"
    required: ["action"]

output_format:
  type: "json"
  schema:
    type: "object"
    properties:
      success:
        type: "boolean"
        description: "Whether the action was successful"
      page:
        type: "object"
        description: "Wiki page object (for create/update/get actions)"
        properties:
          id: { type: "string" }
          title: { type: "string" }
          content: { type: "string" }
          version: { type: "number" }
          author: { type: "string" }
          created_at: { type: "string" }
          updated_at: { type: "string" }
      pages:
        type: "array"
        description: "Array of wiki pages (for search/list actions)"
        items:
          type: "object"
          properties:
            id: { type: "string" }
            title: { type: "string" }
            content: { type: "string" }
            version: { type: "number" }
            author: { type: "string" }
            created_at: { type: "string" }
            updated_at: { type: "string" }
      message:
        type: "string"
        description: "Human-readable message about the result"
      error:
        type: "string"
        description: "Error message if success is false"
    required: ["success", "message"]

triggers:
  - condition: "user requests wiki page creation or update"
    context: ["documentation", "knowledge sharing", "collaborative writing"]
    frequency: "as needed"

dependencies:
  - name: "node"
    version: ">=18.0.0"
    optional: false

environments:
  - name: "nodejs"
    version: ">=18.0.0"
  - name: "bun"
    version: ">=1.0.0"

examples:
  - name: "create-page"
    description: "Create a new wiki page"
    input:
      action: "create"
      title: "AI Ethics Principles"
      content: "This page outlines the fundamental principles of AI ethics..."
      author: "moderator"
    output:
      success: true
      page:
        id: "page-12345"
        title: "AI Ethics Principles"
        content: "This page outlines the fundamental principles of AI ethics..."
        version: 1
        author: "moderator"
        created_at: "2026-01-12T12:00:00.000Z"
        updated_at: "2026-01-12T12:00:00.000Z"
      message: "Wiki page created successfully"

  - name: "update-page"
    description: "Update an existing wiki page"
    input:
      action: "update"
      page_id: "page-12345"
      content: "This page outlines the fundamental principles of AI ethics, including fairness, accountability, and transparency..."
      author: "researcher"
      changelog: "Added transparency principle"
    output:
      success: true
      page:
        id: "page-12345"
        title: "AI Ethics Principles"
        content: "This page outlines the fundamental principles of AI ethics, including fairness, accountability, and transparency..."
        version: 2
        author: "researcher"
        created_at: "2026-01-12T12:00:00.000Z"
        updated_at: "2026-01-12T12:05:00.000Z"
      message: "Wiki page updated successfully"

error_handling:
  - error_type: "invalid_action"
    description: "When an unsupported action is specified"
    recovery: "Return error message with supported actions"
  - error_type: "missing_required_params"
    description: "When required parameters are missing for an action"
    recovery: "Return error message with required parameters"
  - error_type: "page_not_found"
    description: "When a specified page ID does not exist"
    recovery: "Return error message indicating page does not exist"

performance:
  - metric: "execution_time"
    threshold: "2000ms"
    description: "Wiki operations should complete within 2 seconds for typical inputs"

security:
  - aspect: "input_validation"
    description: "Validate all input parameters before processing"
  - aspect: "content_sanitization"
    description: "Sanitize content to prevent injection attacks"