@takuma-hirai/hirai-method 0.1.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/.stale-harness-state/last-check +0 -0
- package/.claude/CommonRules.md +121 -0
- package/.claude/agents/01-core-development/api-designer.md +237 -0
- package/.claude/agents/01-core-development/backend-developer.md +222 -0
- package/.claude/agents/01-core-development/design-bridge.md +127 -0
- package/.claude/agents/01-core-development/electron-pro.md +240 -0
- package/.claude/agents/01-core-development/frontend-developer.md +133 -0
- package/.claude/agents/01-core-development/fullstack-developer.md +235 -0
- package/.claude/agents/01-core-development/graphql-architect.md +238 -0
- package/.claude/agents/01-core-development/microservices-architect.md +239 -0
- package/.claude/agents/01-core-development/mobile-developer.md +283 -0
- package/.claude/agents/01-core-development/ui-designer.md +174 -0
- package/.claude/agents/01-core-development/websocket-engineer.md +150 -0
- package/.claude/agents/03-infrastructure/azure-infra-engineer.md +53 -0
- package/.claude/agents/03-infrastructure/cloud-architect.md +277 -0
- package/.claude/agents/03-infrastructure/database-administrator.md +287 -0
- package/.claude/agents/03-infrastructure/deployment-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/devops-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/devops-incident-responder.md +287 -0
- package/.claude/agents/03-infrastructure/docker-expert.md +278 -0
- package/.claude/agents/03-infrastructure/incident-responder.md +287 -0
- package/.claude/agents/03-infrastructure/kubernetes-specialist.md +287 -0
- package/.claude/agents/03-infrastructure/network-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/platform-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/security-engineer.md +277 -0
- package/.claude/agents/03-infrastructure/sre-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/terraform-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/terragrunt-expert.md +307 -0
- package/.claude/agents/03-infrastructure/windows-infra-admin.md +52 -0
- package/.claude/agents/04-quality-security/accessibility-tester.md +277 -0
- package/.claude/agents/04-quality-security/ad-security-reviewer.md +56 -0
- package/.claude/agents/04-quality-security/ai-writing-auditor.md +77 -0
- package/.claude/agents/04-quality-security/architect-reviewer.md +287 -0
- package/.claude/agents/04-quality-security/chaos-engineer.md +277 -0
- package/.claude/agents/04-quality-security/code-reviewer.md +287 -0
- package/.claude/agents/04-quality-security/compliance-auditor.md +277 -0
- package/.claude/agents/04-quality-security/debugger.md +287 -0
- package/.claude/agents/04-quality-security/error-detective.md +287 -0
- package/.claude/agents/04-quality-security/penetration-tester.md +287 -0
- package/.claude/agents/04-quality-security/performance-engineer.md +287 -0
- package/.claude/agents/04-quality-security/powershell-security-hardening.md +54 -0
- package/.claude/agents/04-quality-security/qa-expert.md +287 -0
- package/.claude/agents/04-quality-security/security-auditor.md +287 -0
- package/.claude/agents/04-quality-security/test-automator.md +287 -0
- package/.claude/agents/04-quality-security/ui-ux-tester.md +234 -0
- package/.claude/agents/06-developer-experience/build-engineer.md +286 -0
- package/.claude/agents/06-developer-experience/cli-developer.md +286 -0
- package/.claude/agents/06-developer-experience/dependency-manager.md +286 -0
- package/.claude/agents/06-developer-experience/documentation-engineer.md +276 -0
- package/.claude/agents/06-developer-experience/dx-optimizer.md +286 -0
- package/.claude/agents/06-developer-experience/git-workflow-manager.md +286 -0
- package/.claude/agents/06-developer-experience/legacy-modernizer.md +286 -0
- package/.claude/agents/06-developer-experience/mcp-developer.md +275 -0
- package/.claude/agents/06-developer-experience/powershell-module-architect.md +58 -0
- package/.claude/agents/06-developer-experience/powershell-ui-architect.md +135 -0
- package/.claude/agents/06-developer-experience/readme-generator.md +238 -0
- package/.claude/agents/06-developer-experience/refactoring-specialist.md +286 -0
- package/.claude/agents/06-developer-experience/slack-expert.md +232 -0
- package/.claude/agents/06-developer-experience/tooling-engineer.md +286 -0
- package/.claude/agents/09-meta-orchestration/agent-installer.md +97 -0
- package/.claude/agents/09-meta-orchestration/agent-organizer.md +287 -0
- package/.claude/agents/09-meta-orchestration/codebase-orchestrator.md +249 -0
- package/.claude/agents/09-meta-orchestration/context-manager.md +287 -0
- package/.claude/agents/09-meta-orchestration/error-coordinator.md +287 -0
- package/.claude/agents/09-meta-orchestration/it-ops-orchestrator.md +60 -0
- package/.claude/agents/09-meta-orchestration/knowledge-synthesizer.md +287 -0
- package/.claude/agents/09-meta-orchestration/multi-agent-coordinator.md +287 -0
- package/.claude/agents/09-meta-orchestration/performance-monitor.md +287 -0
- package/.claude/agents/09-meta-orchestration/task-distributor.md +287 -0
- package/.claude/agents/09-meta-orchestration/workflow-orchestrator.md +287 -0
- package/.claude/agents/10-research-analysis/competitive-analyst.md +287 -0
- package/.claude/agents/10-research-analysis/data-researcher.md +287 -0
- package/.claude/agents/10-research-analysis/market-researcher.md +287 -0
- package/.claude/agents/10-research-analysis/project-idea-validator.md +269 -0
- package/.claude/agents/10-research-analysis/research-analyst.md +287 -0
- package/.claude/agents/10-research-analysis/scientific-literature-researcher.md +151 -0
- package/.claude/agents/10-research-analysis/search-specialist.md +287 -0
- package/.claude/agents/10-research-analysis/trend-analyst.md +287 -0
- package/.claude/archive/README.md +47 -0
- package/.claude/archive/agents/02-language-specialists/angular-architect.md +287 -0
- package/.claude/archive/agents/02-language-specialists/cpp-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/csharp-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/django-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/dotnet-core-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/dotnet-framework-4.8-expert.md +306 -0
- package/.claude/archive/agents/02-language-specialists/elixir-expert.md +311 -0
- package/.claude/archive/agents/02-language-specialists/expo-react-native-expert.md +268 -0
- package/.claude/archive/agents/02-language-specialists/fastapi-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/flutter-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/golang-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/java-architect.md +287 -0
- package/.claude/archive/agents/02-language-specialists/javascript-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/kotlin-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/laravel-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/nextjs-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/node-specialist.md +124 -0
- package/.claude/archive/agents/02-language-specialists/php-pro.md +287 -0
- package/.claude/archive/agents/02-language-specialists/powershell-5.1-expert.md +59 -0
- package/.claude/archive/agents/02-language-specialists/powershell-7-expert.md +57 -0
- package/.claude/archive/agents/02-language-specialists/python-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/rails-expert.md +358 -0
- package/.claude/archive/agents/02-language-specialists/react-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/rust-engineer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/spring-boot-engineer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/sql-pro.md +287 -0
- package/.claude/archive/agents/02-language-specialists/swift-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/symfony-specialist.md +354 -0
- package/.claude/archive/agents/02-language-specialists/typescript-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/vue-expert.md +287 -0
- package/.claude/archive/agents/05-data-ai/ai-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/data-analyst.md +277 -0
- package/.claude/archive/agents/05-data-ai/data-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/data-scientist.md +287 -0
- package/.claude/archive/agents/05-data-ai/database-optimizer.md +287 -0
- package/.claude/archive/agents/05-data-ai/llm-architect.md +287 -0
- package/.claude/archive/agents/05-data-ai/machine-learning-engineer.md +277 -0
- package/.claude/archive/agents/05-data-ai/ml-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/mlops-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/nlp-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/postgres-pro.md +287 -0
- package/.claude/archive/agents/05-data-ai/prompt-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/reinforcement-learning-engineer.md +277 -0
- package/.claude/archive/agents/07-specialized-domains/api-documenter.md +277 -0
- package/.claude/archive/agents/07-specialized-domains/blockchain-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/embedded-systems.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/fintech-engineer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/game-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/healthcare-admin.md +199 -0
- package/.claude/archive/agents/07-specialized-domains/iot-engineer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/m365-admin.md +48 -0
- package/.claude/archive/agents/07-specialized-domains/mobile-app-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/payment-integration.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/quant-analyst.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/risk-manager.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/seo-specialist.md +184 -0
- package/.claude/archive/agents/08-business-product/business-analyst.md +287 -0
- package/.claude/archive/agents/08-business-product/content-marketer.md +287 -0
- package/.claude/archive/agents/08-business-product/customer-success-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/legal-advisor.md +287 -0
- package/.claude/archive/agents/08-business-product/license-engineer.md +295 -0
- package/.claude/archive/agents/08-business-product/product-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/project-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/sales-engineer.md +287 -0
- package/.claude/archive/agents/08-business-product/scrum-master.md +287 -0
- package/.claude/archive/agents/08-business-product/technical-writer.md +287 -0
- package/.claude/archive/agents/08-business-product/ux-researcher.md +287 -0
- package/.claude/archive/agents/08-business-product/wordpress-master.md +316 -0
- package/.claude/archive/skills/competitive-ads-extractor/SKILL.md +293 -0
- package/.claude/archive/skills/developer-growth-analysis/SKILL.md +322 -0
- package/.claude/archive/skills/document-docx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-docx/SKILL.md +197 -0
- package/.claude/archive/skills/document-docx/docx-js.md +350 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/pack.py +159 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/unpack.py +29 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validate.py +69 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/__init__.py +15 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/base.py +951 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/docx.py +274 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/pptx.py +315 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/redlining.py +279 -0
- package/.claude/archive/skills/document-docx/ooxml.md +610 -0
- package/.claude/archive/skills/document-docx/scripts/__init__.py +1 -0
- package/.claude/archive/skills/document-docx/scripts/document.py +1276 -0
- package/.claude/archive/skills/document-docx/scripts/templates/comments.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsExtended.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsExtensible.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsIds.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/people.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/utilities.py +374 -0
- package/.claude/archive/skills/document-pdf/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-pdf/SKILL.md +294 -0
- package/.claude/archive/skills/document-pdf/forms.md +205 -0
- package/.claude/archive/skills/document-pdf/reference.md +612 -0
- package/.claude/archive/skills/document-pdf/scripts/check_bounding_boxes.py +70 -0
- package/.claude/archive/skills/document-pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/.claude/archive/skills/document-pdf/scripts/check_fillable_fields.py +12 -0
- package/.claude/archive/skills/document-pdf/scripts/convert_pdf_to_images.py +35 -0
- package/.claude/archive/skills/document-pdf/scripts/create_validation_image.py +41 -0
- package/.claude/archive/skills/document-pdf/scripts/extract_form_field_info.py +152 -0
- package/.claude/archive/skills/document-pdf/scripts/fill_fillable_fields.py +114 -0
- package/.claude/archive/skills/document-pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/.claude/archive/skills/document-pptx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-pptx/SKILL.md +484 -0
- package/.claude/archive/skills/document-pptx/html2pptx.md +625 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/pack.py +159 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/unpack.py +29 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validate.py +69 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/base.py +951 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/docx.py +274 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/.claude/archive/skills/document-pptx/ooxml.md +427 -0
- package/.claude/archive/skills/document-pptx/scripts/html2pptx.js +979 -0
- package/.claude/archive/skills/document-pptx/scripts/inventory.py +1020 -0
- package/.claude/archive/skills/document-pptx/scripts/rearrange.py +231 -0
- package/.claude/archive/skills/document-pptx/scripts/replace.py +385 -0
- package/.claude/archive/skills/document-pptx/scripts/thumbnail.py +450 -0
- package/.claude/archive/skills/document-xlsx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-xlsx/SKILL.md +289 -0
- package/.claude/archive/skills/document-xlsx/recalc.py +178 -0
- package/.claude/archive/skills/image-enhancer/SKILL.md +99 -0
- package/.claude/archive/skills/meeting-insights-analyzer/SKILL.md +327 -0
- package/.claude/archive/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/.claude/archive/skills/slack-gif-creator/SKILL.md +646 -0
- package/.claude/archive/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/.claude/archive/skills/slack-gif-creator/core/easing.py +230 -0
- package/.claude/archive/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/.claude/archive/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/.claude/archive/skills/slack-gif-creator/core/typography.py +357 -0
- package/.claude/archive/skills/slack-gif-creator/core/validators.py +264 -0
- package/.claude/archive/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/.claude/archive/skills/slack-gif-creator/requirements.txt +4 -0
- package/.claude/archive/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/.claude/archive/skills/slack-gif-creator/templates/explode.py +331 -0
- package/.claude/archive/skills/slack-gif-creator/templates/fade.py +329 -0
- package/.claude/archive/skills/slack-gif-creator/templates/flip.py +291 -0
- package/.claude/archive/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/.claude/archive/skills/slack-gif-creator/templates/morph.py +329 -0
- package/.claude/archive/skills/slack-gif-creator/templates/move.py +293 -0
- package/.claude/archive/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/.claude/archive/skills/slack-gif-creator/templates/shake.py +127 -0
- package/.claude/archive/skills/slack-gif-creator/templates/slide.py +291 -0
- package/.claude/archive/skills/slack-gif-creator/templates/spin.py +269 -0
- package/.claude/archive/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/.claude/archive/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/.claude/archive/skills/twitter-algorithm-optimizer/SKILL.md +327 -0
- package/.claude/archive/skills/video-downloader/SKILL.md +99 -0
- package/.claude/archive/skills/video-downloader/scripts/download_video.py +145 -0
- package/.claude/bash-whitelist-requests/2026-05-28-grep-find-rg.md +68 -0
- package/.claude/bash-whitelist-requests/2026-06-01-readonly-filters.md +76 -0
- package/.claude/bash-whitelist.txt +124 -0
- package/.claude/commands/agent-introspect.md +89 -0
- package/.claude/commands/apply-rules.md +363 -0
- package/.claude/commands/approve-design.md +219 -0
- package/.claude/commands/approve-org-money.md +267 -0
- package/.claude/commands/build.md +234 -0
- package/.claude/commands/commit.md +97 -0
- package/.claude/commands/context-fetch.md +113 -0
- package/.claude/commands/create-tool.md +496 -0
- package/.claude/commands/design-review.md +138 -0
- package/.claude/commands/design.md +807 -0
- package/.claude/commands/discharge-byproduct.md +208 -0
- package/.claude/commands/doc-review.md +165 -0
- package/.claude/commands/document-pair.md +76 -0
- package/.claude/commands/error-triage.md +435 -0
- package/.claude/commands/eval.md +70 -0
- package/.claude/commands/evolve.md +49 -0
- package/.claude/commands/finish-task.md +105 -0
- package/.claude/commands/gan-build.md +91 -0
- package/.claude/commands/gan-design.md +82 -0
- package/.claude/commands/gate-bypass.md +77 -0
- package/.claude/commands/gate-clear.md +45 -0
- package/.claude/commands/gate-status.md +46 -0
- package/.claude/commands/harness-audit.md +151 -0
- package/.claude/commands/hearing.md +138 -0
- package/.claude/commands/impact-check.md +486 -0
- package/.claude/commands/init-tasks.md +49 -0
- package/.claude/commands/instinct-export.md +47 -0
- package/.claude/commands/instinct-import.md +41 -0
- package/.claude/commands/instinct-status.md +43 -0
- package/.claude/commands/investigate.md +547 -0
- package/.claude/commands/learn.md +55 -0
- package/.claude/commands/lint-rules.md +400 -0
- package/.claude/commands/mode.md +58 -0
- package/.claude/commands/modify-feature.md +209 -0
- package/.claude/commands/module-review.md +149 -0
- package/.claude/commands/move-section.md +67 -0
- package/.claude/commands/new-draft.md +67 -0
- package/.claude/commands/new-feature.md +286 -0
- package/.claude/commands/new-task.md +156 -0
- package/.claude/commands/notification.md +107 -0
- package/.claude/commands/pm-start.md +119 -0
- package/.claude/commands/projects.md +32 -0
- package/.claude/commands/promote.md +43 -0
- package/.claude/commands/rasis-report.md +1323 -0
- package/.claude/commands/release-note.md +130 -0
- package/.claude/commands/reply-watch.md +149 -0
- package/.claude/commands/requirement.md +352 -0
- package/.claude/commands/resume-state.md +187 -0
- package/.claude/commands/reviewpr.md +118 -0
- package/.claude/commands/save-state.md +100 -0
- package/.claude/commands/sentry-pr.md +157 -0
- package/.claude/commands/start-task.md +87 -0
- package/.claude/commands/system-review.md +147 -0
- package/.claude/commands/task-bypass.md +70 -0
- package/.claude/commands/task-estimate.md +100 -0
- package/.claude/commands/template-apply.md +89 -0
- package/.claude/commands/test-design.md +116 -0
- package/.claude/commands/transfer-mismatch.md +317 -0
- package/.claude/commands/verify.md +51 -0
- package/.claude/evals/grader-loop-mode-autonomy.sh +165 -0
- package/.claude/evals/grader-system-reminder-attention.sh +99 -0
- package/.claude/evals/loop-mode-autonomy.md +121 -0
- package/.claude/evals/loop-mode-autonomy.results.template.md +133 -0
- package/.claude/evals/system-reminder-attention.md +123 -0
- package/.claude/evals/system-reminder-attention.results.template.md +93 -0
- package/.claude/evals/system-reminder-attention.runner.md +353 -0
- package/.claude/harness-config.local.yml +48 -0
- package/.claude/harness-config.yml +534 -0
- package/.claude/hooks/agent-marker-clear.sh +43 -0
- package/.claude/hooks/agent-marker-set.sh +40 -0
- package/.claude/hooks/agent-router-suggest.sh +123 -0
- package/.claude/hooks/autonomous-action-guard.sh +242 -0
- package/.claude/hooks/byproduct-discharge-guard.sh +128 -0
- package/.claude/hooks/check-md-mermaid.sh +144 -0
- package/.claude/hooks/check-required-env.sh +95 -0
- package/.claude/hooks/check-serena-mcp.sh +123 -0
- package/.claude/hooks/confidence-gate.sh +139 -0
- package/.claude/hooks/context-budget.sh +233 -0
- package/.claude/hooks/delegation-guard.sh +99 -0
- package/.claude/hooks/dispatcher-manifest.tsv +38 -0
- package/.claude/hooks/draft-flow-guard.sh +304 -0
- package/.claude/hooks/failure-loop-detect.sh +139 -0
- package/.claude/hooks/gateguard.sh +209 -0
- package/.claude/hooks/improvement-proposal.sh +112 -0
- package/.claude/hooks/init-tasks-on-start.sh +34 -0
- package/.claude/hooks/lib/bypass-logger.sh +82 -0
- package/.claude/hooks/lib/confidence-gate/bypass.sh +48 -0
- package/.claude/hooks/lib/confidence-gate/extract.sh +99 -0
- package/.claude/hooks/lib/confidence-gate/major-agent-filter.sh +59 -0
- package/.claude/hooks/lib/confidence-gate/messages.sh +53 -0
- package/.claude/hooks/lib/config-loader.sh +784 -0
- package/.claude/hooks/lib/delegation-guard/bash-whitelist.sh +323 -0
- package/.claude/hooks/lib/delegation-guard/git-deny.sh +188 -0
- package/.claude/hooks/lib/delegation-guard/protected-paths.sh +105 -0
- package/.claude/hooks/lib/delegation-guard/subagent-detect.sh +40 -0
- package/.claude/hooks/lib/dispatcher-core.sh +454 -0
- package/.claude/hooks/lib/improvement-proposal/aggregate.py +466 -0
- package/.claude/hooks/lib/improvement-proposal/cache.sh +78 -0
- package/.claude/hooks/lib/mode-loader.sh +80 -0
- package/.claude/hooks/lib/next-actions-parser.sh +153 -0
- package/.claude/hooks/lib/project-root.sh +60 -0
- package/.claude/hooks/list-md-plan-first-reminder.sh +143 -0
- package/.claude/hooks/loop-auto-progress-reminder.sh +108 -0
- package/.claude/hooks/loop-confirmation-detector.sh +241 -0
- package/.claude/hooks/mode-asana-prompt.sh +61 -0
- package/.claude/hooks/mode-enforce.sh +57 -0
- package/.claude/hooks/mode-session-start.sh +93 -0
- package/.claude/hooks/next-actions-surface.sh +136 -0
- package/.claude/hooks/notification-dispatcher.sh +9 -0
- package/.claude/hooks/notify.sh +27 -0
- package/.claude/hooks/parallel-subagent-reminder.sh +469 -0
- package/.claude/hooks/post-tool-use-dispatcher.sh +9 -0
- package/.claude/hooks/pre-tool-use-dispatcher.sh +9 -0
- package/.claude/hooks/reviewer-count-guard.sh +313 -0
- package/.claude/hooks/session-help-surface.sh +192 -0
- package/.claude/hooks/session-start-dispatcher.sh +9 -0
- package/.claude/hooks/session-start-wrapper.sh +156 -0
- package/.claude/hooks/stale-harness-detect.sh +422 -0
- package/.claude/hooks/stop-dispatcher.sh +9 -0
- package/.claude/hooks/stop.sh +25 -0
- package/.claude/hooks/subagent-stop-dispatcher.sh +9 -0
- package/.claude/hooks/task-rule-guard.sh +317 -0
- package/.claude/hooks/tests/run-tests.sh +23 -0
- package/.claude/hooks/tests/test-agent-marker-warn.sh +86 -0
- package/.claude/hooks/tests/test-check-required-env.sh +138 -0
- package/.claude/hooks/tests/test-confidence-gate.sh +170 -0
- package/.claude/hooks/tests/test-config-env-override.sh +220 -0
- package/.claude/hooks/tests/test-gate-disable.sh +118 -0
- package/.claude/hooks/tests/test-improvement-proposal.sh +284 -0
- package/.claude/hooks/tool-call-slip-detector.sh +188 -0
- package/.claude/hooks/user-prompt-submit-dispatcher.sh +9 -0
- package/.claude/hooks/why-x5-reminder.sh +45 -0
- package/.claude/hooks/why-x5-violation-detect.sh +152 -0
- package/.claude/hooks/workflow-guard.sh +263 -0
- package/.claude/mode.yml +28 -0
- package/.claude/project-rules/development-process.md +8 -0
- package/.claude/project-rules/git-workflow.md +8 -0
- package/.claude/project-rules/modes.md +8 -0
- package/.claude/project-rules/self-improvement.md +8 -0
- package/.claude/project-rules/task-management.md +8 -0
- package/.claude/project-rules/why-x5-output.md +8 -0
- package/.claude/project-rules/workflow.md +8 -0
- package/.claude/rules/development-process.md +293 -0
- package/.claude/rules/git-workflow.md +71 -0
- package/.claude/rules/modes.md +189 -0
- package/.claude/rules/self-improvement.md +76 -0
- package/.claude/rules/task-management.md +261 -0
- package/.claude/rules/why-x5-output.md +97 -0
- package/.claude/rules/workflow.md +157 -0
- package/.claude/rules-details/README.md +67 -0
- package/.claude/rules-details/development-process/confidence-gate.md +22 -0
- package/.claude/rules-details/development-process/cross-repo-write.md +35 -0
- package/.claude/rules-details/development-process/delegation-requirements.md +158 -0
- package/.claude/rules-details/development-process/harness-sync.md +21 -0
- package/.claude/rules-details/development-process/origin.md +13 -0
- package/.claude/rules-details/development-process/parallelization-origin.md +22 -0
- package/.claude/rules-details/development-process/research-reuse.md +22 -0
- package/.claude/rules-details/development-process/staging-strategy.md +47 -0
- package/.claude/rules-details/modes/artifacts.md +34 -0
- package/.claude/rules-details/modes/compliance-items.md +120 -0
- package/.claude/rules-details/modes/five-layer-enforcement.md +46 -0
- package/.claude/rules-details/modes/mode-hooks.md +51 -0
- package/.claude/rules-details/modes/origin.md +17 -0
- package/.claude/rules-details/self-improvement/l4-mechanics.md +36 -0
- package/.claude/rules-details/self-improvement/origin.md +8 -0
- package/.claude/rules-details/self-improvement/related-skills.md +35 -0
- package/.claude/rules-details/self-improvement/when-to-use-layers.md +39 -0
- package/.claude/rules-details/task-management/hook-enforcement.md +25 -0
- package/.claude/rules-details/task-management/mandatory-reading.md +20 -0
- package/.claude/rules-details/task-management/origin.md +12 -0
- package/.claude/rules-details/task-management/parking-lot.md +26 -0
- package/.claude/rules-details/task-management/plan-first.md +44 -0
- package/.claude/rules-details/task-management/six-articles.md +68 -0
- package/.claude/rules-details/task-management/task-migration.md +16 -0
- package/.claude/rules-details/task-management/ui-detection.md +11 -0
- package/.claude/rules-details/why-x5-output/examples.md +41 -0
- package/.claude/rules-details/why-x5-output/feedback-memory.md +14 -0
- package/.claude/rules-details/why-x5-output/origin.md +10 -0
- package/.claude/rules-details/why-x5-output/v1-v10-history.md +19 -0
- package/.claude/rules-details/workflow/10-stage.md +43 -0
- package/.claude/rules-details/workflow/14-stage.md +52 -0
- package/.claude/rules-details/workflow/byproduct-discharge.md +39 -0
- package/.claude/rules-details/workflow/draft-flow-guard.md +31 -0
- package/.claude/rules-details/workflow/fan-out.md +70 -0
- package/.claude/rules-details/workflow/mece-20.md +36 -0
- package/.claude/rules-details/workflow/origin.md +14 -0
- package/.claude/rules-details/workflow/refactoring.md +48 -0
- package/.claude/rules-details/workflow/related-skills.md +22 -0
- package/.claude/rules-details/workflow/reviewer-prompt.md +100 -0
- package/.claude/rules-details/workflow/session-persistence.md +46 -0
- package/.claude/rules-details/workflow/workflow-guard.md +36 -0
- package/.claude/scripts/__pycache__/harness-audit.cpython-313.pyc +0 -0
- package/.claude/scripts/agent-stocktake.py +421 -0
- package/.claude/scripts/check-md-mermaid.mjs +138 -0
- package/.claude/scripts/generate-settings.sh +0 -0
- package/.claude/scripts/harness-audit.py +1547 -0
- package/.claude/scripts/hc-config.sh +2265 -0
- package/.claude/scripts/init-tasks.sh +117 -0
- package/.claude/scripts/lib/enforcement-matrix-parse.sh +81 -0
- package/.claude/scripts/lib/hc-config-metadata.sh +190 -0
- package/.claude/scripts/lib/hc-config-web-server.js +1528 -0
- package/.claude/scripts/lib/hc-config-web-ui/app.js +1054 -0
- package/.claude/scripts/lib/hc-config-web-ui/index.html +130 -0
- package/.claude/scripts/lib/hc-config-web-ui/style.css +522 -0
- package/.claude/scripts/new-task-helper.sh +432 -0
- package/.claude/scripts/observe-repair.sh +437 -0
- package/.claude/scripts/observe-rotate.sh +311 -0
- package/.claude/scripts/statusline.sh +239 -0
- package/.claude/settings.generated.preview.json +211 -0
- package/.claude/settings.json +215 -0
- package/.claude/settings.local.example.json +20 -0
- package/.claude/settings.local.json +36 -0
- package/.claude/skills/agent-introspection-debugging/SKILL.md +123 -0
- package/.claude/skills/agent-router/README.md +137 -0
- package/.claude/skills/agent-router/SKILL.md +74 -0
- package/.claude/skills/agent-router/dispatch-table.yml +352 -0
- package/.claude/skills/agent-router/router.py +1086 -0
- package/.claude/skills/agent-router/samples/representative_prompts.txt +24 -0
- package/.claude/skills/agent-router/tests/__init__.py +0 -0
- package/.claude/skills/agent-router/tests/test_router.py +762 -0
- package/.claude/skills/artifacts-builder/LICENSE.txt +202 -0
- package/.claude/skills/artifacts-builder/SKILL.md +74 -0
- package/.claude/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/.claude/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/.claude/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/.claude/skills/brand-guidelines/LICENSE.txt +202 -0
- package/.claude/skills/brand-guidelines/SKILL.md +73 -0
- package/.claude/skills/canvas-design/LICENSE.txt +202 -0
- package/.claude/skills/canvas-design/SKILL.md +130 -0
- package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/.claude/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/.claude/skills/changelog-generator/SKILL.md +104 -0
- package/.claude/skills/check-md-mermaid/SKILL.md +62 -0
- package/.claude/skills/connect/SKILL.md +156 -0
- package/.claude/skills/connect-apps/SKILL.md +80 -0
- package/.claude/skills/content-research-writer/SKILL.md +538 -0
- package/.claude/skills/continuous-agent-loop/SKILL.md +187 -0
- package/.claude/skills/continuous-learning-v2/SKILL.md +238 -0
- package/.claude/skills/continuous-learning-v2/config.json +35 -0
- package/.claude/skills/continuous-learning-v2/hooks/observe.sh +333 -0
- package/.claude/skills/continuous-learning-v2/instinct-cli.py +406 -0
- package/.claude/skills/domain-name-brainstormer/SKILL.md +212 -0
- package/.claude/skills/eval-harness/SKILL.md +100 -0
- package/.claude/skills/eval-harness/swe-bench/README.md +80 -0
- package/.claude/skills/eval-harness/swe-bench/config.yml +29 -0
- package/.claude/skills/eval-harness/swe-bench/docker/Dockerfile +25 -0
- package/.claude/skills/eval-harness/swe-bench/docker/docker-compose.yml +18 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-2026-05-04.json +137 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-comparison-2026-05-04.md +112 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-improved-2026-05-04.json +165 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.patch +12 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.txt +322 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.whole-file.txt +322 -0
- package/.claude/skills/eval-harness/swe-bench/runner.py +845 -0
- package/.claude/skills/eval-harness/swe-bench/scoring.py +298 -0
- package/.claude/skills/eval-harness/swe-bench/tasks/fetch_tasks.py +81 -0
- package/.claude/skills/eval-harness/swe-bench/tasks/lite-50.json +702 -0
- package/.claude/skills/file-organizer/SKILL.md +433 -0
- package/.claude/skills/gan-style-harness/SKILL.md +111 -0
- package/.claude/skills/gateguard/.gateguard.yml +47 -0
- package/.claude/skills/gateguard/SKILL.md +99 -0
- package/.claude/skills/internal-comms/LICENSE.txt +202 -0
- package/.claude/skills/internal-comms/SKILL.md +32 -0
- package/.claude/skills/internal-comms/examples/3p-updates.md +47 -0
- package/.claude/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/.claude/skills/internal-comms/examples/faq-answers.md +30 -0
- package/.claude/skills/internal-comms/examples/general-comms.md +16 -0
- package/.claude/skills/invoice-organizer/SKILL.md +446 -0
- package/.claude/skills/karpathy-guidelines/SKILL.md +67 -0
- package/.claude/skills/langsmith-fetch/SKILL.md +485 -0
- package/.claude/skills/lead-research-assistant/SKILL.md +199 -0
- package/.claude/skills/mcp-builder/LICENSE.txt +202 -0
- package/.claude/skills/mcp-builder/SKILL.md +328 -0
- package/.claude/skills/mcp-builder/reference/evaluation.md +602 -0
- package/.claude/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
- package/.claude/skills/mcp-builder/reference/node_mcp_server.md +916 -0
- package/.claude/skills/mcp-builder/reference/python_mcp_server.md +752 -0
- package/.claude/skills/mcp-builder/scripts/connections.py +151 -0
- package/.claude/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/.claude/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/.claude/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/.claude/skills/raffle-winner-picker/SKILL.md +159 -0
- package/.claude/skills/repo-map/README.md +125 -0
- package/.claude/skills/repo-map/SKILL.md +128 -0
- package/.claude/skills/repo-map/examples/sample-output.md +1194 -0
- package/.claude/skills/repo-map/repo-map.py +715 -0
- package/.claude/skills/salesforce-e2e-testing/SKILL.md +116 -0
- package/.claude/skills/salesforce-e2e-testing/catalog-template.md +161 -0
- package/.claude/skills/salesforce-e2e-testing/methodology.md +179 -0
- package/.claude/skills/salesforce-e2e-testing/observation-rules.md +280 -0
- package/.claude/skills/salesforce-e2e-testing/pattern-taxonomy.md +392 -0
- package/.claude/skills/salesforce-e2e-testing/procedure-template.md +376 -0
- package/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/.claude/skills/skill-creator/SKILL.md +209 -0
- package/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.claude/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/.claude/skills/skill-share/SKILL.md +80 -0
- package/.claude/skills/tailored-resume-generator/SKILL.md +345 -0
- package/.claude/skills/template-skill/SKILL.md +6 -0
- package/.claude/skills/theme-factory/LICENSE.txt +202 -0
- package/.claude/skills/theme-factory/SKILL.md +59 -0
- package/.claude/skills/theme-factory/theme-showcase.pdf +0 -0
- package/.claude/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/.claude/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/.claude/skills/theme-factory/themes/desert-rose.md +19 -0
- package/.claude/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/.claude/skills/theme-factory/themes/golden-hour.md +19 -0
- package/.claude/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/.claude/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/.claude/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/.claude/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/.claude/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/.claude/skills/verification-loop/SKILL.md +129 -0
- package/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/.claude/skills/webapp-testing/SKILL.md +96 -0
- package/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/.claude/templates/docs/draft/_DRAFT_TEMPLATE.md +162 -0
- package/.claude/templates/docs/draft/_TEST_DESIGN_TEMPLATE.md +76 -0
- package/.claude/templates/docs/tasks/_TASK_TEMPLATE.md +276 -0
- package/.claude/templates/docs/tasks/list.md +80 -0
- package/.claude/templates/docs/tasks/parking-lot.md +82 -0
- package/.claude/templates/settings.user-level.json.template +306 -0
- package/.claude/tests/SMOKE-CLASSIFICATION.md +199 -0
- package/.claude/tests/action-space-count-smoke.sh +130 -0
- package/.claude/tests/agent-router-suggest-wiring-smoke.sh +188 -0
- package/.claude/tests/audit-followups-smoke.sh +158 -0
- package/.claude/tests/autonomous-action-guard-relaxation-smoke.sh +479 -0
- package/.claude/tests/autonomous-action-guard-smoke.sh +187 -0
- package/.claude/tests/check-serena-mcp-smoke.sh +156 -0
- package/.claude/tests/common-rules-import-smoke.sh +209 -0
- package/.claude/tests/confidence-gate-smoke.sh +220 -0
- package/.claude/tests/config-feature-toggles-smoke.sh +389 -0
- package/.claude/tests/context-budget-smoke.sh +222 -0
- package/.claude/tests/custom-pm-commands-smoke.sh +93 -0
- package/.claude/tests/delegation-guard-code-smoke.sh +244 -0
- package/.claude/tests/delegation-guard-deny-layers-smoke.sh +356 -0
- package/.claude/tests/delegation-guard-readonly-filter-smoke.sh +205 -0
- package/.claude/tests/delegation-guard-search-whitelist-smoke.sh +152 -0
- package/.claude/tests/delegation-guard-segment-smoke.sh +109 -0
- package/.claude/tests/dispatcher-blocker-invariance-smoke.sh +700 -0
- package/.claude/tests/dispatcher-core-smoke.sh +452 -0
- package/.claude/tests/dispatcher-merge-matrix-smoke.sh +825 -0
- package/.claude/tests/dispatcher-success-stdout-smoke.sh +290 -0
- package/.claude/tests/draft-flow-guard-approved-dir-smoke.sh +234 -0
- package/.claude/tests/draft-flow-guard-smoke.sh +194 -0
- package/.claude/tests/dual-mode-portability-smoke.sh +131 -0
- package/.claude/tests/effective-hook-matrix-smoke.sh +261 -0
- package/.claude/tests/enforcement-mismatch-smoke.sh +263 -0
- package/.claude/tests/fixtures/cascade-sample.jsonl +9 -0
- package/.claude/tests/fixtures/next-actions/case-clean.md +14 -0
- package/.claude/tests/fixtures/next-actions/case-with-red.md +16 -0
- package/.claude/tests/fixtures/next-actions/case-with-yellow-only.md +14 -0
- package/.claude/tests/fixtures/normal-broken-scatter.jsonl +5 -0
- package/.claude/tests/fixtures/task-71/blocker-baseline.tsv +24 -0
- package/.claude/tests/fixtures/task-71/settings-inventory.tsv +37 -0
- package/.claude/tests/fixtures/transcript-50pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-60pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-80pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-95pct.jsonl +2 -0
- package/.claude/tests/fixtures/workflow-guard/case-2-mid.json +21 -0
- package/.claude/tests/fixtures/workflow-guard/case-3-blocked.json +33 -0
- package/.claude/tests/fixtures/workflow-guard/case-4-clean.json +27 -0
- package/.claude/tests/fixtures/workflow-guard/case-8-modify.json +23 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-1.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-2.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-3.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-4.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-5.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-6.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-7.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-8.json +1 -0
- package/.claude/tests/gateguard-smoke.sh +213 -0
- package/.claude/tests/git-deny-mainline-policy-smoke.sh +222 -0
- package/.claude/tests/harness-audit-c-batch-smoke.sh +270 -0
- package/.claude/tests/harness-audit-compare-smoke.sh +186 -0
- package/.claude/tests/harness-audit-pipeline-health-smoke.sh +326 -0
- package/.claude/tests/harness-config-local-smoke.sh +232 -0
- package/.claude/tests/hc-config-git-policy-smoke.sh +241 -0
- package/.claude/tests/hc-config-key-parity-smoke.sh +149 -0
- package/.claude/tests/hc-config-migration-smoke.sh +251 -0
- package/.claude/tests/hc-config-script-smoke.sh +1106 -0
- package/.claude/tests/hc-config-tui-smoke.sh +801 -0
- package/.claude/tests/hc-config-web-ui-smoke.sh +3224 -0
- package/.claude/tests/hook-cwd-robustness-smoke.sh +206 -0
- package/.claude/tests/hook-frequency-tweaks-smoke.sh +312 -0
- package/.claude/tests/improvement-proposal-cache-smoke.sh +238 -0
- package/.claude/tests/install-sh-overwrite-all-smoke.sh +274 -0
- package/.claude/tests/install-sh-regen-settings-smoke.sh +301 -0
- package/.claude/tests/install-sh-sync-drift-smoke.sh +285 -0
- package/.claude/tests/layer-b-context-isolation-smoke.sh +392 -0
- package/.claude/tests/list-md-plan-first-reminder-smoke.sh +313 -0
- package/.claude/tests/loop-auto-progress-smoke.sh +372 -0
- package/.claude/tests/loop-confirmation-detector-smoke.sh +674 -0
- package/.claude/tests/new-task-batch-update-smoke.sh +664 -0
- package/.claude/tests/next-actions-hooks-smoke.sh +283 -0
- package/.claude/tests/npx-cli-smoke.sh +696 -0
- package/.claude/tests/observe-flock-smoke.sh +223 -0
- package/.claude/tests/observe-jq-parse-smoke.sh +250 -0
- package/.claude/tests/observe-repair-smoke.sh +475 -0
- package/.claude/tests/observe-rotate-smoke.sh +428 -0
- package/.claude/tests/observe-subagent-stop-smoke.sh +476 -0
- package/.claude/tests/parallel-subagent-reminder-smoke.sh +918 -0
- package/.claude/tests/project-root-smoke.sh +140 -0
- package/.claude/tests/project-rules-protection-smoke.sh +199 -0
- package/.claude/tests/review-required-min-count-smoke.sh +286 -0
- package/.claude/tests/reviewer-count-guard-smoke.sh +490 -0
- package/.claude/tests/rule-architecture-smoke.sh +418 -0
- package/.claude/tests/rule-change-draft-flow-guard-smoke.sh +343 -0
- package/.claude/tests/run-all-smokes.sh +340 -0
- package/.claude/tests/session-help-surface-smoke.sh +224 -0
- package/.claude/tests/session-start-parallel-smoke.sh +165 -0
- package/.claude/tests/sessionstart-budget-smoke.sh +185 -0
- package/.claude/tests/sessionstart-footprint-smoke.sh +258 -0
- package/.claude/tests/settings-dispatcher-baseline-smoke.sh +709 -0
- package/.claude/tests/settings-generation-feature-pruning-smoke.sh +196 -0
- package/.claude/tests/stale-harness-detect-smoke.sh +974 -0
- package/.claude/tests/statusline-smoke.sh +180 -0
- package/.claude/tests/task-rule-guard-smoke.sh +656 -0
- package/.claude/tests/tool-call-slip-detector-smoke.sh +101 -0
- package/.claude/tests/wave-precheck-template-smoke.sh +159 -0
- package/.claude/tests/why-x5-violation-detect-smoke.sh +157 -0
- package/.claude/tests/workflow-guard-smoke.sh +266 -0
- package/CLAUDE.md +75 -0
- package/LICENSE +21 -0
- package/README.md +790 -0
- package/bin/cli.js +395 -0
- package/docs/INVENTORY.md +163 -0
- package/install.sh +769 -0
- package/package.json +25 -0
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# aggregate.py — improvement-proposal の集計 + heuristics + dedup ロジック
|
|
3
|
+
#
|
|
4
|
+
# 役割:
|
|
5
|
+
# observations.jsonl / hook state を集計し、heuristics に基づき
|
|
6
|
+
# 改善提案を生成、dedup state を考慮して stderr に出力する。
|
|
7
|
+
#
|
|
8
|
+
# 呼び出し方法:
|
|
9
|
+
# python3 .claude/hooks/lib/improvement-proposal/aggregate.py
|
|
10
|
+
#
|
|
11
|
+
# 環境変数で設定を受け取る (improvement-proposal.sh orchestrator が export):
|
|
12
|
+
# HC_IMPROVEMENT_PROPOSAL_LOOKBACK_DAYS
|
|
13
|
+
# HC_IMPROVEMENT_PROPOSAL_MAX_COUNT
|
|
14
|
+
# HC_IMPROVEMENT_PROPOSAL_DEDUP_HOURS
|
|
15
|
+
# HC_GATEGUARD_STATE_DIR
|
|
16
|
+
# HC_TASKGUARD_STATE_DIR
|
|
17
|
+
# HC_FAILURE_WINDOW_DIR
|
|
18
|
+
# HC_CONFIDENCE_STATE_DIR
|
|
19
|
+
# HC_HOMUNCULUS_ROOT
|
|
20
|
+
# ECC_IMPROVEMENT_PROPOSAL_TEST_NOW
|
|
21
|
+
# ABS_STATE_DIR
|
|
22
|
+
# PROJ_ROOT
|
|
23
|
+
# HC_IMPROVEMENT_PROPOSAL_OBS_COUNT_FILE
|
|
24
|
+
# HC_OBSERVE_PATH (test override)
|
|
25
|
+
#
|
|
26
|
+
# 出力: 集計結果を stderr に流す (caller は CACHE_TMP に capture して cache 書き込み)
|
|
27
|
+
|
|
28
|
+
import hashlib
|
|
29
|
+
import json
|
|
30
|
+
import os
|
|
31
|
+
import re
|
|
32
|
+
import subprocess
|
|
33
|
+
import sys
|
|
34
|
+
from collections import Counter
|
|
35
|
+
from datetime import datetime, timedelta, timezone
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
|
|
38
|
+
# === 設定読み込み ===
|
|
39
|
+
def env_int(name, default):
|
|
40
|
+
try:
|
|
41
|
+
return int(os.environ.get(name, "") or default)
|
|
42
|
+
except (TypeError, ValueError):
|
|
43
|
+
return default
|
|
44
|
+
|
|
45
|
+
LOOKBACK_DAYS = env_int("HC_IMPROVEMENT_PROPOSAL_LOOKBACK_DAYS", 7)
|
|
46
|
+
MAX_COUNT = env_int("HC_IMPROVEMENT_PROPOSAL_MAX_COUNT", 3)
|
|
47
|
+
DEDUP_HOURS = env_int("HC_IMPROVEMENT_PROPOSAL_DEDUP_HOURS", 24)
|
|
48
|
+
|
|
49
|
+
PROJ_ROOT = Path(os.environ.get("PROJ_ROOT", os.getcwd()))
|
|
50
|
+
STATE_DIR = Path(os.environ.get("ABS_STATE_DIR", str(PROJ_ROOT / ".claude" / ".improvement-proposal-state")))
|
|
51
|
+
|
|
52
|
+
def _abs(rel_or_abs):
|
|
53
|
+
p = Path(rel_or_abs)
|
|
54
|
+
if p.is_absolute():
|
|
55
|
+
return p
|
|
56
|
+
return PROJ_ROOT / p
|
|
57
|
+
|
|
58
|
+
GATEGUARD_DIR = _abs(os.environ.get("HC_GATEGUARD_STATE_DIR", ".claude/.gateguard-state"))
|
|
59
|
+
TASKGUARD_DIR = _abs(os.environ.get("HC_TASKGUARD_STATE_DIR", ".claude/.taskguard-state"))
|
|
60
|
+
FAILURE_DIR = _abs(os.environ.get("HC_FAILURE_WINDOW_DIR", ".claude/.failure-window"))
|
|
61
|
+
CONFIDENCE_DIR = _abs(os.environ.get("HC_CONFIDENCE_STATE_DIR", ".claude/.confidence-gate-state"))
|
|
62
|
+
|
|
63
|
+
homu_raw = os.environ.get("HC_HOMUNCULUS_ROOT") or "~/.claude/homunculus"
|
|
64
|
+
HOMUNCULUS = Path(os.path.expanduser(homu_raw))
|
|
65
|
+
|
|
66
|
+
# === time ref(テスト用に固定可) ===
|
|
67
|
+
_now_override = os.environ.get("ECC_IMPROVEMENT_PROPOSAL_TEST_NOW")
|
|
68
|
+
if _now_override:
|
|
69
|
+
try:
|
|
70
|
+
NOW = datetime.fromisoformat(_now_override.replace("Z", "+00:00"))
|
|
71
|
+
if NOW.tzinfo is None:
|
|
72
|
+
NOW = NOW.replace(tzinfo=timezone.utc)
|
|
73
|
+
except Exception:
|
|
74
|
+
NOW = datetime.now(timezone.utc)
|
|
75
|
+
else:
|
|
76
|
+
NOW = datetime.now(timezone.utc)
|
|
77
|
+
|
|
78
|
+
CUTOFF = NOW - timedelta(days=LOOKBACK_DAYS)
|
|
79
|
+
|
|
80
|
+
# === observations.jsonl 探索 ===
|
|
81
|
+
def _normalize_remote_url(url):
|
|
82
|
+
s = url.strip()
|
|
83
|
+
m = re.match(r"^git@([^:]+):(.*)$", s)
|
|
84
|
+
if m:
|
|
85
|
+
s = f"https://{m.group(1)}/{m.group(2)}"
|
|
86
|
+
if s.endswith(".git"):
|
|
87
|
+
s = s[:-4]
|
|
88
|
+
return s
|
|
89
|
+
|
|
90
|
+
def project_hash():
|
|
91
|
+
try:
|
|
92
|
+
out = subprocess.check_output(
|
|
93
|
+
["git", "remote", "get-url", "origin"],
|
|
94
|
+
stderr=subprocess.DEVNULL, text=True, cwd=str(PROJ_ROOT),
|
|
95
|
+
).strip()
|
|
96
|
+
if not out:
|
|
97
|
+
return None
|
|
98
|
+
return hashlib.sha256(_normalize_remote_url(out).encode()).hexdigest()[:12]
|
|
99
|
+
except Exception:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
def find_observations():
|
|
103
|
+
# test override: HC_OBSERVE_PATH で直接指定可能 (smoke test 用)
|
|
104
|
+
override = os.environ.get("HC_OBSERVE_PATH")
|
|
105
|
+
if override:
|
|
106
|
+
p = Path(override)
|
|
107
|
+
if p.exists() and p.stat().st_size > 0:
|
|
108
|
+
return p
|
|
109
|
+
return None
|
|
110
|
+
ph = project_hash()
|
|
111
|
+
candidates = []
|
|
112
|
+
if ph:
|
|
113
|
+
candidates.append(HOMUNCULUS / "projects" / ph / "observations.jsonl")
|
|
114
|
+
candidates.append(HOMUNCULUS / "observations.jsonl")
|
|
115
|
+
for p in candidates:
|
|
116
|
+
if p.exists() and p.stat().st_size > 0:
|
|
117
|
+
return p
|
|
118
|
+
return None
|
|
119
|
+
|
|
120
|
+
def parse_ts(s):
|
|
121
|
+
if not s:
|
|
122
|
+
return None
|
|
123
|
+
try:
|
|
124
|
+
if s.endswith("Z"):
|
|
125
|
+
s = s[:-1] + "+00:00"
|
|
126
|
+
dt = datetime.fromisoformat(s)
|
|
127
|
+
if dt.tzinfo is None:
|
|
128
|
+
dt = dt.replace(tzinfo=timezone.utc)
|
|
129
|
+
return dt
|
|
130
|
+
except Exception:
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
def load_recent_observations(path, cutoff):
|
|
134
|
+
"""末尾から逆向きに読み、cutoff より古くなったら停止。tail-like 動作。"""
|
|
135
|
+
if not path or not path.exists():
|
|
136
|
+
return []
|
|
137
|
+
out = []
|
|
138
|
+
try:
|
|
139
|
+
# ファイルが大きいときは末尾チャンクのみ読む
|
|
140
|
+
size = path.stat().st_size
|
|
141
|
+
chunk = min(size, 4 * 1024 * 1024) # max 4MB
|
|
142
|
+
with path.open("rb") as f:
|
|
143
|
+
f.seek(size - chunk)
|
|
144
|
+
data = f.read().decode("utf-8", errors="replace")
|
|
145
|
+
lines = data.splitlines()
|
|
146
|
+
if chunk < size and lines:
|
|
147
|
+
# 最初の行は途中で切れている可能性があるので捨てる
|
|
148
|
+
lines = lines[1:]
|
|
149
|
+
for line in lines:
|
|
150
|
+
line = line.strip()
|
|
151
|
+
if not line:
|
|
152
|
+
continue
|
|
153
|
+
try:
|
|
154
|
+
rec = json.loads(line)
|
|
155
|
+
except Exception:
|
|
156
|
+
continue
|
|
157
|
+
ts = parse_ts(rec.get("ts") or rec.get("timestamp"))
|
|
158
|
+
if ts and ts < cutoff:
|
|
159
|
+
continue
|
|
160
|
+
out.append(rec)
|
|
161
|
+
except Exception:
|
|
162
|
+
return []
|
|
163
|
+
return out
|
|
164
|
+
|
|
165
|
+
# === 集計関数群 ===
|
|
166
|
+
def aggregate_observations(records):
|
|
167
|
+
bash_deny = 0
|
|
168
|
+
edit_deny = 0
|
|
169
|
+
block_count = 0
|
|
170
|
+
error_count = 0
|
|
171
|
+
tool_errors = Counter()
|
|
172
|
+
tools = Counter()
|
|
173
|
+
timeouts = 0
|
|
174
|
+
sessions = set()
|
|
175
|
+
|
|
176
|
+
for r in records:
|
|
177
|
+
tool = r.get("tool") or r.get("tool_name") or "unknown"
|
|
178
|
+
tools[tool] += 1
|
|
179
|
+
|
|
180
|
+
raw = r.get("raw") or {}
|
|
181
|
+
if isinstance(raw, dict):
|
|
182
|
+
sid = raw.get("session_id")
|
|
183
|
+
if sid:
|
|
184
|
+
sessions.add(sid)
|
|
185
|
+
|
|
186
|
+
resp = r.get("tool_response") or (raw.get("tool_response") if isinstance(raw, dict) else None) or {}
|
|
187
|
+
if isinstance(resp, dict):
|
|
188
|
+
text_blob = json.dumps(resp).lower()
|
|
189
|
+
if resp.get("is_error") or resp.get("decision") == "block":
|
|
190
|
+
error_count += 1
|
|
191
|
+
tool_errors[tool] += 1
|
|
192
|
+
if resp.get("decision") == "block":
|
|
193
|
+
block_count += 1
|
|
194
|
+
if "permission" in text_blob and ("denied" in text_blob or "deny" in text_blob):
|
|
195
|
+
if tool == "Bash":
|
|
196
|
+
bash_deny += 1
|
|
197
|
+
elif tool in ("Edit", "Write"):
|
|
198
|
+
edit_deny += 1
|
|
199
|
+
if "timed out" in text_blob or "timeout" in text_blob:
|
|
200
|
+
timeouts += 1
|
|
201
|
+
|
|
202
|
+
return {
|
|
203
|
+
"total": len(records),
|
|
204
|
+
"tools": dict(tools),
|
|
205
|
+
"tool_errors": dict(tool_errors),
|
|
206
|
+
"bash_deny": bash_deny,
|
|
207
|
+
"edit_deny": edit_deny,
|
|
208
|
+
"blocks": block_count,
|
|
209
|
+
"errors": error_count,
|
|
210
|
+
"timeouts": timeouts,
|
|
211
|
+
"sessions": len(sessions),
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
def count_cleared(d):
|
|
215
|
+
if not d.is_dir():
|
|
216
|
+
return 0
|
|
217
|
+
return sum(1 for p in d.iterdir() if p.is_file() and p.name.endswith(".cleared"))
|
|
218
|
+
|
|
219
|
+
def gateguard_recent_count(d, cutoff):
|
|
220
|
+
"""直近 cutoff 以降に作成 / 更新された .cleared 数(mtime ベース)。"""
|
|
221
|
+
if not d.is_dir():
|
|
222
|
+
return 0
|
|
223
|
+
n = 0
|
|
224
|
+
cutoff_ts = cutoff.timestamp()
|
|
225
|
+
for p in d.iterdir():
|
|
226
|
+
if not p.is_file() or not p.name.endswith(".cleared"):
|
|
227
|
+
continue
|
|
228
|
+
try:
|
|
229
|
+
if p.stat().st_mtime >= cutoff_ts:
|
|
230
|
+
n += 1
|
|
231
|
+
except Exception:
|
|
232
|
+
continue
|
|
233
|
+
return n
|
|
234
|
+
|
|
235
|
+
def confidence_breakdown(d, cutoff):
|
|
236
|
+
out = {"bypasses": 0, "recent_reasons": []}
|
|
237
|
+
if not d.is_dir():
|
|
238
|
+
return out
|
|
239
|
+
log = d / "bypass.log"
|
|
240
|
+
if not log.exists():
|
|
241
|
+
return out
|
|
242
|
+
try:
|
|
243
|
+
lines = [ln.strip() for ln in log.read_text().splitlines() if ln.strip()]
|
|
244
|
+
except Exception:
|
|
245
|
+
return out
|
|
246
|
+
recent = []
|
|
247
|
+
for ln in lines:
|
|
248
|
+
# format: "<ts>\t<reason>"
|
|
249
|
+
parts = ln.split("\t", 1)
|
|
250
|
+
if len(parts) != 2:
|
|
251
|
+
continue
|
|
252
|
+
ts = parse_ts(parts[0])
|
|
253
|
+
if ts and ts >= cutoff:
|
|
254
|
+
recent.append((parts[0], parts[1]))
|
|
255
|
+
out["bypasses"] = len(recent)
|
|
256
|
+
out["recent_reasons"] = recent[-3:]
|
|
257
|
+
return out
|
|
258
|
+
|
|
259
|
+
def failure_window_active(d):
|
|
260
|
+
if not d.is_dir():
|
|
261
|
+
return 0
|
|
262
|
+
active = 0
|
|
263
|
+
for log in d.glob("*.log"):
|
|
264
|
+
try:
|
|
265
|
+
lines = [ln.strip() for ln in log.read_text().splitlines() if ln.strip()]
|
|
266
|
+
except Exception:
|
|
267
|
+
continue
|
|
268
|
+
if len(lines) >= 3 and len(set(lines[-3:])) == 1:
|
|
269
|
+
active += 1
|
|
270
|
+
return active
|
|
271
|
+
|
|
272
|
+
def router_dispatch_breakdown(cutoff):
|
|
273
|
+
"""global agent-router-history.json から fallback rate を計算。"""
|
|
274
|
+
p = Path.home() / ".claude" / "agent-router-history.json"
|
|
275
|
+
out = {"total": 0, "general_purpose": 0, "general_rate": 0.0}
|
|
276
|
+
if not p.exists():
|
|
277
|
+
return out
|
|
278
|
+
try:
|
|
279
|
+
data = json.loads(p.read_text())
|
|
280
|
+
except Exception:
|
|
281
|
+
return out
|
|
282
|
+
if not isinstance(data, list):
|
|
283
|
+
return out
|
|
284
|
+
total = 0
|
|
285
|
+
general = 0
|
|
286
|
+
for e in data:
|
|
287
|
+
ts = parse_ts(e.get("ts"))
|
|
288
|
+
if ts and ts < cutoff:
|
|
289
|
+
continue
|
|
290
|
+
total += 1
|
|
291
|
+
if (e.get("dispatched") or "").strip() == "general-purpose":
|
|
292
|
+
general += 1
|
|
293
|
+
out["total"] = total
|
|
294
|
+
out["general_purpose"] = general
|
|
295
|
+
out["general_rate"] = round(general / total, 3) if total else 0.0
|
|
296
|
+
return out
|
|
297
|
+
|
|
298
|
+
# === heuristics: 提案生成 ===
|
|
299
|
+
# 各エントリは (id, severity_priority, message)。priority 高い順に最大 MAX_COUNT 件採用。
|
|
300
|
+
def generate_proposals():
|
|
301
|
+
obs_path = find_observations()
|
|
302
|
+
records = load_recent_observations(obs_path, CUTOFF) if obs_path else []
|
|
303
|
+
agg = aggregate_observations(records)
|
|
304
|
+
|
|
305
|
+
gg_recent = gateguard_recent_count(GATEGUARD_DIR, CUTOFF)
|
|
306
|
+
tg_total = count_cleared(TASKGUARD_DIR)
|
|
307
|
+
cg = confidence_breakdown(CONFIDENCE_DIR, CUTOFF)
|
|
308
|
+
fw_active = failure_window_active(FAILURE_DIR)
|
|
309
|
+
rt = router_dispatch_breakdown(CUTOFF)
|
|
310
|
+
|
|
311
|
+
proposals = []
|
|
312
|
+
|
|
313
|
+
# 1. Bash deny 多 → Agent 委譲が漏れている
|
|
314
|
+
if agg["bash_deny"] >= 5:
|
|
315
|
+
proposals.append((
|
|
316
|
+
"bash-deny", 90,
|
|
317
|
+
f"Bash deny {agg['bash_deny']} 件 → Agent tool 経由の委譲が漏れている可能性。"
|
|
318
|
+
"次回は run_in_background:true で必ず Agent 起動を。"
|
|
319
|
+
))
|
|
320
|
+
# 2. Edit/Write deny 多 → delegation-guard で弾かれている
|
|
321
|
+
if agg["edit_deny"] >= 3:
|
|
322
|
+
proposals.append((
|
|
323
|
+
"edit-deny", 85,
|
|
324
|
+
f"Edit/Write deny {agg['edit_deny']} 件 → メイン直接編集禁止域。"
|
|
325
|
+
"Agent tool 経由で委譲するか、保護パスを再確認。"
|
|
326
|
+
))
|
|
327
|
+
# 3. GateGuard cleared が多い → 事実材料未提示で block を多く受けた可能性
|
|
328
|
+
if gg_recent >= 5:
|
|
329
|
+
proposals.append((
|
|
330
|
+
"gateguard-block", 80,
|
|
331
|
+
f"GateGuard cleared {gg_recent} 件 → Edit/Write 直前の事実材料提示忘れ。"
|
|
332
|
+
"importer/caller/data/quote の 4 点を summary に。"
|
|
333
|
+
))
|
|
334
|
+
# 4. Confidence bypass 多 → 抽出 or 自信付与の問題
|
|
335
|
+
if cg["bypasses"] >= 5:
|
|
336
|
+
proposals.append((
|
|
337
|
+
"confidence-bypass", 75,
|
|
338
|
+
f"Confidence bypass {cg['bypasses']} 件 → 抽出ロジック改善の余地。"
|
|
339
|
+
"docs/CONFIDENCE-GATE.md 参照、subagent prompt に confidence:0.X 明記を。"
|
|
340
|
+
))
|
|
341
|
+
# 5. failure-loop active → 同種エラーで止まっている
|
|
342
|
+
if fw_active >= 1:
|
|
343
|
+
proposals.append((
|
|
344
|
+
"failure-loop", 95,
|
|
345
|
+
f"Failure loop {fw_active} session 検出 → 同種エラーで止まっている。"
|
|
346
|
+
"/agent-introspect で 4-phase Capture-Audit-Diff-Fix を実行を。"
|
|
347
|
+
))
|
|
348
|
+
# 6. Router fallback rate 高 → dispatch table 拡張余地
|
|
349
|
+
if rt["total"] >= 5 and rt["general_rate"] >= 0.6:
|
|
350
|
+
proposals.append((
|
|
351
|
+
"router-fallback", 60,
|
|
352
|
+
f"Agent router で general-purpose 比率 {int(rt['general_rate']*100)}% "
|
|
353
|
+
f"({rt['general_purpose']}/{rt['total']}) → dispatch-table 拡張、"
|
|
354
|
+
"または LLM fallback を検討。"
|
|
355
|
+
))
|
|
356
|
+
# 7. TaskGuard bypass 多 → bypass 常用化
|
|
357
|
+
if tg_total >= 5:
|
|
358
|
+
proposals.append((
|
|
359
|
+
"taskguard-bypass", 55,
|
|
360
|
+
f"TaskGuard bypass {tg_total} 件 → bypass の常用化。"
|
|
361
|
+
"draft/task の同期ルールを再確認。"
|
|
362
|
+
))
|
|
363
|
+
# 8. timeouts 多 → hook が重い
|
|
364
|
+
if agg["timeouts"] >= 3:
|
|
365
|
+
proposals.append((
|
|
366
|
+
"hook-timeouts", 50,
|
|
367
|
+
f"Hook timeouts {agg['timeouts']} 件 → hook 内処理が重い可能性。"
|
|
368
|
+
"harness-config.yml の timeout か hook ロジックを見直し。"
|
|
369
|
+
))
|
|
370
|
+
# 9. errors 多 → 一般的な失敗多
|
|
371
|
+
if agg["errors"] >= 10 and agg["total"] >= 50:
|
|
372
|
+
rate = agg["errors"] / agg["total"]
|
|
373
|
+
if rate >= 0.10:
|
|
374
|
+
proposals.append((
|
|
375
|
+
"error-rate-high", 40,
|
|
376
|
+
f"Tool error rate {int(rate*100)}% ({agg['errors']}/{agg['total']}) → "
|
|
377
|
+
"tool 利用の前提誤りが多い可能性。/harness-audit で詳細確認を。"
|
|
378
|
+
))
|
|
379
|
+
|
|
380
|
+
# priority 高い順、ID 重複排除
|
|
381
|
+
seen = set()
|
|
382
|
+
proposals.sort(key=lambda x: -x[1])
|
|
383
|
+
selected = []
|
|
384
|
+
for pid, prio, msg in proposals:
|
|
385
|
+
if pid in seen:
|
|
386
|
+
continue
|
|
387
|
+
seen.add(pid)
|
|
388
|
+
selected.append((pid, msg))
|
|
389
|
+
if len(selected) >= MAX_COUNT:
|
|
390
|
+
break
|
|
391
|
+
return selected, len(records)
|
|
392
|
+
|
|
393
|
+
# === dedup state ===
|
|
394
|
+
DEDUP_PATH = STATE_DIR / "last_shown.json"
|
|
395
|
+
|
|
396
|
+
def load_dedup():
|
|
397
|
+
if not DEDUP_PATH.exists():
|
|
398
|
+
return {}
|
|
399
|
+
try:
|
|
400
|
+
return json.loads(DEDUP_PATH.read_text())
|
|
401
|
+
except Exception:
|
|
402
|
+
return {}
|
|
403
|
+
|
|
404
|
+
def save_dedup(state):
|
|
405
|
+
try:
|
|
406
|
+
STATE_DIR.mkdir(parents=True, exist_ok=True)
|
|
407
|
+
tmp = DEDUP_PATH.with_suffix(".json.tmp")
|
|
408
|
+
tmp.write_text(json.dumps(state, ensure_ascii=False, sort_keys=True))
|
|
409
|
+
tmp.replace(DEDUP_PATH)
|
|
410
|
+
except Exception:
|
|
411
|
+
pass
|
|
412
|
+
|
|
413
|
+
def filter_dedup(props, dedup_state):
|
|
414
|
+
cutoff = NOW - timedelta(hours=DEDUP_HOURS)
|
|
415
|
+
keep = []
|
|
416
|
+
new_state = dict(dedup_state)
|
|
417
|
+
for pid, msg in props:
|
|
418
|
+
last = parse_ts(dedup_state.get(pid))
|
|
419
|
+
if last and last >= cutoff:
|
|
420
|
+
continue
|
|
421
|
+
keep.append((pid, msg))
|
|
422
|
+
new_state[pid] = NOW.replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
|
423
|
+
return keep, new_state
|
|
424
|
+
|
|
425
|
+
# observations count を保存先 file に書き出し (cache metadata 用)
|
|
426
|
+
def _emit_obs_count(n):
|
|
427
|
+
p = os.environ.get("HC_IMPROVEMENT_PROPOSAL_OBS_COUNT_FILE")
|
|
428
|
+
if not p:
|
|
429
|
+
return
|
|
430
|
+
try:
|
|
431
|
+
Path(p).write_text(str(n))
|
|
432
|
+
except Exception:
|
|
433
|
+
pass
|
|
434
|
+
|
|
435
|
+
# === main ===
|
|
436
|
+
def main():
|
|
437
|
+
try:
|
|
438
|
+
proposals, obs_count = generate_proposals()
|
|
439
|
+
_emit_obs_count(obs_count)
|
|
440
|
+
if not proposals:
|
|
441
|
+
sys.exit(0)
|
|
442
|
+
|
|
443
|
+
dedup_state = load_dedup()
|
|
444
|
+
proposals, new_state = filter_dedup(proposals, dedup_state)
|
|
445
|
+
if not proposals:
|
|
446
|
+
sys.exit(0)
|
|
447
|
+
|
|
448
|
+
# 提案 1+ 件 → stderr に出力
|
|
449
|
+
print(f"[harness] \U0001f4a1 Improvement proposals (last {LOOKBACK_DAYS} days):", file=sys.stderr)
|
|
450
|
+
for i, (pid, msg) in enumerate(proposals, start=1):
|
|
451
|
+
print(f"[harness] {i}. {msg}", file=sys.stderr)
|
|
452
|
+
print(
|
|
453
|
+
"[harness] (これらは提案であり block しません。無視して進めて構いません。"
|
|
454
|
+
"/harness-audit で詳細確認可)",
|
|
455
|
+
file=sys.stderr,
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
save_dedup(new_state)
|
|
459
|
+
except SystemExit:
|
|
460
|
+
raise
|
|
461
|
+
except Exception:
|
|
462
|
+
# fail-open: traceback は出さずに静かに終わる
|
|
463
|
+
pass
|
|
464
|
+
|
|
465
|
+
if __name__ == "__main__":
|
|
466
|
+
main()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# cache.sh — improvement-proposal の TTL 1h cache layer (task-22 W5)
|
|
3
|
+
#
|
|
4
|
+
# 役割:
|
|
5
|
+
# 集計結果を TTL 1h で cache し SessionStart 時間を短縮する。
|
|
6
|
+
# cache 不在 / 期限切れ → 集計実行 → cache 保存 → stderr
|
|
7
|
+
# cache hit → cache の payload を stderr に流して exit 0
|
|
8
|
+
# 空集計も cache する (JSONL 不在環境で都度 fullscan を防ぐ)
|
|
9
|
+
#
|
|
10
|
+
# 入力 (caller が事前に export):
|
|
11
|
+
# ABS_STATE_DIR — state dir 絶対 path
|
|
12
|
+
# CACHE_TTL_SECONDS — TTL 秒数 (default 3600、整数値検証済)
|
|
13
|
+
# CACHE_FILE — cache.json の絶対 path
|
|
14
|
+
# CACHE_ENABLED — true/false (HC_IMPROVEMENT_PROPOSAL_CACHE_ENABLED)
|
|
15
|
+
#
|
|
16
|
+
# 提供関数:
|
|
17
|
+
# _file_mtime <path> — stat の cross-platform 互換 mtime 取得
|
|
18
|
+
# _cache_hit — cache hit なら return 0
|
|
19
|
+
# _write_cache — 集計結果を CACHE_FILE に書き込む
|
|
20
|
+
|
|
21
|
+
# stat の cross-platform 互換 (macOS: -f %m / Linux: -c %Y)
|
|
22
|
+
_file_mtime() {
|
|
23
|
+
local f="$1"
|
|
24
|
+
local m
|
|
25
|
+
m=$(stat -f %m "$f" 2>/dev/null) || m=$(stat -c %Y "$f" 2>/dev/null) || m=""
|
|
26
|
+
printf '%s' "$m"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# cache hit 判定 (jq 不在環境では cache skip, fail-open で再集計)
|
|
30
|
+
_cache_hit() {
|
|
31
|
+
case "$CACHE_ENABLED" in
|
|
32
|
+
false|False|FALSE|0|no|off) return 1 ;;
|
|
33
|
+
esac
|
|
34
|
+
command -v jq >/dev/null 2>&1 || return 1
|
|
35
|
+
[ -f "$CACHE_FILE" ] || return 1
|
|
36
|
+
|
|
37
|
+
local mtime now age
|
|
38
|
+
mtime=$(_file_mtime "$CACHE_FILE")
|
|
39
|
+
[ -n "$mtime" ] || return 1
|
|
40
|
+
now=$(date +%s)
|
|
41
|
+
age=$((now - mtime))
|
|
42
|
+
[ "$age" -lt "$CACHE_TTL_SECONDS" ] || return 1
|
|
43
|
+
|
|
44
|
+
# JSON validity 確認 (corrupt なら fallback)
|
|
45
|
+
jq -e '.payload' "$CACHE_FILE" >/dev/null 2>&1 || return 1
|
|
46
|
+
return 0
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# cache 書き込み (集計結果を保存、空集計も含めて TTL 1h で fullscan を防ぐ)
|
|
50
|
+
# caller が事前に export 必須: CACHE_TMP (集計 stderr 内容の tmp file)
|
|
51
|
+
# HC_IMPROVEMENT_PROPOSAL_OBS_COUNT_FILE
|
|
52
|
+
_write_cache() {
|
|
53
|
+
case "$CACHE_ENABLED" in
|
|
54
|
+
false|False|FALSE|0|no|off) return 0 ;;
|
|
55
|
+
esac
|
|
56
|
+
command -v jq >/dev/null 2>&1 || return 0
|
|
57
|
+
[ -d "$ABS_STATE_DIR" ] || mkdir -p "$ABS_STATE_DIR" 2>/dev/null || return 0
|
|
58
|
+
|
|
59
|
+
local payload generated_at obs_count obs_count_int
|
|
60
|
+
payload=$(cat "$CACHE_TMP" 2>/dev/null || printf '')
|
|
61
|
+
generated_at=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
|
62
|
+
obs_count=$(cat "$HC_IMPROVEMENT_PROPOSAL_OBS_COUNT_FILE" 2>/dev/null || printf '0')
|
|
63
|
+
# obs_count を整数化 (jq --argjson は数値必須、空文字 / 非数字なら 0)
|
|
64
|
+
case "$obs_count" in
|
|
65
|
+
''|*[!0-9]*) obs_count_int=0 ;;
|
|
66
|
+
*) obs_count_int="$obs_count" ;;
|
|
67
|
+
esac
|
|
68
|
+
|
|
69
|
+
local tmp_out
|
|
70
|
+
tmp_out="$ABS_STATE_DIR/.cache.json.tmp.$$"
|
|
71
|
+
jq -n \
|
|
72
|
+
--arg ga "$generated_at" \
|
|
73
|
+
--argjson ttl "$CACHE_TTL_SECONDS" \
|
|
74
|
+
--arg pl "$payload" \
|
|
75
|
+
--argjson oc "$obs_count_int" \
|
|
76
|
+
'{generated_at: $ga, ttl_seconds: $ttl, payload: $pl, source_observations_count: $oc}' \
|
|
77
|
+
> "$tmp_out" 2>/dev/null && mv "$tmp_out" "$CACHE_FILE" 2>/dev/null || rm -f "$tmp_out" 2>/dev/null
|
|
78
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# mode-loader.sh — 動作モード解決ユーティリティ
|
|
3
|
+
#
|
|
4
|
+
# 役割: `.claude/mode.yml` または環境変数 `HC_MODE` から現在のモードを読み取る。
|
|
5
|
+
# 値解決の優先順 (高 → 低): env(HC_MODE) > YAML > default(normal)
|
|
6
|
+
#
|
|
7
|
+
# 使い方:
|
|
8
|
+
# source .claude/hooks/lib/mode-loader.sh
|
|
9
|
+
# MODE=$(load_mode)
|
|
10
|
+
#
|
|
11
|
+
# 戻り値: stdout に "normal" または "loop" を出力。不正値は "normal" に正規化。
|
|
12
|
+
#
|
|
13
|
+
# bash flags の方針 (重要):
|
|
14
|
+
# 本ファイルを source する caller の shell options を汚染しないため、
|
|
15
|
+
# ファイルトップでは `set -euo pipefail` を **使用しない**。
|
|
16
|
+
# 関数本体は subshell `( ... )` で囲み、その内側だけで strict mode を有効化する。
|
|
17
|
+
# 過去に context-budget.sh で `set -e` が source 経由で漏れ、後段の pipeline
|
|
18
|
+
# (`... | jq | head -1`) が SIGPIPE で 141 終了し本体ロジック (state 書き込み /
|
|
19
|
+
# <system-reminder> 注入) が一切実行されない事故があった。
|
|
20
|
+
|
|
21
|
+
load_mode() (
|
|
22
|
+
set -euo pipefail
|
|
23
|
+
local mode=""
|
|
24
|
+
|
|
25
|
+
# 1) 環境変数優先
|
|
26
|
+
if [ -n "${HC_MODE:-}" ]; then
|
|
27
|
+
mode="$HC_MODE"
|
|
28
|
+
else
|
|
29
|
+
# 2) YAML 読み取り (`mode: <value>` 1 行)
|
|
30
|
+
local cfg=".claude/mode.yml"
|
|
31
|
+
if [ -f "$cfg" ]; then
|
|
32
|
+
mode=$(grep -E '^[[:space:]]*mode[[:space:]]*:' "$cfg" \
|
|
33
|
+
| head -1 \
|
|
34
|
+
| sed -E 's/^[[:space:]]*mode[[:space:]]*:[[:space:]]*//' \
|
|
35
|
+
| tr -d '"' | tr -d "'" \
|
|
36
|
+
| awk '{print $1}')
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# 3) 正規化
|
|
41
|
+
case "${mode:-normal}" in
|
|
42
|
+
loop) echo "loop" ;;
|
|
43
|
+
*) echo "normal" ;;
|
|
44
|
+
esac
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Asana 利用モード解決
|
|
48
|
+
# 戻り値: "true" / "false" / "unset"
|
|
49
|
+
# 優先順 (高 → 低): env(HC_ASANA_ENABLED) > YAML > unset
|
|
50
|
+
load_asana_enabled() (
|
|
51
|
+
set -euo pipefail
|
|
52
|
+
local v=""
|
|
53
|
+
|
|
54
|
+
# 1) env 優先
|
|
55
|
+
if [ -n "${HC_ASANA_ENABLED:-}" ]; then
|
|
56
|
+
v="$HC_ASANA_ENABLED"
|
|
57
|
+
else
|
|
58
|
+
# 2) YAML 読み取り (`asana_enabled: <value>` 1 行)
|
|
59
|
+
local cfg=".claude/mode.yml"
|
|
60
|
+
if [ -f "$cfg" ]; then
|
|
61
|
+
v=$(grep -E '^[[:space:]]*asana_enabled[[:space:]]*:' "$cfg" \
|
|
62
|
+
| head -1 \
|
|
63
|
+
| sed -E 's/^[[:space:]]*asana_enabled[[:space:]]*:[[:space:]]*//' \
|
|
64
|
+
| tr -d '"' | tr -d "'" \
|
|
65
|
+
| awk '{print $1}')
|
|
66
|
+
fi
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# 3) 正規化
|
|
70
|
+
case "${v}" in
|
|
71
|
+
true|yes|on|1) echo "true" ;;
|
|
72
|
+
false|no|off|0) echo "false" ;;
|
|
73
|
+
*) echo "unset" ;;
|
|
74
|
+
esac
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# スクリプトとして直接呼ばれた場合
|
|
78
|
+
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
|
|
79
|
+
load_mode
|
|
80
|
+
fi
|