@bastani/atomic 0.6.8 → 0.7.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/atomic +65 -0
- package/package.json +17 -82
- package/postinstall.mjs +47 -0
- package/.agents/skills/ado-commit/SKILL.md +0 -94
- package/.agents/skills/ado-create-pr/SKILL.md +0 -211
- package/.agents/skills/advanced-evaluation/SKILL.md +0 -404
- package/.agents/skills/advanced-evaluation/references/bias-mitigation.md +0 -288
- package/.agents/skills/advanced-evaluation/references/evaluation-pipeline.md +0 -43
- package/.agents/skills/advanced-evaluation/references/implementation-patterns.md +0 -315
- package/.agents/skills/advanced-evaluation/references/metrics-guide.md +0 -331
- package/.agents/skills/advanced-evaluation/scripts/evaluation_example.py +0 -392
- package/.agents/skills/ast-grep/SKILL.md +0 -325
- package/.agents/skills/ast-grep/references/rule_reference.md +0 -297
- package/.agents/skills/bdi-mental-states/SKILL.md +0 -313
- package/.agents/skills/bdi-mental-states/references/bdi-ontology-core.md +0 -207
- package/.agents/skills/bdi-mental-states/references/framework-integration.md +0 -582
- package/.agents/skills/bdi-mental-states/references/rdf-examples.md +0 -315
- package/.agents/skills/bdi-mental-states/references/sparql-competency.md +0 -420
- package/.agents/skills/bun/SKILL.md +0 -233
- package/.agents/skills/context-compression/SKILL.md +0 -274
- package/.agents/skills/context-compression/references/evaluation-framework.md +0 -213
- package/.agents/skills/context-compression/scripts/compression_evaluator.py +0 -862
- package/.agents/skills/context-compression/tests/test_compression_evaluator.py +0 -56
- package/.agents/skills/context-degradation/SKILL.md +0 -208
- package/.agents/skills/context-degradation/references/patterns.md +0 -314
- package/.agents/skills/context-degradation/scripts/degradation_detector.py +0 -614
- package/.agents/skills/context-fundamentals/SKILL.md +0 -203
- package/.agents/skills/context-fundamentals/references/context-components.md +0 -283
- package/.agents/skills/context-fundamentals/scripts/context_manager.py +0 -533
- package/.agents/skills/context-optimization/SKILL.md +0 -197
- package/.agents/skills/context-optimization/references/optimization_techniques.md +0 -272
- package/.agents/skills/context-optimization/scripts/compaction.py +0 -562
- package/.agents/skills/create-spec/SKILL.md +0 -249
- package/.agents/skills/docx/LICENSE.txt +0 -30
- package/.agents/skills/docx/SKILL.md +0 -592
- package/.agents/skills/docx/scripts/__init__.py +0 -1
- package/.agents/skills/docx/scripts/accept_changes.py +0 -135
- package/.agents/skills/docx/scripts/comment.py +0 -318
- package/.agents/skills/docx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/docx/scripts/office/helpers/merge_runs.py +0 -199
- package/.agents/skills/docx/scripts/office/helpers/simplify_redlines.py +0 -197
- package/.agents/skills/docx/scripts/office/pack.py +0 -159
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agents/skills/docx/scripts/office/soffice.py +0 -183
- package/.agents/skills/docx/scripts/office/unpack.py +0 -132
- package/.agents/skills/docx/scripts/office/validate.py +0 -111
- package/.agents/skills/docx/scripts/office/validators/__init__.py +0 -15
- package/.agents/skills/docx/scripts/office/validators/base.py +0 -847
- package/.agents/skills/docx/scripts/office/validators/docx.py +0 -446
- package/.agents/skills/docx/scripts/office/validators/pptx.py +0 -275
- package/.agents/skills/docx/scripts/office/validators/redlining.py +0 -247
- package/.agents/skills/docx/scripts/templates/comments.xml +0 -3
- package/.agents/skills/docx/scripts/templates/commentsExtended.xml +0 -3
- package/.agents/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
- package/.agents/skills/docx/scripts/templates/commentsIds.xml +0 -3
- package/.agents/skills/docx/scripts/templates/people.xml +0 -3
- package/.agents/skills/evaluation/SKILL.md +0 -253
- package/.agents/skills/evaluation/references/metrics.md +0 -339
- package/.agents/skills/evaluation/scripts/evaluator.py +0 -627
- package/.agents/skills/explain-code/SKILL.md +0 -232
- package/.agents/skills/filesystem-context/SKILL.md +0 -289
- package/.agents/skills/filesystem-context/references/implementation-patterns.md +0 -549
- package/.agents/skills/filesystem-context/scripts/filesystem_context.py +0 -425
- package/.agents/skills/find-skills/SKILL.md +0 -144
- package/.agents/skills/gh-commit/SKILL.md +0 -245
- package/.agents/skills/gh-create-pr/SKILL.md +0 -95
- package/.agents/skills/hosted-agents/SKILL.md +0 -262
- package/.agents/skills/hosted-agents/references/infrastructure-patterns.md +0 -700
- package/.agents/skills/hosted-agents/scripts/sandbox_manager.py +0 -590
- package/.agents/skills/impeccable/SKILL.md +0 -178
- package/.agents/skills/impeccable/agents/openai.yaml +0 -4
- package/.agents/skills/impeccable/reference/adapt.md +0 -190
- package/.agents/skills/impeccable/reference/animate.md +0 -175
- package/.agents/skills/impeccable/reference/audit.md +0 -134
- package/.agents/skills/impeccable/reference/bolder.md +0 -113
- package/.agents/skills/impeccable/reference/brand.md +0 -114
- package/.agents/skills/impeccable/reference/clarify.md +0 -174
- package/.agents/skills/impeccable/reference/cognitive-load.md +0 -106
- package/.agents/skills/impeccable/reference/color-and-contrast.md +0 -105
- package/.agents/skills/impeccable/reference/colorize.md +0 -154
- package/.agents/skills/impeccable/reference/craft.md +0 -193
- package/.agents/skills/impeccable/reference/critique.md +0 -213
- package/.agents/skills/impeccable/reference/delight.md +0 -302
- package/.agents/skills/impeccable/reference/distill.md +0 -111
- package/.agents/skills/impeccable/reference/document.md +0 -427
- package/.agents/skills/impeccable/reference/extract.md +0 -70
- package/.agents/skills/impeccable/reference/harden.md +0 -347
- package/.agents/skills/impeccable/reference/heuristics-scoring.md +0 -234
- package/.agents/skills/impeccable/reference/interaction-design.md +0 -195
- package/.agents/skills/impeccable/reference/layout.md +0 -141
- package/.agents/skills/impeccable/reference/live.md +0 -594
- package/.agents/skills/impeccable/reference/motion-design.md +0 -109
- package/.agents/skills/impeccable/reference/onboard.md +0 -234
- package/.agents/skills/impeccable/reference/optimize.md +0 -258
- package/.agents/skills/impeccable/reference/overdrive.md +0 -130
- package/.agents/skills/impeccable/reference/personas.md +0 -178
- package/.agents/skills/impeccable/reference/polish.md +0 -232
- package/.agents/skills/impeccable/reference/product.md +0 -62
- package/.agents/skills/impeccable/reference/quieter.md +0 -99
- package/.agents/skills/impeccable/reference/responsive-design.md +0 -114
- package/.agents/skills/impeccable/reference/shape.md +0 -151
- package/.agents/skills/impeccable/reference/spatial-design.md +0 -100
- package/.agents/skills/impeccable/reference/teach.md +0 -156
- package/.agents/skills/impeccable/reference/typeset.md +0 -124
- package/.agents/skills/impeccable/reference/typography.md +0 -159
- package/.agents/skills/impeccable/reference/ux-writing.md +0 -107
- package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +0 -284
- package/.agents/skills/impeccable/scripts/command-metadata.json +0 -94
- package/.agents/skills/impeccable/scripts/design-parser.mjs +0 -820
- package/.agents/skills/impeccable/scripts/detect-csp.mjs +0 -198
- package/.agents/skills/impeccable/scripts/is-generated.mjs +0 -69
- package/.agents/skills/impeccable/scripts/live-accept.mjs +0 -595
- package/.agents/skills/impeccable/scripts/live-browser.js +0 -4781
- package/.agents/skills/impeccable/scripts/live-inject.mjs +0 -445
- package/.agents/skills/impeccable/scripts/live-poll.mjs +0 -186
- package/.agents/skills/impeccable/scripts/live-server.mjs +0 -694
- package/.agents/skills/impeccable/scripts/live-wrap.mjs +0 -571
- package/.agents/skills/impeccable/scripts/live.mjs +0 -247
- package/.agents/skills/impeccable/scripts/load-context.mjs +0 -141
- package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +0 -14
- package/.agents/skills/impeccable/scripts/pin.mjs +0 -214
- package/.agents/skills/init/SKILL.md +0 -140
- package/.agents/skills/liteparse/SKILL.md +0 -223
- package/.agents/skills/memory-systems/SKILL.md +0 -221
- package/.agents/skills/memory-systems/references/implementation.md +0 -551
- package/.agents/skills/memory-systems/scripts/memory_store.py +0 -616
- package/.agents/skills/multi-agent-patterns/SKILL.md +0 -259
- package/.agents/skills/multi-agent-patterns/references/frameworks.md +0 -433
- package/.agents/skills/multi-agent-patterns/scripts/coordination.py +0 -613
- package/.agents/skills/opentui/SKILL.md +0 -202
- package/.agents/skills/opentui/references/animation/REFERENCE.md +0 -431
- package/.agents/skills/opentui/references/components/REFERENCE.md +0 -144
- package/.agents/skills/opentui/references/components/code-diff.md +0 -672
- package/.agents/skills/opentui/references/components/containers.md +0 -417
- package/.agents/skills/opentui/references/components/inputs.md +0 -531
- package/.agents/skills/opentui/references/components/text-display.md +0 -386
- package/.agents/skills/opentui/references/core/REFERENCE.md +0 -145
- package/.agents/skills/opentui/references/core/api.md +0 -543
- package/.agents/skills/opentui/references/core/configuration.md +0 -168
- package/.agents/skills/opentui/references/core/gotchas.md +0 -393
- package/.agents/skills/opentui/references/core/patterns.md +0 -449
- package/.agents/skills/opentui/references/keyboard/REFERENCE.md +0 -617
- package/.agents/skills/opentui/references/layout/REFERENCE.md +0 -337
- package/.agents/skills/opentui/references/layout/patterns.md +0 -444
- package/.agents/skills/opentui/references/react/REFERENCE.md +0 -174
- package/.agents/skills/opentui/references/react/api.md +0 -436
- package/.agents/skills/opentui/references/react/configuration.md +0 -302
- package/.agents/skills/opentui/references/react/gotchas.md +0 -443
- package/.agents/skills/opentui/references/react/patterns.md +0 -501
- package/.agents/skills/opentui/references/solid/REFERENCE.md +0 -201
- package/.agents/skills/opentui/references/solid/api.md +0 -564
- package/.agents/skills/opentui/references/solid/configuration.md +0 -316
- package/.agents/skills/opentui/references/solid/gotchas.md +0 -427
- package/.agents/skills/opentui/references/solid/patterns.md +0 -560
- package/.agents/skills/opentui/references/testing/REFERENCE.md +0 -614
- package/.agents/skills/pdf/LICENSE.txt +0 -30
- package/.agents/skills/pdf/SKILL.md +0 -316
- package/.agents/skills/pdf/forms.md +0 -294
- package/.agents/skills/pdf/reference.md +0 -612
- package/.agents/skills/pdf/scripts/check_bounding_boxes.py +0 -65
- package/.agents/skills/pdf/scripts/check_fillable_fields.py +0 -11
- package/.agents/skills/pdf/scripts/convert_pdf_to_images.py +0 -33
- package/.agents/skills/pdf/scripts/create_validation_image.py +0 -37
- package/.agents/skills/pdf/scripts/extract_form_field_info.py +0 -122
- package/.agents/skills/pdf/scripts/extract_form_structure.py +0 -115
- package/.agents/skills/pdf/scripts/fill_fillable_fields.py +0 -98
- package/.agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -107
- package/.agents/skills/playwright-cli/SKILL.md +0 -390
- package/.agents/skills/playwright-cli/references/element-attributes.md +0 -23
- package/.agents/skills/playwright-cli/references/playwright-tests.md +0 -39
- package/.agents/skills/playwright-cli/references/request-mocking.md +0 -87
- package/.agents/skills/playwright-cli/references/running-code.md +0 -241
- package/.agents/skills/playwright-cli/references/session-management.md +0 -225
- package/.agents/skills/playwright-cli/references/spec-driven-testing.md +0 -305
- package/.agents/skills/playwright-cli/references/storage-state.md +0 -275
- package/.agents/skills/playwright-cli/references/test-generation.md +0 -134
- package/.agents/skills/playwright-cli/references/tracing.md +0 -139
- package/.agents/skills/playwright-cli/references/video-recording.md +0 -143
- package/.agents/skills/pptx/LICENSE.txt +0 -30
- package/.agents/skills/pptx/SKILL.md +0 -234
- package/.agents/skills/pptx/editing.md +0 -205
- package/.agents/skills/pptx/pptxgenjs.md +0 -420
- package/.agents/skills/pptx/scripts/__init__.py +0 -0
- package/.agents/skills/pptx/scripts/add_slide.py +0 -195
- package/.agents/skills/pptx/scripts/clean.py +0 -286
- package/.agents/skills/pptx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/pptx/scripts/office/helpers/merge_runs.py +0 -199
- package/.agents/skills/pptx/scripts/office/helpers/simplify_redlines.py +0 -197
- package/.agents/skills/pptx/scripts/office/pack.py +0 -159
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agents/skills/pptx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agents/skills/pptx/scripts/office/soffice.py +0 -183
- package/.agents/skills/pptx/scripts/office/unpack.py +0 -132
- package/.agents/skills/pptx/scripts/office/validate.py +0 -111
- package/.agents/skills/pptx/scripts/office/validators/__init__.py +0 -15
- package/.agents/skills/pptx/scripts/office/validators/base.py +0 -847
- package/.agents/skills/pptx/scripts/office/validators/docx.py +0 -446
- package/.agents/skills/pptx/scripts/office/validators/pptx.py +0 -275
- package/.agents/skills/pptx/scripts/office/validators/redlining.py +0 -247
- package/.agents/skills/pptx/scripts/thumbnail.py +0 -289
- package/.agents/skills/project-development/SKILL.md +0 -293
- package/.agents/skills/project-development/references/case-studies.md +0 -388
- package/.agents/skills/project-development/references/pipeline-patterns.md +0 -610
- package/.agents/skills/project-development/scripts/pipeline_template.py +0 -796
- package/.agents/skills/prompt-engineer/SKILL.md +0 -265
- package/.agents/skills/prompt-engineer/references/advanced_patterns.md +0 -271
- package/.agents/skills/prompt-engineer/references/core_prompting.md +0 -137
- package/.agents/skills/prompt-engineer/references/quality_improvement.md +0 -193
- package/.agents/skills/research-codebase/SKILL.md +0 -229
- package/.agents/skills/ripgrep/SKILL.md +0 -384
- package/.agents/skills/skill-creator/LICENSE.txt +0 -202
- package/.agents/skills/skill-creator/SKILL.md +0 -487
- package/.agents/skills/skill-creator/agents/analyzer.md +0 -274
- package/.agents/skills/skill-creator/agents/comparator.md +0 -202
- package/.agents/skills/skill-creator/agents/grader.md +0 -223
- package/.agents/skills/skill-creator/assets/eval_review.html +0 -146
- package/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
- package/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
- package/.agents/skills/skill-creator/references/schemas.md +0 -430
- package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
- package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
- package/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
- package/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
- package/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
- package/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
- package/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
- package/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
- package/.agents/skills/skill-creator/scripts/utils.py +0 -47
- package/.agents/skills/sl-commit/SKILL.md +0 -53
- package/.agents/skills/sl-submit-diff/SKILL.md +0 -57
- package/.agents/skills/tdd/SKILL.md +0 -111
- package/.agents/skills/tdd/deep-modules.md +0 -33
- package/.agents/skills/tdd/interface-design.md +0 -31
- package/.agents/skills/tdd/mocking.md +0 -59
- package/.agents/skills/tdd/refactoring.md +0 -10
- package/.agents/skills/tdd/tests.md +0 -61
- package/.agents/skills/tool-design/SKILL.md +0 -273
- package/.agents/skills/tool-design/references/architectural_reduction.md +0 -210
- package/.agents/skills/tool-design/references/best_practices.md +0 -176
- package/.agents/skills/tool-design/scripts/description_generator.py +0 -528
- package/.agents/skills/typescript-advanced-types/SKILL.md +0 -720
- package/.agents/skills/typescript-expert/SKILL.md +0 -434
- package/.agents/skills/typescript-expert/references/tsconfig-strict.json +0 -92
- package/.agents/skills/typescript-expert/references/typescript-cheatsheet.md +0 -383
- package/.agents/skills/typescript-expert/references/utility-types.ts +0 -335
- package/.agents/skills/typescript-expert/scripts/ts_diagnostic.py +0 -203
- package/.agents/skills/typescript-react-reviewer/SKILL.md +0 -201
- package/.agents/skills/typescript-react-reviewer/references/antipatterns.md +0 -510
- package/.agents/skills/typescript-react-reviewer/references/checklist.md +0 -267
- package/.agents/skills/typescript-react-reviewer/references/react19-patterns.md +0 -305
- package/.agents/skills/workflow-creator/SKILL.md +0 -553
- package/.agents/skills/workflow-creator/references/agent-sessions.md +0 -891
- package/.agents/skills/workflow-creator/references/agent-setup-recipe.md +0 -266
- package/.agents/skills/workflow-creator/references/computation-and-validation.md +0 -201
- package/.agents/skills/workflow-creator/references/control-flow.md +0 -470
- package/.agents/skills/workflow-creator/references/failure-modes.md +0 -1014
- package/.agents/skills/workflow-creator/references/getting-started.md +0 -392
- package/.agents/skills/workflow-creator/references/registry-and-validation.md +0 -141
- package/.agents/skills/workflow-creator/references/running-workflows.md +0 -418
- package/.agents/skills/workflow-creator/references/session-config.md +0 -431
- package/.agents/skills/workflow-creator/references/state-and-data-flow.md +0 -356
- package/.agents/skills/workflow-creator/references/user-input.md +0 -234
- package/.agents/skills/workflow-creator/references/workflow-inputs.md +0 -392
- package/.agents/skills/xlsx/LICENSE.txt +0 -30
- package/.agents/skills/xlsx/SKILL.md +0 -294
- package/.agents/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/xlsx/scripts/office/helpers/merge_runs.py +0 -199
- package/.agents/skills/xlsx/scripts/office/helpers/simplify_redlines.py +0 -197
- package/.agents/skills/xlsx/scripts/office/pack.py +0 -159
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agents/skills/xlsx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agents/skills/xlsx/scripts/office/soffice.py +0 -183
- package/.agents/skills/xlsx/scripts/office/unpack.py +0 -132
- package/.agents/skills/xlsx/scripts/office/validate.py +0 -111
- package/.agents/skills/xlsx/scripts/office/validators/__init__.py +0 -15
- package/.agents/skills/xlsx/scripts/office/validators/base.py +0 -847
- package/.agents/skills/xlsx/scripts/office/validators/docx.py +0 -446
- package/.agents/skills/xlsx/scripts/office/validators/pptx.py +0 -275
- package/.agents/skills/xlsx/scripts/office/validators/redlining.py +0 -247
- package/.agents/skills/xlsx/scripts/recalc.py +0 -184
- package/.claude/agents/code-simplifier.md +0 -52
- package/.claude/agents/codebase-analyzer.md +0 -166
- package/.claude/agents/codebase-locator.md +0 -122
- package/.claude/agents/codebase-online-researcher.md +0 -148
- package/.claude/agents/codebase-pattern-finder.md +0 -247
- package/.claude/agents/codebase-research-analyzer.md +0 -179
- package/.claude/agents/codebase-research-locator.md +0 -145
- package/.claude/agents/debugger.md +0 -91
- package/.claude/agents/orchestrator.md +0 -19
- package/.claude/agents/planner.md +0 -295
- package/.claude/agents/reviewer.md +0 -98
- package/.claude/agents/worker.md +0 -165
- package/.claude/settings.json +0 -27
- package/.github/agents/code-simplifier.md +0 -52
- package/.github/agents/codebase-analyzer.md +0 -166
- package/.github/agents/codebase-locator.md +0 -122
- package/.github/agents/codebase-online-researcher.md +0 -146
- package/.github/agents/codebase-pattern-finder.md +0 -247
- package/.github/agents/codebase-research-analyzer.md +0 -179
- package/.github/agents/codebase-research-locator.md +0 -145
- package/.github/agents/debugger.md +0 -98
- package/.github/agents/orchestrator.md +0 -27
- package/.github/agents/planner.md +0 -305
- package/.github/agents/reviewer.md +0 -95
- package/.github/agents/worker.md +0 -237
- package/.github/lsp.json +0 -93
- package/.mcp.json +0 -20
- package/.opencode/agents/code-simplifier.md +0 -62
- package/.opencode/agents/codebase-analyzer.md +0 -171
- package/.opencode/agents/codebase-locator.md +0 -127
- package/.opencode/agents/codebase-online-researcher.md +0 -152
- package/.opencode/agents/codebase-pattern-finder.md +0 -252
- package/.opencode/agents/codebase-research-analyzer.md +0 -183
- package/.opencode/agents/codebase-research-locator.md +0 -149
- package/.opencode/agents/debugger.md +0 -99
- package/.opencode/agents/orchestrator.md +0 -27
- package/.opencode/agents/planner.md +0 -309
- package/.opencode/agents/reviewer.md +0 -103
- package/.opencode/agents/worker.md +0 -165
- package/.opencode/opencode.json +0 -25
- package/README.md +0 -1624
- package/assets/settings.schema.json +0 -51
- package/dist/commands/cli/claude-inflight-hook.d.ts +0 -100
- package/dist/commands/cli/claude-inflight-hook.d.ts.map +0 -1
- package/dist/commands/cli/claude-stop-hook.d.ts +0 -80
- package/dist/commands/cli/claude-stop-hook.d.ts.map +0 -1
- package/dist/lib/atomic-temp.d.ts +0 -8
- package/dist/lib/atomic-temp.d.ts.map +0 -1
- package/dist/lib/path-root-guard.d.ts +0 -4
- package/dist/lib/path-root-guard.d.ts.map +0 -1
- package/dist/lib/spawn.d.ts +0 -102
- package/dist/lib/spawn.d.ts.map +0 -1
- package/dist/lib/terminal-env.d.ts +0 -9
- package/dist/lib/terminal-env.d.ts.map +0 -1
- package/dist/sdk/components/attached-statusline.d.ts +0 -26
- package/dist/sdk/components/attached-statusline.d.ts.map +0 -1
- package/dist/sdk/components/color-utils.d.ts +0 -4
- package/dist/sdk/components/color-utils.d.ts.map +0 -1
- package/dist/sdk/components/compact-switcher.d.ts +0 -10
- package/dist/sdk/components/compact-switcher.d.ts.map +0 -1
- package/dist/sdk/components/connectors.d.ts +0 -16
- package/dist/sdk/components/connectors.d.ts.map +0 -1
- package/dist/sdk/components/edge.d.ts +0 -4
- package/dist/sdk/components/edge.d.ts.map +0 -1
- package/dist/sdk/components/error-boundary.d.ts +0 -23
- package/dist/sdk/components/error-boundary.d.ts.map +0 -1
- package/dist/sdk/components/graph-theme.d.ts +0 -18
- package/dist/sdk/components/graph-theme.d.ts.map +0 -1
- package/dist/sdk/components/header.d.ts +0 -3
- package/dist/sdk/components/header.d.ts.map +0 -1
- package/dist/sdk/components/hooks.d.ts +0 -15
- package/dist/sdk/components/hooks.d.ts.map +0 -1
- package/dist/sdk/components/layout.d.ts +0 -27
- package/dist/sdk/components/layout.d.ts.map +0 -1
- package/dist/sdk/components/node-card.d.ts +0 -10
- package/dist/sdk/components/node-card.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts +0 -16
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-store.d.ts +0 -52
- package/dist/sdk/components/orchestrator-panel-store.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-types.d.ts +0 -18
- package/dist/sdk/components/orchestrator-panel-types.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel.d.ts +0 -86
- package/dist/sdk/components/orchestrator-panel.d.ts.map +0 -1
- package/dist/sdk/components/renderer-background.d.ts +0 -9
- package/dist/sdk/components/renderer-background.d.ts.map +0 -1
- package/dist/sdk/components/session-graph-panel.d.ts +0 -7
- package/dist/sdk/components/session-graph-panel.d.ts.map +0 -1
- package/dist/sdk/components/status-helpers.d.ts +0 -6
- package/dist/sdk/components/status-helpers.d.ts.map +0 -1
- package/dist/sdk/components/statusline.d.ts +0 -5
- package/dist/sdk/components/statusline.d.ts.map +0 -1
- package/dist/sdk/components/tui-diagnostics.d.ts +0 -56
- package/dist/sdk/components/tui-diagnostics.d.ts.map +0 -1
- package/dist/sdk/components/workflow-picker-panel.d.ts +0 -126
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +0 -1
- package/dist/sdk/define-workflow.d.ts +0 -107
- package/dist/sdk/define-workflow.d.ts.map +0 -1
- package/dist/sdk/errors.d.ts +0 -46
- package/dist/sdk/errors.d.ts.map +0 -1
- package/dist/sdk/index.d.ts +0 -26
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/primitives/inputs.d.ts +0 -36
- package/dist/sdk/primitives/inputs.d.ts.map +0 -1
- package/dist/sdk/primitives/metadata.d.ts +0 -40
- package/dist/sdk/primitives/metadata.d.ts.map +0 -1
- package/dist/sdk/primitives/run.d.ts +0 -57
- package/dist/sdk/primitives/run.d.ts.map +0 -1
- package/dist/sdk/primitives/sessions.d.ts +0 -128
- package/dist/sdk/primitives/sessions.d.ts.map +0 -1
- package/dist/sdk/providers/claude.d.ts +0 -392
- package/dist/sdk/providers/claude.d.ts.map +0 -1
- package/dist/sdk/providers/copilot.d.ts +0 -55
- package/dist/sdk/providers/copilot.d.ts.map +0 -1
- package/dist/sdk/providers/opencode.d.ts +0 -27
- package/dist/sdk/providers/opencode.d.ts.map +0 -1
- package/dist/sdk/registry.d.ts +0 -27
- package/dist/sdk/registry.d.ts.map +0 -1
- package/dist/sdk/runtime/attached-footer.d.ts +0 -31
- package/dist/sdk/runtime/attached-footer.d.ts.map +0 -1
- package/dist/sdk/runtime/cc-debounce.d.ts +0 -29
- package/dist/sdk/runtime/cc-debounce.d.ts.map +0 -1
- package/dist/sdk/runtime/executor-env.d.ts +0 -20
- package/dist/sdk/runtime/executor-env.d.ts.map +0 -1
- package/dist/sdk/runtime/executor.d.ts +0 -265
- package/dist/sdk/runtime/executor.d.ts.map +0 -1
- package/dist/sdk/runtime/graph-inference.d.ts +0 -35
- package/dist/sdk/runtime/graph-inference.d.ts.map +0 -1
- package/dist/sdk/runtime/orchestrator-entry.d.ts +0 -26
- package/dist/sdk/runtime/orchestrator-entry.d.ts.map +0 -1
- package/dist/sdk/runtime/panel.d.ts +0 -9
- package/dist/sdk/runtime/panel.d.ts.map +0 -1
- package/dist/sdk/runtime/port-discovery.d.ts +0 -71
- package/dist/sdk/runtime/port-discovery.d.ts.map +0 -1
- package/dist/sdk/runtime/status-writer.d.ts +0 -101
- package/dist/sdk/runtime/status-writer.d.ts.map +0 -1
- package/dist/sdk/runtime/theme.d.ts +0 -33
- package/dist/sdk/runtime/theme.d.ts.map +0 -1
- package/dist/sdk/runtime/tmux.d.ts +0 -307
- package/dist/sdk/runtime/tmux.d.ts.map +0 -1
- package/dist/sdk/runtime/version-compat.d.ts +0 -28
- package/dist/sdk/runtime/version-compat.d.ts.map +0 -1
- package/dist/sdk/types.d.ts +0 -435
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/worker-shared.d.ts +0 -42
- package/dist/sdk/worker-shared.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +0 -81
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +0 -37
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts +0 -43
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +0 -14
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +0 -136
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +0 -58
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts +0 -43
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +0 -37
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts +0 -68
- package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts +0 -56
- package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts +0 -72
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts +0 -46
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts +0 -32
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts +0 -33
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts +0 -106
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts +0 -50
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts +0 -12
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts +0 -58
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +0 -37
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +0 -34
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts +0 -25
- package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +0 -69
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +0 -266
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +0 -24
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +0 -33
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/index.d.ts +0 -32
- package/dist/sdk/workflows/index.d.ts.map +0 -1
- package/dist/services/config/additional-instructions.d.ts +0 -67
- package/dist/services/config/additional-instructions.d.ts.map +0 -1
- package/dist/services/config/atomic-config.d.ts +0 -42
- package/dist/services/config/atomic-config.d.ts.map +0 -1
- package/dist/services/config/definitions.d.ts +0 -52
- package/dist/services/config/definitions.d.ts.map +0 -1
- package/dist/services/config/index.d.ts +0 -7
- package/dist/services/config/index.d.ts.map +0 -1
- package/dist/services/config/scm-sync.d.ts +0 -37
- package/dist/services/config/scm-sync.d.ts.map +0 -1
- package/dist/services/config/settings-schema.d.ts +0 -2
- package/dist/services/config/settings-schema.d.ts.map +0 -1
- package/dist/services/system/copy.d.ts +0 -84
- package/dist/services/system/copy.d.ts.map +0 -1
- package/dist/services/system/detect.d.ts +0 -75
- package/dist/services/system/detect.d.ts.map +0 -1
- package/dist/theme/colors.d.ts +0 -35
- package/dist/theme/colors.d.ts.map +0 -1
- package/src/cli.ts +0 -397
- package/src/commands/builtin-registry.ts +0 -37
- package/src/commands/cli/chat/index.test.ts +0 -252
- package/src/commands/cli/chat/index.ts +0 -430
- package/src/commands/cli/chat.ts +0 -8
- package/src/commands/cli/claude-ask-hook.test.ts +0 -128
- package/src/commands/cli/claude-ask-hook.ts +0 -84
- package/src/commands/cli/claude-inflight-hook.test.ts +0 -598
- package/src/commands/cli/claude-inflight-hook.ts +0 -359
- package/src/commands/cli/claude-session-start-hook.ts +0 -61
- package/src/commands/cli/claude-stop-hook.test.ts +0 -317
- package/src/commands/cli/claude-stop-hook.ts +0 -441
- package/src/commands/cli/completions.ts +0 -24
- package/src/commands/cli/config.ts +0 -80
- package/src/commands/cli/footer.tsx +0 -248
- package/src/commands/cli/init/index.ts +0 -41
- package/src/commands/cli/init/onboarding.ts +0 -61
- package/src/commands/cli/init.ts +0 -8
- package/src/commands/cli/management-commands.ts +0 -112
- package/src/commands/cli/session.test.ts +0 -830
- package/src/commands/cli/session.ts +0 -447
- package/src/commands/cli/workflow-command.test.ts +0 -618
- package/src/commands/cli/workflow-inputs.test.ts +0 -353
- package/src/commands/cli/workflow-inputs.ts +0 -266
- package/src/commands/cli/workflow-list.test.ts +0 -235
- package/src/commands/cli/workflow-list.ts +0 -0
- package/src/commands/cli/workflow-status.test.ts +0 -451
- package/src/commands/cli/workflow-status.ts +0 -330
- package/src/commands/cli/workflow.ts +0 -196
- package/src/completions/bash.ts +0 -102
- package/src/completions/fish.ts +0 -136
- package/src/completions/index.ts +0 -7
- package/src/completions/powershell.ts +0 -195
- package/src/completions/zsh.ts +0 -150
- package/src/lib/atomic-temp.test.ts +0 -86
- package/src/lib/atomic-temp.ts +0 -62
- package/src/lib/common-ignore.ts +0 -46
- package/src/lib/merge.ts +0 -103
- package/src/lib/path-root-guard.ts +0 -38
- package/src/lib/spawn.test.ts +0 -109
- package/src/lib/spawn.ts +0 -678
- package/src/lib/terminal-env.test.ts +0 -343
- package/src/lib/terminal-env.ts +0 -100
- package/src/scripts/bump-version.ts +0 -94
- package/src/scripts/bundle-configs.ts +0 -116
- package/src/scripts/clean-dist.test.ts +0 -53
- package/src/scripts/clean-dist.ts +0 -37
- package/src/scripts/constants-base.ts +0 -14
- package/src/scripts/constants.ts +0 -35
- package/src/sdk/components/attached-statusline.tsx +0 -86
- package/src/sdk/components/color-utils.ts +0 -20
- package/src/sdk/components/compact-switcher.tsx +0 -78
- package/src/sdk/components/connectors.test.ts +0 -707
- package/src/sdk/components/connectors.ts +0 -160
- package/src/sdk/components/edge.tsx +0 -13
- package/src/sdk/components/error-boundary.tsx +0 -38
- package/src/sdk/components/graph-theme.ts +0 -37
- package/src/sdk/components/header.tsx +0 -85
- package/src/sdk/components/hooks.ts +0 -21
- package/src/sdk/components/layout.test.ts +0 -1245
- package/src/sdk/components/layout.ts +0 -223
- package/src/sdk/components/node-card.tsx +0 -91
- package/src/sdk/components/orchestrator-panel-contexts.ts +0 -35
- package/src/sdk/components/orchestrator-panel-store.test.ts +0 -847
- package/src/sdk/components/orchestrator-panel-store.ts +0 -187
- package/src/sdk/components/orchestrator-panel-types.ts +0 -23
- package/src/sdk/components/orchestrator-panel.tsx +0 -262
- package/src/sdk/components/renderer-background.ts +0 -49
- package/src/sdk/components/session-graph-panel.tsx +0 -471
- package/src/sdk/components/status-helpers.ts +0 -33
- package/src/sdk/components/statusline.tsx +0 -68
- package/src/sdk/components/tui-diagnostics.ts +0 -273
- package/src/sdk/components/workflow-picker-panel.tsx +0 -1613
- package/src/sdk/define-workflow.test.ts +0 -354
- package/src/sdk/define-workflow.ts +0 -275
- package/src/sdk/errors.test.ts +0 -83
- package/src/sdk/errors.ts +0 -77
- package/src/sdk/index.test.ts +0 -92
- package/src/sdk/index.ts +0 -101
- package/src/sdk/primitives/inputs.ts +0 -48
- package/src/sdk/primitives/metadata.ts +0 -63
- package/src/sdk/primitives/run.ts +0 -81
- package/src/sdk/primitives/sessions.test.ts +0 -594
- package/src/sdk/primitives/sessions.ts +0 -328
- package/src/sdk/providers/claude.ts +0 -1450
- package/src/sdk/providers/copilot.test.ts +0 -365
- package/src/sdk/providers/copilot.ts +0 -185
- package/src/sdk/providers/headless-hil-policy.test.ts +0 -211
- package/src/sdk/providers/opencode.ts +0 -88
- package/src/sdk/registry.ts +0 -132
- package/src/sdk/runtime/attached-footer.ts +0 -155
- package/src/sdk/runtime/cc-debounce.ts +0 -104
- package/src/sdk/runtime/executor-env.ts +0 -45
- package/src/sdk/runtime/executor.test.ts +0 -1321
- package/src/sdk/runtime/executor.ts +0 -2136
- package/src/sdk/runtime/graph-inference.ts +0 -50
- package/src/sdk/runtime/orchestrator-entry.ts +0 -110
- package/src/sdk/runtime/panel.tsx +0 -9
- package/src/sdk/runtime/port-discovery.test.ts +0 -573
- package/src/sdk/runtime/port-discovery.ts +0 -496
- package/src/sdk/runtime/status-writer.test.ts +0 -245
- package/src/sdk/runtime/status-writer.ts +0 -201
- package/src/sdk/runtime/theme.ts +0 -71
- package/src/sdk/runtime/tmux.conf +0 -112
- package/src/sdk/runtime/tmux.ts +0 -785
- package/src/sdk/runtime/version-compat.ts +0 -68
- package/src/sdk/types.ts +0 -548
- package/src/sdk/worker-shared.test.ts +0 -163
- package/src/sdk/worker-shared.ts +0 -155
- package/src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts +0 -569
- package/src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts +0 -481
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/batching.ts +0 -65
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.ts +0 -24
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/ignore-by-default.d.ts +0 -8
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.ts +0 -958
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scout.ts +0 -505
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.ts +0 -115
- package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +0 -530
- package/src/sdk/workflows/builtin/open-claude-design/claude/index.ts +0 -500
- package/src/sdk/workflows/builtin/open-claude-design/copilot/index.ts +0 -508
- package/src/sdk/workflows/builtin/open-claude-design/helpers/constants.ts +0 -159
- package/src/sdk/workflows/builtin/open-claude-design/helpers/design-system.ts +0 -88
- package/src/sdk/workflows/builtin/open-claude-design/helpers/export.ts +0 -193
- package/src/sdk/workflows/builtin/open-claude-design/helpers/import.ts +0 -52
- package/src/sdk/workflows/builtin/open-claude-design/helpers/prompts.ts +0 -1110
- package/src/sdk/workflows/builtin/open-claude-design/helpers/scan.ts +0 -117
- package/src/sdk/workflows/builtin/open-claude-design/helpers/validation.ts +0 -38
- package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +0 -610
- package/src/sdk/workflows/builtin/ralph/claude/index.ts +0 -272
- package/src/sdk/workflows/builtin/ralph/copilot/index.ts +0 -298
- package/src/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.ts +0 -105
- package/src/sdk/workflows/builtin/ralph/helpers/git.ts +0 -201
- package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +0 -1108
- package/src/sdk/workflows/builtin/ralph/helpers/review.ts +0 -33
- package/src/sdk/workflows/builtin/ralph/opencode/index.ts +0 -290
- package/src/sdk/workflows/index.ts +0 -116
- package/src/services/config/additional-instructions.ts +0 -273
- package/src/services/config/atomic-config.ts +0 -210
- package/src/services/config/atomic-global-config.ts +0 -348
- package/src/services/config/config-path.ts +0 -19
- package/src/services/config/definitions.ts +0 -125
- package/src/services/config/index.ts +0 -7
- package/src/services/config/scm-sync.ts +0 -185
- package/src/services/config/settings-schema.ts +0 -2
- package/src/services/config/settings.ts +0 -144
- package/src/services/system/agents.ts +0 -95
- package/src/services/system/auth.test.ts +0 -343
- package/src/services/system/auth.ts +0 -140
- package/src/services/system/auto-sync.ts +0 -128
- package/src/services/system/copy.ts +0 -392
- package/src/services/system/detect.ts +0 -161
- package/src/services/system/file-lock.ts +0 -289
- package/src/services/system/install-ui.ts +0 -296
- package/src/services/system/skills.ts +0 -58
- package/src/theme/colors.ts +0 -96
- package/src/theme/logo.ts +0 -123
- package/src/version.ts +0 -7
|
@@ -1,1108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ralph Prompt Utilities
|
|
3
|
-
*
|
|
4
|
-
* Prompts used by the Ralph plan → orchestrate → review loop:
|
|
5
|
-
* - buildPlannerPrompt: initial planning OR re-planning from reviewer findings
|
|
6
|
-
* - buildOrchestratorPrompt: spawn workers to execute the task list
|
|
7
|
-
* - buildInfraDiscoveryPrompts: prompts for parallel sub-agent infrastructure discovery
|
|
8
|
-
* - buildReviewPrompt: structured code review with injected changeset + discovery context
|
|
9
|
-
*
|
|
10
|
-
* Plus Zod schemas for structured output, parsing helpers for the reviewer
|
|
11
|
-
* JSON output, and {@link formatReviewForReplan} which renders the merged
|
|
12
|
-
* reviewer output as the markdown brief consumed by the next planner
|
|
13
|
-
* iteration.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { z } from "zod";
|
|
17
|
-
|
|
18
|
-
// ============================================================================
|
|
19
|
-
// RESPONSE STYLE (token reduction)
|
|
20
|
-
// ============================================================================
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Caveman response-style directive injected into every Ralph prompt.
|
|
24
|
-
*
|
|
25
|
-
* Goal: shrink free-form prose across many loop iterations to cut tokens
|
|
26
|
-
* without dropping technical substance. Carve-outs preserve every
|
|
27
|
-
* machine-consumed contract (schemas, headers, enums, tool args, code).
|
|
28
|
-
*
|
|
29
|
-
* Placement: appended via {@link withCaveman} so each builder's strict
|
|
30
|
-
* output-format block remains the final instruction the model reads.
|
|
31
|
-
*/
|
|
32
|
-
export const CAVEMAN_INSTRUCTION = `## Response Style — Terse Caveman
|
|
33
|
-
|
|
34
|
-
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
35
|
-
|
|
36
|
-
### Persistence
|
|
37
|
-
ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure.
|
|
38
|
-
|
|
39
|
-
### Rules
|
|
40
|
-
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.
|
|
41
|
-
|
|
42
|
-
Pattern: \`[thing] [action] [reason]. [next step].\`
|
|
43
|
-
|
|
44
|
-
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
45
|
-
Yes: "Bug in auth middleware. Token expiry check use \`<\` not \`<=\`. Fix:"
|
|
46
|
-
|
|
47
|
-
### Intensity
|
|
48
|
-
Drop articles, fragments OK, short synonyms.
|
|
49
|
-
|
|
50
|
-
Example — "Why React component re-render?"
|
|
51
|
-
"New object ref each render. Inline object prop = new ref = re-render. Wrap in \`useMemo\`."
|
|
52
|
-
|
|
53
|
-
Example — "Explain database connection pooling."
|
|
54
|
-
"Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
|
|
55
|
-
|
|
56
|
-
### Auto-Clarity
|
|
57
|
-
Drop caveman for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after clear part done.
|
|
58
|
-
|
|
59
|
-
Example — destructive op:
|
|
60
|
-
> **Warning:** This will permanently delete all rows in the \`users\` table and cannot be undone.
|
|
61
|
-
> \`\`\`sql
|
|
62
|
-
> DROP TABLE users;
|
|
63
|
-
> \`\`\`
|
|
64
|
-
> Caveman resume. Verify backup exist first.
|
|
65
|
-
|
|
66
|
-
### Boundaries — caveman MUST NOT touch
|
|
67
|
-
Caveman compresses free-form prose only. Leave the following exactly as the prompt or schema specifies:
|
|
68
|
-
|
|
69
|
-
- Code blocks, commit messages, PR descriptions: write normal.
|
|
70
|
-
- Exact enum / literal strings the schema or prompt specifies (e.g. \`"patch is correct"\`, \`"patch is incorrect"\`, task statuses \`pending\` / \`in_progress\` / \`completed\` / \`error\`).
|
|
71
|
-
- Required section headers and template scaffolding (e.g. \`# Debugger Report\`, \`## Issues Identified\`, RFC section names) — verbatim.
|
|
72
|
-
- Tool names, tool arguments, JSON keys, schema field names.
|
|
73
|
-
- File paths, URLs, command invocations, error text quoted from tools.
|
|
74
|
-
- SQL, JSON, Markdown templates: compress prose inside, never the structure.
|
|
75
|
-
- Task titles / descriptions persisted via task-management tools: keep them self-contained and unambiguous.
|
|
76
|
-
- When the prompt says output ONLY a path / ONLY a fenced block / ONLY a JSON payload, obey that exactly — caveman does not override output contracts.`;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Append the caveman style directive after the prompt body but BEFORE any
|
|
80
|
-
* trailing strict output-format / schema instructions in the caller. Each
|
|
81
|
-
* builder positions the marker so the format contract remains last.
|
|
82
|
-
*/
|
|
83
|
-
function withCaveman(prompt: string): string {
|
|
84
|
-
return `${prompt}\n\n${CAVEMAN_INSTRUCTION}`;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// ============================================================================
|
|
88
|
-
// STRUCTURED OUTPUT SCHEMAS
|
|
89
|
-
// ============================================================================
|
|
90
|
-
|
|
91
|
-
/** Zod schema for a single review finding. */
|
|
92
|
-
export const ReviewFindingSchema = z.object({
|
|
93
|
-
title: z
|
|
94
|
-
.string()
|
|
95
|
-
.describe(
|
|
96
|
-
"Brief title prefixed with priority, e.g. '[P0] Missing null check'",
|
|
97
|
-
),
|
|
98
|
-
body: z
|
|
99
|
-
.string()
|
|
100
|
-
.describe(
|
|
101
|
-
"Detailed explanation of the issue, its impact, and a suggested fix",
|
|
102
|
-
),
|
|
103
|
-
confidence_score: z
|
|
104
|
-
.number()
|
|
105
|
-
.min(0)
|
|
106
|
-
.max(1)
|
|
107
|
-
.optional()
|
|
108
|
-
.describe("Confidence in the finding (0.0–1.0)"),
|
|
109
|
-
priority: z
|
|
110
|
-
.number()
|
|
111
|
-
.int()
|
|
112
|
-
.min(0)
|
|
113
|
-
.max(3)
|
|
114
|
-
.optional()
|
|
115
|
-
.describe(
|
|
116
|
-
"Severity: 0=P0 critical, 1=P1 important, 2=P2 moderate, 3=P3 minor",
|
|
117
|
-
),
|
|
118
|
-
code_location: z
|
|
119
|
-
.object({
|
|
120
|
-
file_path: z
|
|
121
|
-
.string()
|
|
122
|
-
.describe("Repo-relative path to the file containing the issue"),
|
|
123
|
-
line_range: z.object({
|
|
124
|
-
start: z.number().int().describe("Start line number"),
|
|
125
|
-
end: z.number().int().describe("End line number"),
|
|
126
|
-
}),
|
|
127
|
-
})
|
|
128
|
-
.optional()
|
|
129
|
-
.describe("Location of the issue in the codebase"),
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
/** Zod schema for the full structured review output. */
|
|
133
|
-
export const ReviewResultSchema = z.object({
|
|
134
|
-
findings: z
|
|
135
|
-
.array(ReviewFindingSchema)
|
|
136
|
-
.describe("List of review findings, ordered by priority"),
|
|
137
|
-
overall_correctness: z
|
|
138
|
-
.enum(["patch is correct", "patch is incorrect"])
|
|
139
|
-
.describe(
|
|
140
|
-
"Exact literal: 'patch is correct' or 'patch is incorrect'. No paraphrase.",
|
|
141
|
-
),
|
|
142
|
-
overall_explanation: z
|
|
143
|
-
.string()
|
|
144
|
-
.describe("Summary of overall quality and correctness"),
|
|
145
|
-
overall_confidence_score: z
|
|
146
|
-
.number()
|
|
147
|
-
.min(0)
|
|
148
|
-
.max(1)
|
|
149
|
-
.optional()
|
|
150
|
-
.describe("Overall confidence in the review (0.0–1.0)"),
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* JSON Schema derived from the Zod schema — used by Claude and OpenCode SDKs.
|
|
155
|
-
*
|
|
156
|
-
* `target: "openapi-3.0"` drops the `$schema` draft URL that Zod stamps
|
|
157
|
-
* by default. The Claude Agent SDK's validator silently drops
|
|
158
|
-
* `structured_output` when that metadata field is present, so we emit
|
|
159
|
-
* the OpenAPI-flavoured variant which matches the hand-written shape in
|
|
160
|
-
* the SDK's structured-output guide.
|
|
161
|
-
*/
|
|
162
|
-
export const REVIEW_RESULT_JSON_SCHEMA = z.toJSONSchema(ReviewResultSchema, {
|
|
163
|
-
target: "openapi-3.0",
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
/** Result from a reviewer stage with structured output support. */
|
|
167
|
-
export interface StructuredReviewResult {
|
|
168
|
-
/** Parsed and filtered review from SDK structured output, or null if unavailable */
|
|
169
|
-
structured: ReviewResult | null;
|
|
170
|
-
/** Raw text output for fallback parsing and debugger input */
|
|
171
|
-
raw: string;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Merge two parallel reviewer results into one.
|
|
176
|
-
*
|
|
177
|
-
* Each SDK enforces {@link ReviewResultSchema} at the provider level (Claude
|
|
178
|
-
* `outputFormat`, OpenCode `format: json_schema`, Copilot `defineTool`), so a
|
|
179
|
-
* non-null `structured` is already a validated {@link ReviewResult}. When
|
|
180
|
-
* either reviewer failed to produce validated output we propagate `null` —
|
|
181
|
-
* {@link hasActionableFindings} then treats the raw response as actionable so
|
|
182
|
-
* the loop keeps iterating instead of silently exiting on a missing reviewer.
|
|
183
|
-
*/
|
|
184
|
-
export function mergeReviewResults(
|
|
185
|
-
a: StructuredReviewResult,
|
|
186
|
-
b: StructuredReviewResult,
|
|
187
|
-
): StructuredReviewResult {
|
|
188
|
-
const rawCombined = [a.raw, b.raw].filter(Boolean).join("\n\n---\n\n");
|
|
189
|
-
|
|
190
|
-
// Conservative: any missing structured output → propagate null. Fabricating
|
|
191
|
-
// a "patch is correct" default here is how the loop previously exited after
|
|
192
|
-
// a single iteration when one reviewer's output failed SDK validation.
|
|
193
|
-
if (!a.structured || !b.structured) {
|
|
194
|
-
return { structured: null, raw: rawCombined };
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const isIncorrect =
|
|
198
|
-
a.structured.overall_correctness === "patch is incorrect" ||
|
|
199
|
-
b.structured.overall_correctness === "patch is incorrect";
|
|
200
|
-
|
|
201
|
-
const explanations = [
|
|
202
|
-
a.structured.overall_explanation,
|
|
203
|
-
b.structured.overall_explanation,
|
|
204
|
-
].filter((e): e is string => typeof e === "string" && e.length > 0);
|
|
205
|
-
|
|
206
|
-
const confidences = [
|
|
207
|
-
a.structured.overall_confidence_score,
|
|
208
|
-
b.structured.overall_confidence_score,
|
|
209
|
-
].filter((c): c is number => c !== undefined);
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
structured: {
|
|
213
|
-
findings: [...a.structured.findings, ...b.structured.findings],
|
|
214
|
-
overall_correctness: isIncorrect
|
|
215
|
-
? "patch is incorrect"
|
|
216
|
-
: "patch is correct",
|
|
217
|
-
overall_explanation: explanations.join(" | "),
|
|
218
|
-
overall_confidence_score:
|
|
219
|
-
confidences.length > 0 ? Math.max(...confidences) : undefined,
|
|
220
|
-
},
|
|
221
|
-
raw: rawCombined,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// ============================================================================
|
|
226
|
-
// PLANNER
|
|
227
|
-
// ============================================================================
|
|
228
|
-
|
|
229
|
-
export interface PlannerContext {
|
|
230
|
-
/** 1-indexed loop iteration. Iteration 1 = initial plan; >1 = re-plan. */
|
|
231
|
-
iteration: number;
|
|
232
|
-
/**
|
|
233
|
-
* Markdown rendering of the previous iteration's merged reviewer
|
|
234
|
-
* findings. Produced by {@link formatReviewForReplan}. The planner is
|
|
235
|
-
* responsible for validating, deduping, and clustering findings into
|
|
236
|
-
* shared root causes before revising the RFC — there is no separate
|
|
237
|
-
* debugger stage.
|
|
238
|
-
*/
|
|
239
|
-
reviewReport?: string;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Build the planner prompt. The first iteration authors an RFC from the
|
|
244
|
-
* original spec; subsequent iterations revise the RFC using the merged
|
|
245
|
-
* reviewer findings from the previous loop iteration.
|
|
246
|
-
*
|
|
247
|
-
* The planner's deliverable is a filled-in Technical Design Document / RFC
|
|
248
|
-
* rendered as markdown text; the orchestrator consumes the RFC as design
|
|
249
|
-
* context.
|
|
250
|
-
*/
|
|
251
|
-
export function buildPlannerPrompt(
|
|
252
|
-
spec: string,
|
|
253
|
-
context: PlannerContext = { iteration: 1 },
|
|
254
|
-
): string {
|
|
255
|
-
const reviewReport = context.reviewReport?.trim() ?? "";
|
|
256
|
-
const isReplan = context.iteration > 1 && reviewReport.length > 0;
|
|
257
|
-
|
|
258
|
-
const header = isReplan
|
|
259
|
-
? `# Technical Design Revision (Iteration ${context.iteration})
|
|
260
|
-
|
|
261
|
-
The previous iteration's implementation was flagged by the reviewer.
|
|
262
|
-
Investigate the findings, identify shared root causes, and revise the RFC
|
|
263
|
-
so it reflects the corrected approach.`
|
|
264
|
-
: `# Technical Design (Iteration 1)
|
|
265
|
-
|
|
266
|
-
Author a Technical Design Document / RFC for the specification below.`;
|
|
267
|
-
|
|
268
|
-
const specBlock = `## Original Specification
|
|
269
|
-
|
|
270
|
-
<specification>
|
|
271
|
-
${spec}
|
|
272
|
-
</specification>`;
|
|
273
|
-
|
|
274
|
-
const reviewBlock = isReplan
|
|
275
|
-
? `
|
|
276
|
-
|
|
277
|
-
## Reviewer Findings (previous iteration)
|
|
278
|
-
|
|
279
|
-
<reviewer_findings>
|
|
280
|
-
${reviewReport}
|
|
281
|
-
</reviewer_findings>
|
|
282
|
-
|
|
283
|
-
### Triage Before Revising
|
|
284
|
-
|
|
285
|
-
The findings above are reviewer hypotheses, not root causes. Before touching
|
|
286
|
-
the RFC:
|
|
287
|
-
|
|
288
|
-
1. **Validate** — for each finding, Read the cited file/lines (Grep/Glob/LSP)
|
|
289
|
-
and confirm the issue exists. Drop findings that are stale or wrong.
|
|
290
|
-
2. **Dedupe & cluster** — group findings that share a file, module, or
|
|
291
|
-
underlying defect. Multiple symptoms often share one root cause.
|
|
292
|
-
3. **Root-cause** — for each cluster, identify the underlying defect (not
|
|
293
|
-
the symptom). Note files that must change and any invariants the next
|
|
294
|
-
workers must respect.
|
|
295
|
-
|
|
296
|
-
### Revision Focus
|
|
297
|
-
|
|
298
|
-
Fold the validated, clustered root causes into the RFC:
|
|
299
|
-
|
|
300
|
-
- **Section 5 (Detailed Design)** — specify the corrected approach. Each
|
|
301
|
-
root cause should map to a concrete design change.
|
|
302
|
-
- **Section 6 (Alternatives Considered)** — if a root cause points to a
|
|
303
|
-
better option than the one previously chosen, promote it and demote the
|
|
304
|
-
current choice to "rejected" with the new rejection reason.
|
|
305
|
-
- **Section 8 (Migration, Rollout, and Testing)** — add validation steps
|
|
306
|
-
(tests, lint rules, type checks) that would have caught the regression.
|
|
307
|
-
- **Section 9 (Open Questions / Unresolved Issues)** — surface any
|
|
308
|
-
uncertainty triage left unresolved.`
|
|
309
|
-
: "";
|
|
310
|
-
|
|
311
|
-
return withCaveman(`${header}
|
|
312
|
-
|
|
313
|
-
${specBlock}${reviewBlock}
|
|
314
|
-
|
|
315
|
-
${
|
|
316
|
-
isReplan
|
|
317
|
-
? `## Step 1: Author a Revised RFC
|
|
318
|
-
|
|
319
|
-
This is a re-plan iteration — the validated, clustered findings above MUST
|
|
320
|
-
be folded into the design. Always author a revised RFC here, even if the
|
|
321
|
-
original specification was a file path. If the spec is a path, Read the
|
|
322
|
-
file first to get the original design, then produce a revised RFC that
|
|
323
|
-
incorporates the corrected approach. Do NOT short-circuit to just the path
|
|
324
|
-
on re-plan.`
|
|
325
|
-
: `## Step 1: Spec Path Short-Circuit (do this FIRST)
|
|
326
|
-
|
|
327
|
-
The specification above may be either a **file path** to an existing spec
|
|
328
|
-
document, or **raw prose** describing a feature.
|
|
329
|
-
|
|
330
|
-
Before doing anything else, determine which case you're in:
|
|
331
|
-
|
|
332
|
-
- If the specification looks like a path (ends in \`.md\`, \`.txt\`, \`.rst\`,
|
|
333
|
-
or similar; starts with \`/\`, \`./\`, or \`~/\`; or contains \`/\` and no
|
|
334
|
-
line breaks), attempt to Read it.
|
|
335
|
-
- If the Read succeeds, the user has already authored a spec file — there is
|
|
336
|
-
**nothing to draft**. Resolve the path to an absolute path (via Bash
|
|
337
|
-
\`realpath <path>\` or equivalent) and output ONLY that absolute path as
|
|
338
|
-
your final message. Emit nothing else: no RFC, no summary, no commentary.
|
|
339
|
-
The orchestrator will read the file itself.
|
|
340
|
-
- If Read fails, or the specification is clearly inline prose (multiple
|
|
341
|
-
sentences, paragraph structure, no file extension), proceed to Step 2 and
|
|
342
|
-
author the full RFC below.
|
|
343
|
-
|
|
344
|
-
Do NOT author an RFC when the user has already provided a spec file — just
|
|
345
|
-
forward the path. Duplicating the spec wastes tokens and introduces drift.`
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
## Step 2: Author the RFC${isReplan ? " (revision)" : " (only if Step 1 did not short-circuit)"}
|
|
349
|
-
|
|
350
|
-
1. **Investigate first.** Use Grep/Glob/Read to ground the RFC in the actual
|
|
351
|
-
codebase — the services, modules, data models, and external integrations
|
|
352
|
-
this feature will touch. Use Bash for metadata:
|
|
353
|
-
- \`git config user.name\` → Author(s)
|
|
354
|
-
- \`date '+%Y-%m-%d'\` → Created / Last Updated
|
|
355
|
-
2. **Render the RFC template below as your final message.** Preserve every
|
|
356
|
-
section header verbatim and the metadata table exactly. Replace each
|
|
357
|
-
\`_Instruction:_\` italicized block and each \`> **Example:**\` blockquote
|
|
358
|
-
with real, feature-specific content — the templates are authoring guides,
|
|
359
|
-
not final copy.
|
|
360
|
-
3. **Diagrams are load-bearing.** Section 4.1 MUST include a Mermaid System
|
|
361
|
-
Architecture diagram grounded in the real components this feature touches.
|
|
362
|
-
4. **Non-goals matter.** Section 3.2 prevents scope creep. Always fill it in
|
|
363
|
-
with explicit exclusions — do not leave it generic.
|
|
364
|
-
5. **Alternatives must be real.** Section 6 must list at least two concrete
|
|
365
|
-
alternatives (not strawmen) with honest pros, cons, and rejection reasons.
|
|
366
|
-
6. **Surface uncertainty.** Put unresolved decisions in Section 9 with an
|
|
367
|
-
owner placeholder (e.g., \`[OWNER: infra team]\`) — do not paper over gaps
|
|
368
|
-
with vague language.
|
|
369
|
-
|
|
370
|
-
## Constraints
|
|
371
|
-
|
|
372
|
-
- Output nothing else after the RFC (or path) — no meta-commentary, no
|
|
373
|
-
summary. The document (or path) stands on its own.
|
|
374
|
-
- Match depth to stakes: a greenfield service warrants deep sections 5-7; a
|
|
375
|
-
small refactor can abbreviate them, but every section header must be present.`);
|
|
376
|
-
}
|
|
377
|
-
// ============================================================================
|
|
378
|
-
// ORCHESTRATOR
|
|
379
|
-
// ============================================================================
|
|
380
|
-
|
|
381
|
-
export interface OrchestratorContext {
|
|
382
|
-
/**
|
|
383
|
-
* The planner's final assistant message. Under the RFC-based Ralph flow,
|
|
384
|
-
* this is the authoritative design input — either an absolute path to a
|
|
385
|
-
* pre-existing spec file or an inline RFC markdown document. The
|
|
386
|
-
* orchestrator decomposes it into the task list using its SDK-specific
|
|
387
|
-
* task-persistence tool (`TaskCreate` / `sql` / `todowrite`).
|
|
388
|
-
*/
|
|
389
|
-
plannerNotes?: string;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Build the orchestrator prompt. The orchestrator decomposes the planner's
|
|
394
|
-
* design output (a spec path or inline RFC) into a task list using its
|
|
395
|
-
* SDK-specific task-persistence tool, validates the dependency graph, and
|
|
396
|
-
* spawns parallel workers.
|
|
397
|
-
*
|
|
398
|
-
* @param spec - The user's original specification. Used as context/fallback
|
|
399
|
-
* when the planner output is missing or ambiguous.
|
|
400
|
-
* @param context - Planner handoff (the spec path or RFC markdown).
|
|
401
|
-
*/
|
|
402
|
-
export function buildOrchestratorPrompt(
|
|
403
|
-
spec: string,
|
|
404
|
-
context: OrchestratorContext = {},
|
|
405
|
-
): string {
|
|
406
|
-
const plannerNotes = context.plannerNotes?.trim() ?? "";
|
|
407
|
-
const plannerSection =
|
|
408
|
-
plannerNotes.length > 0
|
|
409
|
-
? `<planner_output>
|
|
410
|
-
${plannerNotes}
|
|
411
|
-
</planner_output>`
|
|
412
|
-
: `<planner_output>
|
|
413
|
-
(empty — fall back to the Original User Specification below)
|
|
414
|
-
</planner_output>`;
|
|
415
|
-
|
|
416
|
-
return withCaveman(`You are the workflow orchestrator. You run a three-phase loop:
|
|
417
|
-
|
|
418
|
-
1. **Decompose** the design document into a task list.
|
|
419
|
-
2. **Execute** the tasks by spawning parallel worker sub-agents.
|
|
420
|
-
3. **Report** completion status.
|
|
421
|
-
|
|
422
|
-
## Design Input (authoritative)
|
|
423
|
-
|
|
424
|
-
The planner produced the output below. It is in **one of two formats**:
|
|
425
|
-
- **A file path** (single line, ends in \`.md\`/\`.txt\`/similar, or starts
|
|
426
|
-
with \`/\` / \`./\` / \`~/\`). Read the file to get the spec — its contents
|
|
427
|
-
are what you decompose.
|
|
428
|
-
- **An inline RFC markdown document** (multi-section, starts with a metadata
|
|
429
|
-
table or \`# ... Technical Design Document\` header). Decompose it directly.
|
|
430
|
-
|
|
431
|
-
${plannerSection}
|
|
432
|
-
|
|
433
|
-
## Original User Specification (context / fallback)
|
|
434
|
-
|
|
435
|
-
<specification>
|
|
436
|
-
${spec}
|
|
437
|
-
</specification>
|
|
438
|
-
|
|
439
|
-
## Phase 1: Decompose the Spec into a Task List
|
|
440
|
-
|
|
441
|
-
Read the spec (from the path or the inline RFC) and decompose it into an
|
|
442
|
-
ordered, parallelism-friendly list of implementation tasks. For each task,
|
|
443
|
-
derive:
|
|
444
|
-
|
|
445
|
-
- A short **gerund subject** (e.g., "Implementing auth middleware").
|
|
446
|
-
- An **actionable description** (5-10 words, imperative, specific).
|
|
447
|
-
- A **blockedBy / dependency list** (IDs of tasks that must complete first).
|
|
448
|
-
|
|
449
|
-
**Decomposition guidelines:**
|
|
450
|
-
|
|
451
|
-
1. **Maximize parallelism.** Tasks with empty dependencies form the first
|
|
452
|
-
wave and run concurrently. Split independent work streams into separate
|
|
453
|
-
tasks rather than chaining them.
|
|
454
|
-
2. **Compartmentalize.** Each task should be self-contained — minimize
|
|
455
|
-
shared state and file conflicts. Prefer tasks that touch distinct
|
|
456
|
-
modules/files.
|
|
457
|
-
3. **Dependencies only when truly necessary.** Every unnecessary dependency
|
|
458
|
-
reduces throughput. Ask: "Can this genuinely not start without the
|
|
459
|
-
blocked task?"
|
|
460
|
-
4. **Start with foundations.** Setup, schema, and shared utilities come
|
|
461
|
-
before feature code. Tests come after the code they cover.
|
|
462
|
-
5. **Match sections to task categories.** RFC Section 5 (Detailed Design)
|
|
463
|
-
typically yields 60-80% of tasks. Sections 8.3 (Test Plan) and 7
|
|
464
|
-
(Cross-Cutting) yield validation and infra tasks.
|
|
465
|
-
|
|
466
|
-
### Persist the Task List
|
|
467
|
-
|
|
468
|
-
Persist every task using task management tools and encode dependencies. Use your task tools to better manage the status of tasks and mark tasks as complete when their work is done.
|
|
469
|
-
|
|
470
|
-
## Phase 2: Dependency Graph Integrity Check
|
|
471
|
-
|
|
472
|
-
BEFORE executing any tasks, validate the graph you just persisted:
|
|
473
|
-
|
|
474
|
-
1. For each task, check that every dependency reference points to a task ID
|
|
475
|
-
that actually exists.
|
|
476
|
-
2. Any reference to a non-existent task ID is a **dangling dependency** —
|
|
477
|
-
drop it. The task itself is still valid; only the corrupted reference
|
|
478
|
-
is removed.
|
|
479
|
-
3. Re-evaluate readiness after cleanup.
|
|
480
|
-
|
|
481
|
-
This step is critical. Dangling dependencies will permanently block tasks.
|
|
482
|
-
|
|
483
|
-
## Phase 3: Execute
|
|
484
|
-
|
|
485
|
-
### Readiness Rules
|
|
486
|
-
|
|
487
|
-
A task is READY only when:
|
|
488
|
-
1. Its status is \`pending\`.
|
|
489
|
-
2. ALL tasks it depends on are \`completed\`.
|
|
490
|
-
|
|
491
|
-
Do NOT spawn a worker for a task whose dependencies are not yet completed.
|
|
492
|
-
|
|
493
|
-
### Execution Loop
|
|
494
|
-
|
|
495
|
-
1. **Identify all ready tasks** — pending tasks whose dependencies are
|
|
496
|
-
completed.
|
|
497
|
-
2. **Spawn parallel workers** — for each ready task, dispatch a worker
|
|
498
|
-
sub-agent (via \`Agent\`/\`Task\`/\`agent\` tool) with a focused prompt
|
|
499
|
-
containing: the task subject + description, relevant context from the
|
|
500
|
-
spec/RFC, and instructions to implement and test.
|
|
501
|
-
3. **Monitor completions** — as workers finish, mark tasks \`completed\` and
|
|
502
|
-
spawn newly-unblocked tasks IMMEDIATELY.
|
|
503
|
-
4. **Continue until ALL tasks are \`completed\` or \`error\`.** Do NOT stop
|
|
504
|
-
early.
|
|
505
|
-
5. **Report a summary** when finished: each task and its final status.
|
|
506
|
-
|
|
507
|
-
Spawn ALL ready tasks in parallel — do not serialize when multiple are
|
|
508
|
-
ready simultaneously.
|
|
509
|
-
|
|
510
|
-
## Error Handling
|
|
511
|
-
|
|
512
|
-
When a worker task FAILS:
|
|
513
|
-
|
|
514
|
-
1. **Diagnose** the error.
|
|
515
|
-
2. **Retry with fix**: spawn a new worker with the error context included.
|
|
516
|
-
3. **Retry limit**: up to 3 retries per task. After that, mark it \`error\`.
|
|
517
|
-
4. **Continue regardless**: do NOT stop. Execute all other unblocked tasks.
|
|
518
|
-
5. **Unblocked tasks proceed**: only direct dependents of an \`error\` task
|
|
519
|
-
should be skipped.
|
|
520
|
-
|
|
521
|
-
NEVER mark tasks "blocked-by-failure" and stop. Complete as much work as
|
|
522
|
-
possible.
|
|
523
|
-
|
|
524
|
-
## Task Status Protocol
|
|
525
|
-
|
|
526
|
-
Update statuses **immediately** at every transition via task tool.
|
|
527
|
-
|
|
528
|
-
### Required update sequence per task
|
|
529
|
-
|
|
530
|
-
1. **IMMEDIATELY BEFORE spawning** a worker → mark \`in_progress\`.
|
|
531
|
-
2. **IMMEDIATELY AFTER** the worker returns → mark \`completed\` or
|
|
532
|
-
\`error\`.
|
|
533
|
-
|
|
534
|
-
### Timing rules
|
|
535
|
-
|
|
536
|
-
- Update status in the same turn as the triggering event. Never batch.
|
|
537
|
-
- When multiple workers complete in parallel, issue a SEPARATE update per
|
|
538
|
-
task.
|
|
539
|
-
- Mark previous tasks \`completed\` before marking new ones
|
|
540
|
-
\`in_progress\`.
|
|
541
|
-
|
|
542
|
-
## Worker Sub-Agent Response Style
|
|
543
|
-
|
|
544
|
-
When you spawn a worker via \`Agent\` / \`Task\` / \`agent\`, append this exact
|
|
545
|
-
clause to its prompt so the worker inherits the terse style:
|
|
546
|
-
|
|
547
|
-
> Respond terse like smart caveman. Drop articles, filler, pleasantries,
|
|
548
|
-
> hedging. Fragments OK. Technical terms exact. Code blocks unchanged.
|
|
549
|
-
> Errors quoted exact. Never compress: tool names, tool args, file paths,
|
|
550
|
-
> commit messages, code, exact enum/literal strings, schema field names,
|
|
551
|
-
> required section headers, task titles persisted to task tools.
|
|
552
|
-
|
|
553
|
-
Do NOT compress the worker's task subject, description, or persisted task
|
|
554
|
-
records — those must remain self-contained and unambiguous.`);
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
// ============================================================================
|
|
558
|
-
// CODE SIMPLIFIER
|
|
559
|
-
// ============================================================================
|
|
560
|
-
|
|
561
|
-
export interface CodeSimplifierContext {
|
|
562
|
-
/** Optional planner output (RFC markdown or absolute path to spec). */
|
|
563
|
-
plannerNotes?: string;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Build the code-simplifier prompt. Run by the `code-simplifier` sub-agent
|
|
568
|
-
* to inspect only the orchestrator's changes on the current branch and
|
|
569
|
-
* refine them for clarity, consistency, and maintainability — without
|
|
570
|
-
* altering functionality or test behaviour.
|
|
571
|
-
*
|
|
572
|
-
* @param spec - The user's original specification, used as context/fallback
|
|
573
|
-
* when planner output is missing or ambiguous.
|
|
574
|
-
* @param context - Optional planner handoff (spec path or inline RFC markdown).
|
|
575
|
-
*/
|
|
576
|
-
export function buildCodeSimplifierPrompt(
|
|
577
|
-
spec: string,
|
|
578
|
-
context: CodeSimplifierContext = {},
|
|
579
|
-
): string {
|
|
580
|
-
const plannerNotes = context.plannerNotes?.trim() ?? "";
|
|
581
|
-
const plannerSection =
|
|
582
|
-
plannerNotes.length > 0
|
|
583
|
-
? `<planner_output>
|
|
584
|
-
${plannerNotes}
|
|
585
|
-
</planner_output>`
|
|
586
|
-
: `<planner_output>
|
|
587
|
-
(empty — fall back to the Original User Specification below)
|
|
588
|
-
</planner_output>`;
|
|
589
|
-
|
|
590
|
-
return withCaveman(`Inspect the orchestrator's changes on the current branch and simplify the implementation for clarity, consistency, and maintainability.
|
|
591
|
-
|
|
592
|
-
## Design Input (authoritative)
|
|
593
|
-
|
|
594
|
-
${plannerSection}
|
|
595
|
-
|
|
596
|
-
## Original User Specification (context / fallback)
|
|
597
|
-
|
|
598
|
-
<specification>
|
|
599
|
-
${spec}
|
|
600
|
-
</specification>
|
|
601
|
-
|
|
602
|
-
## Instructions
|
|
603
|
-
|
|
604
|
-
1. **Scope to branch changes only.** Run \`git diff\` and \`git status\` to identify every file the orchestrator touched. Do NOT modify files outside that set.
|
|
605
|
-
2. **Simplify and refine.** Within the changed files, improve clarity, consistency, naming, and structure. Remove dead code, unnecessary comments, and redundant abstractions. Prefer simple, direct implementations.
|
|
606
|
-
3. **Preserve all functionality and test behaviour.** No feature regressions, no removed tests, no altered public interfaces unless the change is strictly cosmetic (e.g. rename of an internal variable).
|
|
607
|
-
4. **Keep changes minimal and focused.** No scope creep. Do not rewrite working code that is already clear. Touch only what genuinely benefits from simplification.
|
|
608
|
-
5. **Verify after edits.** Run \`bun typecheck\` and \`bun lint\` from the repository root after all edits are complete. Fix any errors they surface before finishing.`);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
// ============================================================================
|
|
612
|
-
// INFRASTRUCTURE DISCOVERY
|
|
613
|
-
// ============================================================================
|
|
614
|
-
|
|
615
|
-
/** Prompts for the three parallel infrastructure-discovery sub-agents. */
|
|
616
|
-
export interface InfraDiscoveryPrompts {
|
|
617
|
-
/** Prompt for the codebase-locator sub-agent. */
|
|
618
|
-
locator: string;
|
|
619
|
-
/** Prompt for the codebase-analyzer sub-agent. */
|
|
620
|
-
analyzer: string;
|
|
621
|
-
/** Prompt for the codebase-pattern-finder sub-agent. */
|
|
622
|
-
patternFinder: string;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Build prompts for three parallel sub-agent stages that discover the
|
|
627
|
-
* repository's build, test, lint, and CI infrastructure. Each sub-agent
|
|
628
|
-
* explores the codebase dynamically — no hard-coded file lists or patterns.
|
|
629
|
-
*
|
|
630
|
-
* Inspired by the deep-research-codebase workflow which dispatches
|
|
631
|
-
* codebase-locator, codebase-analyzer, and codebase-pattern-finder
|
|
632
|
-
* sub-agents in parallel for exploratory research.
|
|
633
|
-
*/
|
|
634
|
-
export function buildInfraDiscoveryPrompts(): InfraDiscoveryPrompts {
|
|
635
|
-
return {
|
|
636
|
-
locator: withCaveman(`# Locate Build & Test Infrastructure Files
|
|
637
|
-
|
|
638
|
-
Find ALL files in this repository that define or configure the build, test,
|
|
639
|
-
lint, type-check, and CI/CD infrastructure. Report their paths and a
|
|
640
|
-
one-line description of each.
|
|
641
|
-
|
|
642
|
-
## What to look for
|
|
643
|
-
|
|
644
|
-
- **Package manifest**: package.json, Cargo.toml, go.mod, pyproject.toml, etc.
|
|
645
|
-
- **Lockfiles**: bun.lockb, bun.lock, package-lock.json, yarn.lock, pnpm-lock.yaml, etc.
|
|
646
|
-
- **Build config**: tsconfig.json, webpack.config.*, vite.config.*, esbuild.*, rollup.config.*, Makefile, etc.
|
|
647
|
-
- **Test config**: jest.config.*, vitest.config.*, playwright.config.*, .mocharc.*, pytest.ini, etc.
|
|
648
|
-
- **Lint / format config**: .eslintrc.*, eslint.config.*, biome.json, .prettierrc.*, oxlint.json, etc.
|
|
649
|
-
- **CI/CD workflows (REQUIRED)**: .github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile, .circleci/config.yml, azure-pipelines.yml, etc. List every workflow file separately — reviewers need full coverage.
|
|
650
|
-
- **Agent config files**: CLAUDE.md, AGENTS.md, .claude/*, .github/copilot-instructions.md (these often document project commands)
|
|
651
|
-
|
|
652
|
-
## Output format
|
|
653
|
-
|
|
654
|
-
Respond with a flat list:
|
|
655
|
-
|
|
656
|
-
\`\`\`
|
|
657
|
-
<path> — <one-line description>
|
|
658
|
-
\`\`\`
|
|
659
|
-
|
|
660
|
-
Be exhaustive. Do NOT skip files just because they seem minor — CI configs
|
|
661
|
-
and agent instruction files often contain the authoritative command list.
|
|
662
|
-
End with a brief trailing summary (1-2 sentences) of what you found.`),
|
|
663
|
-
|
|
664
|
-
analyzer: withCaveman(`# Analyze Build & Test Infrastructure
|
|
665
|
-
|
|
666
|
-
Examine this repository's build, test, lint, and type-check infrastructure.
|
|
667
|
-
Your goal is to produce a concise reference that tells a reviewer exactly
|
|
668
|
-
which commands to run to verify an implementation.
|
|
669
|
-
|
|
670
|
-
## Investigation steps
|
|
671
|
-
|
|
672
|
-
1. Read the package manifest (package.json, Cargo.toml, go.mod, etc.) and
|
|
673
|
-
list every script/target related to building, testing, linting,
|
|
674
|
-
type-checking, or formatting.
|
|
675
|
-
2. Identify the package manager (bun, npm, yarn, pnpm, cargo, go, make)
|
|
676
|
-
from lockfiles or config.
|
|
677
|
-
3. Read CI workflow files (.github/workflows/*.yml, etc.) and extract the
|
|
678
|
-
key \`run:\` commands — these are the authoritative "what CI actually
|
|
679
|
-
executes" list.
|
|
680
|
-
4. Read CLAUDE.md / AGENTS.md if present — they often document the
|
|
681
|
-
canonical commands for contributors.
|
|
682
|
-
5. **Audit CI workflows.** When the \`gh\` CLI is available (check via \`command -v gh\`), run:
|
|
683
|
-
- \`gh workflow list\` to enumerate active workflows.
|
|
684
|
-
- \`gh run list --limit 5\` to see the most recent runs and their statuses.
|
|
685
|
-
- \`gh workflow view <name>\` for any workflow whose name suggests it gates merges.
|
|
686
|
-
When \`gh\` is unavailable or unauthenticated, fall back to reading the workflow YAML files directly. Capture: workflow names, triggers (push / pull_request / schedule / workflow_dispatch), job names, the exact \`run:\` commands per job, and recent run statuses.
|
|
687
|
-
6. Identify the test framework(s) in use and how to invoke them.
|
|
688
|
-
|
|
689
|
-
## Output format
|
|
690
|
-
|
|
691
|
-
\`\`\`
|
|
692
|
-
## Package Manager
|
|
693
|
-
<name>
|
|
694
|
-
|
|
695
|
-
## Build Commands
|
|
696
|
-
- \`<command>\` — <what it does>
|
|
697
|
-
|
|
698
|
-
## Test Commands
|
|
699
|
-
- \`<command>\` — <what it does>
|
|
700
|
-
|
|
701
|
-
## Lint / Type-check Commands
|
|
702
|
-
- \`<command>\` — <what it does>
|
|
703
|
-
|
|
704
|
-
## CI Commands (from workflow files)
|
|
705
|
-
- \`<command>\` — <source file and context>
|
|
706
|
-
|
|
707
|
-
## CI / GitHub Actions
|
|
708
|
-
- Workflow: \`<name>\` — triggers: \`<push|pr|schedule|...>\` — jobs: \`<job names>\`
|
|
709
|
-
- Recent runs (when \`gh\` available): \`<conclusion>\` on \`<branch>\` (\`<run id>\`)
|
|
710
|
-
\`\`\`
|
|
711
|
-
|
|
712
|
-
Be specific — include the exact invocation string (e.g. \`bun test\`, not
|
|
713
|
-
just "run tests"). If a command has variants (e.g. test:unit, test:e2e),
|
|
714
|
-
list each separately. End with a brief trailing summary.`),
|
|
715
|
-
|
|
716
|
-
patternFinder: withCaveman(`# Find Build & Test Patterns
|
|
717
|
-
|
|
718
|
-
Search this repository for existing patterns that show how code is built,
|
|
719
|
-
tested, and validated. A reviewer needs to know not just WHAT commands exist,
|
|
720
|
-
but HOW they are used in practice.
|
|
721
|
-
|
|
722
|
-
## What to find
|
|
723
|
-
|
|
724
|
-
1. **Test file patterns**: Where do tests live? What naming convention
|
|
725
|
-
(*.test.ts, *.spec.ts, *_test.go, etc.)? Show 2-3 example paths.
|
|
726
|
-
2. **Test execution patterns**: How are tests actually run? Find examples in
|
|
727
|
-
CI configs, scripts, or documentation. Note any environment variables or
|
|
728
|
-
flags that are standard (e.g. CLAUDECODE=1, --coverage).
|
|
729
|
-
3. **Build patterns**: How is the project built? Is there a multi-step build
|
|
730
|
-
(e.g. codegen → compile → bundle)? What order matters?
|
|
731
|
-
4. **Quality gate patterns**: What checks gate a merge? Look at CI workflows,
|
|
732
|
-
pre-commit hooks, and PR check configurations. List the commands in the
|
|
733
|
-
order CI runs them.
|
|
734
|
-
5. **Dependency install pattern**: How are dependencies installed before
|
|
735
|
-
build/test (e.g. \`bun install\`, \`npm ci\`)?
|
|
736
|
-
6. **CI audit patterns**: Map out the CI structure so reviewers can audit it. Identify matrix builds, job dependencies (\`needs:\`), conditional runs (\`if:\`), required checks, and which jobs gate merges. When \`gh\` is available, surface example commands a reviewer could use:
|
|
737
|
-
- \`gh run view <id> --log-failed\` — inspect a failed run.
|
|
738
|
-
- \`gh pr checks\` — see check status on the current PR.
|
|
739
|
-
- \`gh workflow view <name> --yaml\` — view the canonical workflow definition.
|
|
740
|
-
|
|
741
|
-
## Output format
|
|
742
|
-
|
|
743
|
-
For each pattern found, report:
|
|
744
|
-
- The pattern name
|
|
745
|
-
- The concrete command or file path
|
|
746
|
-
- A brief explanation of when/how it's used
|
|
747
|
-
|
|
748
|
-
End with a brief trailing summary of the overall build/test workflow order
|
|
749
|
-
(e.g. "install → typecheck → lint → test → build"). Also summarise CI workflow order: which workflows fire on what triggers, in what order jobs run within each.`),
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
// ============================================================================
|
|
754
|
-
// REVIEWER
|
|
755
|
-
// ============================================================================
|
|
756
|
-
|
|
757
|
-
/** A single finding from the reviewer sub-agent. */
|
|
758
|
-
export interface ReviewFinding {
|
|
759
|
-
title: string;
|
|
760
|
-
body: string;
|
|
761
|
-
confidence_score?: number;
|
|
762
|
-
priority?: number;
|
|
763
|
-
code_location?: {
|
|
764
|
-
file_path: string;
|
|
765
|
-
line_range: { start: number; end: number };
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
/** Parsed reviewer JSON output. */
|
|
770
|
-
export interface ReviewResult {
|
|
771
|
-
findings: ReviewFinding[];
|
|
772
|
-
overall_correctness: string;
|
|
773
|
-
overall_explanation: string;
|
|
774
|
-
overall_confidence_score?: number;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
export interface ReviewContext {
|
|
778
|
-
/**
|
|
779
|
-
* Full branch changeset captured by {@link captureBranchChangeset}.
|
|
780
|
-
* Contains diff stat, name-status, and uncommitted changes relative to
|
|
781
|
-
* the parent branch — giving the reviewer complete visibility into every
|
|
782
|
-
* change this branch introduces.
|
|
783
|
-
*/
|
|
784
|
-
changeset: {
|
|
785
|
-
baseBranch: string;
|
|
786
|
-
diffStat: string;
|
|
787
|
-
uncommitted: string;
|
|
788
|
-
nameStatus: string;
|
|
789
|
-
errors: string[];
|
|
790
|
-
};
|
|
791
|
-
/** 1-indexed loop iteration, used in the prompt header. */
|
|
792
|
-
iteration?: number;
|
|
793
|
-
/**
|
|
794
|
-
* When true, instructs the reviewer to call the `submit_review` tool
|
|
795
|
-
* instead of outputting JSON directly. Used by the Copilot SDK which
|
|
796
|
-
* achieves structured output through tool definitions.
|
|
797
|
-
*/
|
|
798
|
-
useSubmitTool?: boolean;
|
|
799
|
-
/**
|
|
800
|
-
* Raw output from the parallel infrastructure-discovery sub-agents
|
|
801
|
-
* (codebase-locator, codebase-analyzer, codebase-pattern-finder).
|
|
802
|
-
* When present, the reviewer uses this to identify and run the
|
|
803
|
-
* repository's build/test/lint commands as part of verification.
|
|
804
|
-
*/
|
|
805
|
-
discoveryContext?: string;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Build the reviewer prompt. Injects a deterministic branch-relative
|
|
810
|
-
* changeset so the reviewer sees every file this branch has touched —
|
|
811
|
-
* both committed and uncommitted — without expensive tool calls.
|
|
812
|
-
*/
|
|
813
|
-
export function buildReviewPrompt(
|
|
814
|
-
spec: string,
|
|
815
|
-
context: ReviewContext,
|
|
816
|
-
): string {
|
|
817
|
-
const { changeset } = context;
|
|
818
|
-
const hasChanges =
|
|
819
|
-
changeset.diffStat.length > 0 || changeset.uncommitted.length > 0;
|
|
820
|
-
const hasErrors = changeset.errors.length > 0;
|
|
821
|
-
|
|
822
|
-
// ── Changeset section ──────────────────────────────────────────────────
|
|
823
|
-
|
|
824
|
-
let changesetSection: string;
|
|
825
|
-
|
|
826
|
-
if (hasChanges || hasErrors) {
|
|
827
|
-
const parts: string[] = [];
|
|
828
|
-
|
|
829
|
-
parts.push(`## Branch Changeset (relative to \`${changeset.baseBranch}\`)`);
|
|
830
|
-
|
|
831
|
-
// Surface git errors first — the agent needs to know the data is partial
|
|
832
|
-
if (hasErrors) {
|
|
833
|
-
parts.push(
|
|
834
|
-
"",
|
|
835
|
-
"### Git Errors",
|
|
836
|
-
"",
|
|
837
|
-
"The following git commands failed during changeset capture. The data",
|
|
838
|
-
"below may be **incomplete**. You should re-run the failed commands",
|
|
839
|
-
"yourself to get the full picture, or flag the gap as a finding.",
|
|
840
|
-
"",
|
|
841
|
-
...changeset.errors.map((e) => `- ${e}`),
|
|
842
|
-
);
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
if (hasChanges) {
|
|
846
|
-
parts.push(
|
|
847
|
-
"",
|
|
848
|
-
"The following shows every change this branch introduces — both committed",
|
|
849
|
-
"and uncommitted. Use this to scope your review. Read the actual file",
|
|
850
|
-
"contents for any file that warrants closer inspection.",
|
|
851
|
-
);
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
if (changeset.nameStatus.length > 0) {
|
|
855
|
-
parts.push(
|
|
856
|
-
"",
|
|
857
|
-
"### Changed Files",
|
|
858
|
-
"",
|
|
859
|
-
"```",
|
|
860
|
-
changeset.nameStatus,
|
|
861
|
-
"```",
|
|
862
|
-
);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
if (changeset.diffStat.length > 0) {
|
|
866
|
-
parts.push("", "### Diff Summary", "", "```", changeset.diffStat, "```");
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
if (changeset.uncommitted.length > 0) {
|
|
870
|
-
parts.push(
|
|
871
|
-
"",
|
|
872
|
-
"### Uncommitted Changes (`git status -s`)",
|
|
873
|
-
"",
|
|
874
|
-
"These changes are in the working tree but not yet committed:",
|
|
875
|
-
"",
|
|
876
|
-
"```",
|
|
877
|
-
changeset.uncommitted,
|
|
878
|
-
"```",
|
|
879
|
-
);
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
changesetSection = parts.join("\n");
|
|
883
|
-
} else {
|
|
884
|
-
changesetSection = `## Branch Changeset (relative to \`${changeset.baseBranch}\`)
|
|
885
|
-
|
|
886
|
-
No changes detected relative to \`${changeset.baseBranch}\`. Either nothing
|
|
887
|
-
was implemented, all changes were reverted, or you are already on the base
|
|
888
|
-
branch. Cross-check the task list to verify whether the implementation ran.`;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// ── Header ─────────────────────────────────────────────────────────────
|
|
892
|
-
|
|
893
|
-
const header = context.iteration
|
|
894
|
-
? `# Code Review Request (Iteration ${context.iteration})`
|
|
895
|
-
: "# Code Review Request";
|
|
896
|
-
|
|
897
|
-
// ── Output instructions ────────────────────────────────────────────────
|
|
898
|
-
|
|
899
|
-
const outputSection = context.useSubmitTool
|
|
900
|
-
? `## Output
|
|
901
|
-
|
|
902
|
-
You MUST submit your review by calling the \`submit_review\` tool exactly
|
|
903
|
-
once with your complete structured review. Do NOT output the review as
|
|
904
|
-
plain text — the tool enforces the required schema.`
|
|
905
|
-
: `## Output
|
|
906
|
-
|
|
907
|
-
Your review output is captured via structured output. The schema is enforced
|
|
908
|
-
by the SDK — focus on providing accurate, well-reasoned data for each field.`;
|
|
909
|
-
|
|
910
|
-
// ── Discovery context section ────────────────────────────────────────────
|
|
911
|
-
|
|
912
|
-
const discoverySection = context.discoveryContext
|
|
913
|
-
? `## Build & Test Infrastructure Discovery
|
|
914
|
-
|
|
915
|
-
Three sub-agents explored this repository's build, test, lint, and CI
|
|
916
|
-
infrastructure. Their findings are below. Use them to identify the exact
|
|
917
|
-
commands you must run to verify the implementation.
|
|
918
|
-
|
|
919
|
-
${context.discoveryContext}
|
|
920
|
-
`
|
|
921
|
-
: "";
|
|
922
|
-
|
|
923
|
-
// ── Full prompt ────────────────────────────────────────────────────────
|
|
924
|
-
|
|
925
|
-
return `${header}
|
|
926
|
-
|
|
927
|
-
## Original Specification
|
|
928
|
-
|
|
929
|
-
<user_request>
|
|
930
|
-
${spec}
|
|
931
|
-
</user_request>
|
|
932
|
-
|
|
933
|
-
${changesetSection}
|
|
934
|
-
|
|
935
|
-
${discoverySection}## Project Conventions
|
|
936
|
-
|
|
937
|
-
Use the repository's \`AGENTS.md\` and/or \`CLAUDE.md\` files (if present) for
|
|
938
|
-
guidance on style, conventions, testing expectations, and architectural
|
|
939
|
-
patterns. Your review should respect these project-level norms — flag
|
|
940
|
-
deviations only when they conflict with correctness or security, not personal
|
|
941
|
-
preference.
|
|
942
|
-
|
|
943
|
-
## Retrieve Task List
|
|
944
|
-
|
|
945
|
-
Call \`TaskList\` to fetch the current task plan and statuses. Use it to:
|
|
946
|
-
1. Identify completed vs incomplete tasks.
|
|
947
|
-
2. Cross-reference the plan against the specification.
|
|
948
|
-
3. Calculate completion metrics.
|
|
949
|
-
|
|
950
|
-
## Verification Step
|
|
951
|
-
|
|
952
|
-
**Before writing any findings**, run the build, test, lint, and type-check
|
|
953
|
-
commands identified in the "Build & Test Infrastructure Discovery" section
|
|
954
|
-
above. Execute them via Bash from the repository root. Run ALL commands even
|
|
955
|
-
if earlier ones fail — the goal is a complete picture.
|
|
956
|
-
|
|
957
|
-
- Build failures and type errors → P0 finding.
|
|
958
|
-
- Test failures → P1 finding.
|
|
959
|
-
- Lint violations → P1 finding.
|
|
960
|
-
|
|
961
|
-
Include the exact command, exit status, and relevant error output in each
|
|
962
|
-
finding's body. If no discovery section is present, attempt to discover
|
|
963
|
-
commands yourself by reading package.json, CI configs, or CLAUDE.md.
|
|
964
|
-
|
|
965
|
-
## Review Focus Areas (priority order)
|
|
966
|
-
|
|
967
|
-
1. **Task Completion & Specification Gap Analysis** — HIGHEST priority. Every
|
|
968
|
-
task in PENDING / IN_PROGRESS / ERROR status MUST become a P0 finding.
|
|
969
|
-
Every spec requirement not covered by any task is a P0 finding. Do NOT
|
|
970
|
-
mark the patch correct if any task is incomplete.
|
|
971
|
-
2. **Verification Failures** — Any build, test, lint, or type-check command
|
|
972
|
-
that failed during the verification step above is a P0 or P1 finding.
|
|
973
|
-
Reference the specific command and error output.
|
|
974
|
-
3. **Correctness of Logic** — does the code implement the requirements?
|
|
975
|
-
4. **Error Handling & Edge Cases** — boundary, empty/null, error paths.
|
|
976
|
-
5. **Security** — injection, secret leakage, auth bypasses.
|
|
977
|
-
6. **Performance** — obvious resource leaks, N+1, hot loops.
|
|
978
|
-
7. **Test Coverage** — critical paths and edge cases tested.
|
|
979
|
-
|
|
980
|
-
## Review Guidelines
|
|
981
|
-
|
|
982
|
-
- Be **constructive and helpful** in your feedback. Every finding should
|
|
983
|
-
include a clear explanation of the impact and a concrete suggested fix.
|
|
984
|
-
- Avoid nitpicks (P3) unless they affect readability or maintainability in
|
|
985
|
-
a significant way. The review loop filters out P3 findings.
|
|
986
|
-
- When in doubt, give the implementation the benefit of the doubt — flag
|
|
987
|
-
genuine issues, not stylistic preferences.
|
|
988
|
-
|
|
989
|
-
${outputSection}
|
|
990
|
-
|
|
991
|
-
### Field Guidance
|
|
992
|
-
|
|
993
|
-
- **findings**: Each finding should have:
|
|
994
|
-
- \`title\`: Prefix with priority level, e.g. "[P0] Missing null check"
|
|
995
|
-
- \`body\`: What's wrong, why it matters, and how to fix it
|
|
996
|
-
- \`priority\`: 0 = P0 critical, 1 = P1 important, 2 = P2 moderate, 3 = P3 minor
|
|
997
|
-
- \`confidence_score\`: 0.0 – 1.0, how confident you are this is a real issue
|
|
998
|
-
- \`code_location\`: repo-relative file path and line range (when applicable)
|
|
999
|
-
|
|
1000
|
-
- **overall_correctness**: Set to \`"patch is incorrect"\` whenever there is at
|
|
1001
|
-
least one P0 or P1 finding (including incomplete tasks). Use
|
|
1002
|
-
\`"patch is correct"\` only when findings are empty or strictly P2/P3.
|
|
1003
|
-
|
|
1004
|
-
- **overall_explanation**: Summary of overall quality, correctness, and any
|
|
1005
|
-
patterns observed.
|
|
1006
|
-
|
|
1007
|
-
Begin your review now.`;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
// ============================================================================
|
|
1011
|
-
// PARSING & RE-PLAN HELPERS
|
|
1012
|
-
// ============================================================================
|
|
1013
|
-
|
|
1014
|
-
export function filterActionable(parsed: {
|
|
1015
|
-
findings: ReviewFinding[];
|
|
1016
|
-
overall_correctness: string;
|
|
1017
|
-
overall_explanation?: string;
|
|
1018
|
-
overall_confidence_score?: number;
|
|
1019
|
-
}): ReviewResult {
|
|
1020
|
-
const actionable = parsed.findings.filter(
|
|
1021
|
-
(f) => f.priority === undefined || f.priority <= 2,
|
|
1022
|
-
);
|
|
1023
|
-
return {
|
|
1024
|
-
findings: actionable,
|
|
1025
|
-
overall_correctness: parsed.overall_correctness,
|
|
1026
|
-
overall_explanation: parsed.overall_explanation ?? "",
|
|
1027
|
-
overall_confidence_score: parsed.overall_confidence_score,
|
|
1028
|
-
};
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
/**
|
|
1032
|
-
* Render the merged reviewer result as the markdown brief consumed by the
|
|
1033
|
-
* next iteration's planner.
|
|
1034
|
-
*
|
|
1035
|
-
* Findings are grouped by file path so the planner sees clusters of related
|
|
1036
|
-
* symptoms together (often a hint at a shared root cause). Within each
|
|
1037
|
-
* group findings are ordered by ascending priority (P0 first). The
|
|
1038
|
-
* `overall_explanation` is included verbatim so the planner has the
|
|
1039
|
-
* reviewers' overall narrative.
|
|
1040
|
-
*
|
|
1041
|
-
* When `parsed === null` (SDK validation failed) the raw transcript is
|
|
1042
|
-
* surfaced inside a clearly-labelled fenced block so the planner knows the
|
|
1043
|
-
* data is unstructured and must be investigated rather than trusted.
|
|
1044
|
-
*/
|
|
1045
|
-
export function formatReviewForReplan(
|
|
1046
|
-
parsed: ReviewResult | null,
|
|
1047
|
-
rawText: string,
|
|
1048
|
-
): string {
|
|
1049
|
-
if (parsed === null) {
|
|
1050
|
-
const trimmed = rawText.trim();
|
|
1051
|
-
if (trimmed.length === 0) {
|
|
1052
|
-
return "(no reviewer output captured — investigate the previous iteration's branch state directly)";
|
|
1053
|
-
}
|
|
1054
|
-
return `## Unparseable Reviewer Output
|
|
1055
|
-
|
|
1056
|
-
The reviewer's structured output failed schema validation. Raw transcript
|
|
1057
|
-
below — investigate the branch state to determine what (if anything) needs
|
|
1058
|
-
revision.
|
|
1059
|
-
|
|
1060
|
-
\`\`\`
|
|
1061
|
-
${trimmed}
|
|
1062
|
-
\`\`\``;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
if (parsed.findings.length === 0) {
|
|
1066
|
-
return `## Reviewer Verdict
|
|
1067
|
-
|
|
1068
|
-
${parsed.overall_explanation || "No actionable findings, but the reviewers did not sign off."}`;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
// Group by file path so clusters of related symptoms surface together.
|
|
1072
|
-
const groups = new Map<string, ReviewFinding[]>();
|
|
1073
|
-
for (const f of parsed.findings) {
|
|
1074
|
-
const key = f.code_location?.file_path ?? "(unspecified location)";
|
|
1075
|
-
const bucket = groups.get(key) ?? [];
|
|
1076
|
-
bucket.push(f);
|
|
1077
|
-
groups.set(key, bucket);
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
const sections: string[] = [];
|
|
1081
|
-
|
|
1082
|
-
if (parsed.overall_explanation && parsed.overall_explanation.length > 0) {
|
|
1083
|
-
sections.push(`## Reviewer Summary\n\n${parsed.overall_explanation}`);
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
sections.push(`## Findings (${parsed.findings.length}, grouped by file)`);
|
|
1087
|
-
|
|
1088
|
-
const sortedFiles = Array.from(groups.keys()).sort();
|
|
1089
|
-
for (const filePath of sortedFiles) {
|
|
1090
|
-
const findings = (groups.get(filePath) ?? []).slice().sort(
|
|
1091
|
-
(a, b) => (a.priority ?? 3) - (b.priority ?? 3),
|
|
1092
|
-
);
|
|
1093
|
-
const lines: string[] = [`### \`${filePath}\``];
|
|
1094
|
-
for (const f of findings) {
|
|
1095
|
-
const pri = f.priority !== undefined ? `P${f.priority}` : "P2";
|
|
1096
|
-
const range = f.code_location
|
|
1097
|
-
? `:${f.code_location.line_range.start}-${f.code_location.line_range.end}`
|
|
1098
|
-
: "";
|
|
1099
|
-
lines.push(
|
|
1100
|
-
`- **[${pri}] ${f.title}**${range ? ` (lines${range})` : ""}`,
|
|
1101
|
-
` ${f.body.replace(/\n/g, "\n ")}`,
|
|
1102
|
-
);
|
|
1103
|
-
}
|
|
1104
|
-
sections.push(lines.join("\n"));
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
return sections.join("\n\n");
|
|
1108
|
-
}
|