Skip to content

feat: add changelog highlights to auto-update notifications#1286

Merged
Crunchyman-ralph merged 6 commits intonextfrom
ralph/feat/auto.update.changelog
Oct 10, 2025
Merged

feat: add changelog highlights to auto-update notifications#1286
Crunchyman-ralph merged 6 commits intonextfrom
ralph/feat/auto.update.changelog

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Oct 9, 2025

Summary

Adds a "What's New" section to auto-update notifications that displays all Minor Changes from the CHANGELOG. When users auto-update to a new version, they now see the key features and improvements immediately without having to manually check the changelog.

Changes

  • Added fetchChangelogHighlights(): Fetches CHANGELOG.md from unpkg.com CDN for the new version
  • Added parseChangelogHighlights(): Extracts all Minor Changes from the changelog using regex parsing
  • Updated displayUpgradeNotification(): Shows "What's New" section with bullet points when highlights are available
  • Enhanced UpdateInfo interface: Added optional highlights field
  • Updated integration: Passes highlights through the auto-update flow
  • Added comprehensive tests: Tests for with highlights, without highlights, and backward compatibility

Implementation Details

  • Fetches changelog from unpkg.com/task-master-ai@{version}/CHANGELOG.md
  • 3-second timeout with graceful fallback (returns empty array on any error)
  • Parses Minor Changes section using regex: /^-\s+\[#\d+\][^\n]*?!\s+-\s+(.+?)$/gm
  • Shows all Minor Changes (no limit) for complete visibility
  • Falls back to generic message if no highlights available

Example Output

╭───────────────────────────────────────────────╮
│                                               │
│   Update Available! 0.27.0 → 0.28.0          │
│                                               │
│   What's New:                                 │
│   • Add Codex CLI provider with OAuth        │
│   • Cursor IDE custom slash command support  │
│   • Move to AI SDK v5                        │
│   • Migrate AI services to use generateObject│
│   • Enhanced Roo Code profile with MCP       │
│   • Upgrade grok-cli ai provider             │
│                                               │
│   Auto-updating to the latest version...     │
│                                               │
╰───────────────────────────────────────────────╯

Test Plan

  • Unit tests added for displayUpgradeNotification() with/without highlights
  • Tested changelog parsing with real CHANGELOG.md (versions 0.28.0-rc.0, 0.28.0-rc.2)
  • Verified graceful fallback on fetch errors
  • Confirmed backward compatibility (optional parameter)
  • Manual testing: Trigger auto-update flow on older version to see notification

Benefits

Non-blocking - 3-second timeout won't slow down updates
Graceful degradation - Falls back to generic message on error
Zero maintenance - Works with existing changeset workflow
User-friendly - Shows all important changes in clean format
CDN-based - Reliable unpkg.com source

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • CLI update notifications now include a “What’s New” list with version-specific changelog highlights when available, falling back gracefully if not.
  • Documentation

    • Added changelog entry describing the auto-update “What’s New” experience.
  • Tests

    • Added unit tests for highlights extraction and notification rendering, including handling of malformed inputs.
  • Chores

    • Package configured to include CHANGELOG.md in published files.

@changeset-bot
Copy link

changeset-bot bot commented Oct 9, 2025

🦋 Changeset detected

Latest commit: 3fd5312

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Walkthrough

Adds parsing and display of versioned CHANGELOG "Minor Changes" highlights to the CLI auto-update flow: UpdateInfo now may include highlights, checkForUpdate fetches highlights from unpkg, displayUpgradeNotification can render a "What's New" list, tests added, CHANGELOG included in package files, and a changeset entry added. (41 words)

Changes

Cohort / File(s) Summary
CLI auto-update utilities
apps/cli/src/utils/auto-update.ts
Added optional highlights?: string[] to UpdateInfo; added fetchChangelogHighlights(version) (internal) and exported parseChangelogHighlights(changelog, version) to extract "Minor Changes" bullets; checkForUpdate fetches highlights for latestVersion when update available; displayUpgradeNotification signature updated to accept optional highlights and render a "What's New" list; parsing errors yield empty highlights.
Command invocation
scripts/modules/commands.js
Passes updateInfo.highlights into displayUpgradeNotification when an update is detected; no other control-flow changes.
Unit tests
tests/unit/commands.test.js
Adds tests asserting displayUpgradeNotification renders highlights and handles empty highlights; adds tests for parseChangelogHighlights including valid extraction and safety against malicious/malformed inputs; exposes parseChangelogHighlights from the auto-update module for testing.
Package / publish files
package.json
Adds CHANGELOG.md to the "files" array so it’s included in published package artifacts.
Changeset docs
.changeset/auto-update-changelog-highlights.md
New changeset entry documenting the auto-update "What's New" notification with task label task-master-ai (minor).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant CLI as "CLI Command"
  participant AutoUpdate as "apps/cli/src/utils/auto-update.ts"
  participant CDN as "unpkg CDN"

  User->>CLI: run command
  CLI->>AutoUpdate: checkForUpdate(currentVersion)
  AutoUpdate->>AutoUpdate: determine latestVersion, needsUpdate
  alt update available
    AutoUpdate->>CDN: GET /.../CHANGELOG.md@latestVersion
    CDN-->>AutoUpdate: CHANGELOG.md (or error)
    AutoUpdate->>AutoUpdate: parseChangelogHighlights(changelog, version)
    AutoUpdate-->>CLI: UpdateInfo{currentVersion, latestVersion, highlights?}
    CLI->>AutoUpdate: displayUpgradeNotification(curr, latest, highlights)
    AutoUpdate-->>User: print update notice + optional "What's New" list
  else up-to-date
    AutoUpdate-->>CLI: UpdateInfo(needsUpdate=false)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • eyaltoledano

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the main change: adding changelog highlights to auto-update notifications. It clearly indicates a feature addition and provides enough context for a reviewer to understand the enhancement. The phrasing is concise, follows semantic commit conventions, and avoids unnecessary details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ralph/feat/auto.update.changelog

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4199fe7 and 3fd5312.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
package.json

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci

Files:

  • package.json
🧠 Learnings (1)
📚 Learning: 2025-09-26T19:10:32.906Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1252
File: tsconfig.json:22-28
Timestamp: 2025-09-26T19:10:32.906Z
Learning: In the eyaltoledano/claude-task-master repository, all internal tm/ package path mappings in tsconfig.json consistently point to TypeScript source files (e.g., "./packages/*/src/index.ts") rather than built JavaScript. This is intentional architecture because tsdown bundles internal packages directly from source during build time, eliminating the need for separate compilation of internal packages.

Applied to files:

  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test

Comment @coderabbitai help to get the list of available commands and usage tips.

@Crunchyman-ralph Crunchyman-ralph changed the base branch from main to next October 9, 2025 16:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0df6595 and fa3a087.

📒 Files selected for processing (16)
  • .changeset/auto-update-changelog-highlights.md (1 hunks)
  • .taskmaster/config.json (1 hunks)
  • .taskmaster/docs/autonomous-tdd-git-workflow.md (1 hunks)
  • .taskmaster/docs/tdd-workflow-phase-0-spike.md (1 hunks)
  • .taskmaster/docs/tdd-workflow-phase-1-core-rails.md (1 hunks)
  • .taskmaster/docs/tdd-workflow-phase-2-pr-resumability.md (1 hunks)
  • .taskmaster/docs/tdd-workflow-phase-3-extensibility-guardrails.md (1 hunks)
  • .taskmaster/reports/task-complexity-report_autonomous-tdd-git-workflow.json (1 hunks)
  • .taskmaster/reports/task-complexity-report_tdd-workflow-phase-0.json (1 hunks)
  • .taskmaster/state.json (1 hunks)
  • apps/cli/src/utils/auto-update.ts (5 hunks)
  • docs/contributor-docs/worktree-setup.md (1 hunks)
  • scripts/create-worktree.sh (1 hunks)
  • scripts/list-worktrees.sh (1 hunks)
  • scripts/modules/commands.js (1 hunks)
  • tests/unit/commands.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (20)
.taskmaster/config.json

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

.taskmaster/config.json: Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, etc.) in the .taskmaster/config.json file located in the project root directory. Do not configure non-API key settings via environment variables.
Do not manually edit .taskmaster/config.json unless you are certain of the changes; use the task-master models command or models MCP tool for configuration.

