agentleFS
zwjbendnzwjbendn/weight-loss-skill/plan-export/SKILL.md

plan-export

Skill1 starsChanged 9 months agoMITView on GitHub

Convert Markdown plans to styled HTML web pages (hosted on cloud storage with presigned URLs) or PDFs, and deliver them to users. Supports weight loss plans (PLAN.md) and meal plans (MEAL-PLAN.md) with different HTML templates. Trigger when: (1) weight-loss-planner finishes generating PLAN.md, (2) meal-planner finishes generating MEAL-PLAN.md, (3) any time a Markdown document should be delivered as a professional document to the user, (4) user asks for their plan link and the previous one has expired.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default bucket: nanorhino-im-plans (us-west-1)

    line 42
  2. Very specific:

    Default bucket: JD_OSS_BUCKET env var, or override with --bucket

    line 46
  3. Very specific:

    When --workspace and --key are provided, the script writes/merges into plan-url.json:

    line 94
  4. Very specific:

    Read plan-url.json → find the relevant key

    line 112
  5. Distinctive:

    If the plan content has been updated since last upload, re-run the script to push the new version (URL stays the same)

    line 114
  6. Very specific:

    When --bucket is NOT provided, the script falls back to PDF generation and Slack file upload:

    line 118
  7. Distinctive:

    All formats support Chinese, English, and mixed-language content

    line 168

≈ “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

Plan Export (HTML Web / PDF)

⚠️ SILENT OPERATION: Never narrate internal actions, skill transitions, or tool calls to the user. No "Let me check...", "Now I'll transition to...", "Reading your profile...". Just do it silently and respond with the result.

Convert Markdown plans into professionally styled documents and deliver them to users.

Primary mode: HTML web page uploaded to cloud storage — generates a beautiful, mobile-friendly web page and provides a presigned URL (valid 7 days).

Fallback mode: PDF via Slack file upload — used when cloud storage is not configured.

Supported Document Types

TypeInput FileTemplateKeyHTML Script
Weight Loss PlanPLAN.md(default)weight-loss-plangenerate-html.py
Meal PlanMEAL-PLAN.mdmeal-planmeal-plangenerate-meal-plan-html.py

Primary Mode: HTML + Cloud Storage Presigned URL

Storage Backend (Auto-Detected)

The upload script automatically detects the storage backend:

  1. PLAN_STORAGE_BACKEND env var (aws or jdoss) — force a specific backend
  2. JD_OSS_ACCESS_KEY is set → JD Cloud OSS
  3. aws sts get-caller-identity succeeds → AWS S3
  4. None detected → error

AWS S3 prerequisites:

  • S3 bucket with 30-day lifecycle rule (auto-deletion)
  • AWS CLI credentials with s3:PutObject + s3:GetObject permission
  • Default bucket: nanorhino-im-plans (us-west-1)

JD Cloud OSS prerequisites:

  • Environment variables: JD_OSS_ACCESS_KEY, JD_OSS_SECRET_KEY, JD_OSS_ENDPOINT
  • Default bucket: JD_OSS_BUCKET env var, or override with --bucket

How to Use

# Weight loss plan
URL=$(bash {baseDir}/scripts/generate-and-send.sh \
  --agent <YOUR_AGENT_ID> \
  --input PLAN.md \
  --bucket <BUCKET_NAME> \
  --username <USERNAME> \
  --workspace <AGENT_WORKSPACE_PATH> \
  --key weight-loss-plan)

# Meal plan
URL=$(bash {baseDir}/scripts/generate-and-send.sh \
  --agent <YOUR_AGENT_ID> \
  --input MEAL-PLAN.md \
  --bucket <BUCKET_NAME> \
  --username <USERNAME> \
  --workspace <AGENT_WORKSPACE_PATH> \
  --template meal-plan \
  --key meal-plan)

