ShenyuanNext/wepr-growth-skills / skills/dbs-content-system
dbs-content-system
Verified把本地文稿、推文、选题、案例和课程稿整理成可持续生长、可重组复用的内容工程。用户要求结构化内容资产、整理旧素材或建立主题地图时使用。
tools/summarize-system.js
View on GitHub#!/usr/bin/env node
const fs = require("fs");
const path = require("path");
const root = path.resolve(process.cwd());
function walkFiles(dir) {
if (!fs.existsSync(dir)) return [];
const files = [];
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) files.push(...walkFiles(full));
else if (entry.isFile()) files.push(full);
}
return files;
}
function isContentMarkdown(file) {
return path.extname(file).toLowerCase() === ".md" && path.basename(file).toLowerCase() !== "readme.md";
}
function countContentMarkdownFiles(dir) {
return walkFiles(dir).filter(isContentMarkdown).length;
}
function countBySubdir(dir) {
if (!fs.existsSync(dir)) return {};
const result = {};
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
if (!entry.isDirectory()) continue;
result[entry.name] = countContentMarkdownFiles(path.join(dir, entry.name));
}
return result;
}
const summary = {
totalUnits: countContentMarkdownFiles(path.join(root, "02-内容单元库")),
unitBreakdown: countBySubdir(path.join(root, "02-内容单元库")),
themeMaps: countContentMarkdownFiles(path.join(root, "05-主题地图")),
assemblies: countContentMarkdownFiles(path.join(root, "06-选题装配")),
totalFolders: walkFiles(root).filter((file) => false).length,
};
function countDirs(dir) {
if (!fs.existsSync(dir)) return 0;
let count = 0;
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
if (!entry.isDirectory()) continue;
count += 1;
count += countDirs(path.join(dir, entry.name));
}
return count;
}
summary.totalFolders = countDirs(root);
summary.totalFiles = walkFiles(root).length;
console.log(JSON.stringify(summary, null, 2));
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |