用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fabioc-aloha/Alex_Skill_Mall --skill config-content-separation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | config-content-separation |
| description | Mixing structure and content makes both hard to maintain: |
| lastReviewed | 2026-04-30T00:00:00.000Z |
Mixing structure and content makes both hard to maintain:
// Bad: structure and content interleaved
const menu = [
{ label: 'Home', icon: 'house', content: 'Welcome to our site...' },
{ label: 'About', icon: 'info', content: 'We are a company that...' }
];
Content updates require touching code. Structure changes require editing content.
JSON defines structure. Separate files hold content.
// config/menu.json
{
"items": [
{ "id": "home", "label": "Home", "icon": "house", "contentFile": "home.md" },
{ "id": "about", "label": "About", "icon": "info", "contentFile": "about.md" }
]
}
<!-- content/home.md -->
# Welcome
Welcome to our site. We're glad you're here.
// Loader resolves file references at runtime
function loadMenu(configPath, contentDir) {
const config = require(configPath);
return config.items.map(item => ({
...item,
content: fs.readFileSync(path.join(contentDir, item.contentFile), 'utf8')
}));
}
let cache = null;
let cacheTime = 0;
const CACHE_TTL = 60000; // 1 minute
function getMenu(refresh = false) {
if (!refresh && cache && Date.now() - cacheTime < CACHE_TTL) {
return cache;
}
cache = loadMenu('./config/menu.json', './content');
cacheTime = Date.now();
return cache;
}
// Force refresh on explicit request
app.post('/admin/refresh-content', (req, res) => {
getMenu(true);
res.json({ status: 'refreshed' });
});
build architecture content-management configuration