AgentSkillsCN

olore-docs-packager-1.0.0

将本地文档打包为 olore 技能。当用户希望从本地文件中生成文档包,或询问关于 olore init 或文档构建的相关问题时,可使用此技能。

SKILL.md
--- frontmatter
name: olore-docs-packager-1.0.0
description: Package local documentation into an olore skill. Use when the user wants to create a documentation package from their local files, or asks about olore init or building docs.

Package Local Documentation

Package local documentation files into an olore skill with TOC.md, SKILL.md, and INDEX.md.

Quick Start

If you don't have olore.config.json yet, run:

bash
olore init

This creates olore.config.json and a docs/ folder with a sample file.

Usage

code
/olore-docs-packager-1.0.0                        # Use olore.config.json in cwd
/olore-docs-packager-1.0.0 ./custom-config.json   # Use specific config

Workflow

Step 1: Load and Validate Config

Parse $ARGUMENTS to find config file (default: olore.config.json in cwd).

bash
cat {config_path}

Required fields: name, version, description, contentPath

See contents/getting-started.md for config format.

Step 2: Copy Documentation Files

Run the copy script:

bash
uv run scripts/copy-docs.py {config_path}

This copies files matching extensions, applies excludes, and outputs JSON with file count and size.

Step 3: Determine Tier

Run the tier script:

bash
uv run scripts/determine-tier.py {output_path}/contents
TierCriteria
1< 30 files AND < 500KB
230-100 files OR 500KB-2MB
3> 100 files OR > 2MB

Step 4: Generate TOC.md

Read the appropriate template and generate TOC.md:

Write to {output_path}/TOC.md

Step 5: Generate SKILL.md

Read the appropriate template and generate SKILL.md:

IMPORTANT: The name field MUST be olore-{name}-{version} to match the installed folder.

Write to {output_path}/SKILL.md

Step 5.5: Generate INDEX.md

Read the appropriate index template based on tier:

Write to {output_path}/INDEX.md

Format: Each content line is keyword1,keyword2|contents/path/to/file.ext

Keywords should be actual API names, method names, config keys extracted from the file contents.

Step 6: Generate olore-lock.json

Create {output_path}/olore-lock.json:

json
{
  "name": "{name}",
  "version": "{version}",
  "source": {
    "type": "local",
    "contentPath": "{original contentPath}"
  },
  "builtAt": "{ISO timestamp}",
  "files": {file_count}
}

Step 7: Report Summary

code
Package built successfully:

  Name: olore-{name}-{version}
  Files: {file_count}
  Tier: {tier}
  Output: {output_path}

Install with:
  olore install {output_path}

Config Reference

FieldRequiredDefaultDescription
nameYes-Package name (prefixed with olore-)
versionYes-Version string
descriptionYes-One-line description
contentPathYes-Path to docs (relative to config)
outputPathNo./olore-packageOutput directory
extensionsNo[".md", ".mdx"]File extensions
excludeNo[]Glob patterns to exclude

Requirements

  • uv - Python package manager (handles Python version automatically)

Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh

Example

See contents/getting-started.md for a complete walkthrough.