.taskmaster/config.json: Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.
All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.
Do not manually edit the .taskmaster/config.json file; always use the provided CLI or MCP tools for configuration changes.

Files:

  • .taskmaster/config.json
scripts/modules/commands.js

📄 CodeRabbit inference engine (.cursor/rules/ai_services.mdc)

scripts/modules/commands.js: Centralize all LLM calls through generateTextService or generateObjectService.
Do not import or call anything from the old ai-services.js, ai-client-factory.js, or ai-client-utils.js files.
Do not fetch AI-specific parameters (model ID, max tokens, temp) using config-manager.js getters for the AI call. Pass the role instead.
Do not implement fallback or retry logic outside ai-services-unified.js.
Do not handle API key resolution outside the service layer (it uses utils.js internally).
Determine the appropriate role (main, research, fallback) in your core logic and pass it to the service.
Pass the session object (received in the context parameter, especially from direct function wrappers) to the service call when in MCP context.
Use generateTextService and implement robust manual JSON parsing (with Zod validation after parsing) when structured output is needed, as generateObjectService has shown unreliability with some providers/schemas.
Be aware of potential reliability issues with generateObjectService across different providers and complex schemas. Prefer generateTextService + manual parsing as a more robust alternative for structured data needs.

scripts/modules/commands.js: All new user-facing commands should be added to 'scripts/modules/commands.js'.
Use consistent patterns for option naming and help text in CLI commands.
Follow the Commander.js model for subcommand structure in CLI commands.
When using callbacks (like in Commander.js commands), define them separately to allow testing the callback logic independently.
Add help text to the command definition and update 'dev_workflow.mdc' with command reference when adding a new feature.
Follow the established pattern in 'commands.js' for CLI command implementation, using Commander.js for argument parsing, including comprehensive help text and examples, and supporting tagged task context awareness.
Provide clear error messages for common failu...

