Skip to main content
ClaudeWave
ES, Spanish
Skill5.1k estrellas del repoactualizado 2mo ago

self-media-composer

>

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/dtyq/magic /tmp/self-media-composer && cp -r /tmp/self-media-composer/backend/super-magic/agents/skills/self-media-composer ~/.claude/skills/self-media-composer
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Self-Media Composer Skill

Complete capability for building and managing self-media projects. One project groups many posts; each post is an independent folder with its own meta and card sequence. This skill scaffolds that structure, authors the cards, generates reference engagement data, and keeps the root index in sync.

---

## When to Load This Skill

Load this skill **immediately and before any other action** when the user's message matches any of the following patterns.

### English

| User says | Load reason |
| --- | --- |
| "create a post" / "add a post" | New post creation |
| "make cards for Rednote / Instagram" | Card-based post authoring |
| "write a WeChat article" / "WeChat official account post" | Article post authoring |
| "build a self-media project" / "start a content project" | Project scaffolding |
| "generate social cards" / "design card images" | Card design |
| "create content for [platform]" | Any platform post |
| "post-publication review" / "article ops review" | Operations data sync |
| "fetch published data" / "update ops files" | Operations data sync |
| "sync now" / "real data refresh" | Operations data sync |
| Contains `[@self_media_project:...]` | Existing project reference |

### Multilingual

Load for equivalent requests in any user language, including Chinese-language requests for Xiaohongshu/Rednote posts, WeChat Official Account articles, Instagram cards, card-based social posts, content projects, publishing-data import, immediate sync, real data refresh, operations review, or any message containing `[@self_media_project:...]`.

> **Note:** When localized platform aliases appear, treat them as the corresponding platform values. See Platform Aliases in the Platform Defaults section.

---

## Execution

All Python snippets in this document must run through `run_sdk_snippet`:

```python
run_sdk_snippet(
    python_code="""
from sdk.tool import tool
result = tool.call('create_self_media_project', {
    'project_path': 'ai-monthly',
    'platform': 'rednote'
})
print(result)
"""
)
```

`result` exposes `result.ok`, `result.content`, `result.data`. Access structured data via `result.data`; the object is not subscriptable.

---

## Output Language Contract

The skill documentation is written in English, but generated content must adapt to the user's language.

1. Infer the user's preferred output language from the current user message first, then from active draft content, existing post language, project context, and explicit platform requirements. If the target language is still ambiguous and the choice affects the final content, ask one concise clarification.
2. Write all user-facing text in the inferred language: questions, option labels, project/post display names, titles, subtitles, card copy, article prose, captions, comments, CTA text, placeholder labels, relative time strings, operations review prose, and template descriptions.
3. Keep machine contracts stable: platform values, preset IDs, JSON keys, enum values, CSS class names, JS namespaces, file extensions, and API/tool parameters stay in their documented form.
4. Use safe filesystem IDs. Prefer lowercase ASCII slugs for `project_path`, `post_id`, card filenames, and preset names unless the user explicitly needs localized filenames and the path is safe.
5. Do not translate brand names, platform names, product names, source quotes, code identifiers, or fixed schema values. Translate surrounding explanation and content intent.
6. For Rednote tags, choose tags that fit the user's output language and the platform's search behavior. The Chinese hashtag library is a reference set for Chinese/Xiaohongshu SEO, not a command to force Chinese tags in non-Chinese output.
7. Set HTML `lang` attributes to the inferred language when writing cards or articles (`zh-CN`, `en`, `ja`, etc.).

---

## Project Concept

A self-media project is a Magic Project folder whose `magic.project.js` declares `type: "self-media"`. It contains:

- `magic.project.js` at the root — JSONP, holds a per-platform posts index
- `posts/<post-id>/` — one folder per post, fully self-contained
- `shared/` — optional, assets shared across posts (including copied preset bundles)

Directory layout:

```
<project-root>/
├── magic.project.js
├── posts/
│   ├── <post-id>/
│   │   ├── post.json
│   │   ├── cards/           # rednote / instagram only
│   │   │   ├── <card>.html
│   │   │   └── ...
│   │   └── assets/
│   ├── <wechat-post-id>/    # wechat-official-accounts
│   │   ├── post.json
│   │   ├── <article>.html   # single article HTML
│   │   └── assets/
│   │       ├── cover-hero.jpg
│   │       └── cover-square.jpg
│   └── ...
└── shared/
    └── presets/
        └── <preset-name>/
            ├── <preset-name>.css
            └── <preset-name>.js
```

Preset source files (inside this skill) are organized by platform:

```
presets/
├── rednote/
│   ├── neo-brutalism/
│   ├── code-dispatch/
│   ├── dark-tech/
│   ├── gradient-editorial/
│   ├── personal-insight/
│   ├── film-vintage/
│   ├── warm-journal/
│   ├── paper-column/
│   ├── signal-grid/
│   └── product-launch-preset/
├── instagram/
│   ├── ins-modern/
│   ├── ins-minimal/
│   ├── ins-dark/
│   ├── ins-retro/
│   ├── ins-fluent-depth/
│   ├── ins-token-system/
│   ├── ins-creator-studio/
│   ├── ins-film-frame/
│   ├── ins-warm-journal/
│   └── ins-signal-grid/
└── wechat-official-accounts/
    └── (coming soon)
```

> For `magic.project.js` and `post.json` format examples, path rules, and file authoring rules, see [references/file-formats.md](./references/file-formats.md).

### File authoring rules (summary)

- `magic.project.js` must be generated by `create_self_media_project`. Never create or overwrite it with `write_file`. Edit its inner `posts` array via `edit_file` only.
- `post.json` is produced by `create_self_media_post`. Edit it with `edit_file` for subsequent changes.
- Card HTML files can be authored directly with `write_file`.

---

## Platform Defaults

Curre
agent-infoSkill

Query the list of all agents (employees) available to the current user. Use when generating code that requires a real agentId, or when the user asks "which agents/employees do I have".

ai-card-generatorSkill

|

antd-style-to-tailwindSkill

Migrate existing antd-style CSS-in-JS (createStyles) components to Tailwind CSS utility classes with full dark mode support, following the project's style system transition strategy. Use when the user asks to migrate, convert, or rewrite antd-style components to Tailwind, or when working on new components in files that already use antd-style.

browserSkill

Open and operate webpages in a real browser: navigate, read rendered content, inspect interactive elements, click, type, submit forms, press keys, select options, check boxes, hover, scroll, upload files, wait for page changes, manage pages, take and save screenshots, analyze visual layout, and inspect page errors and network activity.

canvas-designerSkill

Core canvas design skill covering project management, multimedia principles, AI image generation, web image search, and design marker processing. Load for any canvas design task. CRITICAL - When user message contains [@design_canvas_project:...] or [@design_marker:...] mentions, or when the user wants to generate video/animation/clip on a canvas project, you MUST load this skill first before any operations.

chat-historySkill

Use when details may have been lost after context compaction, or when the Agent needs to inspect earlier compacted messages or previously created sub-agents.

cli-managerSkill

Manage persistence for user-installed third-party CLI tools in the Super Magic sandbox. Use when the user wants to install, configure, adopt, restore, inspect, or remove a CLI, or when an external skill, webpage, or installer asks to run CLI install commands such as curl|sh, npm install -g, pipx install, uv tool install, go install, cargo install, or brew install. Do not persist runtime-provided CLIs.

code-review-expertSkill

Expert code review of current git changes with a senior engineer lens. Detects SOLID violations, security risks, and proposes actionable improvements.