claudex-setup 1.3.0 → 1.4.0

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 CHANGED
@@ -49,6 +49,12 @@ async function main() {
49
49
  dir: process.cwd()
50
50
  };
51
51
 
52
+ if (!require('fs').existsSync(options.dir)) {
53
+ console.error(`\n Error: Directory not found: ${options.dir}`);
54
+ console.error(' Run claudex-setup from inside your project directory.\n');
55
+ process.exit(1);
56
+ }
57
+
52
58
  try {
53
59
  if (command === 'badge') {
54
60
  const { getBadgeMarkdown } = require('../src/badge');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudex-setup",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Audit and optimize any project for Claude Code. Powered by 1107 verified techniques.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/audit.js CHANGED
@@ -97,7 +97,18 @@ async function audit(options) {
97
97
  }
98
98
 
99
99
  if (options.json) {
100
- console.log(JSON.stringify({ score, stacks, passed: passed.length, failed: failed.length, results }, null, 2));
100
+ const { version } = require('../package.json');
101
+ console.log(JSON.stringify({
102
+ version,
103
+ timestamp: new Date().toISOString(),
104
+ score,
105
+ stacks,
106
+ passed: passed.length,
107
+ failed: failed.length,
108
+ skipped: skipped.length,
109
+ checkCount: applicable.length,
110
+ results
111
+ }, null, 2));
101
112
  return { score, passed: passed.length, failed: failed.length, stacks, results };
102
113
  }
103
114
 
package/src/setup.js CHANGED
@@ -29,8 +29,7 @@ function detectScripts(ctx) {
29
29
  // Helper: detect key dependencies and generate guidelines
30
30
  // ============================================================
31
31
  function detectDependencies(ctx) {
32
- const pkg = ctx.jsonFile('package.json');
33
- if (!pkg) return [];
32
+ const pkg = ctx.jsonFile('package.json') || {};
34
33
  const allDeps = { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
35
34
  const guidelines = [];
36
35
 
@@ -153,6 +152,50 @@ function detectDependencies(ctx) {
153
152
  if (reqTxt.includes('redis')) {
154
153
  guidelines.push('- Redis is available for caching and task queues');
155
154
  }
155
+ if (reqTxt.includes('langchain')) {
156
+ guidelines.push('- Use LangChain for chain/agent orchestration. Define chains in chains/ directory');
157
+ }
158
+ if (reqTxt.includes('openai')) {
159
+ guidelines.push('- OpenAI SDK available. Use structured outputs where possible');
160
+ }
161
+ if (reqTxt.includes('anthropic')) {
162
+ guidelines.push('- Anthropic SDK available. Prefer Claude for complex reasoning tasks');
163
+ }
164
+ if (reqTxt.includes('chromadb')) {
165
+ guidelines.push('- Use ChromaDB for local vector storage. Persist collections to disk');
166
+ }
167
+ if (reqTxt.includes('pinecone')) {
168
+ guidelines.push('- Use Pinecone for production vector search. Define index schemas upfront');
169
+ }
170
+ if (reqTxt.includes('mlflow')) {
171
+ guidelines.push('- Use MLflow for experiment tracking. Log all model parameters and metrics');
172
+ }
173
+ if (reqTxt.includes('wandb')) {
174
+ guidelines.push('- Use Weights & Biases for experiment tracking and visualization');
175
+ }
176
+ if (reqTxt.includes('transformers')) {
177
+ guidelines.push('- HuggingFace Transformers available. Use AutoModel/AutoTokenizer for loading');
178
+ }
179
+
180
+ // JS AI/ML/Cloud deps
181
+ if (allDeps['@anthropic-ai/sdk']) {
182
+ guidelines.push('- Anthropic SDK configured. Use Messages API with structured tool_use for agents');
183
+ }
184
+ if (allDeps['openai']) {
185
+ guidelines.push('- OpenAI SDK available. Use structured outputs and function calling');
186
+ }
187
+ if (allDeps['@modelcontextprotocol/sdk']) {
188
+ guidelines.push('- MCP SDK available. Build MCP servers with stdio transport');
189
+ }
190
+ if (allDeps['langchain'] || allDeps['@langchain/core']) {
191
+ guidelines.push('- LangChain available. Use LCEL for chain composition');
192
+ }
193
+ if (allDeps['@aws-sdk/client-s3'] || allDeps['@aws-sdk/client-dynamodb']) {
194
+ guidelines.push('- AWS SDK v3 configured. Use modular imports, not aws-sdk v2');
195
+ }
196
+ if (allDeps['@aws-cdk/aws-lambda'] || allDeps['aws-cdk-lib']) {
197
+ guidelines.push('- AWS CDK available. Define stacks in lib/, constructs as separate classes');
198
+ }
156
199
 
157
200
  return guidelines;
158
201
  }
@@ -564,6 +607,12 @@ Before completing any task, confirm:
564
607
  ${verificationSteps.join('\n')}
565
608
  </verification>
566
609
 
610
+ ## Context Management
611
+ - Use /compact when context gets large (above 50% capacity)
612
+ - Prefer focused sessions — one task per conversation
613
+ - If a session gets too long, start fresh with /clear
614
+ - Use subagents for research tasks to keep main context clean
615
+
567
616
  ## Workflow
568
617
  - Verify changes with tests before committing
569
618
  - Use descriptive commit messages (why, not what)