SuperAPI AI Directory

aws-wechat-article-assets

Office & productivity

View repository

Updated 10-15 16:46

About this skill

User business asset library and presets (Assets)

Business assets are organized into directories by product name — .aws-article/products/{产品名}/ is attached directly to the business introduction .md、images/ stores accompanying images (including a same-named description .md)。Before writing articles/images involving the user's own business, you must check here first; newly generated business introduction content should guide the user to save it here. Preset packs are merged into .aws-article/presets/。

Suite description · This skill belongs to the aws-wechat-article-* all-in-one suite (9 slugs in total, entry point aws-wechat-article-main). Cross-skill relative references depend on the same skills/ directory, and it is recommended to clawhub install the full suite together. Source code:https://github.com/aiworkskills/wechat-article-skills

Capabilities

This skill manages the local business asset library and preset packs, and can optionally download from the aiworkskills.cn domain .aws preset packs (ZIP).

  • Credentials: none (butImporting .aws will write the keys inside the pack to the repository root aws.env, see below)
  • Network: optional https://*.aiworkskills.cn/**/*.aws download of preset packs.Whitelist enforcement: HTTPS only + aiworkskills.cn and its subdomains; non-whitelistedexits with an error directly。--allow-any-host can be relaxed, for debugging
  • File read: local images or .aws files specified by the user; before guiding ingestion it will ls .aws-article/products/ to see existing product names
  • File write:
    • .aws-article/products/{产品名}/*.md(business introduction, AI uses the Write tool to store it directly in the library)
    • .aws-article/products/{产品名}/images/*(images + same-named .md, written by the script)
    • .aws-article/presets/<白名单子目录>/*、.aws-article/downloads/*.aws、.aws-article/tmp/*
    • Repository root aws.env: when importing .aws , keys are written incrementally according to the mapping table (before overwriting existing keys, it automatically backs up aws.env.bak.{ts}, stderr prints only key names and not values)
  • Archive safety: extracts .aws(ZIP) to .aws-article/tmp/。has built-in ZIP slip defense—it verifies member paths item by item and rejects absolute paths,.. segments, or paths that resolve to outside the extraction directory; any violation exits immediately and writes no files
  • shell: only {python} {baseDir}/scripts/ under product_image_ingest.py、import_presets_aws.py

Except for aws.env , all writes are restricted to the repository root's .aws-article/ .

Can be used when installed standalone: neither script depends on sibling skills; as long as there is a .aws-article/ directory it can work.

Three things

Capability Description
Business introduction .md ingestion Business introduction produced in conversation → products/{产品名}/<文件名>.md(the Write tool stores it directly in the library, no script)
Business image ingestion User business image → products/{产品名}/images/ + same-named description .md(script,--product required)
Preset pack .aws ZIP (local file or https://aiworkskills.cn/**/*.aws) → merged into presets/ whitelist subdirectories

Design intent (required reading)⛔

.aws-article/products/{产品名}/ isthe user's own business(selling goods / selling software / selling services / self-media IP) repository—it is both thedraft sourcewhen AI writes business-related content, and thesave destination。

.aws-article/products/{产品名}/
├─ 项目介绍.md                # 业务介绍 .md 直挂产品根(命名按用户行业:服务介绍.md / 品牌介绍.md…)
├─ (其他业务文档.md)
└─ images/
   ├─ 配置首页.png
   └─ 配置首页.md             # 图片说明 .md(同名)

Bidirectional trigger:

Direction Trigger condition Behavior
Read The current task involves the user's own business (external introduction / tutorial / case study / own promotion / business images) First ls .aws-article/products/, identify the relevant product, read the *.mdunder its root, check images/ for the same-named .md, and treat existing materials as drafts and image candidates
Write Content AI has just generated or rewrittenthat semantically belongs to the user's business introduction Follow the “Business introduction .md storage” below; if the user says “save as product introduction,” etc., also follow this

When not to triggerSee branches.md “I”。

I. Business introduction .md storage

