yafoo/melog/melog-api-skill
Claude Code and agent skill by yafoo/melog
- community
Checking that the SKILL.md file is still in the repository.
通过 RESTful API 管理 Melog 博客。触发条件:对话必须同时包含 "melog" 和明确的操作意图(如"查文章"、"写文章"、"删文章"、"改文章"、"看分类"、"加分类"、"改分类"、"删分类"、"发布"、"编辑博客"等)。仅提到 melog 但无操作意图时不触发。
Install
npx vskill@latest install yafoo/melog/melog-api-skillSKILL.md
Melog Blog API Skill
Description
This skill provides the ability to manage articles and categories on a Melog blog system via RESTful API. You can list, create, edit, and delete blog articles and categories using token-based authentication.
When to Use
Use this skill when the user wants to:
- Query, list, or search blog articles
- View article details
- Create new blog articles
- Edit existing blog articles
- Delete blog articles
- Query or list blog categories
- Create, edit, or delete categories
Configuration
Before making any API call, read the config file to get the token and base URL:
- Config file:
config.json(与 SKILL.md 同目录) - Contents:
``json { "base_url": "http://127.0.0.1:3003", "token": "ml_xxx..." } ``
Always read this file at the start of each melog-api task to obtain the current base_url and token. Do NOT hardcode these values.
HTTP Headers
Every API request must include this header to get a JSON response (without it the server returns an HTML redirect page):
Authentication
All API requests require a valid token. The token is stored in the config file above. It can be passed in two ways:
- Query parameter:
?token=YOUR_TOKEN_STRING - Authorization header:
Authorization: Bearer YOUR_TOKEN_STRING
The token is generated from the blog admin panel (系统管理 → Token管理). Each token has specific permissions (read/create/edit/delete for categories and articles).
API Base URL
The base URL is stored in the config file. All API endpoints are relative to it. For example, if base_url is http://127.0.0.1:3003, the full URL for listing articles would be http://127.0.0.1:3003/api/article/list.
API Endpoints
Response Format
All responses follow this format:
- Success:
{"state": 1, "msg": "...", "data": ...} - Error:
{"state": 0, "msg": "...", "data": null}
Category APIs
List Categories
Get all blog categories.
- URL:
/api/cate/list - Method: GET
- Parameters:
token(required) - Response:
Get Category Detail
Get details of a specific category.
- URL:
/api/cate/detail - Method: GET
- Parameters:
token(required),id(required) - Response:
Create Category
Create a new blog category.
- URL:
/api/cate/create - Method: POST
- Parameters:
token(required), plus body: cate_name(required): Category namecate_dir(required): Category directory/slug (URL-friendly, no spaces)seo_title: SEO title (optional)keywords: SEO keywords, comma-separated (optional)description: Category description (optional)sort: Sort order, lower number = higher priority (optional, default: 0)is_show: Whether to show (1=show, 0=hide, default: 1)- Response:
Note: data.id.insertId contains the new category's ID.
Edit Category
Update an existing category.
- URL:
/api/cate/edit - Method: POST
- Parameters:
token(required), plus body: id(required): Category IDcate_name: Category name (optional, only update provided fields)cate_dir: Category directory (optional)seo_title: SEO title (optional)keywords: Keywords (optional)description: Description (optional)sort: Sort order (optional)is_show: Show/hide (optional)- Response:
Delete Category
Delete a category.
- URL:
/api/cate/delete - Method: POST
- Parameters:
token(required),id(required) - Response:
Article APIs
List Articles
Get blog articles with pagination and filtering.
- URL:
/api/article/list - Method: GET
- Parameters:
token(required)page: Page number (default: 1)rows: Items per page (default: 10)cate_id: Filter by category ID (optional)keyword: Search keyword, searches in title and writer (optional)- Response:
Get Article Detail
Get full details of a specific article including content.
- URL:
/api/article/detail - Method: GET
- Parameters:
token(required),id(required) - Response:
Create Article
Create a new blog article. The article content supports Markdown format.
- URL:
/api/article/create - Method: POST
- Parameters:
token(required), plus body: title(required): Article titlecate_id(required): Category IDcontent: Article content in Markdown format (optional)writer: Author name (optional)source: Source name (optional)source_url: Source URL (optional)keywords: SEO keywords, comma-separated (optional)description: Article summary/description (optional)thumb: Thumbnail image URL (optional)comment_set: Comment setting: 0=follow system, 1=force enable, -1=force disable (optional, default: 0)- Response:
Note: data.id.insertId contains the new article's ID.
Edit Article
Update an existing article.
- URL:
/api/article/edit - Method: POST
- Parameters:
token(required), plus body: id(required): Article IDtitle: Article title (optional)cate_id: Category ID (optional)content: Article content (optional)writer: Author (optional)source: Source (optional)source_url: Source URL (optional)keywords: Keywords (optional)description: Description (optional)thumb: Thumbnail URL (optional)comment_set: Comment setting (optional)- Response:
Delete Article
Delete an article and its associated comments.
- URL:
/api/article/delete - Method: POST
- Parameters:
token(required),id(required) - Response:
Error Responses
All error responses follow this format:
Common error messages:
- Missing parameters (e.g. "缺少token参数", "缺少id参数")
- Token errors (e.g. "Token无效或已过期")
- Permission errors (e.g. "权限不足")
- Resource not found (e.g. "分类不存在", "文章不存在")
- Request method errors (e.g. "请使用POST请求")
Permission System
Tokens have granular permissions using a bitmask system:
| Permission | Bit | Value | Description | |
|---|---|---|---|---|
| Category Read | 0 | 1 | List/view categories | |
| Category Create | 1 | 2 | Create categories | |
| Category Edit | 2 | 4 | Edit categories | |
| Category Delete | 3 | 8 | Delete categories | |
| Article Read | 4 | 16 | List/view articles | |
| Article Create | 5 | 32 | Create articles | |
| Article Edit | 6 | 64 | Edit articles | |
| Article Delete | 7 | 128 | Delete articles |
Usage Examples
Example 1: List all articles
Example 2: Create a new article
Example 3: List categories
Notes
- Article content supports Markdown format
add_timeandupdate_timeare Unix timestamps (seconds)- When deleting an article, all associated comments are also deleted
- Token expiration is checked on every request; expired tokens return
{state: 0, msg: "Token无效或已过期"} - The
user_idfor new articles is automatically set based on the token's associated account
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmelog-api.skill/SKILL.md
Popularity
- Repository stars
- 50
- Repository forks
- 11
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yafoo/melog/melog-api-skill)