suyuan2022/suyuan-skill / get-biji
get-biji
VerifiedGet 笔记(biji.com):把账号里的笔记同步成本地 Markdown 并检索;用 Get 的转写额度把视频、播客、本地音视频转成逐字稿。 触发:用户要同步或查 Get 笔记里的录音和笔记;给了抖音、小红书、B 站、小宇宙链接或本地音视频,要逐字稿。
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 245 B |
| SKILL.md | skill md | 6.3 KB |
| package-lock.json | manifest | 1.8 KB |
| package.json | manifest | 497 B |
| references/检索.md | markdown | 3.1 KB |
| scripts/api.js | script | 9.7 KB |
| scripts/dedupe.js | script | 2.8 KB |
| scripts/format.js | script | 13.4 KB |
| scripts/link-transcript.js | script | 12.3 KB |
| scripts/paths.js | script | 1.9 KB |
| scripts/rebuild-state.js | script | 1.6 KB |
| scripts/sync.js | script | 8.3 KB |
scripts/dedupe.js
View on GitHub#!/usr/bin/env node
/**
* Get Notes Deduplication Tool
*
* Finds summary files that share a `note_id` anywhere under the notes directory,
* keeps the largest one, and deletes the rest together with their `_原文.md` transcript file.
* A summary and its own `_原文.md` share a note_id by design, so transcript files are never compared.
*/
const fs = require('fs');
const path = require('path');
const { resolveOutputDir } = require('./paths');
const TRANSCRIPT_SUFFIX = '_原文.md';
function listSummaryFiles(dir) {
return fs.readdirSync(dir, { withFileTypes: true }).flatMap(entry => {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) return listSummaryFiles(full);
return entry.name.endsWith('.md') && !entry.name.endsWith(TRANSCRIPT_SUFFIX) ? [full] : [];
});
}
function frontmatterField(content, field) {
const match = content.match(new RegExp(`^${field}:\\s*"?([^"\\n]+)"?`, 'm'));
return match ? match[1].trim() : null;
}
function main() {
const notesDir = resolveOutputDir();
if (!fs.existsSync(notesDir)) {
throw new Error(`Notes directory not found: ${notesDir}`);
}
console.log(`🔍 Scanning ${notesDir}...\n`);
const byNoteId = new Map();
for (const file of listSummaryFiles(notesDir)) {
const content = fs.readFileSync(file, 'utf8');
const noteId = frontmatterField(content, 'note_id');
if (!noteId) continue;
const stats = fs.statSync(file);
const entry = { file, size: stats.size, mtime: stats.mtimeMs, transcript: frontmatterField(content, 'transcript') };
byNoteId.set(noteId, [...(byNoteId.get(noteId) || []), entry]);
}
const duplicates = [...byNoteId.entries()].filter(([, files]) => files.length > 1);
if (duplicates.length === 0) {
console.log('✅ No duplicates found.');
return;
}
let deleted = 0;
for (const [noteId, files] of duplicates) {
files.sort((a, b) => b.size - a.size || b.mtime - a.mtime);
const [keep, ...remove] = files;
console.log(`📝 note_id ${noteId}\n Keep: ${path.relative(notesDir, keep.file)}`);
for (const f of remove) {
const paired = f.transcript ? path.join(path.dirname(f.file), f.transcript) : null;
for (const target of [f.file, paired]) {
if (target && target !== keep.file && fs.existsSync(target)) {
console.log(` Delete: ${path.relative(notesDir, target)}`);
fs.unlinkSync(target);
deleted++;
}
}
}
}
console.log(`\n📊 Deleted ${deleted} files in ${duplicates.length} duplicate sets.`);
}
try {
main();
} catch (e) {
console.error(`❌ ${e.message}`);
process.exit(1);
}
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 |