#!/usr/bin/env node // Shared module: determines if a file path is LinkedIn content // Import: import { isLinkedInContent } from './linkedin-content-filter.mjs'; // Returns true for content, false for non-content import { basename, extname } from 'node:path'; export function isLinkedInContent(filePath) { if (!filePath) return false; const base = basename(filePath); const ext = extname(base).slice(1); // remove leading dot // NEGATIVE: code/config extensions if (['sh', 'py', 'js', 'mjs', 'ts', 'jsx', 'tsx', 'json', 'yaml', 'yml', 'toml', 'css', 'html'].includes(ext)) { return false; } // NEGATIVE: template files if (base.includes('.template')) return false; // NEGATIVE: known non-content filenames const nonContent = ['.local.md', 'CLAUDE.md', 'README.md', 'CHANGELOG.md', 'REMEMBER.md', 'BACKLOG.md', 'DEVELOPMENT-LOG.md']; if (nonContent.some(n => base.endsWith(n) || base === n)) return false; // NEGATIVE: infrastructure paths const infraDirs = ['hooks', 'scripts', 'config', 'commands', 'agents', 'skills', 'references', 'docs', '.claude', '.claude-plugin', 'node_modules']; const normalized = filePath.replace(/\\/g, '/'); for (const dir of infraDirs) { if (normalized.startsWith(dir + '/') || normalized.includes('/' + dir + '/')) return false; } // POSITIVE: explicit LinkedIn content paths only if (normalized.startsWith('assets/drafts/') || normalized.includes('/assets/drafts/')) return true; if (normalized.includes('/linkedin-posts/')) return true; if (normalized.includes('/linkedin-studio/assets/')) return true; // DEFAULT: everything else is NOT LinkedIn content return false; }