@amrhas82/agentic-kit 1.0.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/.claude-plugin/plugin-lite.json +38 -0
- package/.claude-plugin/plugin-pro.json +183 -0
- package/.claude-plugin/plugin-standard.json +147 -0
- package/.claude-plugin/plugin.json +47 -0
- package/LICENSE +21 -0
- package/QUICK-START.md +318 -0
- package/README.md +449 -0
- package/TROUBLESHOOTING.md +788 -0
- package/VARIANTS.md +480 -0
- package/agents/1-create-prd.md +56 -0
- package/agents/2-generate-tasks.md +73 -0
- package/agents/3-process-task-list.md +101 -0
- package/agents/business-analyst.md +76 -0
- package/agents/full-stack-dev.md +80 -0
- package/agents/holistic-architect.md +91 -0
- package/agents/master.md +55 -0
- package/agents/orchestrator.md +103 -0
- package/agents/product-manager.md +82 -0
- package/agents/product-owner.md +97 -0
- package/agents/qa-test-architect.md +72 -0
- package/agents/scrum-master.md +64 -0
- package/agents/ux-expert.md +74 -0
- package/cli.js +230 -0
- package/hooks/register-agents.js +123 -0
- package/package.json +61 -0
- package/resources/agent-teams.yaml +50 -0
- package/resources/checklists.md +1724 -0
- package/resources/data.md +1372 -0
- package/resources/task-briefs.md +4428 -0
- package/resources/templates.yaml +5634 -0
- package/resources/workflows.yaml +1253 -0
- package/skills/algorithmic-art/LICENSE.txt +202 -0
- package/skills/algorithmic-art/SKILL.md +405 -0
- package/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/skills/algorithmic-art/templates/viewer.html +599 -0
- package/skills/artifacts-builder/LICENSE.txt +202 -0
- package/skills/artifacts-builder/SKILL.md +74 -0
- package/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills/brainstorming/SKILL.md +54 -0
- package/skills/brand-guidelines/LICENSE.txt +202 -0
- package/skills/brand-guidelines/SKILL.md +73 -0
- package/skills/canvas-design/LICENSE.txt +202 -0
- package/skills/canvas-design/SKILL.md +130 -0
- package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/code-review/SKILL.md +105 -0
- package/skills/code-review/code-reviewer.md +146 -0
- package/skills/condition-based-waiting/SKILL.md +120 -0
- package/skills/condition-based-waiting/example.ts +158 -0
- package/skills/docx/LICENSE.txt +30 -0
- package/skills/docx/SKILL.md +197 -0
- package/skills/docx/docx-js.md +350 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/docx/ooxml/scripts/pack.py +159 -0
- package/skills/docx/ooxml/scripts/unpack.py +29 -0
- package/skills/docx/ooxml/scripts/validate.py +69 -0
- package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/skills/docx/ooxml/scripts/validation/base.py +951 -0
- package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
- package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/skills/docx/ooxml.md +610 -0
- package/skills/docx/scripts/__init__.py +1 -0
- package/skills/docx/scripts/document.py +1276 -0
- package/skills/docx/scripts/templates/comments.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/skills/docx/scripts/templates/people.xml +3 -0
- package/skills/docx/scripts/utilities.py +374 -0
- package/skills/internal-comms/LICENSE.txt +202 -0
- package/skills/internal-comms/SKILL.md +32 -0
- package/skills/internal-comms/examples/3p-updates.md +47 -0
- package/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/skills/internal-comms/examples/faq-answers.md +30 -0
- package/skills/internal-comms/examples/general-comms.md +16 -0
- package/skills/mcp-builder/LICENSE.txt +202 -0
- package/skills/mcp-builder/SKILL.md +328 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +916 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +752 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/pdf/LICENSE.txt +30 -0
- package/skills/pdf/SKILL.md +294 -0
- package/skills/pdf/forms.md +205 -0
- package/skills/pdf/reference.md +612 -0
- package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/skills/pdf/scripts/create_validation_image.py +41 -0
- package/skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/skills/pptx/LICENSE.txt +30 -0
- package/skills/pptx/SKILL.md +484 -0
- package/skills/pptx/html2pptx.md +625 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/pptx/ooxml/scripts/pack.py +159 -0
- package/skills/pptx/ooxml/scripts/unpack.py +29 -0
- package/skills/pptx/ooxml/scripts/validate.py +69 -0
- package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
- package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/skills/pptx/ooxml.md +427 -0
- package/skills/pptx/scripts/html2pptx.js +979 -0
- package/skills/pptx/scripts/inventory.py +1020 -0
- package/skills/pptx/scripts/rearrange.py +231 -0
- package/skills/pptx/scripts/replace.py +385 -0
- package/skills/pptx/scripts/thumbnail.py +450 -0
- package/skills/root-cause-tracing/SKILL.md +174 -0
- package/skills/root-cause-tracing/find-polluter.sh +63 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +209 -0
- package/skills/skill-creator/scripts/init_skill.py +303 -0
- package/skills/skill-creator/scripts/package_skill.py +110 -0
- package/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/skills/slack-gif-creator/SKILL.md +646 -0
- package/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/skills/slack-gif-creator/core/easing.py +230 -0
- package/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/skills/slack-gif-creator/core/typography.py +357 -0
- package/skills/slack-gif-creator/core/validators.py +264 -0
- package/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/skills/slack-gif-creator/requirements.txt +4 -0
- package/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/skills/slack-gif-creator/templates/explode.py +331 -0
- package/skills/slack-gif-creator/templates/fade.py +329 -0
- package/skills/slack-gif-creator/templates/flip.py +291 -0
- package/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/skills/slack-gif-creator/templates/morph.py +329 -0
- package/skills/slack-gif-creator/templates/move.py +293 -0
- package/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/skills/slack-gif-creator/templates/shake.py +127 -0
- package/skills/slack-gif-creator/templates/slide.py +291 -0
- package/skills/slack-gif-creator/templates/spin.py +269 -0
- package/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +295 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +364 -0
- package/skills/testing-anti-patterns/SKILL.md +302 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/webapp-testing/LICENSE.txt +202 -0
- package/skills/webapp-testing/SKILL.md +96 -0
- package/skills/webapp-testing/examples/console_logging.py +35 -0
- package/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/skills/webapp-testing/scripts/with_server.py +106 -0
- package/skills/xlsx/LICENSE.txt +30 -0
- package/skills/xlsx/SKILL.md +289 -0
- package/skills/xlsx/recalc.py +178 -0
- package/validate-references.sh +86 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Create thumbnail grids from PowerPoint presentation slides.
|
|
4
|
+
|
|
5
|
+
Creates a grid layout of slide thumbnails with configurable columns (max 6).
|
|
6
|
+
Each grid contains up to cols×(cols+1) images. For presentations with more
|
|
7
|
+
slides, multiple numbered grid files are created automatically.
|
|
8
|
+
|
|
9
|
+
The program outputs the names of all files created.
|
|
10
|
+
|
|
11
|
+
Output:
|
|
12
|
+
- Single grid: {prefix}.jpg (if slides fit in one grid)
|
|
13
|
+
- Multiple grids: {prefix}-1.jpg, {prefix}-2.jpg, etc.
|
|
14
|
+
|
|
15
|
+
Grid limits by column count:
|
|
16
|
+
- 3 cols: max 12 slides per grid (3×4)
|
|
17
|
+
- 4 cols: max 20 slides per grid (4×5)
|
|
18
|
+
- 5 cols: max 30 slides per grid (5×6) [default]
|
|
19
|
+
- 6 cols: max 42 slides per grid (6×7)
|
|
20
|
+
|
|
21
|
+
Usage:
|
|
22
|
+
python thumbnail.py input.pptx [output_prefix] [--cols N] [--outline-placeholders]
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
python thumbnail.py presentation.pptx
|
|
26
|
+
# Creates: thumbnails.jpg (using default prefix)
|
|
27
|
+
# Outputs:
|
|
28
|
+
# Created 1 grid(s):
|
|
29
|
+
# - thumbnails.jpg
|
|
30
|
+
|
|
31
|
+
python thumbnail.py large-deck.pptx grid --cols 4
|
|
32
|
+
# Creates: grid-1.jpg, grid-2.jpg, grid-3.jpg
|
|
33
|
+
# Outputs:
|
|
34
|
+
# Created 3 grid(s):
|
|
35
|
+
# - grid-1.jpg
|
|
36
|
+
# - grid-2.jpg
|
|
37
|
+
# - grid-3.jpg
|
|
38
|
+
|
|
39
|
+
python thumbnail.py template.pptx analysis --outline-placeholders
|
|
40
|
+
# Creates thumbnail grids with red outlines around text placeholders
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
import argparse
|
|
44
|
+
import subprocess
|
|
45
|
+
import sys
|
|
46
|
+
import tempfile
|
|
47
|
+
from pathlib import Path
|
|
48
|
+
|
|
49
|
+
from inventory import extract_text_inventory
|
|
50
|
+
from PIL import Image, ImageDraw, ImageFont
|
|
51
|
+
from pptx import Presentation
|
|
52
|
+
|
|
53
|
+
# Constants
|
|
54
|
+
THUMBNAIL_WIDTH = 300 # Fixed thumbnail width in pixels
|
|
55
|
+
CONVERSION_DPI = 100 # DPI for PDF to image conversion
|
|
56
|
+
MAX_COLS = 6 # Maximum number of columns
|
|
57
|
+
DEFAULT_COLS = 5 # Default number of columns
|
|
58
|
+
JPEG_QUALITY = 95 # JPEG compression quality
|
|
59
|
+
|
|
60
|
+
# Grid layout constants
|
|
61
|
+
GRID_PADDING = 20 # Padding between thumbnails
|
|
62
|
+
BORDER_WIDTH = 2 # Border width around thumbnails
|
|
63
|
+
FONT_SIZE_RATIO = 0.12 # Font size as fraction of thumbnail width
|
|
64
|
+
LABEL_PADDING_RATIO = 0.4 # Label padding as fraction of font size
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def main():
|
|
68
|
+
parser = argparse.ArgumentParser(
|
|
69
|
+
description="Create thumbnail grids from PowerPoint slides."
|
|
70
|
+
)
|
|
71
|
+
parser.add_argument("input", help="Input PowerPoint file (.pptx)")
|
|
72
|
+
parser.add_argument(
|
|
73
|
+
"output_prefix",
|
|
74
|
+
nargs="?",
|
|
75
|
+
default="thumbnails",
|
|
76
|
+
help="Output prefix for image files (default: thumbnails, will create prefix.jpg or prefix-N.jpg)",
|
|
77
|
+
)
|
|
78
|
+
parser.add_argument(
|
|
79
|
+
"--cols",
|
|
80
|
+
type=int,
|
|
81
|
+
default=DEFAULT_COLS,
|
|
82
|
+
help=f"Number of columns (default: {DEFAULT_COLS}, max: {MAX_COLS})",
|
|
83
|
+
)
|
|
84
|
+
parser.add_argument(
|
|
85
|
+
"--outline-placeholders",
|
|
86
|
+
action="store_true",
|
|
87
|
+
help="Outline text placeholders with a colored border",
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
args = parser.parse_args()
|
|
91
|
+
|
|
92
|
+
# Validate columns
|
|
93
|
+
cols = min(args.cols, MAX_COLS)
|
|
94
|
+
if args.cols > MAX_COLS:
|
|
95
|
+
print(f"Warning: Columns limited to {MAX_COLS} (requested {args.cols})")
|
|
96
|
+
|
|
97
|
+
# Validate input
|
|
98
|
+
input_path = Path(args.input)
|
|
99
|
+
if not input_path.exists() or input_path.suffix.lower() != ".pptx":
|
|
100
|
+
print(f"Error: Invalid PowerPoint file: {args.input}")
|
|
101
|
+
sys.exit(1)
|
|
102
|
+
|
|
103
|
+
# Construct output path (always JPG)
|
|
104
|
+
output_path = Path(f"{args.output_prefix}.jpg")
|
|
105
|
+
|
|
106
|
+
print(f"Processing: {args.input}")
|
|
107
|
+
|
|
108
|
+
try:
|
|
109
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
110
|
+
# Get placeholder regions if outlining is enabled
|
|
111
|
+
placeholder_regions = None
|
|
112
|
+
slide_dimensions = None
|
|
113
|
+
if args.outline_placeholders:
|
|
114
|
+
print("Extracting placeholder regions...")
|
|
115
|
+
placeholder_regions, slide_dimensions = get_placeholder_regions(
|
|
116
|
+
input_path
|
|
117
|
+
)
|
|
118
|
+
if placeholder_regions:
|
|
119
|
+
print(f"Found placeholders on {len(placeholder_regions)} slides")
|
|
120
|
+
|
|
121
|
+
# Convert slides to images
|
|
122
|
+
slide_images = convert_to_images(input_path, Path(temp_dir), CONVERSION_DPI)
|
|
123
|
+
if not slide_images:
|
|
124
|
+
print("Error: No slides found")
|
|
125
|
+
sys.exit(1)
|
|
126
|
+
|
|
127
|
+
print(f"Found {len(slide_images)} slides")
|
|
128
|
+
|
|
129
|
+
# Create grids (max cols×(cols+1) images per grid)
|
|
130
|
+
grid_files = create_grids(
|
|
131
|
+
slide_images,
|
|
132
|
+
cols,
|
|
133
|
+
THUMBNAIL_WIDTH,
|
|
134
|
+
output_path,
|
|
135
|
+
placeholder_regions,
|
|
136
|
+
slide_dimensions,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Print saved files
|
|
140
|
+
print(f"Created {len(grid_files)} grid(s):")
|
|
141
|
+
for grid_file in grid_files:
|
|
142
|
+
print(f" - {grid_file}")
|
|
143
|
+
|
|
144
|
+
except Exception as e:
|
|
145
|
+
print(f"Error: {e}")
|
|
146
|
+
sys.exit(1)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def create_hidden_slide_placeholder(size):
|
|
150
|
+
"""Create placeholder image for hidden slides."""
|
|
151
|
+
img = Image.new("RGB", size, color="#F0F0F0")
|
|
152
|
+
draw = ImageDraw.Draw(img)
|
|
153
|
+
line_width = max(5, min(size) // 100)
|
|
154
|
+
draw.line([(0, 0), size], fill="#CCCCCC", width=line_width)
|
|
155
|
+
draw.line([(size[0], 0), (0, size[1])], fill="#CCCCCC", width=line_width)
|
|
156
|
+
return img
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def get_placeholder_regions(pptx_path):
|
|
160
|
+
"""Extract ALL text regions from the presentation.
|
|
161
|
+
|
|
162
|
+
Returns a tuple of (placeholder_regions, slide_dimensions).
|
|
163
|
+
text_regions is a dict mapping slide indices to lists of text regions.
|
|
164
|
+
Each region is a dict with 'left', 'top', 'width', 'height' in inches.
|
|
165
|
+
slide_dimensions is a tuple of (width_inches, height_inches).
|
|
166
|
+
"""
|
|
167
|
+
prs = Presentation(str(pptx_path))
|
|
168
|
+
inventory = extract_text_inventory(pptx_path, prs)
|
|
169
|
+
placeholder_regions = {}
|
|
170
|
+
|
|
171
|
+
# Get actual slide dimensions in inches (EMU to inches conversion)
|
|
172
|
+
slide_width_inches = (prs.slide_width or 9144000) / 914400.0
|
|
173
|
+
slide_height_inches = (prs.slide_height or 5143500) / 914400.0
|
|
174
|
+
|
|
175
|
+
for slide_key, shapes in inventory.items():
|
|
176
|
+
# Extract slide index from "slide-N" format
|
|
177
|
+
slide_idx = int(slide_key.split("-")[1])
|
|
178
|
+
regions = []
|
|
179
|
+
|
|
180
|
+
for shape_key, shape_data in shapes.items():
|
|
181
|
+
# The inventory only contains shapes with text, so all shapes should be highlighted
|
|
182
|
+
regions.append(
|
|
183
|
+
{
|
|
184
|
+
"left": shape_data.left,
|
|
185
|
+
"top": shape_data.top,
|
|
186
|
+
"width": shape_data.width,
|
|
187
|
+
"height": shape_data.height,
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
if regions:
|
|
192
|
+
placeholder_regions[slide_idx] = regions
|
|
193
|
+
|
|
194
|
+
return placeholder_regions, (slide_width_inches, slide_height_inches)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def convert_to_images(pptx_path, temp_dir, dpi):
|
|
198
|
+
"""Convert PowerPoint to images via PDF, handling hidden slides."""
|
|
199
|
+
# Detect hidden slides
|
|
200
|
+
print("Analyzing presentation...")
|
|
201
|
+
prs = Presentation(str(pptx_path))
|
|
202
|
+
total_slides = len(prs.slides)
|
|
203
|
+
|
|
204
|
+
# Find hidden slides (1-based indexing for display)
|
|
205
|
+
hidden_slides = {
|
|
206
|
+
idx + 1
|
|
207
|
+
for idx, slide in enumerate(prs.slides)
|
|
208
|
+
if slide.element.get("show") == "0"
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
print(f"Total slides: {total_slides}")
|
|
212
|
+
if hidden_slides:
|
|
213
|
+
print(f"Hidden slides: {sorted(hidden_slides)}")
|
|
214
|
+
|
|
215
|
+
pdf_path = temp_dir / f"{pptx_path.stem}.pdf"
|
|
216
|
+
|
|
217
|
+
# Convert to PDF
|
|
218
|
+
print("Converting to PDF...")
|
|
219
|
+
result = subprocess.run(
|
|
220
|
+
[
|
|
221
|
+
"soffice",
|
|
222
|
+
"--headless",
|
|
223
|
+
"--convert-to",
|
|
224
|
+
"pdf",
|
|
225
|
+
"--outdir",
|
|
226
|
+
str(temp_dir),
|
|
227
|
+
str(pptx_path),
|
|
228
|
+
],
|
|
229
|
+
capture_output=True,
|
|
230
|
+
text=True,
|
|
231
|
+
)
|
|
232
|
+
if result.returncode != 0 or not pdf_path.exists():
|
|
233
|
+
raise RuntimeError("PDF conversion failed")
|
|
234
|
+
|
|
235
|
+
# Convert PDF to images
|
|
236
|
+
print(f"Converting to images at {dpi} DPI...")
|
|
237
|
+
result = subprocess.run(
|
|
238
|
+
["pdftoppm", "-jpeg", "-r", str(dpi), str(pdf_path), str(temp_dir / "slide")],
|
|
239
|
+
capture_output=True,
|
|
240
|
+
text=True,
|
|
241
|
+
)
|
|
242
|
+
if result.returncode != 0:
|
|
243
|
+
raise RuntimeError("Image conversion failed")
|
|
244
|
+
|
|
245
|
+
visible_images = sorted(temp_dir.glob("slide-*.jpg"))
|
|
246
|
+
|
|
247
|
+
# Create full list with placeholders for hidden slides
|
|
248
|
+
all_images = []
|
|
249
|
+
visible_idx = 0
|
|
250
|
+
|
|
251
|
+
# Get placeholder dimensions from first visible slide
|
|
252
|
+
if visible_images:
|
|
253
|
+
with Image.open(visible_images[0]) as img:
|
|
254
|
+
placeholder_size = img.size
|
|
255
|
+
else:
|
|
256
|
+
placeholder_size = (1920, 1080)
|
|
257
|
+
|
|
258
|
+
for slide_num in range(1, total_slides + 1):
|
|
259
|
+
if slide_num in hidden_slides:
|
|
260
|
+
# Create placeholder image for hidden slide
|
|
261
|
+
placeholder_path = temp_dir / f"hidden-{slide_num:03d}.jpg"
|
|
262
|
+
placeholder_img = create_hidden_slide_placeholder(placeholder_size)
|
|
263
|
+
placeholder_img.save(placeholder_path, "JPEG")
|
|
264
|
+
all_images.append(placeholder_path)
|
|
265
|
+
else:
|
|
266
|
+
# Use the actual visible slide image
|
|
267
|
+
if visible_idx < len(visible_images):
|
|
268
|
+
all_images.append(visible_images[visible_idx])
|
|
269
|
+
visible_idx += 1
|
|
270
|
+
|
|
271
|
+
return all_images
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def create_grids(
|
|
275
|
+
image_paths,
|
|
276
|
+
cols,
|
|
277
|
+
width,
|
|
278
|
+
output_path,
|
|
279
|
+
placeholder_regions=None,
|
|
280
|
+
slide_dimensions=None,
|
|
281
|
+
):
|
|
282
|
+
"""Create multiple thumbnail grids from slide images, max cols×(cols+1) images per grid."""
|
|
283
|
+
# Maximum images per grid is cols × (cols + 1) for better proportions
|
|
284
|
+
max_images_per_grid = cols * (cols + 1)
|
|
285
|
+
grid_files = []
|
|
286
|
+
|
|
287
|
+
print(
|
|
288
|
+
f"Creating grids with {cols} columns (max {max_images_per_grid} images per grid)"
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
# Split images into chunks
|
|
292
|
+
for chunk_idx, start_idx in enumerate(
|
|
293
|
+
range(0, len(image_paths), max_images_per_grid)
|
|
294
|
+
):
|
|
295
|
+
end_idx = min(start_idx + max_images_per_grid, len(image_paths))
|
|
296
|
+
chunk_images = image_paths[start_idx:end_idx]
|
|
297
|
+
|
|
298
|
+
# Create grid for this chunk
|
|
299
|
+
grid = create_grid(
|
|
300
|
+
chunk_images, cols, width, start_idx, placeholder_regions, slide_dimensions
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
# Generate output filename
|
|
304
|
+
if len(image_paths) <= max_images_per_grid:
|
|
305
|
+
# Single grid - use base filename without suffix
|
|
306
|
+
grid_filename = output_path
|
|
307
|
+
else:
|
|
308
|
+
# Multiple grids - insert index before extension with dash
|
|
309
|
+
stem = output_path.stem
|
|
310
|
+
suffix = output_path.suffix
|
|
311
|
+
grid_filename = output_path.parent / f"{stem}-{chunk_idx + 1}{suffix}"
|
|
312
|
+
|
|
313
|
+
# Save grid
|
|
314
|
+
grid_filename.parent.mkdir(parents=True, exist_ok=True)
|
|
315
|
+
grid.save(str(grid_filename), quality=JPEG_QUALITY)
|
|
316
|
+
grid_files.append(str(grid_filename))
|
|
317
|
+
|
|
318
|
+
return grid_files
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def create_grid(
|
|
322
|
+
image_paths,
|
|
323
|
+
cols,
|
|
324
|
+
width,
|
|
325
|
+
start_slide_num=0,
|
|
326
|
+
placeholder_regions=None,
|
|
327
|
+
slide_dimensions=None,
|
|
328
|
+
):
|
|
329
|
+
"""Create thumbnail grid from slide images with optional placeholder outlining."""
|
|
330
|
+
font_size = int(width * FONT_SIZE_RATIO)
|
|
331
|
+
label_padding = int(font_size * LABEL_PADDING_RATIO)
|
|
332
|
+
|
|
333
|
+
# Get dimensions
|
|
334
|
+
with Image.open(image_paths[0]) as img:
|
|
335
|
+
aspect = img.height / img.width
|
|
336
|
+
height = int(width * aspect)
|
|
337
|
+
|
|
338
|
+
# Calculate grid size
|
|
339
|
+
rows = (len(image_paths) + cols - 1) // cols
|
|
340
|
+
grid_w = cols * width + (cols + 1) * GRID_PADDING
|
|
341
|
+
grid_h = rows * (height + font_size + label_padding * 2) + (rows + 1) * GRID_PADDING
|
|
342
|
+
|
|
343
|
+
# Create grid
|
|
344
|
+
grid = Image.new("RGB", (grid_w, grid_h), "white")
|
|
345
|
+
draw = ImageDraw.Draw(grid)
|
|
346
|
+
|
|
347
|
+
# Load font with size based on thumbnail width
|
|
348
|
+
try:
|
|
349
|
+
# Use Pillow's default font with size
|
|
350
|
+
font = ImageFont.load_default(size=font_size)
|
|
351
|
+
except Exception:
|
|
352
|
+
# Fall back to basic default font if size parameter not supported
|
|
353
|
+
font = ImageFont.load_default()
|
|
354
|
+
|
|
355
|
+
# Place thumbnails
|
|
356
|
+
for i, img_path in enumerate(image_paths):
|
|
357
|
+
row, col = i // cols, i % cols
|
|
358
|
+
x = col * width + (col + 1) * GRID_PADDING
|
|
359
|
+
y_base = (
|
|
360
|
+
row * (height + font_size + label_padding * 2) + (row + 1) * GRID_PADDING
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
# Add label with actual slide number
|
|
364
|
+
label = f"{start_slide_num + i}"
|
|
365
|
+
bbox = draw.textbbox((0, 0), label, font=font)
|
|
366
|
+
text_w = bbox[2] - bbox[0]
|
|
367
|
+
draw.text(
|
|
368
|
+
(x + (width - text_w) // 2, y_base + label_padding),
|
|
369
|
+
label,
|
|
370
|
+
fill="black",
|
|
371
|
+
font=font,
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
# Add thumbnail below label with proportional spacing
|
|
375
|
+
y_thumbnail = y_base + label_padding + font_size + label_padding
|
|
376
|
+
|
|
377
|
+
with Image.open(img_path) as img:
|
|
378
|
+
# Get original dimensions before thumbnail
|
|
379
|
+
orig_w, orig_h = img.size
|
|
380
|
+
|
|
381
|
+
# Apply placeholder outlines if enabled
|
|
382
|
+
if placeholder_regions and (start_slide_num + i) in placeholder_regions:
|
|
383
|
+
# Convert to RGBA for transparency support
|
|
384
|
+
if img.mode != "RGBA":
|
|
385
|
+
img = img.convert("RGBA")
|
|
386
|
+
|
|
387
|
+
# Get the regions for this slide
|
|
388
|
+
regions = placeholder_regions[start_slide_num + i]
|
|
389
|
+
|
|
390
|
+
# Calculate scale factors using actual slide dimensions
|
|
391
|
+
if slide_dimensions:
|
|
392
|
+
slide_width_inches, slide_height_inches = slide_dimensions
|
|
393
|
+
else:
|
|
394
|
+
# Fallback: estimate from image size at CONVERSION_DPI
|
|
395
|
+
slide_width_inches = orig_w / CONVERSION_DPI
|
|
396
|
+
slide_height_inches = orig_h / CONVERSION_DPI
|
|
397
|
+
|
|
398
|
+
x_scale = orig_w / slide_width_inches
|
|
399
|
+
y_scale = orig_h / slide_height_inches
|
|
400
|
+
|
|
401
|
+
# Create a highlight overlay
|
|
402
|
+
overlay = Image.new("RGBA", img.size, (255, 255, 255, 0))
|
|
403
|
+
overlay_draw = ImageDraw.Draw(overlay)
|
|
404
|
+
|
|
405
|
+
# Highlight each placeholder region
|
|
406
|
+
for region in regions:
|
|
407
|
+
# Convert from inches to pixels in the original image
|
|
408
|
+
px_left = int(region["left"] * x_scale)
|
|
409
|
+
px_top = int(region["top"] * y_scale)
|
|
410
|
+
px_width = int(region["width"] * x_scale)
|
|
411
|
+
px_height = int(region["height"] * y_scale)
|
|
412
|
+
|
|
413
|
+
# Draw highlight outline with red color and thick stroke
|
|
414
|
+
# Using a bright red outline instead of fill
|
|
415
|
+
stroke_width = max(
|
|
416
|
+
5, min(orig_w, orig_h) // 150
|
|
417
|
+
) # Thicker proportional stroke width
|
|
418
|
+
overlay_draw.rectangle(
|
|
419
|
+
[(px_left, px_top), (px_left + px_width, px_top + px_height)],
|
|
420
|
+
outline=(255, 0, 0, 255), # Bright red, fully opaque
|
|
421
|
+
width=stroke_width,
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
# Composite the overlay onto the image using alpha blending
|
|
425
|
+
img = Image.alpha_composite(img, overlay)
|
|
426
|
+
# Convert back to RGB for JPEG saving
|
|
427
|
+
img = img.convert("RGB")
|
|
428
|
+
|
|
429
|
+
img.thumbnail((width, height), Image.Resampling.LANCZOS)
|
|
430
|
+
w, h = img.size
|
|
431
|
+
tx = x + (width - w) // 2
|
|
432
|
+
ty = y_thumbnail + (height - h) // 2
|
|
433
|
+
grid.paste(img, (tx, ty))
|
|
434
|
+
|
|
435
|
+
# Add border
|
|
436
|
+
if BORDER_WIDTH > 0:
|
|
437
|
+
draw.rectangle(
|
|
438
|
+
[
|
|
439
|
+
(tx - BORDER_WIDTH, ty - BORDER_WIDTH),
|
|
440
|
+
(tx + w + BORDER_WIDTH - 1, ty + h + BORDER_WIDTH - 1),
|
|
441
|
+
],
|
|
442
|
+
outline="gray",
|
|
443
|
+
width=BORDER_WIDTH,
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
return grid
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
if __name__ == "__main__":
|
|
450
|
+
main()
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: root-cause-tracing
|
|
3
|
+
description: Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack, adding instrumentation when needed, to identify source of invalid data or incorrect behavior
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Root Cause Tracing
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
```dot
|
|
17
|
+
digraph when_to_use {
|
|
18
|
+
"Bug appears deep in stack?" [shape=diamond];
|
|
19
|
+
"Can trace backwards?" [shape=diamond];
|
|
20
|
+
"Fix at symptom point" [shape=box];
|
|
21
|
+
"Trace to original trigger" [shape=box];
|
|
22
|
+
"BETTER: Also add defense-in-depth" [shape=box];
|
|
23
|
+
|
|
24
|
+
"Bug appears deep in stack?" -> "Can trace backwards?" [label="yes"];
|
|
25
|
+
"Can trace backwards?" -> "Trace to original trigger" [label="yes"];
|
|
26
|
+
"Can trace backwards?" -> "Fix at symptom point" [label="no - dead end"];
|
|
27
|
+
"Trace to original trigger" -> "BETTER: Also add defense-in-depth";
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Use when:**
|
|
32
|
+
- Error happens deep in execution (not at entry point)
|
|
33
|
+
- Stack trace shows long call chain
|
|
34
|
+
- Unclear where invalid data originated
|
|
35
|
+
- Need to find which test/code triggers the problem
|
|
36
|
+
|
|
37
|
+
## The Tracing Process
|
|
38
|
+
|
|
39
|
+
### 1. Observe the Symptom
|
|
40
|
+
```
|
|
41
|
+
Error: git init failed in /Users/jesse/project/packages/core
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Find Immediate Cause
|
|
45
|
+
**What code directly causes this?**
|
|
46
|
+
```typescript
|
|
47
|
+
await execFileAsync('git', ['init'], { cwd: projectDir });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. Ask: What Called This?
|
|
51
|
+
```typescript
|
|
52
|
+
WorktreeManager.createSessionWorktree(projectDir, sessionId)
|
|
53
|
+
→ called by Session.initializeWorkspace()
|
|
54
|
+
→ called by Session.create()
|
|
55
|
+
→ called by test at Project.create()
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 4. Keep Tracing Up
|
|
59
|
+
**What value was passed?**
|
|
60
|
+
- `projectDir = ''` (empty string!)
|
|
61
|
+
- Empty string as `cwd` resolves to `process.cwd()`
|
|
62
|
+
- That's the source code directory!
|
|
63
|
+
|
|
64
|
+
### 5. Find Original Trigger
|
|
65
|
+
**Where did empty string come from?**
|
|
66
|
+
```typescript
|
|
67
|
+
const context = setupCoreTest(); // Returns { tempDir: '' }
|
|
68
|
+
Project.create('name', context.tempDir); // Accessed before beforeEach!
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Adding Stack Traces
|
|
72
|
+
|
|
73
|
+
When you can't trace manually, add instrumentation:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// Before the problematic operation
|
|
77
|
+
async function gitInit(directory: string) {
|
|
78
|
+
const stack = new Error().stack;
|
|
79
|
+
console.error('DEBUG git init:', {
|
|
80
|
+
directory,
|
|
81
|
+
cwd: process.cwd(),
|
|
82
|
+
nodeEnv: process.env.NODE_ENV,
|
|
83
|
+
stack,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
await execFileAsync('git', ['init'], { cwd: directory });
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Critical:** Use `console.error()` in tests (not logger - may not show)
|
|
91
|
+
|
|
92
|
+
**Run and capture:**
|
|
93
|
+
```bash
|
|
94
|
+
npm test 2>&1 | grep 'DEBUG git init'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Analyze stack traces:**
|
|
98
|
+
- Look for test file names
|
|
99
|
+
- Find the line number triggering the call
|
|
100
|
+
- Identify the pattern (same test? same parameter?)
|
|
101
|
+
|
|
102
|
+
## Finding Which Test Causes Pollution
|
|
103
|
+
|
|
104
|
+
If something appears during tests but you don't know which test:
|
|
105
|
+
|
|
106
|
+
Use the bisection script: @find-polluter.sh
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
./find-polluter.sh '.git' 'src/**/*.test.ts'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Runs tests one-by-one, stops at first polluter. See script for usage.
|
|
113
|
+
|
|
114
|
+
## Real Example: Empty projectDir
|
|
115
|
+
|
|
116
|
+
**Symptom:** `.git` created in `packages/core/` (source code)
|
|
117
|
+
|
|
118
|
+
**Trace chain:**
|
|
119
|
+
1. `git init` runs in `process.cwd()` ← empty cwd parameter
|
|
120
|
+
2. WorktreeManager called with empty projectDir
|
|
121
|
+
3. Session.create() passed empty string
|
|
122
|
+
4. Test accessed `context.tempDir` before beforeEach
|
|
123
|
+
5. setupCoreTest() returns `{ tempDir: '' }` initially
|
|
124
|
+
|
|
125
|
+
**Root cause:** Top-level variable initialization accessing empty value
|
|
126
|
+
|
|
127
|
+
**Fix:** Made tempDir a getter that throws if accessed before beforeEach
|
|
128
|
+
|
|
129
|
+
**Also added defense-in-depth:**
|
|
130
|
+
- Layer 1: Project.create() validates directory
|
|
131
|
+
- Layer 2: WorkspaceManager validates not empty
|
|
132
|
+
- Layer 3: NODE_ENV guard refuses git init outside tmpdir
|
|
133
|
+
- Layer 4: Stack trace logging before git init
|
|
134
|
+
|
|
135
|
+
## Key Principle
|
|
136
|
+
|
|
137
|
+
```dot
|
|
138
|
+
digraph principle {
|
|
139
|
+
"Found immediate cause" [shape=ellipse];
|
|
140
|
+
"Can trace one level up?" [shape=diamond];
|
|
141
|
+
"Trace backwards" [shape=box];
|
|
142
|
+
"Is this the source?" [shape=diamond];
|
|
143
|
+
"Fix at source" [shape=box];
|
|
144
|
+
"Add validation at each layer" [shape=box];
|
|
145
|
+
"Bug impossible" [shape=doublecircle];
|
|
146
|
+
"NEVER fix just the symptom" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
|
|
147
|
+
|
|
148
|
+
"Found immediate cause" -> "Can trace one level up?";
|
|
149
|
+
"Can trace one level up?" -> "Trace backwards" [label="yes"];
|
|
150
|
+
"Can trace one level up?" -> "NEVER fix just the symptom" [label="no"];
|
|
151
|
+
"Trace backwards" -> "Is this the source?";
|
|
152
|
+
"Is this the source?" -> "Trace backwards" [label="no - keeps going"];
|
|
153
|
+
"Is this the source?" -> "Fix at source" [label="yes"];
|
|
154
|
+
"Fix at source" -> "Add validation at each layer";
|
|
155
|
+
"Add validation at each layer" -> "Bug impossible";
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**NEVER fix just where the error appears.** Trace back to find the original trigger.
|
|
160
|
+
|
|
161
|
+
## Stack Trace Tips
|
|
162
|
+
|
|
163
|
+
**In tests:** Use `console.error()` not logger - logger may be suppressed
|
|
164
|
+
**Before operation:** Log before the dangerous operation, not after it fails
|
|
165
|
+
**Include context:** Directory, cwd, environment variables, timestamps
|
|
166
|
+
**Capture stack:** `new Error().stack` shows complete call chain
|
|
167
|
+
|
|
168
|
+
## Real-World Impact
|
|
169
|
+
|
|
170
|
+
From debugging session (2025-10-03):
|
|
171
|
+
- Found root cause through 5-level trace
|
|
172
|
+
- Fixed at source (getter validation)
|
|
173
|
+
- Added 4 layers of defense
|
|
174
|
+
- 1847 tests passed, zero pollution
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Bisection script to find which test creates unwanted files/state
|
|
3
|
+
# Usage: ./find-polluter.sh <file_or_dir_to_check> <test_pattern>
|
|
4
|
+
# Example: ./find-polluter.sh '.git' 'src/**/*.test.ts'
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
if [ $# -ne 2 ]; then
|
|
9
|
+
echo "Usage: $0 <file_to_check> <test_pattern>"
|
|
10
|
+
echo "Example: $0 '.git' 'src/**/*.test.ts'"
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
POLLUTION_CHECK="$1"
|
|
15
|
+
TEST_PATTERN="$2"
|
|
16
|
+
|
|
17
|
+
echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
|
|
18
|
+
echo "Test pattern: $TEST_PATTERN"
|
|
19
|
+
echo ""
|
|
20
|
+
|
|
21
|
+
# Get list of test files
|
|
22
|
+
TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
|
|
23
|
+
TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
|
|
24
|
+
|
|
25
|
+
echo "Found $TOTAL test files"
|
|
26
|
+
echo ""
|
|
27
|
+
|
|
28
|
+
COUNT=0
|
|
29
|
+
for TEST_FILE in $TEST_FILES; do
|
|
30
|
+
COUNT=$((COUNT + 1))
|
|
31
|
+
|
|
32
|
+
# Skip if pollution already exists
|
|
33
|
+
if [ -e "$POLLUTION_CHECK" ]; then
|
|
34
|
+
echo "⚠️ Pollution already exists before test $COUNT/$TOTAL"
|
|
35
|
+
echo " Skipping: $TEST_FILE"
|
|
36
|
+
continue
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
echo "[$COUNT/$TOTAL] Testing: $TEST_FILE"
|
|
40
|
+
|
|
41
|
+
# Run the test
|
|
42
|
+
npm test "$TEST_FILE" > /dev/null 2>&1 || true
|
|
43
|
+
|
|
44
|
+
# Check if pollution appeared
|
|
45
|
+
if [ -e "$POLLUTION_CHECK" ]; then
|
|
46
|
+
echo ""
|
|
47
|
+
echo "🎯 FOUND POLLUTER!"
|
|
48
|
+
echo " Test: $TEST_FILE"
|
|
49
|
+
echo " Created: $POLLUTION_CHECK"
|
|
50
|
+
echo ""
|
|
51
|
+
echo "Pollution details:"
|
|
52
|
+
ls -la "$POLLUTION_CHECK"
|
|
53
|
+
echo ""
|
|
54
|
+
echo "To investigate:"
|
|
55
|
+
echo " npm test $TEST_FILE # Run just this test"
|
|
56
|
+
echo " cat $TEST_FILE # Review test code"
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
done
|
|
60
|
+
|
|
61
|
+
echo ""
|
|
62
|
+
echo "✅ No polluter found - all tests clean!"
|
|
63
|
+
exit 0
|