Cp skill convert

From zby/commonplace · View interactive version

Cp skill convert is an AI agent skill from the GitHub repository zby/commonplace. Convert notes between types. Currently supports text to note by adding unverified structured frontmatter, renaming the file to match the title, and fixing backlinks. Use with a note path or note name.

How to use this skill

Skill file

EXECUTE NOW

Target: $ARGUMENTS

Parse immediately:

Supported conversions

text → note (current)

The primary conversion. Adds frontmatter to a raw text file, making it structured and connectable.

Step 1: Locate and verify

Resolve the target to a file path. If just a name, search the project's kb/ for that filename and require one match. Ask for an explicit path if there are zero or multiple matches. Discovery resolves this one requested artifact; it does not authorize a directory sweep.

Read the file. Verify it has no frontmatter (does not start with ---). If it already has frontmatter, report that it's already structured and stop.

Step 2: Understand the content

Read the full file. Identify:

Step 3: Generate frontmatter

Add YAML frontmatter at the top of the file:

---
description: [50-250 chars, adds mechanism/scope/implication beyond the title]
type: types/note.md
traits: []
tags: []
---

Rules:

until a separately authorized editing task assigns it. cp-skill-connect

reports candidate links only; it does not edit tags or library artifacts.

Step 3a: Rename the file

After adding frontmatter, check whether the filename matches the # Title heading.

The filename should match the title. Whether the title itself is good is a semantic question for a human or a frontmatter review assay; deterministic validation checks only its structural limits.

Decide whether to rename:

To rename:

  1. Dry-run the relocation with the # Title heading as the new name:

```bash

commonplace-relocate-note old-path/old-filename.md "Title from the heading"

```

It derives the filename from the title, lists every backlink it will rewrite, and adds the published-site redirect.

  1. If the dry run is correct, run the same command with --apply. Never rename with git mv or by editing backlinks by hand: that skips the redirect and the full backlink rewrite.

Rules:

Step 4: Validate and report

Run commonplace-validate <final-note-path> after conversion, using the new path if the file was renamed. Report any diagnostics.

=== CONVERTED: filename.md ===

text → note (unverified)

renamed: old-filename.md → new-filename.md  [or "filename unchanged" if no rename]
backlinks updated: 3 files  [or "none" if no backlinks]

description: [the description you wrote]
tags: []

Next steps:
- Run the `cp-skill-connect` skill on `new-filename.md` — report candidate
  connections without mutating the note
- Optionally ask the user to verify the artifact after review; only the human may add `user-verified: true`
===

Unsupported conversions

If a user requests any conversion other than text → note, explain that it is

not implemented and stop. Do not invent a conversion or retain a speculative

feature catalogue. If repeated use establishes a concrete missing conversion,

route that design gap through the repository's normal proposal process before

adding it here.

Critical Constraints

Never:

Always:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.