claudex-setup 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +9 -1
- package/package.json +8 -2
- package/src/audit.js +40 -3
- package/src/badge.js +13 -0
- package/src/setup.js +363 -45
- package/.claude/agents/security-reviewer.md +0 -11
- package/.claude/commands/review.md +0 -6
- package/.claude/commands/test.md +0 -6
- package/.claude/hooks/on-edit-lint.sh +0 -5
- package/.claude/rules/frontend.md +0 -4
- package/.claude/skills/fix-issue/SKILL.md +0 -11
- package/APF.md +0 -121
- package/CLAUDE.md +0 -42
- package/CONTRIBUTING.md +0 -53
- package/apf/state.json +0 -29
- package/apf/todo.md +0 -40
- package/content/devto-article.json +0 -8
- package/content/launch-posts.md +0 -160
- package/docs/index.html +0 -681
- package/tools/publish.js +0 -149
package/tools/publish.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CLAUDEX Auto-Publisher
|
|
4
|
-
* Publishes content to all platforms automatically where possible,
|
|
5
|
-
* opens pre-filled browser for platforms that need manual submit.
|
|
6
|
-
*
|
|
7
|
-
* Usage: node tools/publish.js [platform]
|
|
8
|
-
* Platforms: devto, hn, reddit, all
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const https = require('https');
|
|
12
|
-
const http = require('http');
|
|
13
|
-
const { execSync } = require('child_process');
|
|
14
|
-
const fs = require('fs');
|
|
15
|
-
const path = require('path');
|
|
16
|
-
|
|
17
|
-
// Load env
|
|
18
|
-
const envPath = path.join(__dirname, '..', '.env');
|
|
19
|
-
const env = {};
|
|
20
|
-
if (fs.existsSync(envPath)) {
|
|
21
|
-
fs.readFileSync(envPath, 'utf8').split('\n').forEach(line => {
|
|
22
|
-
const match = line.match(/^([A-Z_]+)=(.+)$/);
|
|
23
|
-
if (match) env[match[1]] = match[2];
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const platform = process.argv[2] || 'all';
|
|
28
|
-
|
|
29
|
-
// === Dev.to: Full API automation ===
|
|
30
|
-
async function publishDevTo(article) {
|
|
31
|
-
return new Promise((resolve, reject) => {
|
|
32
|
-
const data = JSON.stringify({ article });
|
|
33
|
-
const req = https.request({
|
|
34
|
-
hostname: 'dev.to',
|
|
35
|
-
path: '/api/articles',
|
|
36
|
-
method: 'POST',
|
|
37
|
-
headers: {
|
|
38
|
-
'api-key': env.DEVTO_API_KEY,
|
|
39
|
-
'Content-Type': 'application/json',
|
|
40
|
-
'Content-Length': Buffer.byteLength(data),
|
|
41
|
-
}
|
|
42
|
-
}, (res) => {
|
|
43
|
-
let body = '';
|
|
44
|
-
res.on('data', chunk => body += chunk);
|
|
45
|
-
res.on('end', () => {
|
|
46
|
-
const result = JSON.parse(body);
|
|
47
|
-
if (result.url) {
|
|
48
|
-
console.log(` ✅ Dev.to: ${result.url}`);
|
|
49
|
-
resolve(result);
|
|
50
|
-
} else {
|
|
51
|
-
console.log(` ❌ Dev.to: ${result.error || JSON.stringify(result)}`);
|
|
52
|
-
reject(result);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
req.on('error', reject);
|
|
57
|
-
req.write(data);
|
|
58
|
-
req.end();
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// === Hacker News: Open pre-filled browser ===
|
|
63
|
-
function publishHN(title, url) {
|
|
64
|
-
const hnUrl = `https://news.ycombinator.com/submitlink?u=${encodeURIComponent(url)}&t=${encodeURIComponent(title)}`;
|
|
65
|
-
console.log(` 🌐 Opening Hacker News submit page...`);
|
|
66
|
-
openBrowser(hnUrl);
|
|
67
|
-
console.log(` ⚠️ HN requires manual submit (click button in browser)`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// === Reddit: Open pre-filled browser (until API approved) ===
|
|
71
|
-
function publishReddit(subreddit, title, text) {
|
|
72
|
-
const redditUrl = `https://www.reddit.com/r/${subreddit}/submit?type=TEXT&title=${encodeURIComponent(title)}&text=${encodeURIComponent(text)}`;
|
|
73
|
-
console.log(` 🌐 Opening Reddit r/${subreddit} submit...`);
|
|
74
|
-
openBrowser(redditUrl);
|
|
75
|
-
console.log(` ⚠️ Reddit requires manual submit (select flair + click Post)`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// === Open browser cross-platform ===
|
|
79
|
-
function openBrowser(url) {
|
|
80
|
-
try {
|
|
81
|
-
if (process.platform === 'win32') {
|
|
82
|
-
execSync(`start "" "${url}"`);
|
|
83
|
-
} else if (process.platform === 'darwin') {
|
|
84
|
-
execSync(`open "${url}"`);
|
|
85
|
-
} else {
|
|
86
|
-
execSync(`xdg-open "${url}"`);
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
console.log(` 📋 Open manually: ${url}`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// === Content library ===
|
|
94
|
-
const CONTENT = {
|
|
95
|
-
hn: {
|
|
96
|
-
title: 'Show HN: claudex-setup – Audit any project for Claude Code optimization (972 techniques)',
|
|
97
|
-
url: 'https://github.com/DnaFin/claudex',
|
|
98
|
-
},
|
|
99
|
-
reddit: {
|
|
100
|
-
title: 'I built a CLI that audits your project for Claude Code optimization — scores 0-100 (972 verified techniques)',
|
|
101
|
-
text: `After cataloging 972 Claude Code techniques and testing 773 of them with real evidence, I built a free CLI that checks if your project is actually set up to get the most out of Claude Code.
|
|
102
|
-
|
|
103
|
-
Most projects score 10-20 out of 100. After running setup, they jump to 70+.
|
|
104
|
-
|
|
105
|
-
npx claudex-setup
|
|
106
|
-
|
|
107
|
-
It checks 12 critical things: CLAUDE.md, hooks, commands, skills, agents, Mermaid diagrams, XML tags, path rules, MCP config, permissions, and more.
|
|
108
|
-
|
|
109
|
-
Then npx claudex-setup setup creates everything that's missing, tailored to your stack (React, Python, TypeScript, Rust, Go, etc).
|
|
110
|
-
|
|
111
|
-
- Zero dependencies
|
|
112
|
-
- No API keys needed
|
|
113
|
-
- Runs entirely on your machine
|
|
114
|
-
- Free and open source
|
|
115
|
-
|
|
116
|
-
GitHub: https://github.com/DnaFin/claudex`,
|
|
117
|
-
subreddits: ['ClaudeAI', 'ChatGPTCoding'],
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// === Main ===
|
|
122
|
-
async function main() {
|
|
123
|
-
console.log('\n 📡 CLAUDEX Publisher\n');
|
|
124
|
-
|
|
125
|
-
if (platform === 'devto' || platform === 'all') {
|
|
126
|
-
console.log(' --- Dev.to ---');
|
|
127
|
-
if (!env.DEVTO_API_KEY) {
|
|
128
|
-
console.log(' ❌ Missing DEVTO_API_KEY in .env');
|
|
129
|
-
} else {
|
|
130
|
-
console.log(' ℹ️ Dev.to article already published. Use for new articles.');
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (platform === 'hn' || platform === 'all') {
|
|
135
|
-
console.log(' --- Hacker News ---');
|
|
136
|
-
publishHN(CONTENT.hn.title, CONTENT.hn.url);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (platform === 'reddit' || platform === 'all') {
|
|
140
|
-
console.log(' --- Reddit ---');
|
|
141
|
-
for (const sub of CONTENT.reddit.subreddits) {
|
|
142
|
-
publishReddit(sub, CONTENT.reddit.title, CONTENT.reddit.text);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
console.log('\n Done.\n');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
main().catch(console.error);
|