@bastani/atomic 0.5.11-0 → 0.5.12-0
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/.agents/skills/adapt/SKILL.md +199 -0
- package/.agents/skills/advanced-evaluation/SKILL.md +402 -0
- package/.agents/skills/advanced-evaluation/references/bias-mitigation.md +288 -0
- package/.agents/skills/advanced-evaluation/references/evaluation-pipeline.md +43 -0
- package/.agents/skills/advanced-evaluation/references/implementation-patterns.md +315 -0
- package/.agents/skills/advanced-evaluation/references/metrics-guide.md +331 -0
- package/.agents/skills/advanced-evaluation/scripts/evaluation_example.py +392 -0
- package/.agents/skills/animate/SKILL.md +175 -0
- package/.agents/skills/arrange/SKILL.md +124 -0
- package/.agents/skills/audit/SKILL.md +148 -0
- package/.agents/skills/bdi-mental-states/SKILL.md +311 -0
- package/.agents/skills/bdi-mental-states/references/bdi-ontology-core.md +207 -0
- package/.agents/skills/bdi-mental-states/references/framework-integration.md +582 -0
- package/.agents/skills/bdi-mental-states/references/rdf-examples.md +315 -0
- package/.agents/skills/bdi-mental-states/references/sparql-competency.md +420 -0
- package/.agents/skills/bolder/SKILL.md +117 -0
- package/.agents/skills/bun/SKILL.md +199 -0
- package/.agents/skills/clarify/SKILL.md +183 -0
- package/.agents/skills/colorize/SKILL.md +143 -0
- package/.agents/skills/context-compression/SKILL.md +272 -0
- package/.agents/skills/context-compression/references/evaluation-framework.md +213 -0
- package/.agents/skills/context-compression/scripts/compression_evaluator.py +862 -0
- package/.agents/skills/context-compression/tests/test_compression_evaluator.py +56 -0
- package/.agents/skills/context-degradation/SKILL.md +206 -0
- package/.agents/skills/context-degradation/references/patterns.md +314 -0
- package/.agents/skills/context-degradation/scripts/degradation_detector.py +614 -0
- package/.agents/skills/context-fundamentals/SKILL.md +201 -0
- package/.agents/skills/context-fundamentals/references/context-components.md +283 -0
- package/.agents/skills/context-fundamentals/scripts/context_manager.py +533 -0
- package/.agents/skills/context-optimization/SKILL.md +195 -0
- package/.agents/skills/context-optimization/references/optimization_techniques.md +272 -0
- package/.agents/skills/context-optimization/scripts/compaction.py +562 -0
- package/.agents/skills/create-spec/SKILL.md +244 -0
- package/.agents/skills/critique/SKILL.md +225 -0
- package/.agents/skills/critique/reference/cognitive-load.md +106 -0
- package/.agents/skills/critique/reference/heuristics-scoring.md +234 -0
- package/.agents/skills/critique/reference/personas.md +178 -0
- package/.agents/skills/delight/SKILL.md +304 -0
- package/.agents/skills/distill/SKILL.md +122 -0
- package/.agents/skills/docx/LICENSE.txt +30 -0
- package/.agents/skills/docx/SKILL.md +590 -0
- package/.agents/skills/docx/scripts/__init__.py +1 -0
- package/.agents/skills/docx/scripts/accept_changes.py +135 -0
- package/.agents/skills/docx/scripts/comment.py +318 -0
- package/.agents/skills/docx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/docx/scripts/office/helpers/merge_runs.py +199 -0
- package/.agents/skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/.agents/skills/docx/scripts/office/pack.py +159 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.agents/skills/docx/scripts/office/soffice.py +183 -0
- package/.agents/skills/docx/scripts/office/unpack.py +132 -0
- package/.agents/skills/docx/scripts/office/validate.py +111 -0
- package/.agents/skills/docx/scripts/office/validators/__init__.py +15 -0
- package/.agents/skills/docx/scripts/office/validators/base.py +847 -0
- package/.agents/skills/docx/scripts/office/validators/docx.py +446 -0
- package/.agents/skills/docx/scripts/office/validators/pptx.py +275 -0
- package/.agents/skills/docx/scripts/office/validators/redlining.py +247 -0
- package/.agents/skills/docx/scripts/templates/comments.xml +3 -0
- package/.agents/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/.agents/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/.agents/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/.agents/skills/docx/scripts/templates/people.xml +3 -0
- package/.agents/skills/evaluation/SKILL.md +251 -0
- package/.agents/skills/evaluation/references/metrics.md +339 -0
- package/.agents/skills/evaluation/scripts/evaluator.py +627 -0
- package/.agents/skills/explain-code/SKILL.md +230 -0
- package/.agents/skills/extract/SKILL.md +91 -0
- package/.agents/skills/filesystem-context/SKILL.md +287 -0
- package/.agents/skills/filesystem-context/references/implementation-patterns.md +549 -0
- package/.agents/skills/filesystem-context/scripts/filesystem_context.py +425 -0
- package/.agents/skills/find-skills/SKILL.md +142 -0
- package/.agents/skills/frontend-design/SKILL.md +147 -0
- package/.agents/skills/frontend-design/reference/color-and-contrast.md +132 -0
- package/.agents/skills/frontend-design/reference/interaction-design.md +195 -0
- package/.agents/skills/frontend-design/reference/motion-design.md +99 -0
- package/.agents/skills/frontend-design/reference/responsive-design.md +114 -0
- package/.agents/skills/frontend-design/reference/spatial-design.md +100 -0
- package/.agents/skills/frontend-design/reference/typography.md +133 -0
- package/.agents/skills/frontend-design/reference/ux-writing.md +107 -0
- package/.agents/skills/gh-commit/SKILL.md +243 -0
- package/.agents/skills/gh-create-pr/SKILL.md +93 -0
- package/.agents/skills/harden/SKILL.md +354 -0
- package/.agents/skills/hosted-agents/SKILL.md +260 -0
- package/.agents/skills/hosted-agents/references/infrastructure-patterns.md +700 -0
- package/.agents/skills/hosted-agents/scripts/sandbox_manager.py +590 -0
- package/.agents/skills/impeccable/SKILL.md +365 -0
- package/.agents/skills/impeccable/reference/color-and-contrast.md +105 -0
- package/.agents/skills/impeccable/reference/craft.md +70 -0
- package/.agents/skills/impeccable/reference/extract.md +70 -0
- package/.agents/skills/impeccable/reference/interaction-design.md +195 -0
- package/.agents/skills/impeccable/reference/motion-design.md +99 -0
- package/.agents/skills/impeccable/reference/responsive-design.md +114 -0
- package/.agents/skills/impeccable/reference/spatial-design.md +100 -0
- package/.agents/skills/impeccable/reference/typography.md +142 -0
- package/.agents/skills/impeccable/reference/ux-writing.md +107 -0
- package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +214 -0
- package/.agents/skills/init/SKILL.md +138 -0
- package/.agents/skills/layout/SKILL.md +125 -0
- package/.agents/skills/liteparse/SKILL.md +222 -0
- package/.agents/skills/memory-systems/SKILL.md +219 -0
- package/.agents/skills/memory-systems/references/implementation.md +551 -0
- package/.agents/skills/memory-systems/scripts/memory_store.py +616 -0
- package/.agents/skills/multi-agent-patterns/SKILL.md +257 -0
- package/.agents/skills/multi-agent-patterns/references/frameworks.md +433 -0
- package/.agents/skills/multi-agent-patterns/scripts/coordination.py +613 -0
- package/.agents/skills/normalize/SKILL.md +70 -0
- package/.agents/skills/onboard/SKILL.md +245 -0
- package/.agents/skills/opentui/SKILL.md +201 -0
- package/.agents/skills/opentui/references/animation/REFERENCE.md +431 -0
- package/.agents/skills/opentui/references/components/REFERENCE.md +144 -0
- package/.agents/skills/opentui/references/components/code-diff.md +672 -0
- package/.agents/skills/opentui/references/components/containers.md +417 -0
- package/.agents/skills/opentui/references/components/inputs.md +531 -0
- package/.agents/skills/opentui/references/components/text-display.md +386 -0
- package/.agents/skills/opentui/references/core/REFERENCE.md +145 -0
- package/.agents/skills/opentui/references/core/api.md +543 -0
- package/.agents/skills/opentui/references/core/configuration.md +168 -0
- package/.agents/skills/opentui/references/core/gotchas.md +393 -0
- package/.agents/skills/opentui/references/core/patterns.md +449 -0
- package/.agents/skills/opentui/references/keyboard/REFERENCE.md +617 -0
- package/.agents/skills/opentui/references/layout/REFERENCE.md +337 -0
- package/.agents/skills/opentui/references/layout/patterns.md +444 -0
- package/.agents/skills/opentui/references/react/REFERENCE.md +174 -0
- package/.agents/skills/opentui/references/react/api.md +436 -0
- package/.agents/skills/opentui/references/react/configuration.md +302 -0
- package/.agents/skills/opentui/references/react/gotchas.md +443 -0
- package/.agents/skills/opentui/references/react/patterns.md +501 -0
- package/.agents/skills/opentui/references/solid/REFERENCE.md +201 -0
- package/.agents/skills/opentui/references/solid/api.md +564 -0
- package/.agents/skills/opentui/references/solid/configuration.md +316 -0
- package/.agents/skills/opentui/references/solid/gotchas.md +427 -0
- package/.agents/skills/opentui/references/solid/patterns.md +560 -0
- package/.agents/skills/opentui/references/testing/REFERENCE.md +614 -0
- package/.agents/skills/optimize/SKILL.md +266 -0
- package/.agents/skills/overdrive/SKILL.md +142 -0
- package/.agents/skills/pdf/LICENSE.txt +30 -0
- package/.agents/skills/pdf/SKILL.md +314 -0
- package/.agents/skills/pdf/forms.md +294 -0
- package/.agents/skills/pdf/reference.md +612 -0
- package/.agents/skills/pdf/scripts/check_bounding_boxes.py +65 -0
- package/.agents/skills/pdf/scripts/check_fillable_fields.py +11 -0
- package/.agents/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/.agents/skills/pdf/scripts/create_validation_image.py +37 -0
- package/.agents/skills/pdf/scripts/extract_form_field_info.py +122 -0
- package/.agents/skills/pdf/scripts/extract_form_structure.py +115 -0
- package/.agents/skills/pdf/scripts/fill_fillable_fields.py +98 -0
- package/.agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/.agents/skills/playwright-cli/SKILL.md +344 -0
- package/.agents/skills/playwright-cli/references/element-attributes.md +23 -0
- package/.agents/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/.agents/skills/playwright-cli/references/request-mocking.md +87 -0
- package/.agents/skills/playwright-cli/references/running-code.md +231 -0
- package/.agents/skills/playwright-cli/references/session-management.md +169 -0
- package/.agents/skills/playwright-cli/references/storage-state.md +275 -0
- package/.agents/skills/playwright-cli/references/test-generation.md +88 -0
- package/.agents/skills/playwright-cli/references/tracing.md +139 -0
- package/.agents/skills/playwright-cli/references/video-recording.md +143 -0
- package/.agents/skills/polish/SKILL.md +224 -0
- package/.agents/skills/pptx/LICENSE.txt +30 -0
- package/.agents/skills/pptx/SKILL.md +232 -0
- package/.agents/skills/pptx/editing.md +205 -0
- package/.agents/skills/pptx/pptxgenjs.md +420 -0
- package/.agents/skills/pptx/scripts/__init__.py +0 -0
- package/.agents/skills/pptx/scripts/add_slide.py +195 -0
- package/.agents/skills/pptx/scripts/clean.py +286 -0
- package/.agents/skills/pptx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
- package/.agents/skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/.agents/skills/pptx/scripts/office/pack.py +159 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.agents/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.agents/skills/pptx/scripts/office/soffice.py +183 -0
- package/.agents/skills/pptx/scripts/office/unpack.py +132 -0
- package/.agents/skills/pptx/scripts/office/validate.py +111 -0
- package/.agents/skills/pptx/scripts/office/validators/__init__.py +15 -0
- package/.agents/skills/pptx/scripts/office/validators/base.py +847 -0
- package/.agents/skills/pptx/scripts/office/validators/docx.py +446 -0
- package/.agents/skills/pptx/scripts/office/validators/pptx.py +275 -0
- package/.agents/skills/pptx/scripts/office/validators/redlining.py +247 -0
- package/.agents/skills/pptx/scripts/thumbnail.py +289 -0
- package/.agents/skills/project-development/SKILL.md +291 -0
- package/.agents/skills/project-development/references/case-studies.md +388 -0
- package/.agents/skills/project-development/references/pipeline-patterns.md +610 -0
- package/.agents/skills/project-development/scripts/pipeline_template.py +796 -0
- package/.agents/skills/prompt-engineer/SKILL.md +263 -0
- package/.agents/skills/prompt-engineer/references/advanced_patterns.md +271 -0
- package/.agents/skills/prompt-engineer/references/core_prompting.md +137 -0
- package/.agents/skills/prompt-engineer/references/quality_improvement.md +193 -0
- package/.agents/skills/quieter/SKILL.md +103 -0
- package/.agents/skills/research-codebase/SKILL.md +227 -0
- package/.agents/skills/shape/SKILL.md +96 -0
- package/.agents/skills/skill-creator/LICENSE.txt +202 -0
- package/.agents/skills/skill-creator/SKILL.md +485 -0
- package/.agents/skills/skill-creator/agents/analyzer.md +274 -0
- package/.agents/skills/skill-creator/agents/comparator.md +202 -0
- package/.agents/skills/skill-creator/agents/grader.md +223 -0
- package/.agents/skills/skill-creator/assets/eval_review.html +146 -0
- package/.agents/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/.agents/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/.agents/skills/skill-creator/references/schemas.md +430 -0
- package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
- package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/.agents/skills/skill-creator/scripts/generate_report.py +326 -0
- package/.agents/skills/skill-creator/scripts/improve_description.py +247 -0
- package/.agents/skills/skill-creator/scripts/package_skill.py +136 -0
- package/.agents/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/.agents/skills/skill-creator/scripts/run_eval.py +310 -0
- package/.agents/skills/skill-creator/scripts/run_loop.py +328 -0
- package/.agents/skills/skill-creator/scripts/utils.py +47 -0
- package/.agents/skills/sl-commit/SKILL.md +51 -0
- package/.agents/skills/sl-submit-diff/SKILL.md +55 -0
- package/.agents/skills/teach-impeccable/SKILL.md +71 -0
- package/.agents/skills/test-driven-development/SKILL.md +371 -0
- package/.agents/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/.agents/skills/tool-design/SKILL.md +271 -0
- package/.agents/skills/tool-design/references/architectural_reduction.md +210 -0
- package/.agents/skills/tool-design/references/best_practices.md +176 -0
- package/.agents/skills/tool-design/scripts/description_generator.py +528 -0
- package/.agents/skills/typescript-advanced-types/SKILL.md +719 -0
- package/.agents/skills/typescript-expert/SKILL.md +428 -0
- package/.agents/skills/typescript-expert/references/tsconfig-strict.json +92 -0
- package/.agents/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/.agents/skills/typescript-expert/references/utility-types.ts +335 -0
- package/.agents/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/.agents/skills/typescript-react-reviewer/SKILL.md +200 -0
- package/.agents/skills/typescript-react-reviewer/references/antipatterns.md +510 -0
- package/.agents/skills/typescript-react-reviewer/references/checklist.md +267 -0
- package/.agents/skills/typescript-react-reviewer/references/react19-patterns.md +305 -0
- package/.agents/skills/typeset/SKILL.md +116 -0
- package/.agents/skills/workflow-creator/SKILL.md +337 -0
- package/.agents/skills/workflow-creator/references/agent-sessions.md +789 -0
- package/.agents/skills/workflow-creator/references/computation-and-validation.md +224 -0
- package/.agents/skills/workflow-creator/references/control-flow.md +450 -0
- package/.agents/skills/workflow-creator/references/discovery-and-verification.md +156 -0
- package/.agents/skills/workflow-creator/references/failure-modes.md +732 -0
- package/.agents/skills/workflow-creator/references/getting-started.md +289 -0
- package/.agents/skills/workflow-creator/references/session-config.md +355 -0
- package/.agents/skills/workflow-creator/references/state-and-data-flow.md +374 -0
- package/.agents/skills/workflow-creator/references/user-input.md +206 -0
- package/.agents/skills/workflow-creator/references/workflow-inputs.md +274 -0
- package/.agents/skills/xlsx/LICENSE.txt +30 -0
- package/.agents/skills/xlsx/SKILL.md +292 -0
- package/.agents/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/.agents/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/.agents/skills/xlsx/scripts/office/pack.py +159 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.agents/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.agents/skills/xlsx/scripts/office/soffice.py +183 -0
- package/.agents/skills/xlsx/scripts/office/unpack.py +132 -0
- package/.agents/skills/xlsx/scripts/office/validate.py +111 -0
- package/.agents/skills/xlsx/scripts/office/validators/__init__.py +15 -0
- package/.agents/skills/xlsx/scripts/office/validators/base.py +847 -0
- package/.agents/skills/xlsx/scripts/office/validators/docx.py +446 -0
- package/.agents/skills/xlsx/scripts/office/validators/pptx.py +275 -0
- package/.agents/skills/xlsx/scripts/office/validators/redlining.py +247 -0
- package/.agents/skills/xlsx/scripts/recalc.py +184 -0
- package/.claude/agents/reviewer.md +1 -0
- package/.github/agents/reviewer.md +1 -0
- package/.opencode/agents/reviewer.md +1 -0
- package/README.md +274 -169
- package/package.json +6 -7
- package/src/commands/cli/init/index.ts +2 -2
- package/src/commands/cli/init/scm.ts +7 -8
- package/src/commands/cli/workflow-command.test.ts +74 -0
- package/src/commands/cli/workflow.ts +7 -2
- package/src/scripts/bundle-configs.ts +128 -0
- package/src/sdk/components/compact-switcher.tsx +1 -1
- package/src/sdk/components/orchestrator-panel-store.ts +13 -0
- package/src/sdk/components/orchestrator-panel.tsx +10 -0
- package/src/sdk/components/statusline.tsx +13 -1
- package/src/sdk/providers/claude.ts +42 -0
- package/src/sdk/runtime/executor.ts +111 -32
- package/src/sdk/types.ts +7 -0
- package/src/sdk/workflows/builtin/ralph/claude/index.ts +132 -76
- package/src/sdk/workflows/builtin/ralph/copilot/index.ts +129 -71
- package/src/sdk/workflows/builtin/ralph/helpers/git.ts +184 -17
- package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +463 -79
- package/src/sdk/workflows/builtin/ralph/opencode/index.ts +124 -80
- package/src/services/system/auto-sync.ts +31 -51
- package/src/services/system/skills.ts +56 -60
- package/dist/lib/path-root-guard.d.ts +0 -4
- package/dist/lib/path-root-guard.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 -15
- package/dist/sdk/components/connectors.d.ts.map +0 -1
- package/dist/sdk/components/connectors.test.d.ts +0 -2
- package/dist/sdk/components/connectors.test.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 -17
- 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/layout.test.d.ts +0 -2
- package/dist/sdk/components/layout.test.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 -46
- package/dist/sdk/components/orchestrator-panel-store.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-store.test.d.ts +0 -2
- package/dist/sdk/components/orchestrator-panel-store.test.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 -52
- package/dist/sdk/components/orchestrator-panel.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 -7
- package/dist/sdk/components/statusline.d.ts.map +0 -1
- package/dist/sdk/components/workflow-picker-panel.d.ts +0 -123
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +0 -1
- package/dist/sdk/define-workflow.d.ts +0 -78
- package/dist/sdk/define-workflow.d.ts.map +0 -1
- package/dist/sdk/define-workflow.test.d.ts +0 -2
- package/dist/sdk/define-workflow.test.d.ts.map +0 -1
- package/dist/sdk/errors.d.ts +0 -24
- package/dist/sdk/errors.d.ts.map +0 -1
- package/dist/sdk/errors.test.d.ts +0 -2
- package/dist/sdk/errors.test.d.ts.map +0 -1
- package/dist/sdk/index.d.ts +0 -13
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/providers/claude.d.ts +0 -170
- package/dist/sdk/providers/claude.d.ts.map +0 -1
- package/dist/sdk/providers/copilot.d.ts +0 -11
- package/dist/sdk/providers/copilot.d.ts.map +0 -1
- package/dist/sdk/providers/opencode.d.ts +0 -11
- package/dist/sdk/providers/opencode.d.ts.map +0 -1
- package/dist/sdk/runtime/discovery.d.ts +0 -86
- package/dist/sdk/runtime/discovery.d.ts.map +0 -1
- package/dist/sdk/runtime/executor-entry.d.ts +0 -11
- package/dist/sdk/runtime/executor-entry.d.ts.map +0 -1
- package/dist/sdk/runtime/executor.d.ts +0 -72
- package/dist/sdk/runtime/executor.d.ts.map +0 -1
- package/dist/sdk/runtime/executor.test.d.ts +0 -2
- package/dist/sdk/runtime/executor.test.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/loader.d.ts +0 -70
- package/dist/sdk/runtime/loader.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/theme.d.ts +0 -28
- package/dist/sdk/runtime/theme.d.ts.map +0 -1
- package/dist/sdk/runtime/tmux.d.ts +0 -297
- package/dist/sdk/runtime/tmux.d.ts.map +0 -1
- package/dist/sdk/types.d.ts +0 -295
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +0 -62
- 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 -46
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +0 -26
- 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 -92
- 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 -57
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +0 -49
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +0 -14
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +0 -14
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +0 -17
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +0 -119
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +0 -20
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +0 -14
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/index.d.ts +0 -24
- package/dist/sdk/workflows/index.d.ts.map +0 -1
- package/dist/services/config/definitions.d.ts +0 -85
- package/dist/services/config/definitions.d.ts.map +0 -1
- package/dist/services/system/copy.d.ts +0 -77
- 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/tsconfig.json +0 -33
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# Workflow Inputs
|
|
2
|
+
|
|
3
|
+
Workflows collect structured data from the user at invocation time through
|
|
4
|
+
a single uniform API: `ctx.inputs` (and `s.inputs` inside stage
|
|
5
|
+
callbacks). This reference covers how the inputs pipe works, when to
|
|
6
|
+
declare a schema vs. rely on the free-form fallback, and how values
|
|
7
|
+
reach the workflow from the CLI and the interactive picker.
|
|
8
|
+
|
|
9
|
+
## The inputs pipe
|
|
10
|
+
|
|
11
|
+
Every workflow run receives a `Record<string, string>` of inputs. The
|
|
12
|
+
runtime populates it from whichever invocation surface the user chose:
|
|
13
|
+
|
|
14
|
+
| Surface | How values are supplied | How they land in `ctx.inputs` |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| **Named run, positional** — `atomic workflow -n hello -a claude "fix the bug"` | A single positional prompt string | `{ prompt: "fix the bug" }` |
|
|
17
|
+
| **Named run, structured** — `atomic workflow -n gen-spec -a claude --research_doc=notes.md --focus=standard` | One `--<field>=<value>` flag per declared input | `{ research_doc: "notes.md", focus: "standard" }` |
|
|
18
|
+
| **Interactive picker** — `atomic workflow -a claude` | The user fills in a form rendered from the declared schema (or the default `prompt` field if the workflow is free-form) | Whatever the user typed, keyed by field name |
|
|
19
|
+
|
|
20
|
+
Workflow code is the same either way — it always reads
|
|
21
|
+
`ctx.inputs.<name>`. The invocation surface is a CLI concern, not a
|
|
22
|
+
workflow concern.
|
|
23
|
+
|
|
24
|
+
## Reading inputs
|
|
25
|
+
|
|
26
|
+
For free-form workflows (no declared schema), the positional prompt
|
|
27
|
+
lands under the reserved `prompt` key. Destructure it once at the top of
|
|
28
|
+
`.run()` so every stage can close over a bare string:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
defineWorkflow<"claude">({ name: "answer", description: "Single-turn answer" })
|
|
32
|
+
.run(async (ctx) => {
|
|
33
|
+
const prompt = ctx.inputs.prompt ?? "";
|
|
34
|
+
|
|
35
|
+
await ctx.stage({ name: "answer" }, {}, {}, async (s) => {
|
|
36
|
+
await s.session.query(prompt);
|
|
37
|
+
s.save(s.sessionId);
|
|
38
|
+
});
|
|
39
|
+
})
|
|
40
|
+
.compile();
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For structured workflows, read each declared field by name. Pull them
|
|
44
|
+
out of `ctx.inputs` once for readability and so downstream stages can
|
|
45
|
+
close over locals:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
defineWorkflow<"claude">({
|
|
49
|
+
name: "gen-spec",
|
|
50
|
+
description: "Convert a research doc into a detailed execution spec",
|
|
51
|
+
inputs: [
|
|
52
|
+
{ name: "research_doc", type: "string", required: true },
|
|
53
|
+
{
|
|
54
|
+
name: "focus",
|
|
55
|
+
type: "enum",
|
|
56
|
+
required: true,
|
|
57
|
+
values: ["minimal", "standard", "exhaustive"],
|
|
58
|
+
default: "standard",
|
|
59
|
+
},
|
|
60
|
+
{ name: "notes", type: "text" },
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
.run(async (ctx) => {
|
|
64
|
+
const { research_doc, focus } = ctx.inputs;
|
|
65
|
+
const notes = ctx.inputs.notes ?? "";
|
|
66
|
+
|
|
67
|
+
await ctx.stage({ name: "write-spec" }, {}, {}, async (s) => {
|
|
68
|
+
await s.session.query(
|
|
69
|
+
`Read ${research_doc} and produce a ${focus} spec.` +
|
|
70
|
+
(notes ? `\n\nExtra guidance:\n${notes}` : ""),
|
|
71
|
+
);
|
|
72
|
+
s.save(s.sessionId);
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
.compile();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The nullish coalescing on `notes` handles the optional field case —
|
|
79
|
+
declared-but-unset inputs resolve to `undefined` unless they have a
|
|
80
|
+
`default`.
|
|
81
|
+
|
|
82
|
+
## Declaring an input schema
|
|
83
|
+
|
|
84
|
+
Pass an `inputs` array to `defineWorkflow({ ... })`. Each entry is a
|
|
85
|
+
`WorkflowInput`:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
interface WorkflowInput {
|
|
89
|
+
/** Field name — becomes the CLI flag (`--<name>`) and form label. */
|
|
90
|
+
name: string;
|
|
91
|
+
/** Input kind: string | text | enum */
|
|
92
|
+
type: "string" | "text" | "enum";
|
|
93
|
+
/** Whether the field must be non-empty before the workflow can run. */
|
|
94
|
+
required?: boolean;
|
|
95
|
+
/** Short description shown as the field caption. */
|
|
96
|
+
description?: string;
|
|
97
|
+
/** Placeholder shown when the field is empty. */
|
|
98
|
+
placeholder?: string;
|
|
99
|
+
/** Default value — enums use this to pick their initial value. */
|
|
100
|
+
default?: string;
|
|
101
|
+
/** Allowed values — required when `type` is `"enum"`. */
|
|
102
|
+
values?: string[];
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Picking a field type
|
|
107
|
+
|
|
108
|
+
| Type | Use when | Picker renders as | Example |
|
|
109
|
+
|---|---|---|---|
|
|
110
|
+
| `string` | Short single-line values — identifiers, file paths, branch names | Single-row text input | `research_doc: "notes.md"` |
|
|
111
|
+
| `text` | Longer free-form prose — specs, prompts, extra context | Multi-row text area | `spec: "Build a..."` |
|
|
112
|
+
| `enum` | A fixed set of allowed values | Radio-button row | `focus: "standard" \| "minimal" \| "exhaustive"` |
|
|
113
|
+
|
|
114
|
+
Rule of thumb: use `enum` whenever there's a closed set of options — it
|
|
115
|
+
gives users discoverable choices instead of making them remember magic
|
|
116
|
+
strings, and the CLI will reject invalid values at parse time.
|
|
117
|
+
|
|
118
|
+
### Validation enforced by the runtime
|
|
119
|
+
|
|
120
|
+
The `defineWorkflow` builder validates the schema at compile time and
|
|
121
|
+
rejects authoring mistakes immediately — you won't discover them in
|
|
122
|
+
production:
|
|
123
|
+
|
|
124
|
+
- **Input names must be valid CLI flag tails** — start with a letter,
|
|
125
|
+
then letters/digits/underscores/dashes. `1bad` is rejected because
|
|
126
|
+
`--1bad` isn't a parseable flag.
|
|
127
|
+
- **Enum inputs must declare `values`** — an enum with no choices is
|
|
128
|
+
always invalid.
|
|
129
|
+
- **Enum `default` must be in `values`** — prevents drift between the
|
|
130
|
+
default and the allowed set.
|
|
131
|
+
- **No duplicate names** — two inputs with the same `name` shadow each
|
|
132
|
+
other and are rejected.
|
|
133
|
+
|
|
134
|
+
At invocation time, the CLI does a second pass to catch runtime errors
|
|
135
|
+
before spinning up any tmux session:
|
|
136
|
+
|
|
137
|
+
- **Required fields must be non-empty** (whitespace-only strings are
|
|
138
|
+
treated as empty). Missing required fields produce a clear
|
|
139
|
+
`Missing required input --<name>` error and exit non-zero.
|
|
140
|
+
- **Enum values must be in the allowed list.** `--focus=bogus` produces
|
|
141
|
+
`Invalid value for --focus: "bogus". Expected one of: minimal, standard, exhaustive.`
|
|
142
|
+
- **Unknown flags are rejected.** A `--random_flag=value` that isn't in
|
|
143
|
+
the schema produces `Unknown input --random_flag` with the valid
|
|
144
|
+
flag list appended.
|
|
145
|
+
|
|
146
|
+
This validation runs before any workflow code, so a malformed
|
|
147
|
+
invocation can never reach your `.run()` callback in a half-filled
|
|
148
|
+
state.
|
|
149
|
+
|
|
150
|
+
## Free-form vs structured: when to use which
|
|
151
|
+
|
|
152
|
+
Choose **free-form** (no `inputs` field on `defineWorkflow`) when:
|
|
153
|
+
|
|
154
|
+
- The workflow takes a single unstructured request that varies widely
|
|
155
|
+
in phrasing — "find the bug", "build me a chart", "refactor the auth
|
|
156
|
+
module".
|
|
157
|
+
- You want the simplest possible CLI surface.
|
|
158
|
+
- The workflow's first LLM call will do its own intent extraction from
|
|
159
|
+
the raw prompt.
|
|
160
|
+
|
|
161
|
+
Read the prompt via `ctx.inputs.prompt ?? ""`.
|
|
162
|
+
|
|
163
|
+
Choose **structured** (declared `inputs: [...]`) when:
|
|
164
|
+
|
|
165
|
+
- Several distinct fields are always needed — a file path + a focus
|
|
166
|
+
level + optional notes, for example.
|
|
167
|
+
- You want the picker to show a real form (each field, its type, and
|
|
168
|
+
any validation cues) instead of a single blob text area.
|
|
169
|
+
- You want the CLI to reject bad inputs before spawning a workflow —
|
|
170
|
+
e.g. a nonexistent enum value.
|
|
171
|
+
- You want the invocation to be scriptable and auditable — flag-based
|
|
172
|
+
invocation reads cleanly in CI.
|
|
173
|
+
|
|
174
|
+
Structured workflows can also include a `prompt` field in their schema
|
|
175
|
+
if they need both a free-form request AND structured parameters. The
|
|
176
|
+
`prompt` key is not magic for structured workflows — it's just a
|
|
177
|
+
conventional name. You only get "positional maps to `prompt`" behavior
|
|
178
|
+
when the workflow has no schema at all.
|
|
179
|
+
|
|
180
|
+
## The interactive picker
|
|
181
|
+
|
|
182
|
+
`atomic workflow -a <agent>` (no `-n`) launches the interactive
|
|
183
|
+
picker. The picker:
|
|
184
|
+
|
|
185
|
+
1. Discovers all workflows compatible with `<agent>` across local,
|
|
186
|
+
global, and builtin sources.
|
|
187
|
+
2. Loads each workflow's metadata (description + declared inputs).
|
|
188
|
+
3. Shows a Telescope-style fuzzy list. The user types to filter,
|
|
189
|
+
arrows to navigate, ↵ to lock in a selection.
|
|
190
|
+
4. Renders the selected workflow's form. Free-form workflows get a
|
|
191
|
+
single `prompt` text field; structured workflows get one field
|
|
192
|
+
per declared input with type-specific rendering.
|
|
193
|
+
5. Validates required fields on ⌃s. If any are empty, focus jumps to
|
|
194
|
+
the first invalid field and the run button stays disabled.
|
|
195
|
+
6. Confirms with a y/n modal, then tears down the picker and hands
|
|
196
|
+
off to the workflow executor — same live-run surface users see
|
|
197
|
+
when they invoke the workflow with `-n` directly.
|
|
198
|
+
|
|
199
|
+
The picker is the preferred discovery path for users who don't
|
|
200
|
+
remember flag names. Structured workflows benefit the most from it
|
|
201
|
+
because the form teaches the schema as the user fills it in.
|
|
202
|
+
|
|
203
|
+
## Builtin protection
|
|
204
|
+
|
|
205
|
+
Builtin workflows (the ones shipped inside the SDK — currently `ralph`
|
|
206
|
+
and `deep-research-codebase`) are **reserved**. A local or global
|
|
207
|
+
workflow with the same name will not shadow the builtin at resolution
|
|
208
|
+
time — the runtime drops user-defined workflows with reserved names
|
|
209
|
+
before any precedence merge. This prevents a user from accidentally
|
|
210
|
+
redefining the canonical version of a workflow in a way that confuses
|
|
211
|
+
teammates or breaks automation.
|
|
212
|
+
|
|
213
|
+
You'll still see shadowed local/global workflows in
|
|
214
|
+
`atomic workflow -l` output so the collision is visible, but running
|
|
215
|
+
`atomic workflow -n ralph -a claude` will always land on the builtin.
|
|
216
|
+
|
|
217
|
+
The practical implication: **don't name a new workflow `ralph` or
|
|
218
|
+
`deep-research-codebase`**. Pick a distinct name and you'll never hit
|
|
219
|
+
this.
|
|
220
|
+
|
|
221
|
+
## Invocation cheat sheet
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# List everything, grouped by source
|
|
225
|
+
atomic workflow -l
|
|
226
|
+
|
|
227
|
+
# Launch the picker for a pinned agent
|
|
228
|
+
atomic workflow -a claude
|
|
229
|
+
|
|
230
|
+
# Free-form, positional prompt
|
|
231
|
+
atomic workflow -n hello -a claude "hello world"
|
|
232
|
+
|
|
233
|
+
# Structured, one flag per field
|
|
234
|
+
atomic workflow -n gen-spec -a claude \
|
|
235
|
+
--research_doc=research/docs/2026-04-11-auth.md \
|
|
236
|
+
--focus=standard \
|
|
237
|
+
--notes="pay special attention to session token storage"
|
|
238
|
+
|
|
239
|
+
# Structured, long-form flag value (= form)
|
|
240
|
+
atomic workflow -n gen-spec -a claude --focus standard --research_doc notes.md
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Both `--flag=value` and `--flag value` forms are accepted. Short flags
|
|
244
|
+
(`-x value`) are NOT parsed as structured inputs — only long-form
|
|
245
|
+
`--<name>` flags resolve against the schema.
|
|
246
|
+
|
|
247
|
+
## Pitfalls
|
|
248
|
+
|
|
249
|
+
### Don't expect `inputs.prompt` on structured workflows
|
|
250
|
+
|
|
251
|
+
A structured workflow that doesn't declare a `prompt` field will have
|
|
252
|
+
`ctx.inputs.prompt === undefined`. The CLI also rejects a positional
|
|
253
|
+
prompt for structured workflows outright — if you try
|
|
254
|
+
`atomic workflow -n gen-spec -a claude "some text"` you'll get:
|
|
255
|
+
|
|
256
|
+
> Error: workflow 'gen-spec' takes structured inputs — pass them as
|
|
257
|
+
> `--<name>=<value>` flags instead of a positional prompt.
|
|
258
|
+
|
|
259
|
+
If your workflow wants both a free-form prompt AND structured fields,
|
|
260
|
+
declare `prompt` as a `text` input explicitly in the schema.
|
|
261
|
+
|
|
262
|
+
### Don't rename inputs across workflow versions
|
|
263
|
+
|
|
264
|
+
Declared input names are part of the workflow's public API — they map
|
|
265
|
+
directly to `--<name>` flags and field identifiers in the picker.
|
|
266
|
+
Renaming a field is a breaking change for any script that invokes the
|
|
267
|
+
workflow. If you need to rename, add the new name alongside the old,
|
|
268
|
+
migrate callers, then remove the old name in a later change.
|
|
269
|
+
|
|
270
|
+
### Don't put secrets in `default`
|
|
271
|
+
|
|
272
|
+
Defaults are visible in the picker and printed in CLI errors. They're
|
|
273
|
+
fine for values like `"standard"` but not for API keys or auth tokens.
|
|
274
|
+
Read those from environment variables inside the workflow instead.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
© 2025 Anthropic, PBC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
LICENSE: Use of these materials (including all code, prompts, assets, files,
|
|
4
|
+
and other components of this Skill) is governed by your agreement with
|
|
5
|
+
Anthropic regarding use of Anthropic's services. If no separate agreement
|
|
6
|
+
exists, use is governed by Anthropic's Consumer Terms of Service or
|
|
7
|
+
Commercial Terms of Service, as applicable:
|
|
8
|
+
https://www.anthropic.com/legal/consumer-terms
|
|
9
|
+
https://www.anthropic.com/legal/commercial-terms
|
|
10
|
+
Your applicable agreement is referred to as the "Agreement." "Services" are
|
|
11
|
+
as defined in the Agreement.
|
|
12
|
+
|
|
13
|
+
ADDITIONAL RESTRICTIONS: Notwithstanding anything in the Agreement to the
|
|
14
|
+
contrary, users may not:
|
|
15
|
+
|
|
16
|
+
- Extract these materials from the Services or retain copies of these
|
|
17
|
+
materials outside the Services
|
|
18
|
+
- Reproduce or copy these materials, except for temporary copies created
|
|
19
|
+
automatically during authorized use of the Services
|
|
20
|
+
- Create derivative works based on these materials
|
|
21
|
+
- Distribute, sublicense, or transfer these materials to any third party
|
|
22
|
+
- Make, offer to sell, sell, or import any inventions embodied in these
|
|
23
|
+
materials
|
|
24
|
+
- Reverse engineer, decompile, or disassemble these materials
|
|
25
|
+
|
|
26
|
+
The receipt, viewing, or possession of these materials does not convey or
|
|
27
|
+
imply any license or right beyond those expressly granted above.
|
|
28
|
+
|
|
29
|
+
Anthropic retains all right, title, and interest in these materials,
|
|
30
|
+
including all copyrights, patents, and other intellectual property rights.
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xlsx
|
|
3
|
+
description: "Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved."
|
|
4
|
+
license: Proprietary. LICENSE.txt has complete terms
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Requirements for Outputs
|
|
8
|
+
|
|
9
|
+
## All Excel files
|
|
10
|
+
|
|
11
|
+
### Professional Font
|
|
12
|
+
- Use a consistent, professional font (e.g., Arial, Times New Roman) for all deliverables unless otherwise instructed by the user
|
|
13
|
+
|
|
14
|
+
### Zero Formula Errors
|
|
15
|
+
- Every Excel model MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?)
|
|
16
|
+
|
|
17
|
+
### Preserve Existing Templates (when updating templates)
|
|
18
|
+
- Study and EXACTLY match existing format, style, and conventions when modifying files
|
|
19
|
+
- Never impose standardized formatting on files with established patterns
|
|
20
|
+
- Existing template conventions ALWAYS override these guidelines
|
|
21
|
+
|
|
22
|
+
## Financial models
|
|
23
|
+
|
|
24
|
+
### Color Coding Standards
|
|
25
|
+
Unless otherwise stated by the user or existing template
|
|
26
|
+
|
|
27
|
+
#### Industry-Standard Color Conventions
|
|
28
|
+
- **Blue text (RGB: 0,0,255)**: Hardcoded inputs, and numbers users will change for scenarios
|
|
29
|
+
- **Black text (RGB: 0,0,0)**: ALL formulas and calculations
|
|
30
|
+
- **Green text (RGB: 0,128,0)**: Links pulling from other worksheets within same workbook
|
|
31
|
+
- **Red text (RGB: 255,0,0)**: External links to other files
|
|
32
|
+
- **Yellow background (RGB: 255,255,0)**: Key assumptions needing attention or cells that need to be updated
|
|
33
|
+
|
|
34
|
+
### Number Formatting Standards
|
|
35
|
+
|
|
36
|
+
#### Required Format Rules
|
|
37
|
+
- **Years**: Format as text strings (e.g., "2024" not "2,024")
|
|
38
|
+
- **Currency**: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")
|
|
39
|
+
- **Zeros**: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")
|
|
40
|
+
- **Percentages**: Default to 0.0% format (one decimal)
|
|
41
|
+
- **Multiples**: Format as 0.0x for valuation multiples (EV/EBITDA, P/E)
|
|
42
|
+
- **Negative numbers**: Use parentheses (123) not minus -123
|
|
43
|
+
|
|
44
|
+
### Formula Construction Rules
|
|
45
|
+
|
|
46
|
+
#### Assumptions Placement
|
|
47
|
+
- Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells
|
|
48
|
+
- Use cell references instead of hardcoded values in formulas
|
|
49
|
+
- Example: Use =B5*(1+$B$6) instead of =B5*1.05
|
|
50
|
+
|
|
51
|
+
#### Formula Error Prevention
|
|
52
|
+
- Verify all cell references are correct
|
|
53
|
+
- Check for off-by-one errors in ranges
|
|
54
|
+
- Ensure consistent formulas across all projection periods
|
|
55
|
+
- Test with edge cases (zero values, negative numbers)
|
|
56
|
+
- Verify no unintended circular references
|
|
57
|
+
|
|
58
|
+
#### Documentation Requirements for Hardcodes
|
|
59
|
+
- Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"
|
|
60
|
+
- Examples:
|
|
61
|
+
- "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"
|
|
62
|
+
- "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
|
|
63
|
+
- "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"
|
|
64
|
+
- "Source: FactSet, 8/20/2025, Consensus Estimates Screen"
|
|
65
|
+
|
|
66
|
+
# XLSX creation, editing, and analysis
|
|
67
|
+
|
|
68
|
+
## Overview
|
|
69
|
+
|
|
70
|
+
A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.
|
|
71
|
+
|
|
72
|
+
## Important Requirements
|
|
73
|
+
|
|
74
|
+
**LibreOffice Required for Formula Recalculation**: You can assume LibreOffice is installed for recalculating formula values using the `scripts/recalc.py` script. The script automatically configures LibreOffice on first run, including in sandboxed environments where Unix sockets are restricted (handled by `scripts/office/soffice.py`)
|
|
75
|
+
|
|
76
|
+
## Reading and analyzing data
|
|
77
|
+
|
|
78
|
+
### Data analysis with pandas
|
|
79
|
+
For data analysis, visualization, and basic operations, use **pandas** which provides powerful data manipulation capabilities:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
import pandas as pd
|
|
83
|
+
|
|
84
|
+
# Read Excel
|
|
85
|
+
df = pd.read_excel('file.xlsx') # Default: first sheet
|
|
86
|
+
all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # All sheets as dict
|
|
87
|
+
|
|
88
|
+
# Analyze
|
|
89
|
+
df.head() # Preview data
|
|
90
|
+
df.info() # Column info
|
|
91
|
+
df.describe() # Statistics
|
|
92
|
+
|
|
93
|
+
# Write Excel
|
|
94
|
+
df.to_excel('output.xlsx', index=False)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Excel File Workflows
|
|
98
|
+
|
|
99
|
+
## CRITICAL: Use Formulas, Not Hardcoded Values
|
|
100
|
+
|
|
101
|
+
**Always use Excel formulas instead of calculating values in Python and hardcoding them.** This ensures the spreadsheet remains dynamic and updateable.
|
|
102
|
+
|
|
103
|
+
### ❌ WRONG - Hardcoding Calculated Values
|
|
104
|
+
```python
|
|
105
|
+
# Bad: Calculating in Python and hardcoding result
|
|
106
|
+
total = df['Sales'].sum()
|
|
107
|
+
sheet['B10'] = total # Hardcodes 5000
|
|
108
|
+
|
|
109
|
+
# Bad: Computing growth rate in Python
|
|
110
|
+
growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']
|
|
111
|
+
sheet['C5'] = growth # Hardcodes 0.15
|
|
112
|
+
|
|
113
|
+
# Bad: Python calculation for average
|
|
114
|
+
avg = sum(values) / len(values)
|
|
115
|
+
sheet['D20'] = avg # Hardcodes 42.5
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### ✅ CORRECT - Using Excel Formulas
|
|
119
|
+
```python
|
|
120
|
+
# Good: Let Excel calculate the sum
|
|
121
|
+
sheet['B10'] = '=SUM(B2:B9)'
|
|
122
|
+
|
|
123
|
+
# Good: Growth rate as Excel formula
|
|
124
|
+
sheet['C5'] = '=(C4-C2)/C2'
|
|
125
|
+
|
|
126
|
+
# Good: Average using Excel function
|
|
127
|
+
sheet['D20'] = '=AVERAGE(D2:D19)'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.
|
|
131
|
+
|
|
132
|
+
## Common Workflow
|
|
133
|
+
1. **Choose tool**: pandas for data, openpyxl for formulas/formatting
|
|
134
|
+
2. **Create/Load**: Create new workbook or load existing file
|
|
135
|
+
3. **Modify**: Add/edit data, formulas, and formatting
|
|
136
|
+
4. **Save**: Write to file
|
|
137
|
+
5. **Recalculate formulas (MANDATORY IF USING FORMULAS)**: Use the scripts/recalc.py script
|
|
138
|
+
```bash
|
|
139
|
+
python scripts/recalc.py output.xlsx
|
|
140
|
+
```
|
|
141
|
+
6. **Verify and fix any errors**:
|
|
142
|
+
- The script returns JSON with error details
|
|
143
|
+
- If `status` is `errors_found`, check `error_summary` for specific error types and locations
|
|
144
|
+
- Fix the identified errors and recalculate again
|
|
145
|
+
- Common errors to fix:
|
|
146
|
+
- `#REF!`: Invalid cell references
|
|
147
|
+
- `#DIV/0!`: Division by zero
|
|
148
|
+
- `#VALUE!`: Wrong data type in formula
|
|
149
|
+
- `#NAME?`: Unrecognized formula name
|
|
150
|
+
|
|
151
|
+
### Creating new Excel files
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
# Using openpyxl for formulas and formatting
|
|
155
|
+
from openpyxl import Workbook
|
|
156
|
+
from openpyxl.styles import Font, PatternFill, Alignment
|
|
157
|
+
|
|
158
|
+
wb = Workbook()
|
|
159
|
+
sheet = wb.active
|
|
160
|
+
|
|
161
|
+
# Add data
|
|
162
|
+
sheet['A1'] = 'Hello'
|
|
163
|
+
sheet['B1'] = 'World'
|
|
164
|
+
sheet.append(['Row', 'of', 'data'])
|
|
165
|
+
|
|
166
|
+
# Add formula
|
|
167
|
+
sheet['B2'] = '=SUM(A1:A10)'
|
|
168
|
+
|
|
169
|
+
# Formatting
|
|
170
|
+
sheet['A1'].font = Font(bold=True, color='FF0000')
|
|
171
|
+
sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
|
|
172
|
+
sheet['A1'].alignment = Alignment(horizontal='center')
|
|
173
|
+
|
|
174
|
+
# Column width
|
|
175
|
+
sheet.column_dimensions['A'].width = 20
|
|
176
|
+
|
|
177
|
+
wb.save('output.xlsx')
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Editing existing Excel files
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
# Using openpyxl to preserve formulas and formatting
|
|
184
|
+
from openpyxl import load_workbook
|
|
185
|
+
|
|
186
|
+
# Load existing file
|
|
187
|
+
wb = load_workbook('existing.xlsx')
|
|
188
|
+
sheet = wb.active # or wb['SheetName'] for specific sheet
|
|
189
|
+
|
|
190
|
+
# Working with multiple sheets
|
|
191
|
+
for sheet_name in wb.sheetnames:
|
|
192
|
+
sheet = wb[sheet_name]
|
|
193
|
+
print(f"Sheet: {sheet_name}")
|
|
194
|
+
|
|
195
|
+
# Modify cells
|
|
196
|
+
sheet['A1'] = 'New Value'
|
|
197
|
+
sheet.insert_rows(2) # Insert row at position 2
|
|
198
|
+
sheet.delete_cols(3) # Delete column 3
|
|
199
|
+
|
|
200
|
+
# Add new sheet
|
|
201
|
+
new_sheet = wb.create_sheet('NewSheet')
|
|
202
|
+
new_sheet['A1'] = 'Data'
|
|
203
|
+
|
|
204
|
+
wb.save('modified.xlsx')
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Recalculating formulas
|
|
208
|
+
|
|
209
|
+
Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided `scripts/recalc.py` script to recalculate formulas:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
python scripts/recalc.py <excel_file> [timeout_seconds]
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Example:
|
|
216
|
+
```bash
|
|
217
|
+
python scripts/recalc.py output.xlsx 30
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The script:
|
|
221
|
+
- Automatically sets up LibreOffice macro on first run
|
|
222
|
+
- Recalculates all formulas in all sheets
|
|
223
|
+
- Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)
|
|
224
|
+
- Returns JSON with detailed error locations and counts
|
|
225
|
+
- Works on both Linux and macOS
|
|
226
|
+
|
|
227
|
+
## Formula Verification Checklist
|
|
228
|
+
|
|
229
|
+
Quick checks to ensure formulas work correctly:
|
|
230
|
+
|
|
231
|
+
### Essential Verification
|
|
232
|
+
- [ ] **Test 2-3 sample references**: Verify they pull correct values before building full model
|
|
233
|
+
- [ ] **Column mapping**: Confirm Excel columns match (e.g., column 64 = BL, not BK)
|
|
234
|
+
- [ ] **Row offset**: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)
|
|
235
|
+
|
|
236
|
+
### Common Pitfalls
|
|
237
|
+
- [ ] **NaN handling**: Check for null values with `pd.notna()`
|
|
238
|
+
- [ ] **Far-right columns**: FY data often in columns 50+
|
|
239
|
+
- [ ] **Multiple matches**: Search all occurrences, not just first
|
|
240
|
+
- [ ] **Division by zero**: Check denominators before using `/` in formulas (#DIV/0!)
|
|
241
|
+
- [ ] **Wrong references**: Verify all cell references point to intended cells (#REF!)
|
|
242
|
+
- [ ] **Cross-sheet references**: Use correct format (Sheet1!A1) for linking sheets
|
|
243
|
+
|
|
244
|
+
### Formula Testing Strategy
|
|
245
|
+
- [ ] **Start small**: Test formulas on 2-3 cells before applying broadly
|
|
246
|
+
- [ ] **Verify dependencies**: Check all cells referenced in formulas exist
|
|
247
|
+
- [ ] **Test edge cases**: Include zero, negative, and very large values
|
|
248
|
+
|
|
249
|
+
### Interpreting scripts/recalc.py Output
|
|
250
|
+
The script returns JSON with error details:
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"status": "success", // or "errors_found"
|
|
254
|
+
"total_errors": 0, // Total error count
|
|
255
|
+
"total_formulas": 42, // Number of formulas in file
|
|
256
|
+
"error_summary": { // Only present if errors found
|
|
257
|
+
"#REF!": {
|
|
258
|
+
"count": 2,
|
|
259
|
+
"locations": ["Sheet1!B5", "Sheet1!C10"]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Best Practices
|
|
266
|
+
|
|
267
|
+
### Library Selection
|
|
268
|
+
- **pandas**: Best for data analysis, bulk operations, and simple data export
|
|
269
|
+
- **openpyxl**: Best for complex formatting, formulas, and Excel-specific features
|
|
270
|
+
|
|
271
|
+
### Working with openpyxl
|
|
272
|
+
- Cell indices are 1-based (row=1, column=1 refers to cell A1)
|
|
273
|
+
- Use `data_only=True` to read calculated values: `load_workbook('file.xlsx', data_only=True)`
|
|
274
|
+
- **Warning**: If opened with `data_only=True` and saved, formulas are replaced with values and permanently lost
|
|
275
|
+
- For large files: Use `read_only=True` for reading or `write_only=True` for writing
|
|
276
|
+
- Formulas are preserved but not evaluated - use scripts/recalc.py to update values
|
|
277
|
+
|
|
278
|
+
### Working with pandas
|
|
279
|
+
- Specify data types to avoid inference issues: `pd.read_excel('file.xlsx', dtype={'id': str})`
|
|
280
|
+
- For large files, read specific columns: `pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])`
|
|
281
|
+
- Handle dates properly: `pd.read_excel('file.xlsx', parse_dates=['date_column'])`
|
|
282
|
+
|
|
283
|
+
## Code Style Guidelines
|
|
284
|
+
**IMPORTANT**: When generating Python code for Excel operations:
|
|
285
|
+
- Write minimal, concise Python code without unnecessary comments
|
|
286
|
+
- Avoid verbose variable names and redundant operations
|
|
287
|
+
- Avoid unnecessary print statements
|
|
288
|
+
|
|
289
|
+
**For Excel files themselves**:
|
|
290
|
+
- Add comments to cells with complex formulas or important assumptions
|
|
291
|
+
- Document data sources for hardcoded values
|
|
292
|
+
- Include notes for key calculations and model sections
|
|
File without changes
|