okf-principles

Refactors agent-instruction artifacts (e.g., Claude agent skills, rule files, CLAUDE.md, manuals) by applying five structural principles derived from the Open Knowledge Format: bound the worst-case context loaded for a question (addressing long-tail and answer accuracy) and ensure cross-references remain valid after rewrite. Use cases include splitting a single skill or reference file, reducing per-question loaded context, adding an index layer, ensuring cross-references remain valid after rewrites, or auditing skill structure to improve efficiency; also apply when the user mentions progressive disclosure, token-saving skills, or refactoring agent instructions.

Last repository push
GitHub Stars
193
Forks
17
Issues / PRs
11

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "okf-principles" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-b10b7447a8a5a56f0b526eb50d770d93030792476460f6ec66e99af733f344dd. Verify the upstream source and version against https://github.com/serradura/okf before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Refactors agent-instruction artifacts (e.g., Claude agent skills, rule files, CLAUDE.md, manuals) by applying five structural principles derived from the Open Knowledge Format: bound the worst-case context loaded for a question (addressing long-tail and answer accuracy) and ensure cross-references remain valid after rewrite. Use cases include splitting a single skill or reference file, reducing per-question loaded context, adding an index layer, ensuring cross-references remain valid after rewrites, or auditing skill structure to improve efficiency; also apply when the user mentions progressive disclosure, token-saving skills, or refactoring agent instructions.

0 Downloads

Introduction source: third_party · serradura · 0.0.1 Reference

SkillPi interpretation

Tasks
Restructure agent instruction artifacts (Claude Agent Skills, rules files, CLAUDE.md, playbooks) by applying five structural principles derived from the Open Knowledge Format - bounding the worst-case context a question loads (the mean may rise; the win is the tail and answer accuracy) and making cross-references survive rewrites. Use this skill whenever the user wants to split a monolithic skill or reference file, reduce context loaded per question, add an index layer, make cross-references survive rewrites, or audit a skill's structure for efficiency. Also use it when the user mentions progressive disclosure, token-efficient skills, or restructuring instructions for agents.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: okf-principles
description: Restructure agent instruction artifacts (Claude Agent Skills, rules files, CLAUDE.md, playbooks) by applying five structural principles derived from the Open Knowledge Format - bounding the worst-case context a question loads (the mean may rise; the win is the tail and answer accuracy) and making cross-references survive rewrites. Use this skill whenever the user wants to split a monolithic skill or reference file, reduce context loaded per question, add an index layer, make cross-references survive rewrites, or audit a skill's structure for efficiency. Also use it when the user mentions progressive disclosure, token-efficient skills, or restructuring instructions for agents.

okf-principles

Restructures instruction artifacts so an agent loads only what a question needs. The measured payoff is the tail, not the average: a split bounds the worst-case context per question and removes the cheap confident wrong answers blind scrolling produces - mean bytes may rise slightly, and that is not a failure. This file is the index: read the one principle file the task calls for, not all five.

The five principles

  • Index first - the reader decides what to load, so structure must be inspectable before it is consumed. Read when splitting a monolith, writing an index, or indexing a vendored or generated file you cannot edit.
  • Keyed identity - references are keyed, never positional, because agents rewrite. Read when adding rule IDs or fixing cross-references before a file move.
  • Permissive reading - partial structure must still work. Read when writing reader-side instructions or migrating incrementally.
  • No tooling required - plain text that survives being read as prose. Read when tempted to add a format, schema, or parser.
  • Kind over location - a file declares what it is; folders are free to change. Read when organizing directories or labeling index entries.

Procedure for restructuring an existing skill

  1. Inventory: list every file, its line count, and what questions it answers. A file answering unrelated questions is a split candidate. Mark any file that is vendored, generated, or third-party: those are never split - they get an index beside them instead (see rule ss-index-beside-foreign).
  2. Split along question boundaries, not size. Each resulting file should answer one family of questions (per verb, per workflow, per format).
  3. Write the index per index-first. Every entry needs a description an agent can route on, and coverage must match the index's claim - especially for an index promoted from inside a file, which inherits its old host's narrower scope silently (rule ss-coverage-matches-claim).
  4. Key every rule worth citing per keyed-identity, then repoint existing cross-references at keys instead of paths and section names.
  5. Add reader guidance per permissive-reading so a half migrated state stays usable.
  6. Verify against the anti-goal with a fixed question set, judging the worst question rather than the mean (rule ss-measure-worst-case): one that loads more files or bytes than before names the boundary to merge back. Where a topic moved between files, leave a pointer at the old seam (rule ss-seam-pointers).

Anti-goals

Do not port machine-oriented metadata (trust tiers, provenance chains, attestation, changelogs) into a skill. Those solve multi-agent corpus problems; a skill has one author and lives in version control. Do not add frontmatter keys beyond what the host harness defines unless a machine must read them; prefer expressing structure in the index body, which no harness parses. <!-- rule: ss-no-ceremony -->

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value80/100

Highlights

  • 提供五项结构化原则,有效解决代理技能重构中的上下文加载和交叉引用问题
  • 明确针对长尾场景优化,提升答案准确性而非仅关注平均性能
Trigger Precision85/100

Highlights

  • 触发场景描述详尽,覆盖拆分技能、减少上下文、添加索引、渐进式披露等多种使用情形
  • 边界清晰,不易与其他技能混淆
Structure and Standards70/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档未设置显式的 When to Use 章节,虽然 description 中已有说明,但结构上建议单独列出

    Recommendation: 在 frontmatter 后添加 When to Use 章节,明确列出适用场景

  • 缺少端到端示例 Reported severity: Minor

    文档提供了原则和流程,但缺少一个完整的端到端重构示例

    Recommendation: 添加一个完整的重构示例,展示从原始技能到重构后结构的完整过程

  • 文档过长 Reported severity: Minor

    文档内容约450行,超过建议的500行限制,影响可读性

    Recommendation: 考虑将部分详细说明移至引用文件中,保持主文档简洁

Highlights

  • 结构层次清晰,包含原则、流程、反目标三个主要部分
  • frontmatter 完整,包含 name 和 description
Execution Reliability65/100

Areas to improve

  • 工具来源不明 Reported severity: Major

    文档未明确说明执行重构所需的工具或环境依赖

    Recommendation: 明确说明是否需要特定工具或环境,或确认是否纯手动操作

  • 异常处理覆盖不足 Reported severity: Major

    重构流程未覆盖文件不存在、权限问题、格式错误等常见异常情况

    Recommendation: 在重构流程中添加异常处理说明,特别是针对文件操作可能遇到的问题

Highlights

  • 重构流程步骤清晰,包含库存、拆分、索引、键入、指导、验证六个步骤
  • 提供了明确的反目标,帮助用户避免常见错误
Evidence Verifiability (mean of the first four)75/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.