{
  "item_type": "chapter",
  "chapter_id": "prodigy-integration",
  "chapter_title": "Prodigy Integration",
  "chapter_file": "book/src/prodigy-integration.md",
  "drift_detected": true,
  "severity": "medium",
  "quality_assessment": "Chapter comprehensively documents Prodigy integration with excellent MapReduce examples. Previous drift issues (NULLS LAST, File vs Function structure) have been addressed. One medium-severity issue remains: the /prodigy-complete-debtmap-fix command signature uses outdated --gaps parameter instead of current --validation parameter.",
  "issues": [
    {
      "type": "outdated_information",
      "severity": "medium",
      "section": "Claude Slash Commands > /prodigy-complete-debtmap-fix",
      "description": "Documentation shows --gaps ${validation.gaps} parameter but actual command uses --validation <validation-file> parameter",
      "current_content": "- claude: \"/prodigy-complete-debtmap-fix --gaps ${validation.gaps} --plan .prodigy/IMPLEMENTATION_PLAN.md --attempt ${validation.attempt_number}\"",
      "should_be": "- claude: \"/prodigy-complete-debtmap-fix --plan .prodigy/IMPLEMENTATION_PLAN.md --validation .prodigy/debtmap-validation.json --attempt ${validation.attempt_number}\"",
      "fix_suggestion": "Update all instances of /prodigy-complete-debtmap-fix to use --validation parameter instead of --gaps parameter. Lines affected: 138, 371, 498, 638, 915",
      "source_reference": ".claude/commands/prodigy-complete-debtmap-fix.md:12, workflows/debtmap.yml:36, workflows/debtmap-reduce.yml:49"
    },
    {
      "type": "incorrect_examples",
      "severity": "medium",
      "section": "Quick Start > workflow example (line 138)",
      "description": "Quick Start workflow example uses --gaps parameter that doesn't exist in the actual command",
      "current_content": "- claude: \"/prodigy-complete-debtmap-fix --gaps ${validation.gaps} --plan .prodigy/IMPLEMENTATION_PLAN.md --attempt ${validation.attempt_number}\"",
      "should_be": "- claude: \"/prodigy-complete-debtmap-fix --plan .prodigy/IMPLEMENTATION_PLAN.md --validation .prodigy/debtmap-validation.json --attempt ${validation.attempt_number}\"",
      "fix_suggestion": "Update line 138 to match actual workflow at workflows/debtmap.yml:36",
      "source_reference": "workflows/debtmap.yml:36"
    },
    {
      "type": "incorrect_examples",
      "severity": "medium",
      "section": "Step-Level Validation example (line 371)",
      "description": "Step-level validation example uses --gaps parameter and missing --attempt parameter",
      "current_content": "- claude: \"/prodigy-complete-debtmap-fix --gaps ${validation.gaps} --plan .prodigy/IMPLEMENTATION_PLAN.md\"",
      "should_be": "- claude: \"/prodigy-complete-debtmap-fix --plan .prodigy/IMPLEMENTATION_PLAN.md --validation .prodigy/debtmap-validation.json --attempt ${validation.attempt_number}\"",
      "fix_suggestion": "Update line 371 to include --validation and --attempt parameters",
      "source_reference": "workflows/debtmap.yml:36"
    },
    {
      "type": "incorrect_examples",
      "severity": "medium",
      "section": "MapReduce Example > agent_template (line 638)",
      "description": "MapReduce example uses --gaps parameter instead of --validation",
      "current_content": "- claude: \"/prodigy-complete-debtmap-fix --gaps ${validation.gaps} --plan .prodigy/plan-${item_id}.md --attempt ${validation.attempt_number}\"",
      "should_be": "- claude: \"/prodigy-complete-debtmap-fix --plan .prodigy/plan-${item_id}.md --validation .prodigy/debtmap-validation-${item_id}.json --attempt ${validation.attempt_number}\"",
      "fix_suggestion": "Update line 638 to match actual workflow at workflows/debtmap-reduce.yml:49",
      "source_reference": "workflows/debtmap-reduce.yml:49"
    },
    {
      "type": "incorrect_examples",
      "severity": "medium",
      "section": "Validation > Step-Level Validation example (line 915)",
      "description": "Validation section example uses --gaps parameter instead of --validation",
      "current_content": "- claude: \"/prodigy-complete-debtmap-fix --gaps ${validation.gaps} --plan .prodigy/IMPLEMENTATION_PLAN.md --attempt ${validation.attempt_number}\"",
      "should_be": "- claude: \"/prodigy-complete-debtmap-fix --plan .prodigy/IMPLEMENTATION_PLAN.md --validation .prodigy/debtmap-validation.json --attempt ${validation.attempt_number}\"",
      "fix_suggestion": "Update line 915 to use --validation parameter",
      "source_reference": "workflows/debtmap.yml:36"
    },
    {
      "type": "missing_content",
      "severity": "low",
      "section": "Claude Slash Commands > /prodigy-complete-debtmap-fix > Parameters",
      "description": "Parameters section (line 502-505) mentions --gaps but should document --validation parameter instead",
      "current_content": "**Parameters:**\n- `--gaps`: Validation gaps to address\n- `--plan`: Original implementation plan\n- `--attempt`: Current retry attempt number",
      "should_be": "**Parameters:**\n- `--plan`: Path to implementation plan file\n- `--validation`: Path to validation JSON file with completion status\n- `--attempt`: Current retry attempt number (from ${validation.attempt_number})",
      "fix_suggestion": "Update parameter documentation to reflect actual command signature",
      "source_reference": ".claude/commands/prodigy-complete-debtmap-fix.md:12-16"
    },
    {
      "type": "inconsistent_information",
      "severity": "low",
      "section": "Claude Slash Commands > /prodigy-validate-debtmap-improvement",
      "description": "Documentation says shell command is used but actual MapReduce workflow uses claude command",
      "current_content": "Note: In practice, workflows use the `debtmap validate-improvement` shell command directly",
      "should_be": "Sequential workflows use shell command; MapReduce workflows use claude command wrapper",
      "fix_suggestion": "Update note to clarify that sequential workflow (debtmap.yml:31) uses shell command while MapReduce workflow (debtmap-reduce.yml:44) uses claude command",
      "source_reference": "workflows/debtmap.yml:31, workflows/debtmap-reduce.yml:44"
    }
  ],
  "positive_aspects": [
    "NULLS LAST handling now properly documented in MapReduce filter/sort examples (line 664-667)",
    "File vs Function item structure clearly documented with explanation (line 759-766)",
    "Comprehensive workflow examples showing both sequential and MapReduce patterns",
    "Clear explanation of iteration strategy and how -n flag works",
    "Excellent troubleshooting section with MapReduce-specific guidance",
    "Good command reference for monitoring progress, DLQ management, and session cleanup",
    "Valid internal links - all cross-references verified to exist",
    "Clear prerequisites checklist at the beginning",
    "Helpful visual diagram of MapReduce architecture"
  ],
  "improvement_suggestions": [
    "Replace all instances of --gaps ${validation.gaps} with --validation <file> parameter",
    "Ensure Quick Start workflow example matches actual workflows/debtmap.yml exactly",
    "Update MapReduce example to match actual workflows/debtmap-reduce.yml exactly",
    "Clarify in the note that MapReduce uses claude command for validate-improvement while sequential uses shell",
    "Document what fields the validation JSON file contains since command reads from it instead of receiving gaps directly"
  ],
  "metadata": {
    "analyzed_at": "2025-12-27T08:30:00Z",
    "feature_inventory": ".prodigy/book-analysis/features.json",
    "topics_covered": [
      "What is Prodigy",
      "Automated debt reduction",
      "Map-reduce workflows",
      "Setting up Prodigy",
      "Running debtmap workflows",
      "Iterative improvement",
      "Validation and testing"
    ],
    "validation_focus": "Check that Prodigy workflow integration is documented with workflow file examples",
    "workflow_files_validated": [
      "workflows/debtmap.yml",
      "workflows/debtmap-reduce.yml"
    ],
    "internal_links_validated": 4,
    "broken_links": [],
    "previous_issues_resolved": [
      "NULLS LAST handling in MapReduce filter/sort now documented",
      "File vs Function item structure now explained with score field differences"
    ],
    "command_files_validated": [
      ".claude/commands/prodigy-complete-debtmap-fix.md"
    ]
  }
}