Files:

  • scripts/modules/commands.js
scripts/modules/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Each module in scripts/modules/ should be focused on a single responsibility, following the modular architecture (e.g., commands.js for CLI command handling, task-manager.js for task data and core logic, dependency-manager.js for dependency management, ui.js for CLI output formatting, ai-services-unified.js for AI service integration, config-manager.js for configuration management, utils.js for utility functions).

scripts/modules/*.js: Export all core functions, helper functions, and utility methods needed by your new function or command from their respective modules. Explicitly review the module's export block to ensure every required dependency is included.
Pass all required parameters to functions you call within your implementation and verify that direct function parameters match their core function counterparts.
Use consistent file naming conventions: 'task_${id.toString().padStart(3, '0')}.txt', use path.join for composing file paths, and use appropriate file extensions (.txt for tasks, .json for data).
Use structured error objects with code and message properties, include clear error messages, and handle both function-specific and file system errors.
Import all silent mode utilities together from 'scripts/modules/utils.js' and always use isSilentMode() to check global silent mode status. Wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in a try/finally block if the core function might produce console output.
Core functions should check outputFormat === 'text' before displaying UI elements and use internal logging that respects silent mode.
Design functions to accept dependencies as parameters (dependency injection) and avoid hard-coded dependencies that are difficult to mock.
Keep pure logic separate from I/O operations or UI rendering to allow testing the logic without mocking complex dependencies.
When implementing core logic for new features, do so in 'scripts/modules/' before CLI or MCP interfaces, and d...

Files:

  • scripts/modules/commands.js
scripts/modules/**

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

When using the MCP server, restart it if core logic in scripts/modules or MCP tool/direct function definitions change.

Files:

  • scripts/modules/commands.js
scripts/modules/*

📄 CodeRabbit inference engine (.cursor/rules/tags.mdc)

scripts/modules/*: Every command that reads or writes tasks.json must be tag-aware
All command files must import getCurrentTag from utils.js
Every CLI command that operates on tasks must include the --tag CLI option
All commands must resolve the tag using the pattern: options.tag || getCurrentTag(projectRoot) || 'master'
All commands must find projectRoot with error handling before proceeding
All commands must pass { projectRoot, tag } as context to core functions
MCP direct functions must accept and use a context object containing projectRoot and tag, and pass them to core functions
Do not hard-code tag resolution (e.g., const tag = options.tag || 'master';); always use getCurrentTag
Do not omit the --tag CLI option in commands that operate on tasks
Do not omit the context parameter when calling core functions from commands
Do not call readJSON or writeJSON without passing projectRoot and tag

Files:

  • scripts/modules/commands.js
**/*.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.js: Declare and initialize global variables at the top of modules to avoid hoisting issues.
Use proper function declarations to avoid hoisting issues and initialize variables before they are referenced.
Do not reference variables before their declaration in module scope.
Use dynamic imports (import()) to avoid initialization order issues in modules.

Files:

  • scripts/modules/commands.js
  • tests/unit/commands.test.js
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/commands.test.js
tests/unit/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Each module should have a corresponding unit test file in tests/unit/ that reflects the module structure (one test file per module).

Files:

  • tests/unit/commands.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/commands.test.js
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/commands.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/commands.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/commands.test.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/commands.test.js
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/commands.test.js
**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{test,spec}.{js,jsx,ts,tsx}: NEVER use async/await in test functions unless testing actual asynchronous operations
Use synchronous top-level imports in tests; avoid dynamic await import()
Keep test bodies synchronous whenever possible

Files:

  • tests/unit/commands.test.js
.taskmaster/state.json

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

Track Taskmaster's current tag context and migration status in .taskmaster/state.json, which is automatically created and managed by the system.

Files:

  • .taskmaster/state.json
docs/**/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Add feature documentation to '/docs' folder, include tagged system usage examples, update command reference documentation, and provide migration notes if relevant.

