Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- `analyze --ai` and `--ai-provider`: this only ever returned a fixed template sentence, never called a model. Use `devcompass ai recommend` instead. `analyze --json`'s `metadata` no longer carries the always-`null` `aiInsight` field.
- `fix --batch`, `--batch-mode`, `--only`, `--skip`: these only ever printed "Batch mode features are not yet available". `--dry`/`--preview` still work as aliases for `--dry-run`.
- The unused, unreachable `outdated.collector.js`, `npm-audit.collector.js`, `recommendation.service.js`, and the batch-fix service files (`batch-executor`, `batch-selector`, `supply-chain-fixer`, `license-conflict-fixer`, `quality-fixer`), plus the `data/batch-categories.json` and `data/priorities.json` files only they read. The supply-chain fixer would have "fixed" a flagged typosquat by uninstalling it and installing the look-alike it matched against.
- The local-install warning in `devcompass.js` ("DevCompass is installed locally — npm install -g devcompass"), which fired for global installs and `npx` too and discouraged pinning DevCompass as a devDependency, the actually-recommended setup for teams/CI.

## [4.1.9] - 2026-10-06

### Fixed
Expand Down
13 changes: 13 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Migration Guide

## Unreleased

- **`analyze --ai` and `--ai-provider` are gone.** These only ever returned a
fixed template sentence — no model was ever called. Use
`devcompass ai recommend` (or `ai ask`/`ai alternatives`) instead, which do
call your configured provider. If you parse `analyze --json`, its `metadata`
no longer includes the always-`null` `aiInsight` field.
- **`fix --batch`, `--batch-mode <mode>`, `--only <categories>`, and
`--skip <categories>` are gone.** They only ever printed "Batch mode
features are not yet available" — there is nothing to switch to; use plain
`devcompass fix`, `fix --all`, or `fix --yes`. `--dry-run` (and its
`--dry`/`--preview` aliases) are unaffected.

## From v4.1.4 → v4.1.5

### What's New
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ devcompass analyze
# Get full detailed report
devcompass analyze --deep

# Get AI-powered recommendations
devcompass analyze --ai
# Get AI-powered recommendations (after configuring a provider with `devcompass llm add`)
devcompass ai recommend

# Generate interactive dependency graph
devcompass graph --open
Expand Down Expand Up @@ -200,9 +200,6 @@ devcompass analyze
# Full detailed report (all issues)
devcompass analyze --deep

# With AI recommendations
devcompass analyze --ai

# JSON output for CI/CD
devcompass analyze --json

Expand Down Expand Up @@ -695,7 +692,7 @@ Every `devcompass analyze` automatically:

### 🔍 What AI Features Actually Send

Every AI feature (`devcompass analyze --ai`, `devcompass ai ask`, `devcompass ai recommend`, etc.) sends one HTTP request to whichever provider you configured, containing a system prompt plus a single user message built from your project's own analysis results. Nothing else — not your source code, not file contents, not your filesystem path. Here's the actual request body, field for field (from `src/features/ai/prompt.templates.js` and `ai.command.js`):
Every AI feature (`devcompass ai ask`, `devcompass ai recommend`, `devcompass ai alternatives`, `devcompass ai chat`) sends one HTTP request to whichever provider you configured, containing a system prompt plus a single user message built from your project's own analysis results. Nothing else — not your source code, not file contents, not your filesystem path. Here's the actual request body, field for field (from `src/features/ai/prompt.templates.js` and `ai.command.js`):

```json
{
Expand Down Expand Up @@ -734,7 +731,7 @@ devcompass llm add --provider local --model llama3.2 --base-url http://localhost
devcompass llm test local

# 6. Use it!
devcompass analyze --ai
devcompass ai recommend
devcompass ai ask "What should I update first?"
```

Expand All @@ -750,7 +747,7 @@ devcompass llm add --provider openai --token sk-YOUR-KEY --model gpt-4o-mini
devcompass llm test openai

# Use
devcompass analyze --ai
devcompass ai recommend
```

### AI Capabilities
Expand Down
6 changes: 0 additions & 6 deletions bin/devcompass.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ const { Command } = require('commander');
const chalk = require('chalk');
const packageJson = require('../package.json');

const isLocalInstall = __dirname.includes('node_modules');
if (isLocalInstall && process.argv.includes('analyze')) {
console.log(chalk.yellow('\n⚠️ DevCompass is installed locally.'));
console.log(chalk.cyan(' npm install -g devcompass\n'));
}

const program = new Command();

program
Expand Down
51 changes: 0 additions & 51 deletions data/batch-categories.json

This file was deleted.

26 changes: 0 additions & 26 deletions data/priorities.json

This file was deleted.

4 changes: 2 additions & 2 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DevCompass is a complement to `npm audit` and Dependabot for teams that also wan

## Complete command reference

- `devcompass analyze` — Full dependency analysis: security, health score, license, unused/outdated packages. Flags: `--deep` (all issues, default shows top 3), `--ai` (AI recommendations), `--json`, `--silent`, `--ci`, `--ci --threshold 8.0`. Health score bands: 9.0-10.0 excellent, 8.0-8.9 good, 6.0-7.9 needs attention, 4.0-5.9 poor, 0.0-3.9 critical.
- `devcompass analyze` — Full dependency analysis: security, health score, license, unused/outdated packages. Flags: `--deep` (all issues, default shows top 3), `--json`, `--silent`, `--ci`, `--ci --threshold 8.0`. Health score bands: 9.0-10.0 excellent, 8.0-8.9 good, 6.0-7.9 needs attention, 4.0-5.9 poor, 0.0-3.9 critical.
- `devcompass cve` — CVE database management. `cve key --set --api-key <KEY>` / `cve key` (status) / `cve key --remove`; `cve test` (test NVD connection); `cve cache --stats` / `cve cache --clear`.
- `devcompass fix` — Automated issue resolution with risk classification (safe/moderate/risky), preview (including a live `package.json` diff), automatic backup before changes, interactive confirmation, and rollback support. Supports `--dry-run`. `--migrate-syntax` additionally rewrites source call-sites broken by a major-version update (built-in codemod, falling back to your configured AI provider), snapshotting every touched file; `devcompass fix undo` reverts the most recent `--migrate-syntax` run.
- `devcompass graph` — Interactive dependency graph, 5 layouts: Tree, Force-directed, Radial, Conflict, Analytics. Real-time filtering (vulnerable/outdated/unused), dark/light themes, export to PNG/JSON/HTML. Flag: `--open`.
Expand All @@ -43,7 +43,7 @@ DevCompass is a complement to `npm audit` and Dependabot for teams that also wan

## AI integration

Four providers: OpenAI, Anthropic, Google, and local Ollama (free, zero-cost, fully offline). Setup pattern: `devcompass llm add --provider <name> [--token <key> | --model <model> --base-url <url>]`, then `devcompass llm test <provider>`, then `devcompass analyze --ai` or `devcompass ai ask "..."`. AI is used for: automatic health assessment context, risk prioritization, breaking-change warnings, migration guidance, interactive Q&A, and package-alternative suggestions (e.g. `ai alternatives moment` → date-fns/dayjs/Luxon with size comparisons).
Four providers: OpenAI, Anthropic, Google, and local Ollama (free, zero-cost, fully offline). Setup pattern: `devcompass llm add --provider <name> [--token <key> | --model <model> --base-url <url>]`, then `devcompass llm test <provider>`, then `devcompass ai recommend` or `devcompass ai ask "..."`. AI is used for: automatic health assessment context, risk prioritization, breaking-change warnings, migration guidance, interactive Q&A, and package-alternative suggestions (e.g. `ai alternatives moment` → date-fns/dayjs/Luxon with size comparisons).

## Configuration & file locations

Expand Down
3 changes: 0 additions & 3 deletions src/cli/commands/analyze.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ module.exports = function registerAnalyzeCommand(program) {
.option('--threshold <score>', 'Health score threshold for CI mode (default: 7.0)', '7.0')
.option('--silent', 'Silent mode - no output')
.option('--no-history', 'Skip saving snapshot to history database')
.option('--ai', 'Get AI-powered insights and recommendations')
.option('--ai-provider <provider>', 'AI provider to use (openai, anthropic, google, local)')
.action(async (options) => {
try {
if (options.ci && options.threshold) {
Expand All @@ -30,7 +28,6 @@ module.exports = function registerAnalyzeCommand(program) {
mode: options.deep ? 'deep' : 'default',
projectPath: options.path,
json: options.json,
aiEnabled: options.ai,
saveHistory: options.history !== false,
ci: options.ci,
ciThreshold: options.ciThreshold !== undefined ? options.ciThreshold : 7.0,
Expand Down
8 changes: 0 additions & 8 deletions src/cli/commands/fix.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ module.exports = function registerFixCommand(program) {
.option('--dry-run', 'Show what would be fixed without making changes')
.option('--dry', 'Alias for --dry-run')
.option('--preview', 'Preview fixes without applying')
.option('--batch', 'Interactive batch mode')
.option('--batch-mode <mode>', 'Preset batch mode: critical, high, all')
.option('--only <categories>', 'Fix only specific categories')
.option('--skip <categories>', 'Skip specific categories')
.option('--verbose', 'Show detailed output')
.option('--migrate-syntax', 'On major-version fixes, also rewrite source call-sites (built-in codemods, falling back to your configured AI provider) — nothing is committed; verify with your tests, or run `devcompass fix undo`')
.action(async (action, options) => {
Expand All @@ -37,10 +33,6 @@ module.exports = function registerFixCommand(program) {
skipConfirm: options.yes,
dryRun: options.dryRun || options.dry || options.preview,
preview: options.preview,
batch: options.batch,
batchMode: options.batchMode,
only: options.only,
skip: options.skip,
verbose: options.verbose,
migrateSyntax: options.migrateSyntax
});
Expand Down
74 changes: 0 additions & 74 deletions src/features/analyze/collectors/npm-audit.collector.js

This file was deleted.

51 changes: 0 additions & 51 deletions src/features/analyze/collectors/outdated.collector.js

This file was deleted.

11 changes: 1 addition & 10 deletions src/features/analyze/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ async function runAnalyze(options = {}) {
mode = 'default',
projectPath = process.cwd(),
json = false,
aiEnabled = false,
saveHistory = true,
ci = false,
silent = false,
Expand Down Expand Up @@ -122,8 +121,7 @@ async function runAnalyze(options = {}) {
securityScanIncomplete: !!securityData?.incomplete,
ecosystemScanIncomplete: !!(shouldRunEcosystem && ecosystemData?.incomplete),
healthScore,
totalDependencies,
aiInsight: aiEnabled ? await generateAIInsight(allIssues) : null
totalDependencies
};

saveAnalysisCache({
Expand Down Expand Up @@ -176,11 +174,4 @@ async function runAnalyze(options = {}) {
}
}

async function generateAIInsight(issues) {
if (!issues || issues.length === 0) return 'Your project has no detected issues.';
const critical = issues.filter(i => i.severity === 'CRITICAL' || i.severity === 'HIGH');
if (critical.length === 0) return 'Your project has minor issues that can be addressed over time.';
return `Your main risk comes from ${critical.length} high-severity issue(s). Fixing ${critical[0].name} will significantly improve security.`;
}

module.exports = { runAnalyze };
Loading