SuperAPI AI Directory

makecontents

Coding & development

View repository

Updated 10-15 20:14

About this skill

MakeContents Agent skill

Overview

MakeContents is a locally running RSS news aggregation and content creation application. This skill enables the Agent to autonomously complete the following tasks:

  1. Fetch news — Retrieve the latest content from configured RSS/RSSHub sources
  2. Filter and push — Select valuable news based on learned patterns, directly generate push content, and distribute it to WeChat and Feishu knowledge bases
  3. Content creation — Generate Xiaohongshu-style image and text content for selected news, automatically rendering cover and detail images
  4. Content archiving — Save the creation results to the Feishu multi-dimensional table and notify humans for review

Configuration

Before starting, confirm the following configurations (via the application system configuration page or .env settings):

  • MakeContents service address: default http://localhost:3710
  • The API Keys required for each feature (Feishu, WeChat) have been filled in on the application configuration page
  • The Feishu multi-dimensional table URL has been configured (used for content archiving, optional)
  • The Feishu bot Webhook has been configured (used for completion notifications)
  • Xiaohongshu Cookie has been configured + the publishing switch has been enabled (used for publishing notes,disabled by default, and must be proactively enabled by a human)

Important notes

  • You must use exec + curl to call the API, do not use web_fetch(the latter is used to fetch external web pages and cannot access local services)
  • All API requests must include the Header:Content-Type: application/json and Accept: application/json
  • Before execution, it is recommended to check service health first:curl -s http://localhost:3710/api/health should return {"status":"ok"}

API reference

For the complete API documentation, see references/api.md, which includes the request/response formats for all endpoints.

Selection pattern memory

The Agent's learned patterns are stored under the skill file path references/agent-rules.md, and this file is updated after each learning session.


Execution flow

Flow 1: Learn selection patterns (optional)

First read the filereferences/agent-rules.mddocument. If it contains content filtering patterns, use these patterns as the selection criteria for subsequent tasks and skip this step; when there is no reference pattern content, execute in order:

  1. Call GET /api/news/agent-summary to get learning data
  2. Analyze the data:
    • saved_news: news items pushed by the user (including push_type)
    • all_news_in_period: all news items in the corresponding time period
    • Compare the two lists and extract the common characteristics of the selected news items
  3. Append the analyzed patterns to references/agent-rules.md:

Analysis perspectives:

  • Source distribution of selected news items (which sources are preferred)
  • Topic characteristics of selected news items (keywords, topic types)
  • Distribution of push types (which type of push users tend to prefer)
  • Topic selection characteristics for content creation (which types of topics are created)

Flow 2: News push

To execute the news push workflow:

  1. Call POST /api/news/fetch to fetch the latest news
  2. Call GET /api/news/grouped?agent=1 Get the news list (already-pushed items are automatically excluded, no manual deduplication needed)
  3. Use references/agent-rules.md filtering rules in
  4. Filter 0-5 valuable news items from the list according to the rules (if there is no valuable news, you can end this process directly)
  5. For each news item:
    • Determine the push type (ainews / aitopics / aitools)
    • Generate news_title(≤30 characters, concise and powerful) and news_summary(100-200 characters, matching the corresponding style)
    • Call the corresponding push API (note: the API paths are /api/news/{id}/ainews etc.,not /{id}/ainews/):
      POST /api/news/{id}/ainews
      POST /api/news/{id}/aitopics
      POST /api/news/{id}/aitools
      
    • Request body example:{"news_title":"标题","news_summary":"摘要内容"}
  6. After completion, call POST /api/content/notify-bot to notify the human

Push type determination principles:

  • ainews: objective factual news, quick-report style
  • aitopics: controversial or thought-provoking topics, add a guiding question at the end
  • aitools: new tool/product releases, highlight features and use cases

Process 3: Content creation

To execute the content creation workflow:

  1. Select 0-3 news items from the news list that are suitable for content creation (usually in-depth or interesting topics; if there is no valuable news, you can end this process directly)
  2. For each news item, construct the following parameters and call POST /api/content/agent-render:
    • news_id: news ID
    • source_url: original link (the link in description, not the news link; fill in if available, the service will automatically take a screenshot)
    • cover_word: 1-2 English words summarizing the core theme
    • cover_title: ≤15 characters, impactful Chinese title
    • cover_description: ≤20 characters, supplementary explanation
    • cover_emoji: 1 related Emoji
    • content_type:news/tools/topics/default(determines the color scheme)
    • title: ≤20 characters, Xiaohongshu-style title
    • content: body text, 500-800 characters, Xiaohongshu style, with opinions and emotions
    • tags: 3-5 tags, comma-separated
  3. Get the rendered result's saved_content_id、cover_url、detail_urls
  4. (optional, skip if not specified) call POST /api/content/save-to-bitable and save to Feishu Bitable (pass saved_content_id)
  5. Call POST /api/content/publish-xhsto publish the note content to Xiaohongshu:
    {
      "title": "{title(≤20字)}",
      "desc": "{content}",
      "cover_url": "{cover_url}",
      "detail_urls": ["{detail_urls[0]}", "..."],
      "is_private": true
    }
    
    • Agent must pass "is_private": true, the note will be published as "visible only to myself", and the human will manually set it to public after review in the Xiaohongshu App
    • After success, get from the response note_url
    • If the API returns the error "Xiaohongshu publishing feature is not enabled",do not retry, do not report an error, just skip this step
  6. Call POST /api/content/notify-bot to send a notification, message format:
    ✅ 内容创作完成
    
    标题:{title}
    类型:{content_type}
    标签:{tags}
    
    已存入飞书多维表,请审核。
    {如已发布到小红书:🔗 小红书笔记(仅自己可见,请在 App 审核后设为公开):{note_url}}
    

Notes

  • Screenshot detail images may fail due to anti-scraping on the target website. If it fails, skip silently and only generate the cover
  • The push API will automatically mark the news as saved, no need to manually call the save API
  • When the Agent generates content,news_title and news_summary are directly used as push content, quality must be ensured
  • After each complete process execution, it is recommended to run the learning process once to update the rule memory
  • Xiaohongshu publishing: The publishing switch is off by default, and the human decides whether to authorize. The Agent should respect this switch, silently skip when receiving a "not enabled" error, and must not repeatedly retry or prompt the human to enable it
  • Service unavailable: Before calling the API, it is recommended to first GET /api/health. If the request returns a 5xx error, it may be a temporary service failure; wait a few seconds and retry once; if it still fails, terminate the process and notify a human.