AgentSkillsCN

markdown-editor

创建、编写、生成、编辑、更新并格式化Markdown文档(README、CHANGELOG、研究笔记、计划、指南、教程)。支持前言元数据、目录组织与文件命名。在编写.md文件、记录代码、创建项目文档、保存研究成果、构建README文件、管理TODO列表,或生成任何Markdown内容时使用此功能。

SKILL.md
--- frontmatter
name: markdown-editor
description: Create, write, generate, edit, update, and format markdown documentation (README, CHANGELOG, research notes, plans, guides, tutorials). Handles frontmatter metadata, directory organization, and file naming. Use when writing .md files, documenting code, creating project docs, saving research findings, building README files, managing TODO lists, or generating any markdown content.
version: 1.0.1
license: MIT
metadata:
  audience: developers, agents
  workflow: documentation

Quick Start

Prerequisites:

  • Git configured (git config user.name for author extraction)
  • Write access to target directory

Tools Used: Read, Write, Edit, Bash (for git config, mkdir)

Basic Usage:

  1. Determine document type (research, plan, docs, README, TODO, CHANGELOG)
  2. Choose location based on type
  3. Create directory if needed
  4. Write with appropriate frontmatter (or none for special files)

When to Use Me

Use this skill when you:

  • Create, write, or generate new markdown (.md) files
  • Edit, update, or modify existing markdown content
  • Write research notes, findings, or analysis documents
  • Create implementation plans, strategies, or roadmaps
  • Build or update README files for projects or modules
  • Manage TODO lists or CHANGELOG files
  • Need to save agent research findings persistently

Additional Triggers

Also use this skill when you:

  • Fix markdown lint issues or formatting problems
  • Reflow or wrap long lines in documentation
  • Validate frontmatter structure or fix schema issues
  • Check or fix broken links in documentation

What I Do

  • Create and edit markdown files with consistent structure
  • Apply YAML frontmatter (title, author, timestamps, type, tags)
  • Organize docs by type: research → ./docs/research/, plans → ./docs/plans/
  • Handle special files (README, TODO, CHANGELOG) without frontmatter
  • Generate descriptive kebab-case filenames
  • Extract author from git config, manage ISO 8601 timestamps

Document Type Quick Reference

TypeLocationFrontmatterTrigger Words
Research./docs/research/Yesresearch, analyze, investigate, explore
Plan./docs/plans/Yesplan, strategy, roadmap, implementation
General./docs/Yesdocument, guide, notes
READMEProject/module rootNoreadme, overview, project docs
TODOProject rootNotodo, tasks, action items
CHANGELOGProject rootNochangelog, releases, versions

Frontmatter Template

yaml
---
title: Descriptive Title
created: 2025-12-25T14:30:00Z
last_modified: 2025-12-25T14:30:00Z
author: John Doe
type: research|plan|documentation
tags: [tag1, tag2]
---

Common Errors

ErrorCauseSolution
Directory not foundTarget path doesn't existCreate with mkdir -p ./docs/research/
Author is "Unknown"Git not configuredRun git config user.name "Your Name"
Frontmatter on READMEApplied template to special fileREADME, TODO, CHANGELOG skip frontmatter
Filename collisionGeneric name already existsUse more specific descriptive name
Invalid timestampWrong date formatUse ISO 8601 with UTC: 2025-12-25T14:30:00Z

References

ReferenceLoad When
examples.mdNeed concrete examples of creating/editing documents
document-types.mdNeed detailed guidance on document type conventions

Validation Checklist

  • Document type identified (research, plan, docs, README, TODO, CHANGELOG)
  • Location follows conventions
  • Directory exists (create if needed)
  • Filename is descriptive, kebab-case, no timestamp
  • Frontmatter included only when appropriate
  • Timestamps in ISO 8601 UTC format (ending in 'Z')
  • When editing: preserve created/author, update last_modified