Parameters:

  • --agent (required): Your agent ID (e.g., 007-zhuoran)
  • --input (required): Path to the Markdown file
  • --bucket (required for HTML mode): Storage bucket name. For JD OSS, falls back to JD_OSS_BUCKET env var if omitted. For AWS, defaults to nanorhino-im-plans.
  • --username (required for HTML mode): User identifier for the S3 key path. Auto-detect from workspace path: if it matches workspace-wechat-dm-{id}, use {id}; otherwise use the agent ID (e.g., 007-zhuoran)
  • --workspace (optional): Agent workspace path — if provided, writes plan-url.json there
  • --template (optional): meal-plan for meal plan HTML. Omit for default (weight loss plan).
  • --key (required for HTML mode): Document key, used in both S3 path and plan-url.json (e.g., weight-loss-plan, meal-plan)

The script outputs the public URL to stdout. You are responsible for sending this URL to the user using the message tool (works with any channel: Slack, Telegram, etc.).

After Sending

Tell the user their plan is ready and include the link. Example:

"你的计划已经生成好了!点击这里查看:[链接] 📄 有什么问题随时问我!"

When PLAN.md or MEAL-PLAN.md is Updated

Whenever a plan file is modified by any skill, always re-run the upload script to push the new version to cloud storage. The file is uploaded to the same S3 key ({username}/{key}.html), so the public URL stays the same. You only need to send the link once; subsequent updates are reflected automatically at the same URL.

plan-url.json (Multi-Document)

When --workspace and --key are provided, the script writes/merges into plan-url.json:

{
  "weight-loss-plan": {
    "url": "https://nanorhino.ai/zhuoran/weight-loss-plan.html",
    "uploaded_at": "2026-03-09T04:15:00Z"
  },
  "meal-plan": {
    "url": "https://nanorhino.ai/zhuoran/meal-plan.html",
    "uploaded_at": "2026-03-09T07:00:00Z"
  }
}

Each key is updated independently — uploading a new meal plan doesn't affect the weight loss plan entry.

When a user asks for their plan link:

  1. Read plan-url.json → find the relevant key
  2. Send the existing url — URLs are permanent (no expiry)
  3. If the plan content has been updated since last upload, re-run the script to push the new version (URL stays the same)

Fallback Mode: PDF via Slack

When --bucket is NOT provided, the script falls back to PDF generation and Slack file upload:

bash {baseDir}/scripts/generate-and-send.sh \
  --agent <YOUR_AGENT_ID> \
  --input PLAN.md \
  --message "📋 这是你的体重管理计划" \
  --filename "体重管理计划.pdf"

Individual Scripts (Advanced)

Generate HTML only (weight loss plan)

python3 {baseDir}/scripts/generate-html.py <input.md> [output.html]

Generate HTML only (meal plan)

python3 {baseDir}/scripts/generate-meal-plan-html.py <input.md> [output.html]

The meal plan script expects Markdown in the schema defined at meal-planner/references/meal-plan-schema.md.

Generate PDF only

bash {baseDir}/scripts/generate-pdf.sh <input.md> [output.pdf]

Upload to cloud storage only

bash {baseDir}/scripts/upload-to-s3.sh \
  --file <path.html> \
  --bucket <name> \
  --username <username> \
  --key <document-key> \
  [--workspace <path>] \
  [--base-url <url>]

Send file to Slack only (legacy)

bash {baseDir}/scripts/send-to-slack.sh --agent <id> --file <path> [--message <text>] [--filename <name>]

Notes

  • Weight loss plan HTML: blue theme, tables, Inter + Noto Sans SC fonts
  • Meal plan HTML: green theme, day-card layout, responsive, print-friendly
  • PDF mode uses WeasyPrint (Python) — no Chrome/browser dependency
  • All formats support Chinese, English, and mixed-language content
  • Cloud storage objects: set lifecycle rule on bucket for auto-cleanup (optional)
  • Public URLs are permanent ({base-url}/{username}/{key}.html), served via Cloudflare Worker
  • Same S3 key is overwritten on each upload — URL stays stable
  • Agent-to-Slack-user mapping (PDF fallback) is auto-resolved from openclaw.json bindings

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.