Skip to content

Fix/complexity-prompt-json-output#1407

Merged
Crunchyman-ralph merged 2 commits intonextfrom
fix/complexity-prompt-json-output
Nov 14, 2025
Merged

Fix/complexity-prompt-json-output#1407
Crunchyman-ralph merged 2 commits intonextfrom
fix/complexity-prompt-json-output

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Nov 14, 2025

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

Bug Fixes

  • Fixed complexity analysis prompt to ensure consistent and predictable JSON output format across all analysis scenarios. Schema structure now enforces fixed per-task fields with optional metadata support. Enhanced codebase analysis workflow provides more comprehensive assessment capabilities, including context-aware analysis based on project structure and configuration.

Your Name added 2 commits November 14, 2025 13:29
…is prompt

The complexity analysis prompt was missing the final instruction specifying
that output should be a JSON object with a 'complexityAnalysis' key containing
the array of analysis objects. This caused inconsistent output formatting.

This fix ensures the AI model returns properly structured JSON output that
can be reliably parsed by the complexity analysis module.
@changeset-bot
Copy link

changeset-bot bot commented Nov 14, 2025

🦋 Changeset detected

Latest commit: 0e59606

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 Nov 14, 2025

Walkthrough

A changeset entry is added for a patch release, and the complexity analysis prompt is updated to enforce a consistent JSON output format with a fixed schema containing a complexityAnalysis array, optional metadata, and an expanded codebase analysis workflow section in the user instructions.

Changes

Cohort / File(s) Change Summary
Changeset Entry
.changeset/fix-complexity-prompt-json-output.md
Added new changeset documenting patch release for CLI with fix to complexity analysis prompt JSON output format.
Prompt Configuration
src/prompts/analyze-complexity.json
Updated system prompt to require analysis objects with fixed fields within a complexityAnalysis array and optional metadata. Expanded user prompt with new "Codebase Analysis Required" workflow section (Glob, Grep, Read steps) and conditional logic for project context integration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the updated JSON schema structure is correctly specified and does not break existing integrations
  • Confirm the new codebase analysis workflow section requirements are clearly understood and achievable by the prompt consumer
  • Check that metadata optionality is properly documented

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 'Fix/complexity-prompt-json-output' is related to the changeset which fixes the complexity analysis prompt to ensure consistent JSON output format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/complexity-prompt-json-output

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9079d04 and 0e59606.

📒 Files selected for processing (2)
  • .changeset/fix-complexity-prompt-json-output.md (1 hunks)
  • src/prompts/analyze-complexity.json (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: eyaltoledano
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/floppy-news-buy.md:7-38
Timestamp: 2025-08-02T14:54:52.216Z
Learning: For major feature additions like new CLI commands, eyaltoledano prefers detailed changesets with comprehensive descriptions, usage examples, and feature explanations rather than minimal single-line summaries.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1285
File: .changeset/nice-ways-hope.md:5-17
Timestamp: 2025-10-08T12:21:14.455Z
Learning: For changeset files (.changeset/*.md): The first line should be concise and in imperative mood, but the body after the first line can include as many user-facing details as desired (bullets, explanations, links, etc.) to provide context for the CHANGELOG.md.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Use kebab-case for command names (e.g., analyze-complexity) and descriptive, action-oriented names.

Applied to files:

  • src/prompts/analyze-complexity.json
  • .changeset/fix-complexity-prompt-json-output.md
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: When breaking down complex tasks in Taskmaster, use the `expand_task` command with appropriate flags (`--num`, `--research`, `--force`, `--prompt`) and review generated subtasks for accuracy.

Applied to files:

  • src/prompts/analyze-complexity.json
📚 Learning: 2025-09-22T19:45:04.337Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.

Applied to files:

  • .changeset/fix-complexity-prompt-json-output.md
📚 Learning: 2025-11-12T18:23:46.054Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1386
File: apps/cli/src/ui/formatters/complexity-formatters.ts:27-37
Timestamp: 2025-11-12T18:23:46.054Z
Learning: In the eyaltoledano/claude-task-master codebase, task complexity scores are always integers, never fractional values (e.g., never 7.8 or 8.8). Using parseInt for complexity parsing is appropriate and correct.

Applied to files:

  • .changeset/fix-complexity-prompt-json-output.md
📚 Learning: 2025-09-03T13:46:00.640Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/oauth-service.ts:20-20
Timestamp: 2025-09-03T13:46:00.640Z
Learning: For Node.js v22 and later, JSON imports should use `with { type: 'json' }` syntax, not `assert { type: 'json' }`. The `assert` syntax was removed in Node.js v22 in favor of the `with` syntax for import attributes. This applies to the eyaltoledano/claude-task-master codebase which uses Node.js v24.

Applied to files:

  • .changeset/fix-complexity-prompt-json-output.md
⏰ 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
🔇 Additional comments (3)
.changeset/fix-complexity-prompt-json-output.md (1)

1-5: Changeset entry looks good.

The file is properly formatted with a clear, concise description in imperative mood that accurately reflects the fix to enforce consistent JSON output format in the complexity analysis prompt.

src/prompts/analyze-complexity.json (2)

1-51: No issues found. All verifications confirm code quality and compatibility.

Existing codebase already expects the complexityAnalysis array schema being enforced—10+ files across tests, UI, task management, and MCP server modules consistently access this property. The stricter JSON validation clarifies implicit requirements and causes no breaking changes. Changeset file is properly formatted and correctly marked as a patch release for @task-master/cli.


1-51: ****

The changeset file exists and is properly formatted. The file .changeset/fix-complexity-prompt-json-output.md is present in the repository with the following content:

---
"@task-master/cli": patch
---

Fix complexity analysis prompt to ensure consistent JSON output format

This changeset correctly follows project conventions: it has a plain, unstyled summary line after the frontmatter in imperative mood, with no markdown styling. The filename and content directly correlate to the PR's changes to src/prompts/analyze-complexity.json. The original review concern is unfounded.

Likely an incorrect or invalid review comment.


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

@Crunchyman-ralph Crunchyman-ralph merged commit 0003b6f into next Nov 14, 2025
6 checks passed
This was referenced Nov 15, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 17, 2025
16 tasks
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
* fix(prompts): add JSON output format instruction to complexity analysis prompt

The complexity analysis prompt was missing the final instruction specifying
that output should be a JSON object with a 'complexityAnalysis' key containing
the array of analysis objects. This caused inconsistent output formatting.

This fix ensures the AI model returns properly structured JSON output that
can be reliably parsed by the complexity analysis module.

* chore: add changeset for complexity prompt fix

---------

Co-authored-by: Your Name <you@example.com>
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