No script needed; AI uses the Write tool to store directly. Two triggers:

  • AI proactive identification: When the content just generated/rewritten clearly belongs to the user's own business introduction (product / service / brand / project / team / business scope), prompt the user:

    “This passage is the business introduction for [product name]. Do you want to save it to the product repository? I can save it to .aws-article/products/{产品名}/{文件名}.md, and next time I write an article involving the business, it will be used automatically.”

  • User proactive instruction: “Save as product introduction / business introduction / service introduction / store to product / save to product repository,” etc.

Save process:

  1. Confirm the product name:ls .aws-article/products/, if a directory already exists prompt to reuse it; for a new product, get the name from the user.
  2. Confirm the file name: default 项目介绍.md; can be changed to something fitting the user's industry 产品介绍.md / 服务介绍.md / 品牌介绍.md。
  3. Create directory:mkdir -p .aws-article/products/{产品名}/images/(build the full skeleton even if it is temporarily empty).
  4. Write: Write tool stores to .aws-article/products/{产品名}/{文件名}.md。
  5. Feedback: “Saved to <完整路径>. Next time an article involving the [product name] business comes up, it will be used automatically.”

II. Business image storage

The script does not read images—reading images to determine file names and writing image descriptions is the Agent's job; the storage command must include --content:

{python} {baseDir}/scripts/product_image_ingest.py <源图片路径> \
  --product "公众号AI运营助手" --stem "配置首页" \
  --content "客观中文描述,一两句即可"

--product / --stem is required; the product directory and images/ are automatically created if they do not exist. Output 配置首页.png + 配置首页.md。

If --content is not passed, a placeholder sentence will be written (expected behavior, not a malfunction)、.md 's fixed format, see branches.md “II”。

III. Preset package import (.aws)

Extension .aws, essentially ZIP. The package root should contain preset folders consistent with the repository (it may contain other files; the script only processes the whitelist):

closing-blocks、cover-styles、formatting、image-styles、sticker-styles、structures、title-styles

There may also be a root-level config.yaml、writing-spec.md。Directories not in the whitelist will be skipped and logged——components/ and review-rules.yaml are not managed by .aws , for the reason see branches.md “III”。

Workflow:

  1. Prepare source: local .aws file, or a whitelisted HTTPS URL.
  2. First --dry-run to see which paths will be written.
  3. In therepository rootrun:
# 本地路径
{python} {baseDir}/scripts/import_presets_aws.py path/to/bundle.aws
{python} {baseDir}/scripts/import_presets_aws.py path/to/bundle.aws --dry-run

# URL(仅 aiworkskills.cn 及子域)
{python} {baseDir}/scripts/import_presets_aws.py https://aiworkskills.cn/bundles/brand-a.aws

Three semantics to know first ⛔:

  • Preset directories are replace-style: if the package contains that subdirectory → first clear the local directory of the same name and then write; if not in the package → leave the local one untouched.
  • config.yaml does not overwrite: if it already exists locally, only print the differences as JSON to stdout, and you mustask the userbefore manually editing. Only copy if it does not exist locally.
  • Secrets go into aws.env: wechat_appid / wechat_appsecret / writing_model.api_key / image_model.api_key in the package is written incrementally per the mapping, backing up before overwriting aws.env.bak.{ts}。

Complete rules (mapping table, write strategy, package root priority, URL whitelist,tmp semantics) are in branches.md "Sections 3–5"。

Script

Script parameters
product_image_ingest.py source、--product(required),--stem(required),--content、--repo
import_presets_aws.py bundle(path or whitelisted URL),--dry-run、--repo、--allow-any-host(debug)

Branches and details

Cases that should not be committed, the two steps for committing a business diagram,.aws merge semantics, secret mapping, URL whitelist → references/branches.md。

Process files

Scenario Output
Business introduction .md committed .aws-article/products/{产品名}/{文件名}.md(also mkdir images/)
Business diagram committed .aws-article/products/{产品名}/images/*.{png,…} + same-name *.md
.aws import .aws-article/presets/** update;config.yaml first copy or stdout diff JSON; secrets written incrementally to aws.env(backup before overwrite); extraction cache in .aws-article/tmp/
.aws URL import download cache .aws-article/downloads/*.aws; the rest is the same as local import