agentleFS
siculosiculo/okf-skills/skills/okf-skill-edit/SKILL.md

okf:edit

Skill2 starsChanged 5 months agoUnlicenseView on GitHub

Modify an OKF bundle based on a natural-language instruction (rename, move, merge, add a section, bulk-tag). Use when you know exactly what to change and do not have a source document to ingest. Use okf:update to ingest new source documents; use okf:reconcile for a full source-alignment pass.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If no instruction is provided, ask the user what they want to change before proceeding.

    line 19
  2. Distinctive:

    Before writing anything, produce a clear plan:

    line 61
  3. Distinctive:

    Ask: "Apply these changes?

    line 94
  4. Distinctive:

    Wait for the user's answer.

    line 96
  5. Distinctive:

    After user approval, apply in this order to avoid broken intermediate states:

    line 100
  6. Distinctive:

    After all changes, scan the bundle for broken links caused by the edit (renamed or deleted files).

    line 116
  7. Very specific:

    Follow okf:_okf-skill-git-commit with commit message derived from the instruction: edit: <concise description of the change>

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are editing an OKF (Open Knowledge Format) bundle based on the user's instructions.

1. Parse arguments

$ARGUMENTS may contain:

  • A natural language instruction describing what to change (required). May be quoted or unquoted.
  • bundle:<path> — path to the bundle root (default: current working directory).

If no instruction is provided, ask the user what they want to change before proceeding.

2. Classify the instruction

Understand what the user wants. Instructions fall into these categories — a single instruction may combine several:

Content edits — modifying the text of one or more concept files:

  • Rewriting or extending a body section (# Schema, # Examples, etc.)
  • Adding or removing a section
  • Correcting factual content
  • Updating description, title, or other frontmatter fields

Structural edits — changing the organization of the bundle:

  • Renaming a concept file or directory
  • Moving concepts between directories
  • Splitting one concept into multiple files
  • Merging multiple concepts into one
  • Creating or deleting concepts

Bulk edits — applying a uniform change across multiple concepts:

  • Changing a type value across all matching concepts
  • Adding or removing a tag from a set of concepts
  • Adding a section to all concepts of a given type
  • Normalizing frontmatter fields (e.g., converting timestamp to UTC)

Cross-link edits — modifying how concepts reference each other:

  • Fixing broken links
  • Converting relative links to absolute (bundle-relative) links or vice versa
  • Adding links between concepts that should be related but aren't

Identify the category, the scope (single concept / directory / whole bundle / cross-cutting filter), and the target (which files are affected).

3. Read the relevant portion of the bundle

  • For single-concept edits: read only that file.
  • For directory-scoped edits: read all concept files in that directory.
  • For whole-bundle or bulk edits: scan all concepts and read the files that match the filter implied by the instruction.

Also read the affected index.md files and log.md.

4. Plan the changes

Before writing anything, produce a clear plan:

Edit plan
─────────────────────────────────────────
Instruction : "<user instruction>"
Scope       : <single concept / <N> concepts / whole bundle>
Bundle      : <path>

CHANGES (<N> files)
  ~ path/to/concept.md
      [field] description: "old value" → "new value"
      [body]  Added section "# Usage" with <N> lines
      [move]  → new/path/concept.md

  ~ path/to/other.md
      [type]  "BigQuery Table" → "Table"

INDEX UPDATES (<N>)
  ↻ tables/index.md  — reflects rename

LOG ENTRY
  log.md — will add **Edit** entry for today

For destructive changes (deleting concepts, merging files, removing sections), call them out explicitly:

DESTRUCTIVE CHANGES — review carefully
  ✗ legacy/old-concept.md — will be deleted
  ✗ tables/orders.md (body section "# Old Notes") — will be removed

Ask: "Apply these changes? (yes / no / describe adjustments)"

Wait for the user's answer. If they request adjustments, revise the plan and show it again. Never apply any change without explicit approval.

5. Apply changes

After user approval, apply in this order to avoid broken intermediate states:

  1. Content edits: rewrite fields and body sections as planned. Preserve all frontmatter keys not mentioned in the plan. Update timestamp to the current datetime on any concept whose content changed.
  2. Structural edits:
    • Renames/moves: write the file at the new path, delete the old one, update all cross-links in the bundle that pointed to the old path.
    • Splits: write the new concept files, remove the original, update cross-links.
    • Merges: write the merged concept, remove the originals, update cross-links.
  3. Index files: regenerate index.md for every affected directory. Preserve any manually written content not related to the changed concepts.
  4. Log file: prepend an entry to log.md at the bundle root:
    ## <YYYY-MM-DD>
    * **Edit**: <concise description of what changed and why, derived from the instruction>.

6. Cross-link integrity

After all changes, scan the bundle for broken links caused by the edit (renamed or deleted files). Report any that remain and offer to fix them. Do not leave the bundle in a state with newly introduced broken links without warning the user.

7. Git (optional)

Follow okf:_okf-skill-git-commit with commit message derived from the instruction: edit: <concise description of the change>

8. Validate

Follow okf:_okf-skill-validate.

9. Final report

OKF bundle edited
─────────────────────────────────────────
Bundle     : <absolute path>
Changed    : <N> concept file(s)
Structural : <renames / moves / splits / merges, or "none">
Links fixed: <N> cross-links updated
Git        : committed  /  not committed
Validation : ✓ Conformant (OKF <version>)
Skill version : 1.0

10. Write invocation log

Follow okf:_okf-skill-write-log with:

  • skill: okf:edit, version: 1.0
  • bundle: absolute path to the bundle root
  • outcome: success if the final report was printed; cancelled if the user declined the plan; error if an unrecoverable error occurred
  • concepts_added: null
  • concepts_updated: number of concept files changed (N from final report)
  • concepts_split: null
  • conflicts: null
  • note: null

Examples of valid instructions

  • "Rename type 'BigQuery Table' to 'Table' everywhere"
  • "Move all concepts tagged 'legacy' into a new legacy/ directory"
  • "Add a # Usage section to tables/orders.md explaining how to query it"
  • "Split tables/customers.md into two concepts: one for schema, one for PII handling"
  • "Convert all relative cross-links to absolute bundle-relative paths"
  • "Remove the tag 'wip' from all concepts that have a description"
  • "Merge datasets/sales.md and datasets/marketing.md into a single datasets/commercial.md"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.