@harness-engineering/cli 1.14.0 → 1.16.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/dist/agents/commands/codex/AGENTS.md +39 -0
- package/dist/agents/commands/codex/harness/add-harness-component/SKILL.md +195 -0
- package/dist/agents/commands/codex/harness/add-harness-component/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/cleanup-dead-code/SKILL.md +248 -0
- package/dist/agents/commands/codex/harness/cleanup-dead-code/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/detect-doc-drift/SKILL.md +182 -0
- package/dist/agents/commands/codex/harness/detect-doc-drift/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/enforce-architecture/SKILL.md +299 -0
- package/dist/agents/commands/codex/harness/enforce-architecture/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/SKILL.md +452 -0
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-autopilot/SKILL.md +919 -0
- package/dist/agents/commands/codex/harness/harness-autopilot/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-brainstorming/SKILL.md +409 -0
- package/dist/agents/commands/codex/harness/harness-brainstorming/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-code-review/SKILL.md +860 -0
- package/dist/agents/commands/codex/harness/harness-code-review/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/SKILL.md +227 -0
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-debugging/SKILL.md +369 -0
- package/dist/agents/commands/codex/harness/harness-debugging/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-dependency-health/SKILL.md +182 -0
- package/dist/agents/commands/codex/harness/harness-dependency-health/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/SKILL.md +463 -0
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-execution/SKILL.md +513 -0
- package/dist/agents/commands/codex/harness/harness-execution/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/SKILL.md +164 -0
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-impact-analysis/SKILL.md +187 -0
- package/dist/agents/commands/codex/harness/harness-impact-analysis/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-integrity/SKILL.md +170 -0
- package/dist/agents/commands/codex/harness/harness-integrity/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-onboarding/SKILL.md +291 -0
- package/dist/agents/commands/codex/harness/harness-onboarding/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-perf/SKILL.md +263 -0
- package/dist/agents/commands/codex/harness/harness-perf/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-planning/SKILL.md +582 -0
- package/dist/agents/commands/codex/harness/harness-planning/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-refactoring/SKILL.md +172 -0
- package/dist/agents/commands/codex/harness/harness-refactoring/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-release-readiness/SKILL.md +692 -0
- package/dist/agents/commands/codex/harness/harness-release-readiness/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-roadmap/SKILL.md +598 -0
- package/dist/agents/commands/codex/harness/harness-roadmap/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-security-scan/SKILL.md +157 -0
- package/dist/agents/commands/codex/harness/harness-security-scan/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-skill-authoring/SKILL.md +295 -0
- package/dist/agents/commands/codex/harness/harness-skill-authoring/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-soundness-review/SKILL.md +1270 -0
- package/dist/agents/commands/codex/harness/harness-soundness-review/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/SKILL.md +247 -0
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-tdd/SKILL.md +180 -0
- package/dist/agents/commands/codex/harness/harness-tdd/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-test-advisor/SKILL.md +163 -0
- package/dist/agents/commands/codex/harness/harness-test-advisor/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-verification/SKILL.md +424 -0
- package/dist/agents/commands/codex/harness/harness-verification/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/harness-verify/SKILL.md +162 -0
- package/dist/agents/commands/codex/harness/harness-verify/agents/openai.yaml +3 -0
- package/dist/agents/commands/codex/harness/initialize-harness-project/SKILL.md +235 -0
- package/dist/agents/commands/codex/harness/initialize-harness-project/agents/openai.yaml +3 -0
- package/dist/agents/commands/cursor/harness/add-harness-component.mdc +200 -0
- package/dist/agents/commands/cursor/harness/cleanup-dead-code.mdc +253 -0
- package/dist/agents/commands/cursor/harness/detect-doc-drift.mdc +187 -0
- package/dist/agents/commands/cursor/harness/enforce-architecture.mdc +304 -0
- package/dist/agents/commands/cursor/harness/harness-architecture-advisor.mdc +457 -0
- package/dist/agents/commands/cursor/harness/harness-autopilot.mdc +924 -0
- package/dist/agents/commands/cursor/harness/harness-brainstorming.mdc +414 -0
- package/dist/agents/commands/cursor/harness/harness-code-review.mdc +865 -0
- package/dist/agents/commands/cursor/harness/harness-codebase-cleanup.mdc +232 -0
- package/dist/agents/commands/cursor/harness/harness-debugging.mdc +374 -0
- package/dist/agents/commands/cursor/harness/harness-dependency-health.mdc +187 -0
- package/dist/agents/commands/cursor/harness/harness-docs-pipeline.mdc +468 -0
- package/dist/agents/commands/cursor/harness/harness-execution.mdc +518 -0
- package/dist/agents/commands/cursor/harness/harness-hotspot-detector.mdc +169 -0
- package/dist/agents/commands/cursor/harness/harness-impact-analysis.mdc +192 -0
- package/dist/agents/commands/cursor/harness/harness-integrity.mdc +175 -0
- package/dist/agents/commands/cursor/harness/harness-onboarding.mdc +296 -0
- package/dist/agents/commands/cursor/harness/harness-perf.mdc +268 -0
- package/dist/agents/commands/cursor/harness/harness-planning.mdc +587 -0
- package/dist/agents/commands/cursor/harness/harness-refactoring.mdc +177 -0
- package/dist/agents/commands/cursor/harness/harness-release-readiness.mdc +697 -0
- package/dist/agents/commands/cursor/harness/harness-roadmap.mdc +603 -0
- package/dist/agents/commands/cursor/harness/harness-security-scan.mdc +162 -0
- package/dist/agents/commands/cursor/harness/harness-skill-authoring.mdc +300 -0
- package/dist/agents/commands/cursor/harness/harness-soundness-review.mdc +1275 -0
- package/dist/agents/commands/cursor/harness/harness-supply-chain-audit.mdc +252 -0
- package/dist/agents/commands/cursor/harness/harness-tdd.mdc +185 -0
- package/dist/agents/commands/cursor/harness/harness-test-advisor.mdc +168 -0
- package/dist/agents/commands/cursor/harness/harness-verification.mdc +429 -0
- package/dist/agents/commands/cursor/harness/harness-verify.mdc +167 -0
- package/dist/agents/commands/cursor/harness/initialize-harness-project.mdc +240 -0
- package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-api-design/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-architecture-advisor/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-auth/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +355 -45
- package/dist/agents/skills/claude-code/harness-autopilot/skill.yaml +12 -0
- package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +97 -3
- package/dist/agents/skills/claude-code/harness-code-review/skill.yaml +6 -0
- package/dist/agents/skills/claude-code/harness-codebase-cleanup/SKILL.md +2 -4
- package/dist/agents/skills/claude-code/harness-database/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-deployment/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +99 -3
- package/dist/agents/skills/claude-code/harness-planning/skill.yaml +6 -0
- package/dist/agents/skills/claude-code/harness-pre-commit-review/SKILL.md +1 -1
- package/dist/agents/skills/claude-code/harness-product-spec/SKILL.md +5 -5
- package/dist/agents/skills/claude-code/harness-security-review/SKILL.md +27 -7
- package/dist/agents/skills/claude-code/harness-security-scan/SKILL.md +52 -0
- package/dist/agents/skills/claude-code/harness-supply-chain-audit/SKILL.md +281 -0
- package/dist/agents/skills/claude-code/harness-supply-chain-audit/skill.yaml +51 -0
- package/dist/agents/skills/codex/add-harness-component/SKILL.md +192 -0
- package/dist/agents/skills/codex/add-harness-component/skill.yaml +33 -0
- package/dist/agents/skills/codex/align-documentation/SKILL.md +213 -0
- package/dist/agents/skills/codex/align-documentation/skill.yaml +32 -0
- package/dist/agents/skills/codex/check-mechanical-constraints/SKILL.md +191 -0
- package/dist/agents/skills/codex/check-mechanical-constraints/skill.yaml +33 -0
- package/dist/agents/skills/codex/cleanup-dead-code/SKILL.md +245 -0
- package/dist/agents/skills/codex/cleanup-dead-code/skill.yaml +34 -0
- package/dist/agents/skills/codex/detect-doc-drift/SKILL.md +179 -0
- package/dist/agents/skills/codex/detect-doc-drift/skill.yaml +31 -0
- package/dist/agents/skills/codex/enforce-architecture/SKILL.md +296 -0
- package/dist/agents/skills/codex/enforce-architecture/skill.yaml +35 -0
- package/dist/agents/skills/codex/harness-accessibility/SKILL.md +281 -0
- package/dist/agents/skills/codex/harness-accessibility/skill.yaml +52 -0
- package/dist/agents/skills/codex/harness-api-design/SKILL.md +356 -0
- package/dist/agents/skills/codex/harness-api-design/skill.yaml +74 -0
- package/dist/agents/skills/codex/harness-architecture-advisor/SKILL.md +449 -0
- package/dist/agents/skills/codex/harness-architecture-advisor/skill.yaml +49 -0
- package/dist/agents/skills/codex/harness-auth/SKILL.md +331 -0
- package/dist/agents/skills/codex/harness-auth/skill.yaml +81 -0
- package/dist/agents/skills/codex/harness-autopilot/SKILL.md +916 -0
- package/dist/agents/skills/codex/harness-autopilot/skill.yaml +67 -0
- package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +406 -0
- package/dist/agents/skills/codex/harness-brainstorming/skill.yaml +50 -0
- package/dist/agents/skills/codex/harness-caching/SKILL.md +309 -0
- package/dist/agents/skills/codex/harness-caching/skill.yaml +73 -0
- package/dist/agents/skills/codex/harness-chaos/SKILL.md +295 -0
- package/dist/agents/skills/codex/harness-chaos/skill.yaml +72 -0
- package/dist/agents/skills/codex/harness-code-review/SKILL.md +857 -0
- package/dist/agents/skills/codex/harness-code-review/skill.yaml +52 -0
- package/dist/agents/skills/codex/harness-codebase-cleanup/SKILL.md +224 -0
- package/dist/agents/skills/codex/harness-codebase-cleanup/skill.yaml +65 -0
- package/dist/agents/skills/codex/harness-compliance/SKILL.md +303 -0
- package/dist/agents/skills/codex/harness-compliance/skill.yaml +78 -0
- package/dist/agents/skills/codex/harness-containerization/SKILL.md +284 -0
- package/dist/agents/skills/codex/harness-containerization/skill.yaml +80 -0
- package/dist/agents/skills/codex/harness-data-pipeline/SKILL.md +274 -0
- package/dist/agents/skills/codex/harness-data-pipeline/skill.yaml +81 -0
- package/dist/agents/skills/codex/harness-data-validation/SKILL.md +343 -0
- package/dist/agents/skills/codex/harness-data-validation/skill.yaml +75 -0
- package/dist/agents/skills/codex/harness-database/SKILL.md +310 -0
- package/dist/agents/skills/codex/harness-database/skill.yaml +80 -0
- package/dist/agents/skills/codex/harness-debugging/SKILL.md +366 -0
- package/dist/agents/skills/codex/harness-debugging/skill.yaml +48 -0
- package/dist/agents/skills/codex/harness-dependency-health/SKILL.md +179 -0
- package/dist/agents/skills/codex/harness-dependency-health/skill.yaml +42 -0
- package/dist/agents/skills/codex/harness-deployment/SKILL.md +307 -0
- package/dist/agents/skills/codex/harness-deployment/skill.yaml +77 -0
- package/dist/agents/skills/codex/harness-design/SKILL.md +265 -0
- package/dist/agents/skills/codex/harness-design/skill.yaml +54 -0
- package/dist/agents/skills/codex/harness-design-mobile/SKILL.md +336 -0
- package/dist/agents/skills/codex/harness-design-mobile/skill.yaml +50 -0
- package/dist/agents/skills/codex/harness-design-system/SKILL.md +282 -0
- package/dist/agents/skills/codex/harness-design-system/skill.yaml +51 -0
- package/dist/agents/skills/codex/harness-design-web/SKILL.md +360 -0
- package/dist/agents/skills/codex/harness-design-web/skill.yaml +53 -0
- package/dist/agents/skills/codex/harness-diagnostics/SKILL.md +318 -0
- package/dist/agents/skills/codex/harness-diagnostics/skill.yaml +51 -0
- package/dist/agents/skills/codex/harness-docs-pipeline/SKILL.md +460 -0
- package/dist/agents/skills/codex/harness-docs-pipeline/skill.yaml +70 -0
- package/dist/agents/skills/codex/harness-dx/SKILL.md +276 -0
- package/dist/agents/skills/codex/harness-dx/skill.yaml +76 -0
- package/dist/agents/skills/codex/harness-e2e/SKILL.md +245 -0
- package/dist/agents/skills/codex/harness-e2e/skill.yaml +78 -0
- package/dist/agents/skills/codex/harness-event-driven/SKILL.md +280 -0
- package/dist/agents/skills/codex/harness-event-driven/skill.yaml +77 -0
- package/dist/agents/skills/codex/harness-execution/SKILL.md +510 -0
- package/dist/agents/skills/codex/harness-execution/skill.yaml +52 -0
- package/dist/agents/skills/codex/harness-feature-flags/SKILL.md +287 -0
- package/dist/agents/skills/codex/harness-feature-flags/skill.yaml +74 -0
- package/dist/agents/skills/codex/harness-git-workflow/SKILL.md +268 -0
- package/dist/agents/skills/codex/harness-git-workflow/skill.yaml +32 -0
- package/dist/agents/skills/codex/harness-hotspot-detector/SKILL.md +161 -0
- package/dist/agents/skills/codex/harness-hotspot-detector/skill.yaml +45 -0
- package/dist/agents/skills/codex/harness-i18n/SKILL.md +484 -0
- package/dist/agents/skills/codex/harness-i18n/skill.yaml +55 -0
- package/dist/agents/skills/codex/harness-i18n-process/SKILL.md +388 -0
- package/dist/agents/skills/codex/harness-i18n-process/skill.yaml +44 -0
- package/dist/agents/skills/codex/harness-i18n-workflow/SKILL.md +512 -0
- package/dist/agents/skills/codex/harness-i18n-workflow/skill.yaml +54 -0
- package/dist/agents/skills/codex/harness-impact-analysis/SKILL.md +184 -0
- package/dist/agents/skills/codex/harness-impact-analysis/skill.yaml +45 -0
- package/dist/agents/skills/codex/harness-incident-response/SKILL.md +223 -0
- package/dist/agents/skills/codex/harness-incident-response/skill.yaml +78 -0
- package/dist/agents/skills/codex/harness-infrastructure-as-code/SKILL.md +279 -0
- package/dist/agents/skills/codex/harness-infrastructure-as-code/skill.yaml +80 -0
- package/dist/agents/skills/codex/harness-integration-test/SKILL.md +271 -0
- package/dist/agents/skills/codex/harness-integration-test/skill.yaml +73 -0
- package/dist/agents/skills/codex/harness-integrity/SKILL.md +167 -0
- package/dist/agents/skills/codex/harness-integrity/skill.yaml +48 -0
- package/dist/agents/skills/codex/harness-knowledge-mapper/SKILL.md +195 -0
- package/dist/agents/skills/codex/harness-knowledge-mapper/skill.yaml +50 -0
- package/dist/agents/skills/codex/harness-load-testing/SKILL.md +274 -0
- package/dist/agents/skills/codex/harness-load-testing/skill.yaml +79 -0
- package/dist/agents/skills/codex/harness-ml-ops/SKILL.md +341 -0
- package/dist/agents/skills/codex/harness-ml-ops/skill.yaml +79 -0
- package/dist/agents/skills/codex/harness-mobile-patterns/SKILL.md +326 -0
- package/dist/agents/skills/codex/harness-mobile-patterns/skill.yaml +82 -0
- package/dist/agents/skills/codex/harness-mutation-test/SKILL.md +251 -0
- package/dist/agents/skills/codex/harness-mutation-test/skill.yaml +70 -0
- package/dist/agents/skills/codex/harness-observability/SKILL.md +283 -0
- package/dist/agents/skills/codex/harness-observability/skill.yaml +78 -0
- package/dist/agents/skills/codex/harness-onboarding/SKILL.md +288 -0
- package/dist/agents/skills/codex/harness-onboarding/skill.yaml +31 -0
- package/dist/agents/skills/codex/harness-parallel-agents/SKILL.md +256 -0
- package/dist/agents/skills/codex/harness-parallel-agents/skill.yaml +34 -0
- package/dist/agents/skills/codex/harness-perf/SKILL.md +260 -0
- package/dist/agents/skills/codex/harness-perf/skill.yaml +51 -0
- package/dist/agents/skills/codex/harness-perf-tdd/SKILL.md +249 -0
- package/dist/agents/skills/codex/harness-perf-tdd/skill.yaml +48 -0
- package/dist/agents/skills/codex/harness-planning/SKILL.md +579 -0
- package/dist/agents/skills/codex/harness-planning/skill.yaml +56 -0
- package/dist/agents/skills/codex/harness-pre-commit-review/SKILL.md +324 -0
- package/dist/agents/skills/codex/harness-pre-commit-review/skill.yaml +34 -0
- package/dist/agents/skills/codex/harness-product-spec/SKILL.md +285 -0
- package/dist/agents/skills/codex/harness-product-spec/skill.yaml +72 -0
- package/dist/agents/skills/codex/harness-property-test/SKILL.md +281 -0
- package/dist/agents/skills/codex/harness-property-test/skill.yaml +71 -0
- package/dist/agents/skills/codex/harness-refactoring/SKILL.md +169 -0
- package/dist/agents/skills/codex/harness-refactoring/skill.yaml +34 -0
- package/dist/agents/skills/codex/harness-release-readiness/SKILL.md +689 -0
- package/dist/agents/skills/codex/harness-release-readiness/skill.yaml +58 -0
- package/dist/agents/skills/codex/harness-resilience/SKILL.md +255 -0
- package/dist/agents/skills/codex/harness-resilience/skill.yaml +76 -0
- package/dist/agents/skills/codex/harness-roadmap/SKILL.md +595 -0
- package/dist/agents/skills/codex/harness-roadmap/skill.yaml +44 -0
- package/dist/agents/skills/codex/harness-secrets/SKILL.md +293 -0
- package/dist/agents/skills/codex/harness-secrets/skill.yaml +76 -0
- package/dist/agents/skills/codex/harness-security-review/SKILL.md +260 -0
- package/dist/agents/skills/codex/harness-security-review/skill.yaml +53 -0
- package/dist/agents/skills/codex/harness-security-scan/SKILL.md +154 -0
- package/dist/agents/skills/codex/harness-security-scan/skill.yaml +42 -0
- package/dist/agents/skills/codex/harness-skill-authoring/SKILL.md +292 -0
- package/dist/agents/skills/codex/harness-skill-authoring/skill.yaml +33 -0
- package/dist/agents/skills/codex/harness-soundness-review/SKILL.md +1267 -0
- package/dist/agents/skills/codex/harness-soundness-review/skill.yaml +49 -0
- package/dist/agents/skills/codex/harness-sql-review/SKILL.md +315 -0
- package/dist/agents/skills/codex/harness-sql-review/skill.yaml +74 -0
- package/dist/agents/skills/codex/harness-state-management/SKILL.md +309 -0
- package/dist/agents/skills/codex/harness-state-management/skill.yaml +33 -0
- package/dist/agents/skills/codex/harness-supply-chain-audit/SKILL.md +281 -0
- package/dist/agents/skills/codex/harness-supply-chain-audit/skill.yaml +51 -0
- package/dist/agents/skills/codex/harness-tdd/SKILL.md +177 -0
- package/dist/agents/skills/codex/harness-tdd/skill.yaml +49 -0
- package/dist/agents/skills/codex/harness-test-advisor/SKILL.md +160 -0
- package/dist/agents/skills/codex/harness-test-advisor/skill.yaml +45 -0
- package/dist/agents/skills/codex/harness-test-data/SKILL.md +268 -0
- package/dist/agents/skills/codex/harness-test-data/skill.yaml +74 -0
- package/dist/agents/skills/codex/harness-ux-copy/SKILL.md +271 -0
- package/dist/agents/skills/codex/harness-ux-copy/skill.yaml +77 -0
- package/dist/agents/skills/codex/harness-verification/SKILL.md +421 -0
- package/dist/agents/skills/codex/harness-verification/skill.yaml +43 -0
- package/dist/agents/skills/codex/harness-verify/SKILL.md +159 -0
- package/dist/agents/skills/codex/harness-verify/skill.yaml +41 -0
- package/dist/agents/skills/codex/harness-visual-regression/SKILL.md +257 -0
- package/dist/agents/skills/codex/harness-visual-regression/skill.yaml +74 -0
- package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +232 -0
- package/dist/agents/skills/codex/initialize-harness-project/skill.yaml +32 -0
- package/dist/agents/skills/codex/validate-context-engineering/SKILL.md +150 -0
- package/dist/agents/skills/codex/validate-context-engineering/skill.yaml +32 -0
- package/dist/agents/skills/cursor/add-harness-component/SKILL.md +192 -0
- package/dist/agents/skills/cursor/add-harness-component/skill.yaml +33 -0
- package/dist/agents/skills/cursor/align-documentation/SKILL.md +213 -0
- package/dist/agents/skills/cursor/align-documentation/skill.yaml +32 -0
- package/dist/agents/skills/cursor/check-mechanical-constraints/SKILL.md +191 -0
- package/dist/agents/skills/cursor/check-mechanical-constraints/skill.yaml +33 -0
- package/dist/agents/skills/cursor/cleanup-dead-code/SKILL.md +245 -0
- package/dist/agents/skills/cursor/cleanup-dead-code/skill.yaml +34 -0
- package/dist/agents/skills/cursor/detect-doc-drift/SKILL.md +179 -0
- package/dist/agents/skills/cursor/detect-doc-drift/skill.yaml +31 -0
- package/dist/agents/skills/cursor/enforce-architecture/SKILL.md +296 -0
- package/dist/agents/skills/cursor/enforce-architecture/skill.yaml +35 -0
- package/dist/agents/skills/cursor/harness-accessibility/SKILL.md +281 -0
- package/dist/agents/skills/cursor/harness-accessibility/skill.yaml +52 -0
- package/dist/agents/skills/cursor/harness-api-design/SKILL.md +356 -0
- package/dist/agents/skills/cursor/harness-api-design/skill.yaml +74 -0
- package/dist/agents/skills/cursor/harness-architecture-advisor/SKILL.md +449 -0
- package/dist/agents/skills/cursor/harness-architecture-advisor/skill.yaml +49 -0
- package/dist/agents/skills/cursor/harness-auth/SKILL.md +331 -0
- package/dist/agents/skills/cursor/harness-auth/skill.yaml +81 -0
- package/dist/agents/skills/cursor/harness-autopilot/SKILL.md +916 -0
- package/dist/agents/skills/cursor/harness-autopilot/skill.yaml +67 -0
- package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +406 -0
- package/dist/agents/skills/cursor/harness-brainstorming/skill.yaml +50 -0
- package/dist/agents/skills/cursor/harness-caching/SKILL.md +309 -0
- package/dist/agents/skills/cursor/harness-caching/skill.yaml +73 -0
- package/dist/agents/skills/cursor/harness-chaos/SKILL.md +295 -0
- package/dist/agents/skills/cursor/harness-chaos/skill.yaml +72 -0
- package/dist/agents/skills/cursor/harness-code-review/SKILL.md +857 -0
- package/dist/agents/skills/cursor/harness-code-review/skill.yaml +52 -0
- package/dist/agents/skills/cursor/harness-codebase-cleanup/SKILL.md +224 -0
- package/dist/agents/skills/cursor/harness-codebase-cleanup/skill.yaml +65 -0
- package/dist/agents/skills/cursor/harness-compliance/SKILL.md +303 -0
- package/dist/agents/skills/cursor/harness-compliance/skill.yaml +78 -0
- package/dist/agents/skills/cursor/harness-containerization/SKILL.md +284 -0
- package/dist/agents/skills/cursor/harness-containerization/skill.yaml +80 -0
- package/dist/agents/skills/cursor/harness-data-pipeline/SKILL.md +274 -0
- package/dist/agents/skills/cursor/harness-data-pipeline/skill.yaml +81 -0
- package/dist/agents/skills/cursor/harness-data-validation/SKILL.md +343 -0
- package/dist/agents/skills/cursor/harness-data-validation/skill.yaml +75 -0
- package/dist/agents/skills/cursor/harness-database/SKILL.md +310 -0
- package/dist/agents/skills/cursor/harness-database/skill.yaml +80 -0
- package/dist/agents/skills/cursor/harness-debugging/SKILL.md +366 -0
- package/dist/agents/skills/cursor/harness-debugging/skill.yaml +48 -0
- package/dist/agents/skills/cursor/harness-dependency-health/SKILL.md +179 -0
- package/dist/agents/skills/cursor/harness-dependency-health/skill.yaml +42 -0
- package/dist/agents/skills/cursor/harness-deployment/SKILL.md +307 -0
- package/dist/agents/skills/cursor/harness-deployment/skill.yaml +77 -0
- package/dist/agents/skills/cursor/harness-design/SKILL.md +265 -0
- package/dist/agents/skills/cursor/harness-design/skill.yaml +54 -0
- package/dist/agents/skills/cursor/harness-design-mobile/SKILL.md +336 -0
- package/dist/agents/skills/cursor/harness-design-mobile/skill.yaml +50 -0
- package/dist/agents/skills/cursor/harness-design-system/SKILL.md +282 -0
- package/dist/agents/skills/cursor/harness-design-system/skill.yaml +51 -0
- package/dist/agents/skills/cursor/harness-design-web/SKILL.md +360 -0
- package/dist/agents/skills/cursor/harness-design-web/skill.yaml +53 -0
- package/dist/agents/skills/cursor/harness-diagnostics/SKILL.md +318 -0
- package/dist/agents/skills/cursor/harness-diagnostics/skill.yaml +51 -0
- package/dist/agents/skills/cursor/harness-docs-pipeline/SKILL.md +460 -0
- package/dist/agents/skills/cursor/harness-docs-pipeline/skill.yaml +70 -0
- package/dist/agents/skills/cursor/harness-dx/SKILL.md +276 -0
- package/dist/agents/skills/cursor/harness-dx/skill.yaml +76 -0
- package/dist/agents/skills/cursor/harness-e2e/SKILL.md +245 -0
- package/dist/agents/skills/cursor/harness-e2e/skill.yaml +78 -0
- package/dist/agents/skills/cursor/harness-event-driven/SKILL.md +280 -0
- package/dist/agents/skills/cursor/harness-event-driven/skill.yaml +77 -0
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +510 -0
- package/dist/agents/skills/cursor/harness-execution/skill.yaml +52 -0
- package/dist/agents/skills/cursor/harness-feature-flags/SKILL.md +287 -0
- package/dist/agents/skills/cursor/harness-feature-flags/skill.yaml +74 -0
- package/dist/agents/skills/cursor/harness-git-workflow/SKILL.md +268 -0
- package/dist/agents/skills/cursor/harness-git-workflow/skill.yaml +32 -0
- package/dist/agents/skills/cursor/harness-hotspot-detector/SKILL.md +161 -0
- package/dist/agents/skills/cursor/harness-hotspot-detector/skill.yaml +45 -0
- package/dist/agents/skills/cursor/harness-i18n/SKILL.md +484 -0
- package/dist/agents/skills/cursor/harness-i18n/skill.yaml +55 -0
- package/dist/agents/skills/cursor/harness-i18n-process/SKILL.md +388 -0
- package/dist/agents/skills/cursor/harness-i18n-process/skill.yaml +44 -0
- package/dist/agents/skills/cursor/harness-i18n-workflow/SKILL.md +512 -0
- package/dist/agents/skills/cursor/harness-i18n-workflow/skill.yaml +54 -0
- package/dist/agents/skills/cursor/harness-impact-analysis/SKILL.md +184 -0
- package/dist/agents/skills/cursor/harness-impact-analysis/skill.yaml +45 -0
- package/dist/agents/skills/cursor/harness-incident-response/SKILL.md +223 -0
- package/dist/agents/skills/cursor/harness-incident-response/skill.yaml +78 -0
- package/dist/agents/skills/cursor/harness-infrastructure-as-code/SKILL.md +279 -0
- package/dist/agents/skills/cursor/harness-infrastructure-as-code/skill.yaml +80 -0
- package/dist/agents/skills/cursor/harness-integration-test/SKILL.md +271 -0
- package/dist/agents/skills/cursor/harness-integration-test/skill.yaml +73 -0
- package/dist/agents/skills/cursor/harness-integrity/SKILL.md +167 -0
- package/dist/agents/skills/cursor/harness-integrity/skill.yaml +48 -0
- package/dist/agents/skills/cursor/harness-knowledge-mapper/SKILL.md +195 -0
- package/dist/agents/skills/cursor/harness-knowledge-mapper/skill.yaml +50 -0
- package/dist/agents/skills/cursor/harness-load-testing/SKILL.md +274 -0
- package/dist/agents/skills/cursor/harness-load-testing/skill.yaml +79 -0
- package/dist/agents/skills/cursor/harness-ml-ops/SKILL.md +341 -0
- package/dist/agents/skills/cursor/harness-ml-ops/skill.yaml +79 -0
- package/dist/agents/skills/cursor/harness-mobile-patterns/SKILL.md +326 -0
- package/dist/agents/skills/cursor/harness-mobile-patterns/skill.yaml +82 -0
- package/dist/agents/skills/cursor/harness-mutation-test/SKILL.md +251 -0
- package/dist/agents/skills/cursor/harness-mutation-test/skill.yaml +70 -0
- package/dist/agents/skills/cursor/harness-observability/SKILL.md +283 -0
- package/dist/agents/skills/cursor/harness-observability/skill.yaml +78 -0
- package/dist/agents/skills/cursor/harness-onboarding/SKILL.md +288 -0
- package/dist/agents/skills/cursor/harness-onboarding/skill.yaml +31 -0
- package/dist/agents/skills/cursor/harness-parallel-agents/SKILL.md +256 -0
- package/dist/agents/skills/cursor/harness-parallel-agents/skill.yaml +34 -0
- package/dist/agents/skills/cursor/harness-perf/SKILL.md +260 -0
- package/dist/agents/skills/cursor/harness-perf/skill.yaml +51 -0
- package/dist/agents/skills/cursor/harness-perf-tdd/SKILL.md +249 -0
- package/dist/agents/skills/cursor/harness-perf-tdd/skill.yaml +48 -0
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +579 -0
- package/dist/agents/skills/cursor/harness-planning/skill.yaml +56 -0
- package/dist/agents/skills/cursor/harness-pre-commit-review/SKILL.md +324 -0
- package/dist/agents/skills/cursor/harness-pre-commit-review/skill.yaml +34 -0
- package/dist/agents/skills/cursor/harness-product-spec/SKILL.md +285 -0
- package/dist/agents/skills/cursor/harness-product-spec/skill.yaml +72 -0
- package/dist/agents/skills/cursor/harness-property-test/SKILL.md +281 -0
- package/dist/agents/skills/cursor/harness-property-test/skill.yaml +71 -0
- package/dist/agents/skills/cursor/harness-refactoring/SKILL.md +169 -0
- package/dist/agents/skills/cursor/harness-refactoring/skill.yaml +34 -0
- package/dist/agents/skills/cursor/harness-release-readiness/SKILL.md +689 -0
- package/dist/agents/skills/cursor/harness-release-readiness/skill.yaml +58 -0
- package/dist/agents/skills/cursor/harness-resilience/SKILL.md +255 -0
- package/dist/agents/skills/cursor/harness-resilience/skill.yaml +76 -0
- package/dist/agents/skills/cursor/harness-roadmap/SKILL.md +595 -0
- package/dist/agents/skills/cursor/harness-roadmap/skill.yaml +44 -0
- package/dist/agents/skills/cursor/harness-secrets/SKILL.md +293 -0
- package/dist/agents/skills/cursor/harness-secrets/skill.yaml +76 -0
- package/dist/agents/skills/cursor/harness-security-review/SKILL.md +260 -0
- package/dist/agents/skills/cursor/harness-security-review/skill.yaml +53 -0
- package/dist/agents/skills/cursor/harness-security-scan/SKILL.md +154 -0
- package/dist/agents/skills/cursor/harness-security-scan/skill.yaml +42 -0
- package/dist/agents/skills/cursor/harness-skill-authoring/SKILL.md +292 -0
- package/dist/agents/skills/cursor/harness-skill-authoring/skill.yaml +33 -0
- package/dist/agents/skills/cursor/harness-soundness-review/SKILL.md +1267 -0
- package/dist/agents/skills/cursor/harness-soundness-review/skill.yaml +49 -0
- package/dist/agents/skills/cursor/harness-sql-review/SKILL.md +315 -0
- package/dist/agents/skills/cursor/harness-sql-review/skill.yaml +74 -0
- package/dist/agents/skills/cursor/harness-state-management/SKILL.md +309 -0
- package/dist/agents/skills/cursor/harness-state-management/skill.yaml +33 -0
- package/dist/agents/skills/cursor/harness-supply-chain-audit/SKILL.md +281 -0
- package/dist/agents/skills/cursor/harness-supply-chain-audit/skill.yaml +51 -0
- package/dist/agents/skills/cursor/harness-tdd/SKILL.md +177 -0
- package/dist/agents/skills/cursor/harness-tdd/skill.yaml +49 -0
- package/dist/agents/skills/cursor/harness-test-advisor/SKILL.md +160 -0
- package/dist/agents/skills/cursor/harness-test-advisor/skill.yaml +45 -0
- package/dist/agents/skills/cursor/harness-test-data/SKILL.md +268 -0
- package/dist/agents/skills/cursor/harness-test-data/skill.yaml +74 -0
- package/dist/agents/skills/cursor/harness-ux-copy/SKILL.md +271 -0
- package/dist/agents/skills/cursor/harness-ux-copy/skill.yaml +77 -0
- package/dist/agents/skills/cursor/harness-verification/SKILL.md +421 -0
- package/dist/agents/skills/cursor/harness-verification/skill.yaml +43 -0
- package/dist/agents/skills/cursor/harness-verify/SKILL.md +159 -0
- package/dist/agents/skills/cursor/harness-verify/skill.yaml +41 -0
- package/dist/agents/skills/cursor/harness-visual-regression/SKILL.md +257 -0
- package/dist/agents/skills/cursor/harness-visual-regression/skill.yaml +74 -0
- package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +232 -0
- package/dist/agents/skills/cursor/initialize-harness-project/skill.yaml +32 -0
- package/dist/agents/skills/cursor/validate-context-engineering/SKILL.md +150 -0
- package/dist/agents/skills/cursor/validate-context-engineering/skill.yaml +32 -0
- package/dist/agents/skills/gemini-cli/enforce-architecture/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-api-design/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-architecture-advisor/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-auth/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +355 -45
- package/dist/agents/skills/gemini-cli/harness-autopilot/skill.yaml +12 -0
- package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +97 -3
- package/dist/agents/skills/gemini-cli/harness-code-review/skill.yaml +6 -0
- package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/SKILL.md +2 -4
- package/dist/agents/skills/gemini-cli/harness-database/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-deployment/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +99 -3
- package/dist/agents/skills/gemini-cli/harness-planning/skill.yaml +6 -0
- package/dist/agents/skills/gemini-cli/harness-pre-commit-review/SKILL.md +1 -1
- package/dist/agents/skills/gemini-cli/harness-product-spec/SKILL.md +5 -5
- package/dist/agents/skills/gemini-cli/harness-security-review/SKILL.md +27 -7
- package/dist/agents/skills/gemini-cli/harness-security-scan/SKILL.md +52 -0
- package/dist/agents/skills/gemini-cli/harness-supply-chain-audit/SKILL.md +281 -0
- package/dist/agents/skills/gemini-cli/harness-supply-chain-audit/skill.yaml +51 -0
- package/dist/agents/skills/package.json +1 -0
- package/dist/agents/skills/templates/discipline-template.md +49 -0
- package/dist/agents/skills/tests/schema.ts +1 -1
- package/dist/agents/skills/vitest.config.mts +5 -0
- package/dist/{agents-md-YTYQDA3P.js → agents-md-VYDFPIRW.js} +1 -1
- package/dist/{architecture-JQZYM4US.js → architecture-K5HSRBGB.js} +2 -2
- package/dist/bin/harness-mcp.js +13 -13
- package/dist/bin/harness.js +21 -19
- package/dist/{check-phase-gate-L3RADYWO.js → check-phase-gate-5AS6SXL6.js} +3 -3
- package/dist/{chunk-6KTUUFRN.js → chunk-5ZXHMCPL.js} +1 -1
- package/dist/{chunk-RCWZBSK5.js → chunk-6KWBH4EO.js} +1 -1
- package/dist/{chunk-ABQHQ6I5.js → chunk-ALFKNAZW.js} +2436 -233
- package/dist/{chunk-OXLLOSSR.js → chunk-AV6KMDO5.js} +2 -2
- package/dist/{chunk-7IP4JIFL.js → chunk-C7DTKLPW.js} +4 -4
- package/dist/{chunk-ZOAWBDWU.js → chunk-CJDVBBPB.js} +5 -1
- package/dist/{chunk-YPYGXRDR.js → chunk-DNDBFIZN.js} +18 -4
- package/dist/{chunk-XYLGHKG6.js → chunk-HKUX2X7O.js} +11 -2
- package/dist/{chunk-YZD2MRNQ.js → chunk-JOP2NDNB.js} +684 -142
- package/dist/{chunk-YBJ262QL.js → chunk-LRG3B43J.js} +1 -1
- package/dist/{chunk-AOZRDOIP.js → chunk-M6TIO6NF.js} +1 -1
- package/dist/{chunk-O5OJVPL6.js → chunk-OCDDCGDE.js} +9 -1
- package/dist/{chunk-OSXBPAMK.js → chunk-QDF7COPQ.js} +1 -1
- package/dist/{chunk-TPOTOBR7.js → chunk-RWZPHW4H.js} +3 -3
- package/dist/{chunk-3C2MLBPJ.js → chunk-SFRGPAK6.js} +1 -1
- package/dist/{chunk-XKECDXJS.js → chunk-SHYWICGA.js} +2184 -456
- package/dist/{chunk-S2FXOWOR.js → chunk-TF6ZLHJV.js} +2 -2
- package/dist/{chunk-NLVUVUGD.js → chunk-ZJMU7MEV.js} +1 -1
- package/dist/{ci-workflow-EQZFVX3P.js → ci-workflow-CRWU723U.js} +1 -1
- package/dist/{create-skill-XSWHMSM5.js → create-skill-NDXQSTIK.js} +2 -2
- package/dist/{dist-HWXF2C3R.js → dist-4LPXJYVZ.js} +105 -1
- package/dist/{docs-7ECGYMAV.js → docs-4JRHTLUZ.js} +3 -3
- package/dist/{engine-EG4EH4IX.js → engine-3G3VIM6L.js} +1 -1
- package/dist/{entropy-5USWKLVS.js → entropy-G6CZ2A6P.js} +2 -2
- package/dist/{feedback-UTBXZZHF.js → feedback-QYKQ65HB.js} +1 -1
- package/dist/{generate-agent-definitions-3PM5EU7V.js → generate-agent-definitions-SAAOAPT4.js} +3 -3
- package/dist/index.d.ts +25 -4
- package/dist/index.js +18 -18
- package/dist/{loader-ZPALXIVR.js → loader-VCOK3PF7.js} +1 -1
- package/dist/{mcp-362EZHF4.js → mcp-YENEPHBW.js} +13 -13
- package/dist/{performance-OQAFMJUD.js → performance-UBCFI2UP.js} +4 -2
- package/dist/{review-pipeline-C4GCFVGP.js → review-pipeline-IQAVCWAX.js} +1 -1
- package/dist/{runtime-7YLVK453.js → runtime-PYFFIESU.js} +1 -1
- package/dist/{security-PZOX7AQS.js → security-ZDADTPYW.js} +1 -1
- package/dist/{skill-executor-XZLYZYAK.js → skill-executor-XEVDGXUM.js} +2 -2
- package/dist/{validate-FD3Z6VJD.js → validate-VRTUHALQ.js} +2 -2
- package/dist/{validate-cross-check-WNJM6H2D.js → validate-cross-check-4Y6NHNK3.js} +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: harness-product-spec
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: User story generation, EARS acceptance criteria, and PRD creation from issues
|
|
4
|
+
cognitive_mode: constructive-architect
|
|
5
|
+
triggers:
|
|
6
|
+
- manual
|
|
7
|
+
- on_new_feature
|
|
8
|
+
platforms:
|
|
9
|
+
- claude-code
|
|
10
|
+
- gemini-cli
|
|
11
|
+
tools:
|
|
12
|
+
- Bash
|
|
13
|
+
- Read
|
|
14
|
+
- Write
|
|
15
|
+
- Edit
|
|
16
|
+
- Glob
|
|
17
|
+
- Grep
|
|
18
|
+
- emit_interaction
|
|
19
|
+
cli:
|
|
20
|
+
command: harness skill run harness-product-spec
|
|
21
|
+
args:
|
|
22
|
+
- name: path
|
|
23
|
+
description: Project root path
|
|
24
|
+
required: false
|
|
25
|
+
- name: source
|
|
26
|
+
description: "Input source: issue URL, feature description file, or inline text"
|
|
27
|
+
required: true
|
|
28
|
+
- name: format
|
|
29
|
+
description: "Output format: prd, user-stories, acceptance-criteria, all. Defaults to all."
|
|
30
|
+
required: false
|
|
31
|
+
mcp:
|
|
32
|
+
tool: run_skill
|
|
33
|
+
input:
|
|
34
|
+
skill: harness-product-spec
|
|
35
|
+
path: string
|
|
36
|
+
type: rigid
|
|
37
|
+
tier: 3
|
|
38
|
+
internal: false
|
|
39
|
+
keywords:
|
|
40
|
+
- product spec
|
|
41
|
+
- user story
|
|
42
|
+
- acceptance criteria
|
|
43
|
+
- EARS
|
|
44
|
+
- PRD
|
|
45
|
+
- requirements
|
|
46
|
+
- product requirements
|
|
47
|
+
- BDD
|
|
48
|
+
- given-when-then
|
|
49
|
+
- feature specification
|
|
50
|
+
stack_signals:
|
|
51
|
+
- "docs/specs/"
|
|
52
|
+
- "docs/requirements/"
|
|
53
|
+
- "specs/"
|
|
54
|
+
- ".github/ISSUE_TEMPLATE/"
|
|
55
|
+
- "docs/prd/"
|
|
56
|
+
phases:
|
|
57
|
+
- name: parse
|
|
58
|
+
description: Extract feature intent, stakeholders, and constraints from input source
|
|
59
|
+
required: true
|
|
60
|
+
- name: craft
|
|
61
|
+
description: Generate user stories with EARS acceptance criteria and edge cases
|
|
62
|
+
required: true
|
|
63
|
+
- name: generate
|
|
64
|
+
description: Produce PRD document with scope, requirements, and success metrics
|
|
65
|
+
required: true
|
|
66
|
+
- name: validate
|
|
67
|
+
description: Verify completeness, testability of acceptance criteria, and traceability to source
|
|
68
|
+
required: true
|
|
69
|
+
state:
|
|
70
|
+
persistent: false
|
|
71
|
+
files: []
|
|
72
|
+
depends_on: []
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Harness Property Test
|
|
2
|
+
|
|
3
|
+
> Property-based and generative testing with fast-check, hypothesis, and automatic shrinking. Discovers edge cases that example-based tests miss by generating thousands of random inputs and verifying invariants hold for all of them.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- Testing functions with large input spaces (parsers, serializers, encoders, validators)
|
|
8
|
+
- Verifying mathematical or algebraic properties (commutativity, associativity, round-trip encoding)
|
|
9
|
+
- Finding edge cases in data transformation, sorting, or filtering logic
|
|
10
|
+
- NOT when testing UI rendering or visual output (use harness-visual-regression instead)
|
|
11
|
+
- NOT when testing simple CRUD operations with well-defined inputs (use harness-tdd instead)
|
|
12
|
+
- NOT when testing external service integrations (use harness-integration-test instead)
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
### Phase 1: IDENTIFY -- Discover Testable Properties and Invariants
|
|
17
|
+
|
|
18
|
+
1. **Catalog candidate functions.** Search for functions that exhibit testable properties:
|
|
19
|
+
- **Pure functions** with deterministic output for given input
|
|
20
|
+
- **Serializers/deserializers** where `decode(encode(x)) === x` (round-trip property)
|
|
21
|
+
- **Sorting/filtering** where output maintains invariants (sorted order, subset relationship)
|
|
22
|
+
- **Validators** where valid input always passes and specific invalid inputs always fail
|
|
23
|
+
- **Mathematical functions** with known algebraic properties
|
|
24
|
+
|
|
25
|
+
2. **Identify properties for each candidate.** Common property categories:
|
|
26
|
+
- **Round-trip:** `deserialize(serialize(x)) === x` for any valid `x`
|
|
27
|
+
- **Idempotence:** `f(f(x)) === f(x)` (applying the function twice gives the same result)
|
|
28
|
+
- **Invariant preservation:** output always satisfies a postcondition regardless of input
|
|
29
|
+
- **Commutativity:** `f(a, b) === f(b, a)` for operations where order should not matter
|
|
30
|
+
- **No-crash (robustness):** function does not throw for any input in the domain
|
|
31
|
+
- **Monotonicity:** if `a <= b`, then `f(a) <= f(b)` for order-preserving functions
|
|
32
|
+
- **Equivalence:** `fastImpl(x) === referenceImpl(x)` for optimized implementations
|
|
33
|
+
|
|
34
|
+
3. **Define input domains.** For each property, specify:
|
|
35
|
+
- The type and range of valid inputs
|
|
36
|
+
- Constraints that inputs must satisfy (e.g., non-empty arrays, positive integers)
|
|
37
|
+
- Edge cases that the generator should emphasize (empty strings, zero, max int, Unicode)
|
|
38
|
+
|
|
39
|
+
4. **Prioritize by risk.** Focus property tests on:
|
|
40
|
+
- Functions where bugs have high business impact
|
|
41
|
+
- Functions with complex branching logic
|
|
42
|
+
- Functions that have had historical bugs or regression issues
|
|
43
|
+
|
|
44
|
+
5. **Report findings.** List candidate functions, their properties, and the expected generator configuration.
|
|
45
|
+
|
|
46
|
+
### Phase 2: DEFINE -- Write Property Specifications and Custom Generators
|
|
47
|
+
|
|
48
|
+
1. **Select the property testing framework.** Based on the project's language:
|
|
49
|
+
- **TypeScript/JavaScript:** fast-check
|
|
50
|
+
- **Python:** hypothesis
|
|
51
|
+
- **Rust:** proptest or quickcheck
|
|
52
|
+
- **Scala:** ScalaCheck
|
|
53
|
+
- **Haskell:** QuickCheck
|
|
54
|
+
- **Java/Kotlin:** jqwik
|
|
55
|
+
|
|
56
|
+
2. **Define custom generators (arbitraries) for domain types.** For each domain model:
|
|
57
|
+
- Build a generator that produces valid instances with realistic field values
|
|
58
|
+
- Add constraints matching the model's validation rules
|
|
59
|
+
- Compose generators for nested structures using `map`, `flatMap`, and `filter`
|
|
60
|
+
|
|
61
|
+
3. **Write property test specifications.** For each property identified in Phase 1:
|
|
62
|
+
- State the property as a universally quantified assertion: "For all inputs X satisfying constraint C, property P holds"
|
|
63
|
+
- Use the framework's property definition syntax
|
|
64
|
+
- Configure iteration count (default: 100 iterations for fast properties, 1000 for critical properties)
|
|
65
|
+
|
|
66
|
+
4. **Configure shrinking.** Ensure the framework's automatic shrinking is enabled:
|
|
67
|
+
- Shrinking reduces failing inputs to the minimal counterexample
|
|
68
|
+
- Custom generators should support shrinking (use `map` over `filter` where possible, since `filter` breaks shrinking)
|
|
69
|
+
- Set a shrink limit to prevent infinite shrinking on complex inputs
|
|
70
|
+
|
|
71
|
+
5. **Write seed values for reproducibility.** Configure:
|
|
72
|
+
- A fixed seed for CI to ensure deterministic reruns
|
|
73
|
+
- Seed logging so that any failure can be reproduced exactly
|
|
74
|
+
- Replay capability: failed seeds are stored and replayed on subsequent runs
|
|
75
|
+
|
|
76
|
+
### Phase 3: EXECUTE -- Run Property Tests and Collect Counterexamples
|
|
77
|
+
|
|
78
|
+
1. **Run property tests with verbose output.** Execute the test suite and observe:
|
|
79
|
+
- Number of test cases generated per property
|
|
80
|
+
- Any counterexamples found (failing inputs)
|
|
81
|
+
- Shrinking progress (how the framework reduces counterexamples)
|
|
82
|
+
|
|
83
|
+
2. **Analyze counterexamples.** For each failing property:
|
|
84
|
+
- Read the shrunk counterexample -- this is the minimal input that violates the property
|
|
85
|
+
- Understand why this input causes a failure
|
|
86
|
+
- Classify: is this a real bug, or is the property specification too strict?
|
|
87
|
+
|
|
88
|
+
3. **Reproduce counterexamples deterministically.** For each counterexample:
|
|
89
|
+
- Record the failing seed value
|
|
90
|
+
- Write an explicit example-based test using the shrunk counterexample as a regression test
|
|
91
|
+
- This regression test serves as documentation and prevents the same bug from recurring
|
|
92
|
+
|
|
93
|
+
4. **Handle flaky property tests.** If a property test fails intermittently:
|
|
94
|
+
- Increase the iteration count to reproduce more reliably
|
|
95
|
+
- Check if the property is sensitive to floating-point precision
|
|
96
|
+
- Verify that the generator does not produce inputs outside the valid domain
|
|
97
|
+
|
|
98
|
+
5. **Iterate on generator quality.** If the generator frequently produces uninteresting inputs:
|
|
99
|
+
- Add bias toward edge cases (empty collections, boundary values)
|
|
100
|
+
- Use `filter` sparingly (it discards inputs, wasting iterations)
|
|
101
|
+
- Prefer `map` and `flatMap` to construct valid inputs directly
|
|
102
|
+
|
|
103
|
+
### Phase 4: ANALYZE -- Diagnose Root Causes and Harden Implementations
|
|
104
|
+
|
|
105
|
+
1. **Fix bugs exposed by counterexamples.** For each real bug found:
|
|
106
|
+
- Understand the root cause using the minimal counterexample
|
|
107
|
+
- Fix the implementation
|
|
108
|
+
- Verify the property now holds (rerun with the same seed)
|
|
109
|
+
- Keep the regression test with the explicit counterexample
|
|
110
|
+
|
|
111
|
+
2. **Strengthen property specifications.** After fixing bugs:
|
|
112
|
+
- Consider whether additional properties are now testable
|
|
113
|
+
- Tighten existing properties if the fix enables stricter invariants
|
|
114
|
+
- Add properties for edge cases revealed by the counterexamples
|
|
115
|
+
|
|
116
|
+
3. **Measure property test effectiveness.** Evaluate:
|
|
117
|
+
- Number of unique bugs found by property tests vs. example-based tests
|
|
118
|
+
- Types of bugs found (off-by-one, overflow, Unicode handling, null handling)
|
|
119
|
+
- Generator coverage: what percentage of the input domain is being explored
|
|
120
|
+
|
|
121
|
+
4. **Integrate property tests into CI.** Configure:
|
|
122
|
+
- Property tests run on every PR with a moderate iteration count (100)
|
|
123
|
+
- Nightly runs use a higher iteration count (10,000) for deeper exploration
|
|
124
|
+
- Failed seeds are stored as artifacts for reproduction
|
|
125
|
+
|
|
126
|
+
5. **Run `harness validate`.** Confirm the project passes all harness checks with property tests in place.
|
|
127
|
+
|
|
128
|
+
### Graph Refresh
|
|
129
|
+
|
|
130
|
+
If a knowledge graph exists at `.harness/graph/`, refresh it after code changes to keep graph queries accurate:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
harness scan [path]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Harness Integration
|
|
137
|
+
|
|
138
|
+
- **`harness validate`** -- Run in ANALYZE phase after property tests are written and bugs are fixed. Confirms project health.
|
|
139
|
+
- **`harness check-deps`** -- Run after DEFINE phase to verify property testing framework is in devDependencies.
|
|
140
|
+
- **`emit_interaction`** -- Used to present counterexample analysis and property specification decisions to the human.
|
|
141
|
+
- **Grep** -- Used in IDENTIFY phase to find pure functions, serializers, validators, and mathematical operations.
|
|
142
|
+
- **Glob** -- Used to catalog existing property test files and domain type definitions.
|
|
143
|
+
|
|
144
|
+
## Success Criteria
|
|
145
|
+
|
|
146
|
+
- Every function with large input space has at least one property test
|
|
147
|
+
- Custom generators produce valid domain objects without relying heavily on `filter`
|
|
148
|
+
- All counterexamples are investigated: real bugs are fixed, property specs are adjusted for false positives
|
|
149
|
+
- Shrunk counterexamples are preserved as explicit regression tests
|
|
150
|
+
- Property tests are deterministic in CI (fixed seed) while still exploring randomly in local development
|
|
151
|
+
- `harness validate` passes with property tests in place
|
|
152
|
+
|
|
153
|
+
## Examples
|
|
154
|
+
|
|
155
|
+
### Example: fast-check for a TypeScript URL Parser
|
|
156
|
+
|
|
157
|
+
**IDENTIFY -- Properties of a URL parser:**
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
Function: parseUrl(input: string): ParsedUrl
|
|
161
|
+
Properties:
|
|
162
|
+
1. Round-trip: formatUrl(parseUrl(url)) === url for any valid URL
|
|
163
|
+
2. No-crash: parseUrl(arbitrary_string) never throws (returns Result type)
|
|
164
|
+
3. Invariant: parsed.protocol is always lowercase
|
|
165
|
+
4. Invariant: parsed.host never contains a trailing slash
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**DEFINE -- Custom generator and property tests:**
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
// tests/property/url-parser.prop.test.ts
|
|
172
|
+
import fc from 'fast-check';
|
|
173
|
+
import { parseUrl, formatUrl } from '../../src/url-parser';
|
|
174
|
+
|
|
175
|
+
// Custom generator for valid URLs
|
|
176
|
+
const urlArb = fc
|
|
177
|
+
.record({
|
|
178
|
+
protocol: fc.constantFrom('http', 'https', 'ftp'),
|
|
179
|
+
host: fc.domain(),
|
|
180
|
+
port: fc.option(fc.integer({ min: 1, max: 65535 }), { nil: undefined }),
|
|
181
|
+
path: fc
|
|
182
|
+
.array(
|
|
183
|
+
fc.stringOf(fc.constantFrom(...'abcdefghijklmnopqrstuvwxyz0123456789-_'.split('')), {
|
|
184
|
+
minLength: 1,
|
|
185
|
+
})
|
|
186
|
+
)
|
|
187
|
+
.map((segments) => '/' + segments.join('/')),
|
|
188
|
+
})
|
|
189
|
+
.map(({ protocol, host, port, path }) => `${protocol}://${host}${port ? ':' + port : ''}${path}`);
|
|
190
|
+
|
|
191
|
+
describe('URL parser properties', () => {
|
|
192
|
+
it('round-trips valid URLs', () => {
|
|
193
|
+
fc.assert(
|
|
194
|
+
fc.property(urlArb, (url) => {
|
|
195
|
+
const parsed = parseUrl(url);
|
|
196
|
+
if (!parsed.ok) return false; // skip invalid (generator should not produce these)
|
|
197
|
+
return formatUrl(parsed.value) === url;
|
|
198
|
+
}),
|
|
199
|
+
{ numRuns: 1000, seed: 42 }
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('never throws on arbitrary string input', () => {
|
|
204
|
+
fc.assert(
|
|
205
|
+
fc.property(fc.string(), (input) => {
|
|
206
|
+
const result = parseUrl(input);
|
|
207
|
+
// Must return a Result, never throw
|
|
208
|
+
return result.ok === true || result.ok === false;
|
|
209
|
+
}),
|
|
210
|
+
{ numRuns: 5000 }
|
|
211
|
+
);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it('always produces lowercase protocol', () => {
|
|
215
|
+
fc.assert(
|
|
216
|
+
fc.property(urlArb, (url) => {
|
|
217
|
+
const parsed = parseUrl(url.toUpperCase());
|
|
218
|
+
if (!parsed.ok) return true; // skip failures
|
|
219
|
+
return parsed.value.protocol === parsed.value.protocol.toLowerCase();
|
|
220
|
+
})
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Example: hypothesis for a Python Sorting Algorithm
|
|
227
|
+
|
|
228
|
+
**DEFINE -- Property tests with hypothesis:**
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
# tests/property/test_sort_properties.py
|
|
232
|
+
from hypothesis import given, settings, assume
|
|
233
|
+
from hypothesis import strategies as st
|
|
234
|
+
from myapp.sorting import merge_sort
|
|
235
|
+
|
|
236
|
+
@given(st.lists(st.integers()))
|
|
237
|
+
def test_sort_preserves_length(xs):
|
|
238
|
+
"""Sorted output has the same length as input."""
|
|
239
|
+
assert len(merge_sort(xs)) == len(xs)
|
|
240
|
+
|
|
241
|
+
@given(st.lists(st.integers()))
|
|
242
|
+
def test_sort_preserves_elements(xs):
|
|
243
|
+
"""Sorted output contains exactly the same elements as input."""
|
|
244
|
+
assert sorted(merge_sort(xs)) == sorted(xs)
|
|
245
|
+
|
|
246
|
+
@given(st.lists(st.integers(), min_size=1))
|
|
247
|
+
def test_sort_produces_ordered_output(xs):
|
|
248
|
+
"""Every element is less than or equal to the next."""
|
|
249
|
+
result = merge_sort(xs)
|
|
250
|
+
for i in range(len(result) - 1):
|
|
251
|
+
assert result[i] <= result[i + 1]
|
|
252
|
+
|
|
253
|
+
@given(st.lists(st.integers()))
|
|
254
|
+
def test_sort_is_idempotent(xs):
|
|
255
|
+
"""Sorting an already-sorted list produces the same result."""
|
|
256
|
+
once = merge_sort(xs)
|
|
257
|
+
twice = merge_sort(once)
|
|
258
|
+
assert once == twice
|
|
259
|
+
|
|
260
|
+
@settings(max_examples=5000)
|
|
261
|
+
@given(st.lists(st.floats(allow_nan=False, allow_infinity=False)))
|
|
262
|
+
def test_sort_handles_floats(xs):
|
|
263
|
+
"""Sort works correctly with floating-point numbers."""
|
|
264
|
+
result = merge_sort(xs)
|
|
265
|
+
for i in range(len(result) - 1):
|
|
266
|
+
assert result[i] <= result[i + 1]
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Gates
|
|
270
|
+
|
|
271
|
+
- **No property tests without shrinking.** If the framework's automatic shrinking is disabled or the generator uses patterns that break shrinking (excessive `filter`), counterexamples will be unhelpfully large. Fix the generator to support shrinking.
|
|
272
|
+
- **No ignoring counterexamples.** Every counterexample produced by a property test must be investigated. If it reveals a real bug, fix it. If it is a false positive, adjust the property specification or generator. Never just increase the iteration count to make it "less likely to fail."
|
|
273
|
+
- **No property tests that always pass trivially.** A property that returns `true` for every input is useless. Review that properties make substantive assertions. If a property has a `return true` fallback for most inputs, the generator is producing too many invalid inputs.
|
|
274
|
+
- **Regression tests are mandatory for counterexamples.** Every shrunk counterexample that revealed a bug must be preserved as an explicit example-based test, even after the property test passes. The explicit test serves as documentation and prevents regression.
|
|
275
|
+
|
|
276
|
+
## Escalation
|
|
277
|
+
|
|
278
|
+
- **When the generator cannot produce valid inputs efficiently (> 50% rejection rate):** Rewrite the generator to construct valid inputs directly rather than filtering. Use `flatMap` to build constrained structures incrementally. If the domain constraints are too complex for a generator, consider whether the function's API needs simplification.
|
|
279
|
+
- **When a counterexample is too complex to understand even after shrinking:** The shrinking strategy may be insufficient for the data type. Write a custom shrinker that targets the specific structure. Alternatively, add intermediate logging to the property to trace which sub-property fails.
|
|
280
|
+
- **When property tests are too slow for CI (> 5 minutes):** Reduce the iteration count for PR runs (100 iterations). Run high-iteration tests (10,000+) as a nightly job. Consider whether some properties can be tested with smaller input ranges without losing coverage.
|
|
281
|
+
- **When the team debates whether a property is correct:** The property may be encoding an assumption that does not hold. Review the specification or domain requirements. If the correct behavior is ambiguous, escalate to product/domain experts before encoding the property in a test.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: harness-property-test
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Property-based and generative testing with fast-check, hypothesis, and automatic shrinking
|
|
4
|
+
cognitive_mode: constructive-architect
|
|
5
|
+
triggers:
|
|
6
|
+
- manual
|
|
7
|
+
- on_new_feature
|
|
8
|
+
platforms:
|
|
9
|
+
- claude-code
|
|
10
|
+
- gemini-cli
|
|
11
|
+
tools:
|
|
12
|
+
- Bash
|
|
13
|
+
- Read
|
|
14
|
+
- Write
|
|
15
|
+
- Edit
|
|
16
|
+
- Glob
|
|
17
|
+
- Grep
|
|
18
|
+
- emit_interaction
|
|
19
|
+
cli:
|
|
20
|
+
command: harness skill run harness-property-test
|
|
21
|
+
args:
|
|
22
|
+
- name: path
|
|
23
|
+
description: Project root path
|
|
24
|
+
required: false
|
|
25
|
+
- name: framework
|
|
26
|
+
description: "Property testing framework: fast-check, hypothesis, proptest, or quickcheck. Auto-detected when omitted."
|
|
27
|
+
required: false
|
|
28
|
+
- name: target
|
|
29
|
+
description: "Target function or module for property test generation."
|
|
30
|
+
required: false
|
|
31
|
+
mcp:
|
|
32
|
+
tool: run_skill
|
|
33
|
+
input:
|
|
34
|
+
skill: harness-property-test
|
|
35
|
+
path: string
|
|
36
|
+
type: rigid
|
|
37
|
+
tier: 3
|
|
38
|
+
internal: false
|
|
39
|
+
keywords:
|
|
40
|
+
- property-based testing
|
|
41
|
+
- generative testing
|
|
42
|
+
- fast-check
|
|
43
|
+
- hypothesis
|
|
44
|
+
- proptest
|
|
45
|
+
- QuickCheck
|
|
46
|
+
- fuzzing
|
|
47
|
+
- shrinking
|
|
48
|
+
- arbitrary
|
|
49
|
+
- invariant
|
|
50
|
+
stack_signals:
|
|
51
|
+
- "src/**/*property*"
|
|
52
|
+
- "tests/property/"
|
|
53
|
+
- "src/**/*.prop.*"
|
|
54
|
+
- "tests/**/properties/"
|
|
55
|
+
phases:
|
|
56
|
+
- name: identify
|
|
57
|
+
description: Analyze functions and data types to discover testable properties and invariants
|
|
58
|
+
required: true
|
|
59
|
+
- name: define
|
|
60
|
+
description: Define property specifications, custom generators, and shrinking strategies
|
|
61
|
+
required: true
|
|
62
|
+
- name: execute
|
|
63
|
+
description: Run property tests with sufficient iterations and collect counterexamples
|
|
64
|
+
required: true
|
|
65
|
+
- name: analyze
|
|
66
|
+
description: Interpret shrunk counterexamples, diagnose root causes, and harden implementations
|
|
67
|
+
required: true
|
|
68
|
+
state:
|
|
69
|
+
persistent: false
|
|
70
|
+
files: []
|
|
71
|
+
depends_on: []
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Harness Refactoring
|
|
2
|
+
|
|
3
|
+
> Safe refactoring with constraint verification at every step. Change structure without changing behavior, with harness checks as your safety net.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- When improving code structure, readability, or maintainability without changing behavior
|
|
8
|
+
- When reducing duplication (DRY refactoring)
|
|
9
|
+
- When moving code to the correct architectural layer
|
|
10
|
+
- When splitting large files or functions into smaller, focused ones
|
|
11
|
+
- When renaming for clarity across the codebase
|
|
12
|
+
- After completing a feature (post-TDD cleanup beyond single-cycle refactoring)
|
|
13
|
+
- NOT when adding new behavior (use harness-tdd instead)
|
|
14
|
+
- NOT when fixing bugs (use harness-tdd — write a failing test first)
|
|
15
|
+
- NOT when the test suite is already failing — fix the tests before refactoring
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### Iron Rule
|
|
20
|
+
|
|
21
|
+
**All tests must pass BEFORE you start refactoring and AFTER every single change.**
|
|
22
|
+
|
|
23
|
+
If tests are not green before you start, you are not refactoring — you are debugging. Fix the tests first. If tests break during refactoring, undo the last change immediately. Do not try to fix forward.
|
|
24
|
+
|
|
25
|
+
### Phase 1: Prepare — Verify Starting State
|
|
26
|
+
|
|
27
|
+
1. **Run the full test suite.** Every test must pass. Record the count of passing tests — this number must not decrease at any point.
|
|
28
|
+
|
|
29
|
+
2. **Run `harness validate`** and **`harness check-deps`**. Both must pass. You are establishing a clean baseline. If either reports issues, fix those first (that is a separate task, not part of this refactoring).
|
|
30
|
+
|
|
31
|
+
3. **Identify the refactoring target.** Be specific: which file, function, class, or module? What is wrong with the current structure? What will be better after refactoring?
|
|
32
|
+
|
|
33
|
+
4. **Plan the steps.** Break the refactoring into the smallest possible individual changes. Each step should be independently committable and verifiable. If you cannot describe a step in one sentence, it is too large.
|
|
34
|
+
|
|
35
|
+
### Graph-Enhanced Context (when available)
|
|
36
|
+
|
|
37
|
+
When a knowledge graph exists at `.harness/graph/`, use graph queries for faster, more accurate context:
|
|
38
|
+
|
|
39
|
+
- `get_impact` — precise impact analysis: "if I move this function, what breaks?"
|
|
40
|
+
- `query_graph` — find all transitive consumers, not just direct importers
|
|
41
|
+
|
|
42
|
+
Catches indirect consumers that grep misses. Fall back to file-based commands if no graph is available.
|
|
43
|
+
|
|
44
|
+
### Phase 2: Execute — One Small Change at a Time
|
|
45
|
+
|
|
46
|
+
For EACH step in the plan:
|
|
47
|
+
|
|
48
|
+
1. **Make ONE small change.** Examples of "one small change":
|
|
49
|
+
- Rename one variable or function
|
|
50
|
+
- Extract one function from a larger function
|
|
51
|
+
- Move one function to a different file
|
|
52
|
+
- Inline one unnecessary abstraction
|
|
53
|
+
- Replace one conditional with polymorphism
|
|
54
|
+
- Remove one instance of duplication
|
|
55
|
+
|
|
56
|
+
2. **Run the full test suite.** All tests must pass. If any test fails:
|
|
57
|
+
- **STOP immediately.**
|
|
58
|
+
- **Undo the change** (git checkout the file or revert manually).
|
|
59
|
+
- **Analyze why it broke.** Either the change was not purely structural (it changed behavior) or the tests are coupled to implementation details.
|
|
60
|
+
- **Try a smaller step** or a different approach.
|
|
61
|
+
|
|
62
|
+
3. **Run `harness validate` and `harness check-deps`.** Both must pass. A refactoring that fixes code structure but violates architectural constraints is not safe.
|
|
63
|
+
|
|
64
|
+
4. **Commit the step.** Each step gets its own commit. The commit message describes the structural change: "extract validateInput from processOrder" or "move UserRepository to data-access layer."
|
|
65
|
+
|
|
66
|
+
5. **Repeat** for the next step in the plan.
|
|
67
|
+
|
|
68
|
+
### Phase 3: Verify — Confirm the Refactoring is Complete
|
|
69
|
+
|
|
70
|
+
1. **Run the full test suite one final time.** Same number of passing tests as Phase 1.
|
|
71
|
+
|
|
72
|
+
2. **Run `harness validate` and `harness check-deps` one final time.** Clean output.
|
|
73
|
+
|
|
74
|
+
### Graph Refresh
|
|
75
|
+
|
|
76
|
+
If a knowledge graph exists at `.harness/graph/`, refresh it after code changes to keep graph queries accurate:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
harness scan [path]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Skipping this step means subsequent graph queries (impact analysis, dependency health, test advisor) may return stale results.
|
|
83
|
+
|
|
84
|
+
3. **Review the cumulative diff.** Does the final state match the intended improvement? Is the code genuinely better, or just different?
|
|
85
|
+
|
|
86
|
+
4. **If the refactoring introduced no improvement,** revert the entire sequence. Refactoring for its own sake is churn.
|
|
87
|
+
|
|
88
|
+
## Common Refactoring Patterns
|
|
89
|
+
|
|
90
|
+
### Extract Function
|
|
91
|
+
|
|
92
|
+
**When:** A function is doing too many things, or a block of code is reused in multiple places.
|
|
93
|
+
**How:** Identify the block. Ensure all variables it uses are either parameters or local. Cut the block into a new function with a descriptive name. Replace the original block with a call to the new function.
|
|
94
|
+
**Harness guidance:** If the extracted function belongs in a different layer, move it there AND update the import. Run `harness check-deps` to verify the new import respects layer boundaries.
|
|
95
|
+
|
|
96
|
+
### Move to Layer
|
|
97
|
+
|
|
98
|
+
**When:** Code is in the wrong architectural layer (e.g., business logic in a UI component, database queries in a service).
|
|
99
|
+
**How:** Create the function in the correct layer. Update all callers to import from the new location. Delete the old function. Run `harness check-deps` after each step.
|
|
100
|
+
**Harness guidance:** This is where `harness check-deps` is most valuable. Moving code between layers changes the dependency graph. The tool will tell you immediately if the move created a violation.
|
|
101
|
+
|
|
102
|
+
### Split File
|
|
103
|
+
|
|
104
|
+
**When:** A file has grown too large or contains unrelated responsibilities.
|
|
105
|
+
**How:** Identify the cohesive groups within the file. Create new files, one per group. Move functions/classes to their new files. Update the original file to re-export from the new files (for backward compatibility) or update all callers.
|
|
106
|
+
**Harness guidance:** Run `harness validate` after splitting to ensure the new files follow naming conventions and are properly structured. Run `harness check-deps` to verify no new boundary violations.
|
|
107
|
+
|
|
108
|
+
### Inline Abstraction
|
|
109
|
+
|
|
110
|
+
**When:** An abstraction (class, interface, wrapper function) adds complexity without value. It has only one implementation, is never extended, and obscures what the code actually does.
|
|
111
|
+
**How:** Replace uses of the abstraction with the concrete implementation. Delete the abstraction. Run tests.
|
|
112
|
+
**Harness guidance:** Removing an abstraction may expose a layer violation that the abstraction was hiding. Run `harness check-deps` to check.
|
|
113
|
+
|
|
114
|
+
### Rename for Clarity
|
|
115
|
+
|
|
116
|
+
**When:** A name is misleading, ambiguous, or no longer reflects what the code does.
|
|
117
|
+
**How:** Use your editor's rename/refactor tool to change the name everywhere it appears. If the name is part of a public API, check for external consumers first.
|
|
118
|
+
**Harness guidance:** Run `harness check-docs` after renaming to detect documentation that still uses the old name. AGENTS.md, inline comments, and doc pages may all need updating.
|
|
119
|
+
|
|
120
|
+
## Harness Integration
|
|
121
|
+
|
|
122
|
+
- **`harness validate`** — Run before starting, after each step, and at the end. Catches structural issues, naming violations, and configuration drift.
|
|
123
|
+
- **`harness check-deps`** — Run after each step, especially when moving code between files or layers. Catches dependency violations introduced by structural changes.
|
|
124
|
+
- **`harness check-docs`** — Run after renaming or moving public APIs. Catches documentation that references old names or locations.
|
|
125
|
+
- **`harness cleanup`** — Run after completing a refactoring sequence. Detects dead code that the refactoring may have created (unused exports, orphaned files).
|
|
126
|
+
|
|
127
|
+
## Success Criteria
|
|
128
|
+
|
|
129
|
+
- All tests pass before, during, and after refactoring (same count, same results)
|
|
130
|
+
- `harness validate` passes at every step
|
|
131
|
+
- `harness check-deps` passes at every step
|
|
132
|
+
- Each step is an atomic commit with a clear structural description
|
|
133
|
+
- The code is measurably better after refactoring (clearer names, less duplication, correct layering, smaller functions)
|
|
134
|
+
- No behavioral changes were introduced (the test suite is the proof)
|
|
135
|
+
- No dead code was left behind (run `harness cleanup` to verify)
|
|
136
|
+
|
|
137
|
+
## Examples
|
|
138
|
+
|
|
139
|
+
### Example: Moving business logic out of a UI component
|
|
140
|
+
|
|
141
|
+
**Target:** `src/components/OrderSummary.tsx` contains a `calculateDiscount()` function with complex business rules. This logic belongs in the service layer.
|
|
142
|
+
|
|
143
|
+
**Step 1:** Create `src/services/discount-service.ts` with the `calculateDiscount` function copied from the component.
|
|
144
|
+
|
|
145
|
+
- Run tests: pass
|
|
146
|
+
- Run `harness check-deps`: pass (new file, no violations)
|
|
147
|
+
- Commit: "extract calculateDiscount to discount-service"
|
|
148
|
+
|
|
149
|
+
**Step 2:** Update `OrderSummary.tsx` to import `calculateDiscount` from `discount-service` instead of using the local function.
|
|
150
|
+
|
|
151
|
+
- Run tests: pass
|
|
152
|
+
- Run `harness check-deps`: pass (UI importing from service is allowed)
|
|
153
|
+
- Commit: "update OrderSummary to use discount-service"
|
|
154
|
+
|
|
155
|
+
**Step 3:** Delete the original `calculateDiscount` function from `OrderSummary.tsx`.
|
|
156
|
+
|
|
157
|
+
- Run tests: pass
|
|
158
|
+
- Run `harness check-deps`: pass
|
|
159
|
+
- Run `harness cleanup`: no dead code detected
|
|
160
|
+
- Commit: "remove duplicate calculateDiscount from OrderSummary"
|
|
161
|
+
|
|
162
|
+
**Final verification:** 3 steps, 3 commits, all tests green throughout, all harness checks passing. The business logic is now in the correct layer.
|
|
163
|
+
|
|
164
|
+
## Escalation
|
|
165
|
+
|
|
166
|
+
- **When tests fail during refactoring and you cannot figure out why:** Revert to the last green commit. The test failure means the change was not purely structural. Analyze the test to understand what behavioral assumption it depends on, then plan a different approach.
|
|
167
|
+
- **When `harness check-deps` fails after a move:** The code you moved may have dependencies that are not allowed in its new layer. You may need to refactor the moved code itself (remove forbidden imports) before it can live in the new layer.
|
|
168
|
+
- **When a refactoring requires changing tests:** This is a warning sign. If the tests need to change, the refactoring may be changing behavior. The only valid reason to change tests during refactoring is if the tests were testing implementation details (not behavior) — and in that case, fix the tests first as a separate step before refactoring.
|
|
169
|
+
- **When the refactoring scope keeps growing:** Stop. Commit what you have (if it is clean). Re-plan with a smaller scope. Large refactorings should be broken into multiple sessions, each leaving the code in a better state.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: harness-refactoring
|
|
2
|
+
version: "1.0.0"
|
|
3
|
+
description: Safe refactoring with validation before and after changes
|
|
4
|
+
cognitive_mode: meticulous-implementer
|
|
5
|
+
triggers:
|
|
6
|
+
- manual
|
|
7
|
+
- on_refactor
|
|
8
|
+
platforms:
|
|
9
|
+
- claude-code
|
|
10
|
+
- gemini-cli
|
|
11
|
+
tools:
|
|
12
|
+
- Bash
|
|
13
|
+
- Read
|
|
14
|
+
- Write
|
|
15
|
+
- Edit
|
|
16
|
+
- Glob
|
|
17
|
+
- Grep
|
|
18
|
+
cli:
|
|
19
|
+
command: harness skill run harness-refactoring
|
|
20
|
+
args:
|
|
21
|
+
- name: path
|
|
22
|
+
description: Project root path
|
|
23
|
+
required: false
|
|
24
|
+
mcp:
|
|
25
|
+
tool: run_skill
|
|
26
|
+
input:
|
|
27
|
+
skill: harness-refactoring
|
|
28
|
+
path: string
|
|
29
|
+
type: flexible
|
|
30
|
+
tier: 1
|
|
31
|
+
state:
|
|
32
|
+
persistent: false
|
|
33
|
+
files: []
|
|
34
|
+
depends_on: []
|