Files:

  • docs/contributor-docs/worktree-setup.md
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in imperative mood, typically a single line, and not a detailed Git commit message.
The changeset summary should be user-facing, describing what changed in the released version that is relevant to users or consumers of the package.
Do not use your detailed Git commit message body as the changeset summary.

Files:

  • .changeset/auto-update-changelog-highlights.md
.changeset/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Create appropriate changesets for new features, use semantic versioning, include tagged system information in release notes, and document breaking changes if any.

Files:

  • .changeset/auto-update-changelog-highlights.md
.changeset/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Changeset entries should be user-facing, describing the end-user impact rather than code specifics

Files:

  • .changeset/auto-update-changelog-highlights.md
🧠 Learnings (14)
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.

Applied to files:

  • .taskmaster/config.json
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Implement version checking to notify users of available updates, use non-blocking version checks, and display update notifications after command completion.

Applied to files:

  • scripts/modules/commands.js
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Implement semantic version comparison and display attractive update notifications using boxen.

Applied to files:

  • scripts/modules/commands.js
  • apps/cli/src/utils/auto-update.ts
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Integrate version checking in the CLI run function, starting the update check in the background and displaying notifications after command execution.

Applied to files:

  • scripts/modules/commands.js
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to {.taskmaster/tasks/tasks.json,.taskmaster/reports/task-complexity-report.json,.taskmaster/docs/research/**} : Do not manually edit generated files such as .taskmaster/tasks/tasks.json, .taskmaster/reports/task-complexity-report.json, or files in .taskmaster/docs/research/. Always use Taskmaster commands to modify these files.

Applied to files:

  • .taskmaster/reports/task-complexity-report_tdd-workflow-phase-0.json
📚 Learning: 2025-09-24T15:12:12.658Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-09-24T15:12:12.658Z
Learning: Use task-master complexity-report to view formatted complexity insights and recommendations

Applied to files:

  • .taskmaster/reports/task-complexity-report_tdd-workflow-phase-0.json
  • .taskmaster/reports/task-complexity-report_autonomous-tdd-git-workflow.json
📚 Learning: 2025-09-24T15:12:12.658Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-09-24T15:12:12.658Z
Learning: Analyze task complexity with task-master analyze-complexity --research and use results to plan breakdown

Applied to files:

  • .taskmaster/reports/task-complexity-report_tdd-workflow-phase-0.json
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use AI to generate detailed subtasks within the current tag context, considering complexity analysis for subtask counts and ensuring proper IDs for newly created subtasks.

Applied to files:

  • .taskmaster/reports/task-complexity-report_tdd-workflow-phase-0.json
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.

Applied to files:

  • tests/unit/commands.test.js
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Describes the high-level architecture of the Task Master CLI application, including the new tagged task lists system (architecture.mdc).

Applied to files:

  • .taskmaster/docs/autonomous-tdd-git-workflow.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for integrating new features into the Task Master CLI with tagged system considerations (new_features.mdc).

Applied to files:

  • .taskmaster/docs/autonomous-tdd-git-workflow.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guide for using Task Master to manage task-driven development workflows with tagged task lists support (dev_workflow.mdc).

Applied to files:

  • .taskmaster/docs/autonomous-tdd-git-workflow.md
📚 Learning: 2025-07-18T17:10:53.657Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for implementing and maintaining tests for Task Master CLI (tests.mdc).

Applied to files:

  • .taskmaster/docs/autonomous-tdd-git-workflow.md
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/state.json : Track Taskmaster's current tag context and migration status in `.taskmaster/state.json`, which is automatically created and managed by the system.

Applied to files:

  • .taskmaster/state.json
🧬 Code graph analysis (1)
tests/unit/commands.test.js (2)
apps/cli/src/utils/auto-update.ts (1)
  • displayUpgradeNotification (243-268)
apps/cli/src/index.ts (1)
  • displayUpgradeNotification (30-30)
🪛 ast-grep (0.39.6)
apps/cli/src/utils/auto-update.ts

[warning] 120-120: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(## ${version.replace(/\./g, '\\.')}\\s*\\n, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 markdownlint-cli2 (0.18.1)
.taskmaster/docs/autonomous-tdd-git-workflow.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


297-297: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


339-339: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


339-339: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


428-428: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


429-429: Strong style
Expected: asterisk; Actual: underscore

(MD050, strong-style)


429-429: Strong style
Expected: asterisk; Actual: underscore

(MD050, strong-style)


435-435: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


435-435: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


505-505: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


513-513: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


519-519: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


525-525: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


550-550: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


852-852: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1

(MD005, list-indent)


852-852: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

docs/contributor-docs/worktree-setup.md

45-45: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


52-52: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


77-77: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


119-119: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


215-215: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


221-221: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


230-230: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


238-238: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


246-246: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


257-257: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


265-265: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


273-273: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


291-291: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


301-301: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


314-314: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


361-361: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


369-369: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


382-382: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

.changeset/auto-update-changelog-highlights.md

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


7-7: Files should end with a single newline character

(MD047, single-trailing-newline)

.taskmaster/docs/tdd-workflow-phase-3-extensibility-guardrails.md

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


6-6: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


18-18: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


55-55: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


82-82: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


109-109: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


140-140: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


172-172: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


182-182: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


199-199: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


199-199: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


220-220: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


273-273: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


281-281: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


306-306: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


328-328: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


346-346: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


382-382: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


405-405: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


432-432: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


476-476: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


484-484: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


492-492: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


498-498: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


506-506: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


511-511: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


514-514: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


527-527: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

.taskmaster/docs/tdd-workflow-phase-0-spike.md

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


6-6: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


14-14: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


20-20: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


26-26: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


38-38: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


91-91: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


97-97: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


104-104: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


110-110: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


115-115: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


118-118: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🔇 Additional comments (8)
.taskmaster/config.json (1)

4-7: Confirm provider/model compatibility.

Switching the main provider to "claude-code" with "modelId": "sonnet" might break Taskmaster if that provider key or model identifier isn’t recognized. Please verify the CLI/agent actually accepts this tuple before merging. Based on learnings.

apps/cli/src/utils/auto-update.ts (4)

11-16: LGTM! Backwards-compatible interface extension.

The optional highlights field is properly typed and maintains backwards compatibility with existing code.


63-110: LGTM! Robust error handling with graceful degradation.

The function properly handles:

  • HTTP errors (non-200 status codes)
  • Network failures (request errors)
  • Timeouts (3-second limit)
  • Parsing errors

All error cases gracefully return an empty array, ensuring the auto-update flow continues uninterrupted even if highlights are unavailable.


187-216: LGTM! Clean integration of highlight fetching.

The modifications properly:

  • Only fetch highlights when an update is actually needed (performance optimization)
  • Handle the async nature of fetchChangelogHighlights
  • Maintain backwards compatibility by including highlights conditionally
  • Preserve existing error handling for the main update check

243-268: LGTM! User-friendly presentation of highlights.

The notification logic cleanly handles both cases:

  • When highlights are available: displays a "What's New:" section with bullet points
  • When highlights are unavailable: shows a generic update message

The backwards-compatible signature (optional parameter) ensures existing callers continue to work.

scripts/modules/commands.js (1)

5112-5116: LGTM! Proper integration with updated notification function.

The code correctly passes updateInfo.highlights to displayUpgradeNotification, completing the integration of the new highlights feature. The undefined case is properly handled by the notification function.

tests/unit/commands.test.js (2)

306-322: LGTM! Comprehensive test coverage for highlights display.

The test properly verifies:

  • The "What's New:" section is rendered
  • Version information is displayed
  • All provided highlights are included in the output

The use of realistic sample highlights makes the test more meaningful.

Based on learnings


324-331: LGTM! Proper test coverage for the fallback scenario.

The test correctly verifies that when highlights are unavailable (empty array):

  • The "What's New:" section is not displayed
  • The default update message is shown instead

This ensures graceful degradation when highlights cannot be fetched.

Based on learnings

Crunchyman-ralph and others added 2 commits October 9, 2025 18:31
Display "What's New" section in auto-update notifications showing all Minor Changes from CHANGELOG. Fetches changelog from unpkg.com CDN with graceful fallback.

- Add fetchChangelogHighlights() to fetch CHANGELOG.md from CDN
- Add parseChangelogHighlights() to extract Minor Changes
- Update displayUpgradeNotification() to show highlights
- Include highlights in UpdateInfo interface
- Add comprehensive unit tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/feat/auto.update.changelog branch from fa3a087 to 0ebcf7f Compare October 9, 2025 16:31
Add semver validation before constructing regex to prevent potential ReDoS attacks. While the version parameter comes from a trusted source (npm registry), this provides defense-in-depth security.

- Add semver pattern validation in parseChangelogHighlights()
- Export function for testing with @internal annotation
- Add comprehensive tests for valid/invalid version formats
- Test includes malicious input patterns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
apps/cli/src/utils/auto-update.ts (1)

121-121: Address ReDoS risk with version validation.

The dynamic regex construction at line 121 poses a potential ReDoS risk, as flagged by static analysis and a previous review. While the version comes from npm (trusted source), adding validation provides defense-in-depth.

Consider adding version validation before regex construction:

 function parseChangelogHighlights(
 	changelog: string,
 	version: string
 ): string[] {
 	try {
+		// Validate version format (basic semver pattern)
+		if (!/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?$/.test(version)) {
+			return [];
+		}
+
 		// Find the version section
 		const versionRegex = new RegExp(`## ${version.replace(/\./g, '\\.')}\\s*\\n`, 'i');

As per past review comments

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa3a087 and 0ebcf7f.

📒 Files selected for processing (4)
  • .changeset/auto-update-changelog-highlights.md (1 hunks)
  • apps/cli/src/utils/auto-update.ts (5 hunks)
  • scripts/modules/commands.js (1 hunks)
  • tests/unit/commands.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (17)
scripts/modules/commands.js

📄 CodeRabbit inference engine (.cursor/rules/ai_services.mdc)

scripts/modules/commands.js: Centralize all LLM calls through generateTextService or generateObjectService.
Do not import or call anything from the old ai-services.js, ai-client-factory.js, or ai-client-utils.js files.
Do not fetch AI-specific parameters (model ID, max tokens, temp) using config-manager.js getters for the AI call. Pass the role instead.
Do not implement fallback or retry logic outside ai-services-unified.js.
Do not handle API key resolution outside the service layer (it uses utils.js internally).
Determine the appropriate role (main, research, fallback) in your core logic and pass it to the service.
Pass the session object (received in the context parameter, especially from direct function wrappers) to the service call when in MCP context.
Use generateTextService and implement robust manual JSON parsing (with Zod validation after parsing) when structured output is needed, as generateObjectService has shown unreliability with some providers/schemas.
Be aware of potential reliability issues with generateObjectService across different providers and complex schemas. Prefer generateTextService + manual parsing as a more robust alternative for structured data needs.

scripts/modules/commands.js: All new user-facing commands should be added to 'scripts/modules/commands.js'.
Use consistent patterns for option naming and help text in CLI commands.
Follow the Commander.js model for subcommand structure in CLI commands.
When using callbacks (like in Commander.js commands), define them separately to allow testing the callback logic independently.
Add help text to the command definition and update 'dev_workflow.mdc' with command reference when adding a new feature.
Follow the established pattern in 'commands.js' for CLI command implementation, using Commander.js for argument parsing, including comprehensive help text and examples, and supporting tagged task context awareness.
Provide clear error messages for common failu...

Files:

  • scripts/modules/commands.js
scripts/modules/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Each module in scripts/modules/ should be focused on a single responsibility, following the modular architecture (e.g., commands.js for CLI command handling, task-manager.js for task data and core logic, dependency-manager.js for dependency management, ui.js for CLI output formatting, ai-services-unified.js for AI service integration, config-manager.js for configuration management, utils.js for utility functions).

scripts/modules/*.js: Export all core functions, helper functions, and utility methods needed by your new function or command from their respective modules. Explicitly review the module's export block to ensure every required dependency is included.
Pass all required parameters to functions you call within your implementation and verify that direct function parameters match their core function counterparts.
Use consistent file naming conventions: 'task_${id.toString().padStart(3, '0')}.txt', use path.join for composing file paths, and use appropriate file extensions (.txt for tasks, .json for data).
Use structured error objects with code and message properties, include clear error messages, and handle both function-specific and file system errors.
Import all silent mode utilities together from 'scripts/modules/utils.js' and always use isSilentMode() to check global silent mode status. Wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in a try/finally block if the core function might produce console output.
Core functions should check outputFormat === 'text' before displaying UI elements and use internal logging that respects silent mode.
Design functions to accept dependencies as parameters (dependency injection) and avoid hard-coded dependencies that are difficult to mock.
Keep pure logic separate from I/O operations or UI rendering to allow testing the logic without mocking complex dependencies.
When implementing core logic for new features, do so in 'scripts/modules/' before CLI or MCP interfaces, and d...

Files:

  • scripts/modules/commands.js
scripts/modules/**

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

When using the MCP server, restart it if core logic in scripts/modules or MCP tool/direct function definitions change.

Files:

  • scripts/modules/commands.js
scripts/modules/*

📄 CodeRabbit inference engine (.cursor/rules/tags.mdc)

scripts/modules/*: Every command that reads or writes tasks.json must be tag-aware
All command files must import getCurrentTag from utils.js
Every CLI command that operates on tasks must include the --tag CLI option
All commands must resolve the tag using the pattern: options.tag || getCurrentTag(projectRoot) || 'master'
All commands must find projectRoot with error handling before proceeding
All commands must pass { projectRoot, tag } as context to core functions
MCP direct functions must accept and use a context object containing projectRoot and tag, and pass them to core functions
Do not hard-code tag resolution (e.g., const tag = options.tag || 'master';); always use getCurrentTag
Do not omit the --tag CLI option in commands that operate on tasks
Do not omit the context parameter when calling core functions from commands
Do not call readJSON or writeJSON without passing projectRoot and tag

Files:

  • scripts/modules/commands.js
**/*.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.js: Declare and initialize global variables at the top of modules to avoid hoisting issues.
Use proper function declarations to avoid hoisting issues and initialize variables before they are referenced.
Do not reference variables before their declaration in module scope.
Use dynamic imports (import()) to avoid initialization order issues in modules.

Files:

  • scripts/modules/commands.js
  • tests/unit/commands.test.js
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/commands.test.js
tests/unit/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Each module should have a corresponding unit test file in tests/unit/ that reflects the module structure (one test file per module).

Files:

  • tests/unit/commands.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/commands.test.js
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/commands.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/commands.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/commands.test.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/commands.test.js
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/commands.test.js
**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{test,spec}.{js,jsx,ts,tsx}: NEVER use async/await in test functions unless testing actual asynchronous operations
Use synchronous top-level imports in tests; avoid dynamic await import()
Keep test bodies synchronous whenever possible

Files:

  • tests/unit/commands.test.js
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in imperative mood, typically a single line, and not a detailed Git commit message.
The changeset summary should be user-facing, describing what changed in the released version that is relevant to users or consumers of the package.
Do not use your detailed Git commit message body as the changeset summary.

Files:

  • .changeset/auto-update-changelog-highlights.md
.changeset/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Create appropriate changesets for new features, use semantic versioning, include tagged system information in release notes, and document breaking changes if any.

Files:

  • .changeset/auto-update-changelog-highlights.md
.changeset/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Changeset entries should be user-facing, describing the end-user impact rather than code specifics

Files:

  • .changeset/auto-update-changelog-highlights.md
🧠 Learnings (5)
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Implement semantic version comparison and display attractive update notifications using boxen.

Applied to files:

  • apps/cli/src/utils/auto-update.ts
  • scripts/modules/commands.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Implement version checking to notify users of available updates, use non-blocking version checks, and display update notifications after command completion.

Applied to files:

  • scripts/modules/commands.js
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Integrate version checking in the CLI run function, starting the update check in the background and displaying notifications after command execution.

Applied to files:

  • scripts/modules/commands.js
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.

Applied to files:

  • tests/unit/commands.test.js
📚 Learning: 2025-07-18T17:07:53.100Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/changeset.mdc:0-0
Timestamp: 2025-07-18T17:07:53.100Z
Learning: Applies to .changeset/*.md : When running `npm run changeset` or `npx changeset add`, provide a concise summary of the changes for the `CHANGELOG.md` in imperative mood, typically a single line, and not a detailed Git commit message.

Applied to files:

  • .changeset/auto-update-changelog-highlights.md
🧬 Code graph analysis (2)
apps/cli/src/utils/auto-update.ts (1)
test-version-check-full.js (1)
  • needsUpdate (27-28)
tests/unit/commands.test.js (1)
apps/cli/src/utils/auto-update.ts (1)
  • displayUpgradeNotification (243-268)
🪛 ast-grep (0.39.6)
apps/cli/src/utils/auto-update.ts

[warning] 120-120: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(## ${version.replace(/\./g, '\\.')}\\s*\\n, 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 GitHub Actions: CI
apps/cli/src/utils/auto-update.ts

[error] 119-134: Formatter would have reformatted the file. Code changes suggested by biome format. Run 'biome format .' to apply fixes.

tests/unit/commands.test.js

[error] 317-334: Formatter would have reformatted the file. Run 'biome format .' to apply fixes.

🪛 markdownlint-cli2 (0.18.1)
.changeset/auto-update-changelog-highlights.md

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


7-7: Files should end with a single newline character

(MD047, single-trailing-newline)

🔇 Additional comments (6)
scripts/modules/commands.js (1)

5114-5115: LGTM! Correctly passes highlights to notification.

The addition of updateInfo.highlights as a third parameter to displayUpgradeNotification correctly integrates the new changelog highlights feature. The optional nature of highlights ensures backward compatibility.

tests/unit/commands.test.js (1)

306-322: LGTM! Comprehensive test for highlights display.

The test correctly verifies that when highlights are provided, the notification includes a "What's New:" section with all the changelog highlights. The assertions properly check for the presence of all key elements.

apps/cli/src/utils/auto-update.ts (4)

15-15: LGTM! Clean interface extension.

The addition of the optional highlights field to the UpdateInfo interface maintains backward compatibility and is properly typed.


63-110: LGTM! Well-designed fetch function with graceful fallback.

The implementation correctly:

  • Sets a reasonable 3-second timeout to avoid blocking
  • Gracefully handles errors by returning an empty array
  • Uses unpkg.com CDN for changelog retrieval
  • Handles all error paths consistently

The non-blocking timeout and graceful degradation align with the PR objectives.


187-208: LGTM! Efficient and graceful highlights integration.

The changes correctly:

  • Make the callback async to support awaiting fetchChangelogHighlights
  • Only fetch highlights when an update is needed (efficient)
  • Include highlights in the returned UpdateInfo object
  • Maintain backward compatibility with graceful fallback

The conditional fetching optimizes performance by avoiding unnecessary network requests.


243-268: LGTM! Well-structured notification display with highlights.

The updated function correctly:

  • Accepts an optional highlights parameter (backward compatible)
  • Conditionally renders a "What's New:" section when highlights are available
  • Falls back to a default message when highlights are absent or empty
  • Maintains consistent formatting with boxen

The implementation provides a user-friendly display while gracefully handling the absence of highlights.

@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/feat/auto.update.changelog branch from 13b5acb to 80ed1c7 Compare October 9, 2025 16:56
Fetch CHANGELOG.md from GitHub main branch instead of unpkg CDN.

- Change hostname from unpkg.com to raw.githubusercontent.com
- Use main branch path: /eyaltoledano/claude-task-master/main/CHANGELOG.md
- More reliable as GitHub is always available
- Always gets the latest CHANGELOG from main branch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/feat/auto.update.changelog branch from 80ed1c7 to 4199fe7 Compare October 9, 2025 16:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3f37d4 and 4199fe7.

📒 Files selected for processing (2)
  • apps/cli/src/utils/auto-update.ts (5 hunks)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
package.json

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci

Files:

  • package.json
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Implement version checking to notify users of available updates, use non-blocking version checks, and display update notifications after command completion.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Implement version checking to notify users of available updates, use non-blocking version checks, and display update notifications after command completion.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Implement semantic version comparison and display attractive update notifications using boxen.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Implement semantic version comparison and display attractive update notifications using boxen.
📚 Learning: 2025-09-26T19:10:32.906Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1252
File: tsconfig.json:22-28
Timestamp: 2025-09-26T19:10:32.906Z
Learning: In the eyaltoledano/claude-task-master repository, all internal tm/ package path mappings in tsconfig.json consistently point to TypeScript source files (e.g., "./packages/*/src/index.ts") rather than built JavaScript. This is intentional architecture because tsdown bundles internal packages directly from source during build time, eliminating the need for separate compilation of internal packages.

Applied to files:

  • package.json
📚 Learning: 2025-07-31T22:07:49.716Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-31T22:07:49.716Z
Learning: Applies to scripts/modules/commands.js : Implement semantic version comparison and display attractive update notifications using boxen.

Applied to files:

  • apps/cli/src/utils/auto-update.ts
🧬 Code graph analysis (1)
apps/cli/src/utils/auto-update.ts (3)
tests/unit/commands.test.js (1)
  • parseChangelogHighlights (282-282)
test-version-check-full.js (1)
  • needsUpdate (27-28)
scripts/modules/commands.js (1)
  • currentVersion (5099-5099)
🪛 ast-grep (0.39.6)
apps/cli/src/utils/auto-update.ts

[warning] 126-129: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(
## ${version.replace(/\./g, '\\.')}\\s*\\n,
'i'
)
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 GitHub Actions: CI
package.json

[error] 119-127: Biome format check failed. The formatter would modify the following content in package.json. Run 'npm run format-check' (or 'biome format .') to apply fixes.

🔇 Additional comments (4)
apps/cli/src/utils/auto-update.ts (4)

11-16: LGTM!

The addition of the optional highlights property to the UpdateInfo interface is well-designed and maintains backward compatibility.


116-171: LGTM with note on ReDoS mitigation.

The parsing logic correctly extracts "Minor Changes" from the changelog. The version validation at lines 121-124 effectively mitigates the ReDoS risk flagged by static analysis at lines 126-129. The regex construction is safe because the version string is validated against a strict semver pattern before being used in the RegExp constructor.

Note: The static analysis warning is a false positive given the upfront validation.


199-220: LGTM!

The modification to conditionally fetch highlights only when an update is needed is efficient and correct. The async/await handling is proper, and the optional nature of highlights ensures backward compatibility.

Note: This depends on the fetchChangelogHighlights function being corrected to fetch from the version-specific source.


255-282: LGTM!

The updated notification display logic is well-implemented:

  • Backward compatible with the optional highlights parameter
  • Clear conditional rendering based on highlights availability
  • Professional formatting with proper use of chalk and boxen
  • Graceful fallback to a generic message when highlights are unavailable

Based on learnings

@Crunchyman-ralph Crunchyman-ralph merged commit f12a16d into next Oct 10, 2025
7 checks passed
@Crunchyman-ralph Crunchyman-ralph deleted the ralph/feat/auto.update.changelog branch October 10, 2025 16:51
@coderabbitai coderabbitai bot mentioned this pull request Oct 11, 2025
16 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 14, 2025
16 tasks
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant