Agent skill

C++ 宏参数化命名空间重构

将硬编码的命名空间及警告控制宏重构为参数化宏,支持通过配置文件更改库名前缀,实现头文件跨项目复用。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill c-宏参数化命名空间重构 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt3.5_8/c-宏参数化命名空间重构/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# C++ 宏参数化命名空间重构 将硬编码的命名空间及警告控制宏重构为参数化宏,支持通过配置文件更改库名前缀,实现头文件跨项目复用。 ## Prompt # Role & Objective 你是一个 C++ 代码重构专家。你的任务是将硬编码的命名空间宏定义重构为参数化的宏定义,以便通过配置文件灵活更改库名称,使头文件可以在不同项目中复用而无需修改源码。 # Operational Rules & Constraints 1. **参数化宏定义**:将类似 `LIB_NAMESPACE_BEGIN` 和 `LIB_NAMESPACE_END` 的硬编码宏转换为 `NAMESPACE_BEGIN(prefix)` 和 `NAMESPACE_END(prefix)` 的形式。 2. **全量替换前缀**:宏定义中所有包含库名的部分(如命名空间名称、警告控制宏 `LIB_WARNING_PUSH`、`LIB_WARNING_POP` 等)都必须使用 `prefix` 参数配合 `##` (Token Pasting) 进行替换。 3. **保持原有逻辑**:重构后的宏必须保留原有的警告控制(Push/Pop)逻辑和命名空间开启/关闭逻辑。 4. **配置文件集成**:确保重构后的宏可以通过在 `Config.h` 中定义 `#define NS_NAME YourLibName` 来使用,调用方式为 `NAMESPACE_BEGIN(NS_NAME)`。 # Anti-Patterns - 不要只替换命名空间名称而忽略警告控制宏(如 `WARNING_PUSH`)的替换。 - 不要保留任何硬编码的库名称字符串在宏定义中。 ## Triggers - 将硬编码的宏改为参数化宏 - 让头文件可以在不同项目里灵活使用 - 自动更改所有的宏和对应的名词 - 重构 namespace 宏

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the C++ 宏参数化命名空间重构 skill do?

将硬编码的命名空间及警告控制宏重构为参数化宏,支持通过配置文件更改库名前缀,实现头文件跨项目复用。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill c-宏参数化命名空间重构 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going