---
name: wechat-skill-toggle-yashu
description: "开启或关闭公众号相关技能。当用户说『打开公众号技能』或『关闭公众号技能』时调用。"
title: wechat-skill-toggle-yashu
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/wechat-skill-toggle-yashu
last_updated: 2026-10-07T07:20:50.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install steelan9199/wechat-publisher/wechat-skill-toggle-yashu`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/wechat-skill-toggle-yashu`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/steelan9199/wechat-publisher/wechat-skill-toggle-yashu) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/wechat-skill-toggle-yashu`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/wechat-skill-toggle-yashu --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/wechat-skill-toggle-yashu --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# 公众号技能开关

本技能用于控制公众号相关技能的启用与禁用，通过修改 Trae 配置文件 `C:\Users\Administrator\.trae-cn\skill-config.json` 中的 `disabledSkills` 字段来实现。

## 受控的技能列表

以下 4 个技能属于"公众号技能"组：

- `wechat-title-optimizer-yashu`
- `wechat-content-optimizer-yashu`
- `wechat-publisher-yashu`
- `generate-cover-prompt-yashu`

## 触发条件

- 当用户说 **"打开公众号技能"**（或类似表达如"启用公众号技能"、"开启公众号技能"）时，执行**开启操作**。
- 当用户说 **"关闭公众号技能"**（或类似表达如"禁用公众号技能"、"停用公众号技能"）时，执行**关闭操作**。

## 配置文件路径

```
C:\Users\Administrator\.trae-cn\skill-config.json
```

该文件结构如下：

```json
{
  "disabledSkills": [
    "skill-name-1",
    "skill-name-2"
  ],
  "builtinSkillStatus": {},
  "managedSkills": {},
  "deletedSkills": []
}
```

## 开启操作（打开公众号技能）

从 `disabledSkills` 数组中**移除**以下 4 个技能名称：

- `wechat-title-optimizer-yashu`
- `wechat-content-optimizer-yashu`
- `wechat-publisher-yashu`
- `generate-cover-prompt-yashu`

操作步骤：
1. 使用 Read 工具读取 `C:\Users\Administrator\.trae-cn\skill-config.json`。
2. 解析 JSON，从 `disabledSkills` 数组中移除上述 4 个技能名称（如果存在的话）。
3. 保持数组中其他技能名称不变，保持文件中其他字段不变。
4. 使用 Write 工具将修改后的 JSON 写回原文件（保持 2 空格缩进格式）。
5. 向用户报告操作结果，列出当前 `disabledSkills` 的最终状态。

## 关闭操作（关闭公众号技能）

向 `disabledSkills` 数组中**添加**以下 4 个技能名称（如果尚未存在的话）：

- `wechat-title-optimizer-yashu`
- `wechat-content-optimizer-yashu`
- `wechat-publisher-yashu`
- `generate-cover-prompt-yashu`

操作步骤：
1. 使用 Read 工具读取 `C:\Users\Administrator\.trae-cn\skill-config.json`。
2. 解析 JSON，检查上述 4 个技能名称是否已在 `disabledSkills` 数组中。
3. 将不存在的技能名称添加到 `disabledSkills` 数组末尾。
4. 保持数组中其他技能名称不变，保持文件中其他字段不变。
5. 使用 Write 工具将修改后的 JSON 写回原文件（保持 2 空格缩进格式）。
6. 向用户报告操作结果，列出当前 `disabledSkills` 的最终状态。

## 注意事项

- 仅修改 `disabledSkills` 字段，**不要修改** `builtinSkillStatus`、`managedSkills`、`deletedSkills` 等其他字段。
- 添加时做去重检查，避免数组中出现重复的技能名称。
- 移除时只移除指定的 4 个技能名称，不影响其他技能。
- 写回文件时保持 JSON 格式：2 空格缩进，UTF-8 编码，末尾保留换行符。
- 操作完成后，简要告知用户当前公众号技能是"已开启"还是"已关闭"状态。
