Skip to content

refactor: 精简 SKILL.md 并统一路由表真相源#690

Open
binggg wants to merge 3 commits intomainfrom
fix/prompt-skills-view-url
Open

refactor: 精简 SKILL.md 并统一路由表真相源#690
binggg wants to merge 3 commits intomainfrom
fix/prompt-skills-view-url

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 29, 2026

改动说明

问题

  • SKILL.md 434 行过长,AI 处理时有效信息密度下降
  • 路由表在 YAML 和 Markdown 两处维护,存在冗余和漂移风险

解决

  • activation-map.yaml 移入 references/,成为唯一真相源
  • 构建时(build-allinone-skill.ts)自动从 YAML 生成路由表注入 SKILL.md,不再双写
  • 新增 references/mcp-setup.md,存放 MCP 详细配置(从 SKILL.md 移出)
  • 删除冗余章节:Quick Reference / Core Capabilities / Professional Skill Reference
  • SKILL.md434 行 → 199 行

改动文件

  • config/source/guideline/cloudbase/SKILL.md — 精简
  • config/source/guideline/cloudbase/references/activation-map.yaml — 新增(从上层目录移入)
  • config/source/guideline/cloudbase/references/mcp-setup.md — 新增
  • scripts/build-allinone-skill.ts — 新增 guideline references 复制 + 路由表注入

- 将 activation-map.yaml 移入 references/,成为唯一真相源
- 构建时自动从 YAML 生成路由表注入 SKILL.md(build-allinone-skill.ts)
- 精简 SKILL.md:删除 Quick Reference / Core Capabilities / Professional Skill Reference 冗余章节
- MCP 详细配置移至 references/mcp-setup.md
- SKILL.md 从 434 行降至 199 行
- build-allinone-skill.ts 新增:复制 guideline references、注入路由表
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da907c5afe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const SOURCES = {
mainRules: 'config/source/guideline/cloudbase/SKILL.md',
skillsDir: 'config/source/skills',
guidelineReferences: 'config/source/guideline/cloudbase/references',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve legacy activation-map path or update all consumers

This change moves the routing source from config/source/guideline/cloudbase/activation-map.yaml to .../references/activation-map.yaml via SOURCES.guidelineReferences, but existing consumers still read the old path (for example tests/skill-activation-routing.test.js lines 10-17). As merged, those reads now fail with ENOENT, which breaks routing-contract validation and any tooling still pinned to the previous canonical location. Please either keep a compatibility file at the old path or update all in-repo readers in the same commit.

Useful? React with 👍 / 👎.

Comment on lines +167 to +169
fallbackMarker + '.*?(?=\\n### )',
`${marker}\n\n${table}\n`,
's' // dotall mode
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a real regex for fallback routing-table injection

The fallback branch intended to replace the "canonical routing contract" section is currently ineffective: String.replace is called with a plain string pattern plus a third 's' argument, but JavaScript ignores extra args and does not interpret the pattern as regex. If the marker comment is absent, the replacement silently fails and the table is not injected, reintroducing drift between SKILL.md and activation-map.yaml.

Useful? React with 👍 / 👎.

binggg added 2 commits April 29, 2026 19:45
- activation-map.yaml: 给所有 scenario 加上 label 和 mustCheckBeforeAction 字段
- build-allinone-skill.ts: generateRoutingTableFromYaml() 生成完整 5 列表格
- skill-activation-routing.test.js: 更新 ACTIVATION_MAP_FILE 路径到 references/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant