claude-task-master icon indicating copy to clipboard operation
claude-task-master copied to clipboard

feedback: PRD Parsing Fails with Formatting Issues - Anthropic API error during object generation

Open rcaos opened this issue 8 months ago • 4 comments

Hi folks! I hope this feedback saves you valuable debugging time and helps streamline your development process.

Feedback Summary

parse-prd command fails with error:

Error: Anthropic API error during object generation: No object generated: response did not match schema.
Version: 0.17.0

When PRDs contain formatting elements like code blocks, inline code with backticks, or complex formatting. Error message provides no indication that formatting is the root cause.

User Context

I'm a new user writing detailed PRDs with enthusiasm to be comprehensive. Included coding examples, inline code references, and complex formatting to thoroughly document technical requirements. Expected the parser to handle standard markdown formatting.

I'm using task-master with Cursor as an MCP

User Impact

  • Time Lost: Spent hours debugging what appeared to be an API or configuration issue
  • Error message doesn't hint at formatting being the problem
  • Frustration: Had to systematically compare with working PRDs and remove elements to identify the cause
  • Discovery Process: Only found solution by trial and error, not through clear guidance

Suggestions

  1. Improve Error Messages: Provide more specific error messages that hint at formatting issues
  2. Pre-validation: Add formatting validation that identifies problematic elements before API calls
  3. Documentation Prominence: Make formatting requirements more visible in main docs.
  4. Examples: Show both āœ… good and āŒ bad formatting examples in primary documentation

Relevant Screenshots or Examples

Error Message:

Anthropic API error during object generation: No object generated: response did not match schema.

Additional Notes

This issue could save future users significant debugging time. The formatting requirements exist in taskmaster.mdc but aren't prominent enough for new users who naturally want to include technical details in their PRDs. Consider this a UX improvement opportunity rather than a bug fix.

I added to my cursor rule (taskmaster.mdc):

### PRD Formatting Requirements (CRITICAL)

**🚨 FATAL: Formatting Issues That Break Parsing**

These formatting patterns will cause `"Anthropic API error: response did not match schema"` failures:

**āŒ XML-Like Tags:**
```markdown
<context>
Content here
</context>


**āŒ Non-ASCII Characters:**
- Arrow symbols: `→` (use "then" instead)  
- Special unicode characters
- Smart quotes: `""` (use regular quotes: `""`)

**āŒ Code Blocks:**
```markdown
```swift
// Code examples in PRDs break parsing


**āŒ Inline Code with Backticks:**
- `UserDefaults.standard`
- `@DependencyClient` 
- Any text wrapped in backticks

**āŒ Complex Nested Formatting:**
- Bold text within lists that contain code
- Multiple levels of nested formatting
- Mixed formatting patterns

**āœ… SAFE: Standard Markdown That Works**
Use simple markdown formatting without code blocks or inline code.

rcaos avatar Jun 18 '25 13:06 rcaos

Thanks for the feedback, this definitely needs to be included as we want users to be able to put whatever they want in their PRDs...

Crunchyman-ralph avatar Jun 18 '25 15:06 Crunchyman-ralph

Thanks for the feedback, this definitely needs to be included as we want users to be able to put whatever they want in their PRDs...

Crunchyman-ralph avatar Jun 18 '25 15:06 Crunchyman-ralph

This also is an issue sometimes, but for OpenRouter API as well (for the latest version)

BradKML avatar Aug 11 '25 03:08 BradKML

This also is an issue sometimes, but for OpenRouter API as well (for the latest version)

BradKML avatar Aug 11 '25 03:08 BradKML

Found 3 possible duplicate issues:

  1. https://github.com/eyaltoledano/claude-task-master/issues/1161
  2. https://github.com/eyaltoledano/claude-task-master/issues/1156
  3. https://github.com/eyaltoledano/claude-task-master/issues/1141

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and šŸ‘ the existing issue instead
  • To prevent auto-closure, add a comment or šŸ‘Ž this comment

šŸ¤– Generated with [Task Master Bot]

github-actions[bot] avatar Aug 28 '25 14:08 github-actions[bot]

Found 3 possible duplicate issues:

  1. https://github.com/eyaltoledano/claude-task-master/issues/1161
  2. https://github.com/eyaltoledano/claude-task-master/issues/1156
  3. https://github.com/eyaltoledano/claude-task-master/issues/1141

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and šŸ‘ the existing issue instead
  • To prevent auto-closure, add a comment or šŸ‘Ž this comment

šŸ¤– Generated with [Task Master Bot]

github-actions[bot] avatar Aug 28 '25 14:08 github-actions[bot]

I just bumped into this error now - the first time I ever ran the parse-prd command.

I wrote my PRD, then used Claude Opus to turn it into a professional PRD, and then I ran parse-prd.

Toggle to my PRD file

# Product Requirements Document: Accounting App Improvements

## Context

This Next.js accounting application manages cryptocurrency transactions, revenue tracking, and revaluations. The
following improvements are needed to enhance data formatting, UI/UX, and fix existing bugs.

## Requirements by Component

### 1. Formatting & Utilities (`@app/lib/utils.ts`)

**Priority: HIGH**

#### 1.1 Number Formatting Refactor

- **Current State**: Generic currency formatting function
- **Required Changes**:
  - Create `formatCrypto(amount: number): string` - Formats crypto amounts to exactly 2 decimal places
  - Rename `formatCurrency` to `formatFiat` for clarity
  - Ensure all components using the old function are updated
- **Acceptance Criteria**:
  - All crypto amounts display with exactly 2 decimal places (e.g., "1234.56")
  - All fiat amounts maintain proper currency formatting
  - No regression in existing functionality

#### 1.2 Date Formatting Standardization

- **Requirement**: Standardize all date displays to ISO format (YYYY-MM-DD)
- **Scope**: All components displaying dates
- **Acceptance Criteria**: Every date in the application follows YYYY-MM-DD format

### 2. Transaction Table Improvements (`@app/components/TransactionTable.tsx`)

**Priority: HIGH**

#### 2.1 Column Separation

- **Current State**: Single "From/To" column
- **Required Change**: Split into two distinct columns: "From" and "To"
- **Implementation Notes**: Adjust table headers and data mapping accordingly

#### 2.2 Monthly Grouping

- **Requirement**: Group transaction history by month
- **Display Format**:
  - Month headers (e.g., "2024-03", "2024-02")
  - Transactions sorted by date within each month
  - Visual separation between month groups
- **Acceptance Criteria**:
  - Transactions clearly grouped by month
  - Maintain sortability within groups
  - Preserve all existing functionality

### 3. Bug Fixes

**Priority: CRITICAL**

#### 3.1 Revaluations Table Scroll Issue (`@app/components/RevaluationTable.tsx`)

- **Bug Description**: Dual scrollbars preventing proper scrolling
- **Root Cause**: Likely nested scrollable containers or conflicting CSS
- **Solution Requirements**:
  - Single scrollbar for table content
  - Smooth scrolling experience
  - Maintain responsive design
- **Testing**: Verify scrolling works on different screen sizes

### 4. Interactive Enhancements

**Priority: MEDIUM**

#### 4.1 Row Click Navigation

- **Requirement**: Hovering over a table row should make it clickable if a transaction URL exists
- **Implementation**:
  - Visual hover state (cursor pointer, background change)
  - Click handler to open URL in new tab
  - Only apply to rows with valid URLs
- **Affected Components**: All table components with URL data

## Technical Constraints

- Maintain TypeScript type safety throughout
- Preserve existing API contracts
- Ensure mobile responsiveness
- No breaking changes to data structures

## Testing Requirements

- Verify all number formatting displays correctly
- Test date formatting across different locales
- Confirm scroll behavior on various browsers
- Validate URL navigation opens in new tabs

## Delegation Strategy

Group tasks for efficient parallel development:

1. **Formatting Agent**: Handle all utils.ts changes and component updates
2. **Table Enhancement Agent**: TransactionTable column split and monthly grouping
3. **Bug Fix Agent**: Resolve RevaluationTable scroll issue
4. **UX Agent**: Implement row hover/click functionality

I then got a vague error that had misleadingly indicated that there's an issue with my Claude API config/provider setup. Here's the full error log:

See full error log

šŸ·ļø tag: master
Parsing PRD file: /Users/prb/Sablier/business/accounting/PRD.md
Generating 10 tasks...
[INFO] Tag 'master' is empty or doesn't exist. Creating/updating tag with new tasks.
ā ‹ Parsing PRD and generating tasks...
ā ¦ Parsing PRD and generating tasks...
[ERROR] Claude Code object generation failed: No object generated: response did not match schema. {"error":{"name":"AI_NoObjectGeneratedError","cause":{"name":"AI_TypeValidationError","cause":{"issues":[{"received":"critical","code":"invalid_enum_value","options":["high","medium","low"],"path":["tasks",5,"priority"],"message":"Invalid enum value. Expected 'high' | 'medium' | 'low', received 'critical'"}],"name":"ZodError"},"value":{"tasks":[{"id":1,"title":"Create formatCrypto utility function","description":"Add new formatCrypto function to utils.ts for consistent crypto amount formatting with exactly 2 decimal places","status":"pending","dependencies":[],"priority":"high","details":"Create formatCrypto(amount: number): string function in app/lib/utils.ts that formats crypto amounts to exactly 2 decimal places using toFixed(2). This will ensure consistent display across all crypto-related components. Function should return string like '1234.56' without currency symbols.","testStrategy":"Unit test the function with various decimal inputs (1.1, 1.123, 1000.999) to ensure exactly 2 decimal places. Verify output format matches expected patterns."},{"id":2,"title":"Rename formatCurrency to formatFiat","description":"Rename the existing formatCurrency function to formatFiat for clarity and update all references","status":"pending","dependencies":[1],"priority":"high","details":"In app/lib/utils.ts, rename formatCurrency function to formatFiat. Update all imports and function calls across components (RevenueTable.tsx, CryptoRevenueTable.tsx, and any other components using this function). Maintain exact same functionality but with clearer naming convention.","testStrategy":"Search codebase for all formatCurrency references. Ensure all components compile after rename. Test that fiat amounts still display correctly with proper currency symbols and formatting."},{"id":3,"title":"Standardize date formatting to ISO format","description":"Update all components to use consistent YYYY-MM-DD date format across the application","status":"pending","dependencies":[2],"priority":"medium","details":"Update formatDate function in utils.ts to ensure it always returns YYYY-MM-DD format. Review TransactionTable.tsx (currently uses different format on line 49-55), RevaluationTable.tsx (line 60-67), and other components to use the standardized formatDate function from utils.ts consistently.","testStrategy":"Verify all date displays across the app show YYYY-MM-DD format. Test with various date inputs including edge cases like year boundaries and leap years."},{"id":4,"title":"Split TransactionTable From/To columns","description":"Convert the combined 'From/To' column in TransactionTable into separate 'From' and 'To' columns","status":"pending","dependencies":[3],"priority":"high","details":"In app/components/TransactionTable.tsx, modify table headers (line 165-170) to replace single 'From/To' header with separate 'From' and 'To' headers. Update table body (line 209-235) to render from and to data in separate columns instead of combined format. Adjust table structure and styling accordingly.","testStrategy":"Verify table displays two distinct columns for From and To. Test with transactions that have both from/to, only from, only to, and neither. Ensure table remains responsive on mobile devices."},{"id":5,"title":"Add monthly grouping to TransactionTable","description":"Implement monthly grouping with visual month headers and proper sorting within each group","status":"pending","dependencies":[4],"priority":"high","details":"Modify TransactionTable.tsx to group transactions by month (YYYY-MM format). Add month header rows between transaction groups. Sort transactions within each month by date. Use React fragments or separate rendering logic to insert month header rows. Style month headers to be visually distinct from transaction rows.","testStrategy":"Test with transactions spanning multiple months. Verify month headers appear correctly and transactions are properly grouped. Ensure sorting within each month works correctly."},{"id":6,"title":"Fix RevaluationTable scroll issue","description":"Resolve the dual scrollbar problem in RevaluationTable that prevents proper scrolling","status":"pending","dependencies":[],"priority":"critical","details":"In app/components/RevaluationTable.tsx, investigate the overflow-x-auto container on line 173. Likely caused by nested scrollable containers or conflicting CSS. Remove redundant scroll containers, adjust table width constraints, or modify CSS to ensure only one functional scrollbar. Test on different screen sizes.","testStrategy":"Test scrolling behavior on various screen sizes and browsers. Ensure table scrolls smoothly horizontally when content overflows. Verify no dual scrollbars appear and table remains fully accessible."},{"id":7,"title":"Add table row hover states","description":"Implement visual hover indicators for table rows that contain clickable URLs","status":"pending","dependencies":[6],"priority":"medium","details":"Add hover states to table rows in TransactionTable.tsx and RevaluationTable.tsx. Only apply hover cursor:pointer and background color changes to rows that have a valid URL field. Use conditional CSS classes based on row.url existence. Apply consistent hover styling across both components.","testStrategy":"Test hover states on rows with and without URLs. Verify only rows with URLs show pointer cursor and hover effects. Ensure hover states work correctly in both light and dark themes."},{"id":8,"title":"Add table row click navigation","description":"Implement click handlers for table rows to open transaction URLs in new tabs","status":"pending","dependencies":[7],"priority":"medium","details":"Add onClick handlers to table rows in TransactionTable.tsx that have URLs. When row is clicked, open the URL in a new tab using window.open(url, '_blank', 'noopener,noreferrer'). Only attach click handlers to rows with valid URLs. Prevent event bubbling from other clickable elements within rows.","testStrategy":"Test row clicks open URLs in new tabs. Verify clicks only work on rows with URLs. Ensure other interactive elements in rows (like export button) don't interfere with row click behavior."},{"id":9,"title":"Update all components to use new formatting functions","description":"Ensure all components consistently use the new formatCrypto and formatFiat functions","status":"pending","dependencies":[8],"priority":"medium","details":"Review all components (TransactionTable.tsx, RevaluationTable.tsx, CryptoRevenueTable.tsx, RevenueTable.tsx) and update them to use appropriate formatting functions. Replace inline formatting logic with calls to formatCrypto for crypto amounts and formatFiat for fiat amounts. Ensure consistent import statements.","testStrategy":"Search codebase for inline formatting logic. Verify all numbers display with correct formatting. Test crypto amounts show 2 decimal places and fiat amounts show proper currency symbols and formatting."},{"id":10,"title":"Run comprehensive testing and validation","description":"Execute full code validation including TypeScript checks, linting, and formatting","status":"pending","dependencies":[9],"priority":"high","details":"Run `just full-check` to verify all code passes linting and type checking. Run `just full-write` to fix any auto-fixable issues. Execute `just tsc-check` specifically for TypeScript validation. Test the application manually to ensure all features work correctly and no regressions were introduced.","testStrategy":"Verify all just commands pass without errors. Perform manual testing of all modified components. Test responsive design, dark/light themes, data loading states, and error scenarios. Confirm all formatting functions work as expected."}],"metadata":{"projectName":"Sablier Accounting App Improvements","totalTasks":10,"sourceFile":"/Users/prb/Sablier/business/accounting/PRD.md","generatedAt":"2025-09-03"}}},"text":"{\n    \"tasks\": [\n        {\n            \"id\": 1,\n            \"title\": \"Create formatCrypto utility function\",\n            \"description\": \"Add new formatCrypto function to utils.ts for consistent crypto amount formatting with exactly 2 decimal places\",\n            \"status\": \"pending\",\n            \"dependencies\": [],\n            \"priority\": \"high\",\n            \"details\": \"Create formatCrypto(amount: number): string function in app/lib/utils.ts that formats crypto amounts to exactly 2 decimal places using toFixed(2). This will ensure consistent display across all crypto-related components. Function should return string like '1234.56' without currency symbols.\",\n            \"testStrategy\": \"Unit test the function with various decimal inputs (1.1, 1.123, 1000.999) to ensure exactly 2 decimal places. Verify output format matches expected patterns.\"\n        },\n        {\n            \"id\": 2,\n            \"title\": \"Rename formatCurrency to formatFiat\",\n            \"description\": \"Rename the existing formatCurrency function to formatFiat for clarity and update all references\",\n            \"status\": \"pending\",\n            \"dependencies\": [1],\n            \"priority\": \"high\",\n            \"details\": \"In app/lib/utils.ts, rename formatCurrency function to formatFiat. Update all imports and function calls across components (RevenueTable.tsx, CryptoRevenueTable.tsx, and any other components using this function). Maintain exact same functionality but with clearer naming convention.\",\n            \"testStrategy\": \"Search codebase for all formatCurrency references. Ensure all components compile after rename. Test that fiat amounts still display correctly with proper currency symbols and formatting.\"\n        },\n        {\n            \"id\": 3,\n            \"title\": \"Standardize date formatting to ISO format\",\n            \"description\": \"Update all components to use consistent YYYY-MM-DD date format across the application\",\n            \"status\": \"pending\",\n            \"dependencies\": [2],\n            \"priority\": \"medium\",\n            \"details\": \"Update formatDate function in utils.ts to ensure it always returns YYYY-MM-DD format. Review TransactionTable.tsx (currently uses different format on line 49-55), RevaluationTable.tsx (line 60-67), and other components to use the standardized formatDate function from utils.ts consistently.\",\n            \"testStrategy\": \"Verify all date displays across the app show YYYY-MM-DD format. Test with various date inputs including edge cases like year boundaries and leap years.\"\n        },\n        {\n            \"id\": 4,\n            \"title\": \"Split TransactionTable From/To columns\",\n            \"description\": \"Convert the combined 'From/To' column in TransactionTable into separate 'From' and 'To' columns\",\n            \"status\": \"pending\",\n            \"dependencies\": [3],\n            \"priority\": \"high\",\n            \"details\": \"In app/components/TransactionTable.tsx, modify table headers (line 165-170) to replace single 'From/To' header with separate 'From' and 'To' headers. Update table body (line 209-235) to render from and to data in separate columns instead of combined format. Adjust table structure and styling accordingly.\",\n            \"testStrategy\": \"Verify table displays two distinct columns for From and To. Test with transactions that have both from/to, only from, only to, and neither. Ensure table remains responsive on mobile devices.\"\n        },\n        {\n            \"id\": 5,\n            \"title\": \"Add monthly grouping to TransactionTable\",\n            \"description\": \"Implement monthly grouping with visual month headers and proper sorting within each group\",\n            \"status\": \"pending\",\n            \"dependencies\": [4],\n            \"priority\": \"high\",\n            \"details\": \"Modify TransactionTable.tsx to group transactions by month (YYYY-MM format). Add month header rows between transaction groups. Sort transactions within each month by date. Use React fragments or separate rendering logic to insert month header rows. Style month headers to be visually distinct from transaction rows.\",\n            \"testStrategy\": \"Test with transactions spanning multiple months. Verify month headers appear correctly and transactions are properly grouped. Ensure sorting within each month works correctly.\"\n        },\n        {\n            \"id\": 6,\n            \"title\": \"Fix RevaluationTable scroll issue\",\n            \"description\": \"Resolve the dual scrollbar problem in RevaluationTable that prevents proper scrolling\",\n            \"status\": \"pending\",\n            \"dependencies\": [],\n            \"priority\": \"critical\",\n            \"details\": \"In app/components/RevaluationTable.tsx, investigate the overflow-x-auto container on line 173. Likely caused by nested scrollable containers or conflicting CSS. Remove redundant scroll containers, adjust table width constraints, or modify CSS to ensure only one functional scrollbar. Test on different screen sizes.\",\n            \"testStrategy\": \"Test scrolling behavior on various screen sizes and browsers. Ensure table scrolls smoothly horizontally when content overflows. Verify no dual scrollbars appear and table remains fully accessible.\"\n        },\n        {\n            \"id\": 7,\n            \"title\": \"Add table row hover states\",\n            \"description\": \"Implement visual hover indicators for table rows that contain clickable URLs\",\n            \"status\": \"pending\",\n            \"dependencies\": [6],\n            \"priority\": \"medium\",\n            \"details\": \"Add hover states to table rows in TransactionTable.tsx and RevaluationTable.tsx. Only apply hover cursor:pointer and background color changes to rows that have a valid URL field. Use conditional CSS classes based on row.url existence. Apply consistent hover styling across both components.\",\n            \"testStrategy\": \"Test hover states on rows with and without URLs. Verify only rows with URLs show pointer cursor and hover effects. Ensure hover states work correctly in both light and dark themes.\"\n        },\n        {\n            \"id\": 8,\n            \"title\": \"Add table row click navigation\",\n            \"description\": \"Implement click handlers for table rows to open transaction URLs in new tabs\",\n            \"status\": \"pending\",\n            \"dependencies\": [7],\n            \"priority\": \"medium\",\n            \"details\": \"Add onClick handlers to table rows in TransactionTable.tsx that have URLs. When row is clicked, open the URL in a new tab using window.open(url, '_blank', 'noopener,noreferrer'). Only attach click handlers to rows with valid URLs. Prevent event bubbling from other clickable elements within rows.\",\n            \"testStrategy\": \"Test row clicks open URLs in new tabs. Verify clicks only work on rows with URLs. Ensure other interactive elements in rows (like export button) don't interfere with row click behavior.\"\n        },\n        {\n            \"id\": 9,\n            \"title\": \"Update all components to use new formatting functions\",\n            \"description\": \"Ensure all components consistently use the new formatCrypto and formatFiat functions\",\n            \"status\": \"pending\",\n            \"dependencies\": [8],\n            \"priority\": \"medium\",\n            \"details\": \"Review all components (TransactionTable.tsx, RevaluationTable.tsx, CryptoRevenueTable.tsx, RevenueTable.tsx) and update them to use appropriate formatting functions. Replace inline formatting logic with calls to formatCrypto for crypto amounts and formatFiat for fiat amounts. Ensure consistent import statements.\",\n            \"testStrategy\": \"Search codebase for inline formatting logic. Verify all numbers display with correct formatting. Test crypto amounts show 2 decimal places and fiat amounts show proper currency symbols and formatting.\"\n        },\n        {\n            \"id\": 10,\n            \"title\": \"Run comprehensive testing and validation\",\n            \"description\": \"Execute full code validation including TypeScript checks, linting, and formatting\",\n            \"status\": \"pending\",\n            \"dependencies\": [9],\n            \"priority\": \"high\",\n            \"details\": \"Run `just full-check` to verify all code passes linting and type checking. Run `just full-write` to fix any auto-fixable issues. Execute `just tsc-check` specifically for TypeScript validation. Test the application manually to ensure all features work correctly and no regressions were introduced.\",\n            \"testStrategy\": \"Verify all just commands pass without errors. Perform manual testing of all modified components. Test responsive design, dark/light themes, data loading states, and error scenarios. Confirm all formatting functions work as expected.\"\n        }\n    ],\n    \"metadata\": {\n        \"projectName\": \"Sablier Accounting App Improvements\", \n        \"totalTasks\": 10,\n        \"sourceFile\": \"/Users/prb/Sablier/business/accounting/PRD.md\",\n        \"generatedAt\": \"2025-09-03\"\n    }\n}","response":{"id":"AWyMljR4C8G3vozl","timestamp":"2025-09-03T18:44:23.313Z","modelId":"sonnet"},"usage":{"promptTokens":61950,"completionTokens":2029,"totalTokens":63979},"finishReason":"stop"}}
[WARN] Attempt 1 failed for role main (generateObject / claude-code): Claude Code API error during object generation: No object generated: response did not match schema.
[ERROR] Something went wrong on the provider side. Max retries reached for role main (generateObject / claude-code).
[ERROR] Service call failed for role main (Provider: claude-code, Model: sonnet): Claude Code API error during object generation: Nāœ” Tasks generated successfully!

[!NOTE] This happened even if Task Master was able to, eventually, generate the task list.

PaulRBerg avatar Sep 03 '25 18:09 PaulRBerg