incitaciones 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/LICENSE +395 -0
- package/README.md +410 -0
- package/content/distilled/abstraction-miner.md +32 -0
- package/content/distilled/adversarial-stakeholder-evaluation.md +121 -0
- package/content/distilled/anti-slop-prose.md +46 -0
- package/content/distilled/bias-audit.md +39 -0
- package/content/distilled/code-review/SKILL.md +53 -0
- package/content/distilled/code-review/references/criteria.md +50 -0
- package/content/distilled/code-review/references/templates.md +75 -0
- package/content/distilled/code-review/references/variants.md +32 -0
- package/content/distilled/commit/SKILL.md +41 -0
- package/content/distilled/commit/references/criteria.md +21 -0
- package/content/distilled/commit/references/templates.md +46 -0
- package/content/distilled/composability-diagnostician.md +67 -0
- package/content/distilled/context-guardian.md +20 -0
- package/content/distilled/create-handoff/SKILL.md +16 -0
- package/content/distilled/create-handoff/references/handoff-template.md +65 -0
- package/content/distilled/create-handoff/references/naming.md +7 -0
- package/content/distilled/create-issues/SKILL.md +72 -0
- package/content/distilled/create-issues/references/criteria.md +44 -0
- package/content/distilled/create-issues/references/templates.md +75 -0
- package/content/distilled/create-plan/SKILL.md +19 -0
- package/content/distilled/create-plan/references/plan-template.md +87 -0
- package/content/distilled/create-plan/references/scenarios.md +19 -0
- package/content/distilled/debug/SKILL.md +42 -0
- package/content/distilled/debug/references/criteria.md +27 -0
- package/content/distilled/debug/references/templates.md +39 -0
- package/content/distilled/describe-pr/SKILL.md +17 -0
- package/content/distilled/describe-pr/references/pr-template.md +62 -0
- package/content/distilled/design-practice.md +213 -0
- package/content/distilled/design-review/SKILL.md +29 -0
- package/content/distilled/design-review/references/combined-review.md +27 -0
- package/content/distilled/design-review/references/decision-matrix.md +122 -0
- package/content/distilled/design-review/references/problem-statement.md +141 -0
- package/content/distilled/design-review/references/report-template.md +36 -0
- package/content/distilled/design-review/references/scope-document.md +51 -0
- package/content/distilled/distill-prompt/SKILL.md +41 -0
- package/content/distilled/distill-prompt/references/criteria.md +26 -0
- package/content/distilled/distill-prompt/references/templates.md +30 -0
- package/content/distilled/doc-link-verifier/SKILL.md +212 -0
- package/content/distilled/doc-link-verifier/scripts/check_links.py +453 -0
- package/content/distilled/doc-link-verifier/scripts/extract_links.py +521 -0
- package/content/distilled/edge-case-discovery.md +123 -0
- package/content/distilled/error-handling-diagnostician.md +90 -0
- package/content/distilled/extract-prompt.md +220 -0
- package/content/distilled/formal-verification-evaluator.md +158 -0
- package/content/distilled/grill-me.md +24 -0
- package/content/distilled/guided-review.md +68 -0
- package/content/distilled/implement-documentation.md +68 -0
- package/content/distilled/implement-plan/SKILL.md +23 -0
- package/content/distilled/implement-plan/references/common-situations.md +36 -0
- package/content/distilled/implement-plan/references/verification-template.md +18 -0
- package/content/distilled/invalid-states-diagnostician.md +63 -0
- package/content/distilled/issue-review/SKILL.md +37 -0
- package/content/distilled/issue-review/references/convergence.md +19 -0
- package/content/distilled/issue-review/references/final-report.md +60 -0
- package/content/distilled/issue-review/references/pass-1-clarity.md +28 -0
- package/content/distilled/issue-review/references/pass-2-scope.md +22 -0
- package/content/distilled/issue-review/references/pass-3-dependencies.md +23 -0
- package/content/distilled/issue-review/references/pass-4-alignment.md +17 -0
- package/content/distilled/issue-review/references/pass-5-executability.md +17 -0
- package/content/distilled/issue-review/references/setup.md +25 -0
- package/content/distilled/iterate-plan/SKILL.md +24 -0
- package/content/distilled/iterate-plan/references/change-template.md +15 -0
- package/content/distilled/iterate-plan/references/common-scenarios.md +14 -0
- package/content/distilled/julia-performance-diagnostician.md +71 -0
- package/content/distilled/modularity-diagnostician.md +68 -0
- package/content/distilled/multi-agent-review.md +196 -0
- package/content/distilled/mutability-diagnostician.md +63 -0
- package/content/distilled/narrative-article.md +60 -0
- package/content/distilled/optionality-review.md +190 -0
- package/content/distilled/parallel-review/SKILL.md +49 -0
- package/content/distilled/parallel-review/references/criteria.md +34 -0
- package/content/distilled/parallel-review/references/templates.md +59 -0
- package/content/distilled/plan-review/SKILL.md +42 -0
- package/content/distilled/plan-review/references/criteria.md +51 -0
- package/content/distilled/plan-review/references/templates.md +67 -0
- package/content/distilled/pre-mortem.md +10 -0
- package/content/distilled/project-status-report.md +124 -0
- package/content/distilled/pwa-accessibility-review.md +81 -0
- package/content/distilled/rca-diagnostician/SKILL.md +30 -0
- package/content/distilled/rca-diagnostician/references/action-hierarchy.md +77 -0
- package/content/distilled/rca-diagnostician/references/bias-countermeasures.md +64 -0
- package/content/distilled/rca-diagnostician/references/evidence-timeline.md +49 -0
- package/content/distilled/rca-diagnostician/references/hypothesis-methods.md +53 -0
- package/content/distilled/rca-diagnostician/references/problem-definition.md +34 -0
- package/content/distilled/rca-diagnostician/references/report-template.md +75 -0
- package/content/distilled/rca-diagnostician/references/rigor-checklist.md +66 -0
- package/content/distilled/red-team-review.md +133 -0
- package/content/distilled/research-codebase/SKILL.md +22 -0
- package/content/distilled/research-codebase/references/report-template.md +75 -0
- package/content/distilled/research-codebase/references/search-patterns.md +27 -0
- package/content/distilled/research-documentation.md +79 -0
- package/content/distilled/research-review/SKILL.md +42 -0
- package/content/distilled/research-review/references/criteria.md +51 -0
- package/content/distilled/research-review/references/templates.md +73 -0
- package/content/distilled/resonant-refactor.md +45 -0
- package/content/distilled/resume-handoff/SKILL.md +19 -0
- package/content/distilled/resume-handoff/references/analysis-template.md +40 -0
- package/content/distilled/resume-handoff/references/locating.md +12 -0
- package/content/distilled/review-documentation.md +44 -0
- package/content/distilled/rigidity-diagnostician.md +70 -0
- package/content/distilled/rule-of-5-universal/SKILL.md +26 -0
- package/content/distilled/rule-of-5-universal/references/criteria.md +34 -0
- package/content/distilled/rule-of-5-universal/references/examples.md +69 -0
- package/content/distilled/rule-of-5-universal/references/templates.md +136 -0
- package/content/distilled/specification-evaluation-diagnostician.md +106 -0
- package/content/distilled/specification-review/SKILL.md +43 -0
- package/content/distilled/specification-review/references/criteria.md +51 -0
- package/content/distilled/specification-review/references/templates.md +67 -0
- package/content/distilled/systematic-housekeeping.md +27 -0
- package/content/distilled/tdd/SKILL.md +38 -0
- package/content/distilled/tdd/references/criteria.md +26 -0
- package/content/distilled/tdd/references/templates.md +53 -0
- package/content/distilled/test-abstraction-miner.md +43 -0
- package/content/distilled/test-friction.md +51 -0
- package/content/distilled/testability-implementability-evaluator.md +144 -0
- package/content/distilled/ui-align.md +32 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/SKILL.md +21 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-1-product.md +20 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-2-engineering.md +20 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-3-interface.md +23 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-4-ecosystem.md +20 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-5-documentation.md +19 -0
- package/content/distilled/ux-dx-evaluation-diagnostician/references/report-template.md +36 -0
- package/content/distilled/verification-diagnostician.md +90 -0
- package/content/distilled/verify-prompt/SKILL.md +32 -0
- package/content/distilled/verify-prompt/references/criteria.md +21 -0
- package/content/manifest.json +3220 -0
- package/package.json +50 -0
- package/pi-package/README.md +9 -0
- package/pi-package/prompts/abstraction-miner.md +10 -0
- package/pi-package/prompts/adversarial-stakeholder-evaluation.md +10 -0
- package/pi-package/prompts/anti-slop-prose.md +10 -0
- package/pi-package/prompts/bias-audit.md +10 -0
- package/pi-package/prompts/code-review.md +10 -0
- package/pi-package/prompts/commit.md +10 -0
- package/pi-package/prompts/composability-diagnostician.md +10 -0
- package/pi-package/prompts/context-guardian.md +10 -0
- package/pi-package/prompts/create-handoff.md +10 -0
- package/pi-package/prompts/create-issues.md +10 -0
- package/pi-package/prompts/create-plan.md +10 -0
- package/pi-package/prompts/debug.md +10 -0
- package/pi-package/prompts/describe-pr.md +10 -0
- package/pi-package/prompts/design-practice.md +10 -0
- package/pi-package/prompts/design-review.md +10 -0
- package/pi-package/prompts/distill-prompt.md +10 -0
- package/pi-package/prompts/doc-link-verifier.md +10 -0
- package/pi-package/prompts/edge-case-discovery.md +10 -0
- package/pi-package/prompts/error-handling-diagnostician.md +10 -0
- package/pi-package/prompts/extract-prompt.md +10 -0
- package/pi-package/prompts/formal-verification-evaluator.md +10 -0
- package/pi-package/prompts/grill-me.md +10 -0
- package/pi-package/prompts/guided-review.md +10 -0
- package/pi-package/prompts/implement-documentation.md +10 -0
- package/pi-package/prompts/implement-plan.md +10 -0
- package/pi-package/prompts/invalid-states-diagnostician.md +10 -0
- package/pi-package/prompts/issue-review.md +10 -0
- package/pi-package/prompts/iterate-plan.md +10 -0
- package/pi-package/prompts/julia-performance-diagnostician.md +10 -0
- package/pi-package/prompts/modularity-diagnostician.md +10 -0
- package/pi-package/prompts/multi-agent-review.md +10 -0
- package/pi-package/prompts/mutability-diagnostician.md +10 -0
- package/pi-package/prompts/narrative-article.md +10 -0
- package/pi-package/prompts/optionality-review.md +10 -0
- package/pi-package/prompts/parallel-review.md +10 -0
- package/pi-package/prompts/plan-review.md +10 -0
- package/pi-package/prompts/pre-mortem.md +10 -0
- package/pi-package/prompts/project-status-report.md +10 -0
- package/pi-package/prompts/pwa-accessibility-review.md +10 -0
- package/pi-package/prompts/rca-diagnostician.md +10 -0
- package/pi-package/prompts/red-team-review.md +10 -0
- package/pi-package/prompts/research-codebase.md +10 -0
- package/pi-package/prompts/research-documentation.md +10 -0
- package/pi-package/prompts/research-review.md +10 -0
- package/pi-package/prompts/resonant-refactor.md +10 -0
- package/pi-package/prompts/resume-handoff.md +10 -0
- package/pi-package/prompts/review-documentation.md +10 -0
- package/pi-package/prompts/rigidity-diagnostician.md +10 -0
- package/pi-package/prompts/rule-of-5-universal.md +10 -0
- package/pi-package/prompts/specification-evaluation-diagnostician.md +10 -0
- package/pi-package/prompts/specification-review.md +10 -0
- package/pi-package/prompts/systematic-housekeeping.md +10 -0
- package/pi-package/prompts/tdd.md +10 -0
- package/pi-package/prompts/test-abstraction-miner.md +10 -0
- package/pi-package/prompts/test-friction.md +10 -0
- package/pi-package/prompts/testability-implementability-evaluator.md +10 -0
- package/pi-package/prompts/ui-align.md +10 -0
- package/pi-package/prompts/ux-dx-evaluation-diagnostician.md +10 -0
- package/pi-package/prompts/verification-diagnostician.md +10 -0
- package/pi-package/prompts/verify-prompt.md +10 -0
- package/pi-package/skills/abstraction-miner/SKILL.md +38 -0
- package/pi-package/skills/adversarial-stakeholder-evaluation/SKILL.md +127 -0
- package/pi-package/skills/anti-slop-prose/SKILL.md +52 -0
- package/pi-package/skills/bias-audit/SKILL.md +45 -0
- package/pi-package/skills/code-review/SKILL.md +59 -0
- package/pi-package/skills/code-review/references/criteria.md +50 -0
- package/pi-package/skills/code-review/references/templates.md +75 -0
- package/pi-package/skills/code-review/references/variants.md +32 -0
- package/pi-package/skills/commit/SKILL.md +47 -0
- package/pi-package/skills/commit/references/criteria.md +21 -0
- package/pi-package/skills/commit/references/templates.md +46 -0
- package/pi-package/skills/composability-diagnostician/SKILL.md +73 -0
- package/pi-package/skills/context-guardian/SKILL.md +26 -0
- package/pi-package/skills/create-handoff/SKILL.md +22 -0
- package/pi-package/skills/create-handoff/references/handoff-template.md +65 -0
- package/pi-package/skills/create-handoff/references/naming.md +7 -0
- package/pi-package/skills/create-issues/SKILL.md +78 -0
- package/pi-package/skills/create-issues/references/criteria.md +44 -0
- package/pi-package/skills/create-issues/references/templates.md +75 -0
- package/pi-package/skills/create-plan/SKILL.md +25 -0
- package/pi-package/skills/create-plan/references/plan-template.md +87 -0
- package/pi-package/skills/create-plan/references/scenarios.md +19 -0
- package/pi-package/skills/debug/SKILL.md +48 -0
- package/pi-package/skills/debug/references/criteria.md +27 -0
- package/pi-package/skills/debug/references/templates.md +39 -0
- package/pi-package/skills/describe-pr/SKILL.md +23 -0
- package/pi-package/skills/describe-pr/references/pr-template.md +62 -0
- package/pi-package/skills/design-practice/SKILL.md +219 -0
- package/pi-package/skills/design-review/SKILL.md +35 -0
- package/pi-package/skills/design-review/references/combined-review.md +27 -0
- package/pi-package/skills/design-review/references/decision-matrix.md +122 -0
- package/pi-package/skills/design-review/references/problem-statement.md +141 -0
- package/pi-package/skills/design-review/references/report-template.md +36 -0
- package/pi-package/skills/design-review/references/scope-document.md +51 -0
- package/pi-package/skills/distill-prompt/SKILL.md +47 -0
- package/pi-package/skills/distill-prompt/references/criteria.md +26 -0
- package/pi-package/skills/distill-prompt/references/templates.md +30 -0
- package/pi-package/skills/doc-link-verifier/SKILL.md +218 -0
- package/pi-package/skills/doc-link-verifier/scripts/check_links.py +453 -0
- package/pi-package/skills/doc-link-verifier/scripts/extract_links.py +521 -0
- package/pi-package/skills/edge-case-discovery/SKILL.md +129 -0
- package/pi-package/skills/error-handling-diagnostician/SKILL.md +96 -0
- package/pi-package/skills/extract-prompt/SKILL.md +226 -0
- package/pi-package/skills/formal-verification-evaluator/SKILL.md +164 -0
- package/pi-package/skills/grill-me/SKILL.md +30 -0
- package/pi-package/skills/guided-review/SKILL.md +74 -0
- package/pi-package/skills/implement-documentation/SKILL.md +74 -0
- package/pi-package/skills/implement-plan/SKILL.md +29 -0
- package/pi-package/skills/implement-plan/references/common-situations.md +36 -0
- package/pi-package/skills/implement-plan/references/verification-template.md +18 -0
- package/pi-package/skills/invalid-states-diagnostician/SKILL.md +69 -0
- package/pi-package/skills/issue-review/SKILL.md +43 -0
- package/pi-package/skills/issue-review/references/convergence.md +19 -0
- package/pi-package/skills/issue-review/references/final-report.md +60 -0
- package/pi-package/skills/issue-review/references/pass-1-clarity.md +28 -0
- package/pi-package/skills/issue-review/references/pass-2-scope.md +22 -0
- package/pi-package/skills/issue-review/references/pass-3-dependencies.md +23 -0
- package/pi-package/skills/issue-review/references/pass-4-alignment.md +17 -0
- package/pi-package/skills/issue-review/references/pass-5-executability.md +17 -0
- package/pi-package/skills/issue-review/references/setup.md +25 -0
- package/pi-package/skills/iterate-plan/SKILL.md +30 -0
- package/pi-package/skills/iterate-plan/references/change-template.md +15 -0
- package/pi-package/skills/iterate-plan/references/common-scenarios.md +14 -0
- package/pi-package/skills/julia-performance-diagnostician/SKILL.md +77 -0
- package/pi-package/skills/modularity-diagnostician/SKILL.md +74 -0
- package/pi-package/skills/multi-agent-review/SKILL.md +202 -0
- package/pi-package/skills/mutability-diagnostician/SKILL.md +69 -0
- package/pi-package/skills/narrative-article/SKILL.md +66 -0
- package/pi-package/skills/optionality-review/SKILL.md +196 -0
- package/pi-package/skills/parallel-review/SKILL.md +55 -0
- package/pi-package/skills/parallel-review/references/criteria.md +34 -0
- package/pi-package/skills/parallel-review/references/templates.md +59 -0
- package/pi-package/skills/plan-review/SKILL.md +48 -0
- package/pi-package/skills/plan-review/references/criteria.md +51 -0
- package/pi-package/skills/plan-review/references/templates.md +67 -0
- package/pi-package/skills/pre-mortem/SKILL.md +16 -0
- package/pi-package/skills/project-status-report/SKILL.md +130 -0
- package/pi-package/skills/pwa-accessibility-review/SKILL.md +87 -0
- package/pi-package/skills/rca-diagnostician/SKILL.md +36 -0
- package/pi-package/skills/rca-diagnostician/references/action-hierarchy.md +77 -0
- package/pi-package/skills/rca-diagnostician/references/bias-countermeasures.md +64 -0
- package/pi-package/skills/rca-diagnostician/references/evidence-timeline.md +49 -0
- package/pi-package/skills/rca-diagnostician/references/hypothesis-methods.md +53 -0
- package/pi-package/skills/rca-diagnostician/references/problem-definition.md +34 -0
- package/pi-package/skills/rca-diagnostician/references/report-template.md +75 -0
- package/pi-package/skills/rca-diagnostician/references/rigor-checklist.md +66 -0
- package/pi-package/skills/red-team-review/SKILL.md +139 -0
- package/pi-package/skills/research-codebase/SKILL.md +28 -0
- package/pi-package/skills/research-codebase/references/report-template.md +75 -0
- package/pi-package/skills/research-codebase/references/search-patterns.md +27 -0
- package/pi-package/skills/research-documentation/SKILL.md +85 -0
- package/pi-package/skills/research-review/SKILL.md +48 -0
- package/pi-package/skills/research-review/references/criteria.md +51 -0
- package/pi-package/skills/research-review/references/templates.md +73 -0
- package/pi-package/skills/resonant-refactor/SKILL.md +51 -0
- package/pi-package/skills/resume-handoff/SKILL.md +25 -0
- package/pi-package/skills/resume-handoff/references/analysis-template.md +40 -0
- package/pi-package/skills/resume-handoff/references/locating.md +12 -0
- package/pi-package/skills/review-documentation/SKILL.md +50 -0
- package/pi-package/skills/rigidity-diagnostician/SKILL.md +76 -0
- package/pi-package/skills/rule-of-5-universal/SKILL.md +32 -0
- package/pi-package/skills/rule-of-5-universal/references/criteria.md +34 -0
- package/pi-package/skills/rule-of-5-universal/references/examples.md +69 -0
- package/pi-package/skills/rule-of-5-universal/references/templates.md +136 -0
- package/pi-package/skills/specification-evaluation-diagnostician/SKILL.md +112 -0
- package/pi-package/skills/specification-review/SKILL.md +49 -0
- package/pi-package/skills/specification-review/references/criteria.md +51 -0
- package/pi-package/skills/specification-review/references/templates.md +67 -0
- package/pi-package/skills/systematic-housekeeping/SKILL.md +33 -0
- package/pi-package/skills/tdd/SKILL.md +44 -0
- package/pi-package/skills/tdd/references/criteria.md +26 -0
- package/pi-package/skills/tdd/references/templates.md +53 -0
- package/pi-package/skills/test-abstraction-miner/SKILL.md +49 -0
- package/pi-package/skills/test-friction/SKILL.md +57 -0
- package/pi-package/skills/testability-implementability-evaluator/SKILL.md +150 -0
- package/pi-package/skills/ui-align/SKILL.md +38 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/SKILL.md +27 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-1-product.md +20 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-2-engineering.md +20 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-3-interface.md +23 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-4-ecosystem.md +20 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-5-documentation.md +19 -0
- package/pi-package/skills/ux-dx-evaluation-diagnostician/references/report-template.md +36 -0
- package/pi-package/skills/verification-diagnostician/SKILL.md +96 -0
- package/pi-package/skills/verify-prompt/SKILL.md +38 -0
- package/pi-package/skills/verify-prompt/references/criteria.md +21 -0
- package/scripts/cli.mjs +453 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement-plan
|
|
3
|
+
description: "Execute implementation plans phase by phase"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
# Implement Plan
|
|
8
|
+
|
|
9
|
+
Implement an approved plan using Red, Green, Refactor.
|
|
10
|
+
|
|
11
|
+
## Procedure
|
|
12
|
+
|
|
13
|
+
1. Read the plan completely and identify the first incomplete phase.
|
|
14
|
+
2. Read any related specs or documentation referenced by the plan.
|
|
15
|
+
3. For each phase:
|
|
16
|
+
- Write failing tests first.
|
|
17
|
+
- Implement the minimum code to pass.
|
|
18
|
+
- Refactor while keeping tests green.
|
|
19
|
+
- Run the success criteria checks.
|
|
20
|
+
- Update the plan with progress.
|
|
21
|
+
4. Use `references/verification-template.md` when reporting phase completion.
|
|
22
|
+
5. Use `references/common-situations.md` when the plan and reality diverge.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Never skip the red phase.
|
|
27
|
+
- Complete one phase at a time.
|
|
28
|
+
- Do not blindly follow an outdated plan if the codebase contradicts it.
|
|
29
|
+
- Wait for user confirmation before proceeding to the next phase.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## Common Situations
|
|
2
|
+
|
|
3
|
+
### Tests already pass
|
|
4
|
+
|
|
5
|
+
- Verify the implementation really matches the plan.
|
|
6
|
+
- Mark the phase complete if it does.
|
|
7
|
+
|
|
8
|
+
### The plan does not match reality
|
|
9
|
+
|
|
10
|
+
Report:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
Issue in Phase [N]:
|
|
14
|
+
|
|
15
|
+
Expected (from plan): [What the plan says]
|
|
16
|
+
Found (in codebase): [Actual situation]
|
|
17
|
+
Why this matters: [Impact]
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
1. Adapt implementation to current reality
|
|
21
|
+
2. Update the plan
|
|
22
|
+
3. Ask the user for guidance
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### A better approach appears mid-implementation
|
|
26
|
+
|
|
27
|
+
- Explain the current plan.
|
|
28
|
+
- Explain the alternative.
|
|
29
|
+
- Summarize the tradeoffs.
|
|
30
|
+
- Ask whether to continue or update the plan.
|
|
31
|
+
|
|
32
|
+
### External dependency is unavailable
|
|
33
|
+
|
|
34
|
+
- State what is blocked.
|
|
35
|
+
- Explain impact.
|
|
36
|
+
- List available workarounds, if any.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```text
|
|
2
|
+
Phase [N] Complete - Ready for Verification
|
|
3
|
+
|
|
4
|
+
Automated verification:
|
|
5
|
+
- [x] All tests pass
|
|
6
|
+
- [x] Type checking passes
|
|
7
|
+
- [x] Build succeeds
|
|
8
|
+
|
|
9
|
+
Manual verification needed:
|
|
10
|
+
- [ ] [Manual step 1]
|
|
11
|
+
- [ ] [Manual step 2]
|
|
12
|
+
|
|
13
|
+
Changes made:
|
|
14
|
+
- [path:line] [What changed]
|
|
15
|
+
- [path:line] [What changed]
|
|
16
|
+
|
|
17
|
+
Let me know when verified so I can proceed to Phase [N+1].
|
|
18
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: invalid-states-diagnostician
|
|
3
|
+
description: "Diagnose representable invalid states — primitive obsession, boolean blindness, implicit coupling, shotgun parsing, ad-hoc state machines, exhaustiveness gaps — and map findings to type-tightening refactoring patterns"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
<!-- Full version: content/prompt-task-invalid-states-diagnostician.md -->
|
|
8
|
+
You are a Type Integrity Analyst. Diagnose locations where the type system permits business-invalid states — including primitive obsession, boolean blindness, implicit coupling, shotgun parsing, ad-hoc state machines, unconstrained optionality, exhaustiveness gaps, and monolithic records — and map each finding to a type-tightening refactoring pattern. Do NOT modify any files — advisory only.
|
|
9
|
+
|
|
10
|
+
**GUARD:** Do not apply to greenfield projects, codebases without static type checking and no gradual typing in use (plain JS without TS, Python without mypy/pyright), or when the problem is mutable state/side effects (use mutability-diagnostician), structural coupling/inheritance (use rigidity-diagnostician), or composition friction (use composability-diagnostician). Domain concepts that are genuinely unconstrained strings (free-text, user notes) are not primitive obsession — only flag primitives harboring hidden business rules.
|
|
11
|
+
|
|
12
|
+
**INPUT**
|
|
13
|
+
- Target files/directory: [SPECIFY]
|
|
14
|
+
- High-churn files (optional): [git log output OR "none"]
|
|
15
|
+
- Architecture reference (optional): [AGENTS.md rules OR "none"]
|
|
16
|
+
- Language/framework (optional): [e.g., "TypeScript/React" — or "infer"]
|
|
17
|
+
|
|
18
|
+
**PROTOCOL (Five-Step Pipeline)**
|
|
19
|
+
|
|
20
|
+
Step 1 — Detect State Integrity Signals: Read all files. Identify:
|
|
21
|
+
- Shotgun Parsing (Critical): validation (format checks, range checks, null guards) scattered across business logic instead of enforced at boundary; same validation duplicated in multiple locations
|
|
22
|
+
- Ad-hoc State Machine (Critical): lifecycle via string comparisons, boolean flag combinations, or enum checks without structural enforcement; functions callable in semantically invalid states
|
|
23
|
+
- Primitive Obsession (High): domain concepts (email, money, URL, coordinates) as raw strings/numbers without validation; implicit constraints enforced only at usage sites
|
|
24
|
+
- Boolean Blindness (High): bare boolean parameters/returns with invisible meaning at call site; boolean flag clusters whose combinations produce invalid states; boolean checks disconnected from guarded data
|
|
25
|
+
- Implicit Coupling (High): fields that must change together but exist independently — updating one without the other silently corrupts state
|
|
26
|
+
- Exhaustiveness Gap (High): switch/match with catch-all default on types that should be exhaustively handled; missing `never`/`assert_never` guards
|
|
27
|
+
- Unconstrained Optionality (High): implicit nullability without type-system-enforced null checks; Option/Maybe unwrapped deep in business logic instead of parsed at boundary
|
|
28
|
+
- Monolithic Record (Medium): large records grouping unrelated fields updated independently; domain transactions forced to instantiate more data than needed
|
|
29
|
+
Note file, line range, and description for each.
|
|
30
|
+
|
|
31
|
+
Step 2 — Classify State Space Gap: For each signal, assess:
|
|
32
|
+
- Scope: Type-local (single type too broad) / Cross-type (shared implicit coupling) / Boundary (external data enters unparsed) / System-wide (domain types exposed as API/DB schemas)
|
|
33
|
+
- Invalid state count: how many representable states are business-invalid (e.g., 3 booleans = 8 states, 3 valid → 5 invalid)
|
|
34
|
+
- Failure mode: silent corruption (Critical) / runtime exception (High) / logged warning (Low)
|
|
35
|
+
- Validation scattering: how many locations currently guard against this invalid state at runtime
|
|
36
|
+
|
|
37
|
+
Step 3 — Analyze State Space: For top 5-10 findings by severity:
|
|
38
|
+
- **Finite state spaces** (boolean clusters, enum combinations): Enumerate S_repr (all states type permits), S_valid (business-legal states), S_invalid = S_repr - S_valid (states to make unrepresentable)
|
|
39
|
+
- **Unbounded state spaces** (string for email, number for price): Characterize S_valid subset (e.g., "RFC 5322 email format") — do not enumerate infinite invalid space; count compensating runtime guards as primary severity metric
|
|
40
|
+
- For all findings: locate compensating validation for each invalid state — count guard locations
|
|
41
|
+
|
|
42
|
+
Step 4 — Map to Refactoring Pattern:
|
|
43
|
+
- Domain concepts as raw primitives → **Value Object (Tiny Type)**: self-validating, immutable; invalid data fails construction
|
|
44
|
+
- Bare booleans for domain states → **Semantic Enum / Discriminated Union**: `Permission.ReadOnly | Permission.ReadWrite` not `(bool, bool)`
|
|
45
|
+
- Coupled fields existing independently → **Atomic Record**: group into single type updated as transactional unit
|
|
46
|
+
- Unrelated fields over-grouped → **Context-Specific Decomposition**: split into bounded types per usage context
|
|
47
|
+
- Validation scattered across layers → **Parse at the Boundary**: "Parse, Don't Validate" — transform external data to strict domain types at edge
|
|
48
|
+
- Lifecycle managed by flags/strings → **Typestate Pattern**: distinct type per state; invalid transitions are compiler errors
|
|
49
|
+
- Missing exhaustive handling → **Exhaustiveness Enforcement**: remove defaults, add `never`/`assert_never`; omit `default` on sealed switches (Java)
|
|
50
|
+
- Implicit nullability → **Explicit Optionality with Boundary Parsing**: Option/Maybe with strict null checks; unwrap at boundary only
|
|
51
|
+
|
|
52
|
+
Native equivalents: Value Object → `record` (C#/Java), `data class` (Kotlin), newtype (Rust), branded types (TS); Discriminated Union → `enum` with data (Rust/Swift), `sealed interface` (Java/Kotlin), discriminated union (F#/TS); Typestate → `PhantomData` (Rust), sealed hierarchies (Kotlin/Java), discriminated union (TS — simple) or branded types (TS — advanced); Exhaustiveness → `never` (TS), `assert_never()` (Python), omit `default` on sealed switches (Java); Boundary Parsing → Zod/io-ts (TS), Pydantic (Python), serde (Rust), `System.Text.Json` (C#).
|
|
53
|
+
|
|
54
|
+
Step 5 — Prioritize: Score = State Space Gap (System-wide=3, Boundary/Cross-type=2, Type-local=1) x Failure Severity (Silent corruption/security=3, Runtime exception=2, Cosmetic=1) x Validation Scattering (3+ guards=3, 2 guards=2, Single/none=1). Sequence: Value Objects first (smallest, safest, collapses scattered validation), boundary parsing next (prevents new invalid data entering), semantic enums and exhaustiveness follow (eliminates boolean blindness), atomic records and decompositions next (structural grouping), typestate last (highest architectural impact). Each step independently deployable.
|
|
55
|
+
|
|
56
|
+
**OUTPUT**
|
|
57
|
+
|
|
58
|
+
Summary table:
|
|
59
|
+
| Location | State Integrity Signal | State Space Gap | S_invalid Count | Refactoring Pattern | Priority |
|
|
60
|
+
|
|
61
|
+
If multiple signals share root cause, consolidate. Then per finding: signal (files, lines, names), state space gap (S_repr vs S_valid — which states are invalid, how many guards compensate), recommended pattern (sketch, not full code), refactoring sequence (safe steps), success signals (domain types rejecting invalid state at construction, switch statements breaking at compile time on new variants, boundary parsers transforming chaos into axioms).
|
|
62
|
+
|
|
63
|
+
Enforcement recommendations per language: TS → `strictNullChecks`, `noUncheckedIndexedAccess`, Zod at boundaries, `never` default; Rust → `clippy::all` + `clippy::pedantic`, exhaustive match; Java → sealed interfaces, no `default` on sealed switches, ArchUnit for encapsulation; C#/.NET → NetArchTest (no parameterless constructors, no public setters on domain types), `record` with `init`; Python → `mypy --strict`, `assert_never()`, Pydantic at boundaries. Unlisted: Kotlin (`sealed class`, `when` exhaustiveness), Swift (exhaustive `switch`), F# (discriminated unions), Go (unexported fields + constructors).
|
|
64
|
+
|
|
65
|
+
Needs Human Review: list ambiguous cases — genuinely unconstrained strings (free-text, notes), boolean flags required by framework conventions (serialization, ORM), boundary schemas where strict typing conflicts with backwards compatibility (enforce internally via "Parse, Don't Validate", keep external schemas permissive), state machines in high-variance domains where bidirectional transitions are business requirements, unsigned vs signed integer choices (unsigned arithmetic can underflow to dangerous positive values), performance-critical hot paths where Value Object allocation overhead matters.
|
|
66
|
+
|
|
67
|
+
If no signals found: "No representable invalid states found. Domain types accurately constrain their business meaning, boundaries parse external data into strict types, and state transitions are structurally enforced." Do not fabricate findings.
|
|
68
|
+
|
|
69
|
+
Stop when all files analyzed. Do not modify anything.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-review
|
|
3
|
+
description: "Review issues for completeness and dependencies"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
# Tracer-Bullet Issue Review (Rule of 5)
|
|
8
|
+
|
|
9
|
+
Review an issue set in five passes, with special attention to whether tickets are true tracer-bullet vertical slices.
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
Read `references/setup.md` for tracker-specific collection commands before reviewing.
|
|
14
|
+
|
|
15
|
+
## Procedure
|
|
16
|
+
|
|
17
|
+
1. Gather the issue set to review plus the source plan/spec/parent issue when available.
|
|
18
|
+
2. Run the passes in order:
|
|
19
|
+
- Pass 1: `references/pass-1-clarity.md`
|
|
20
|
+
- Pass 2: `references/pass-2-scope.md`
|
|
21
|
+
- Pass 3: `references/pass-3-dependencies.md`
|
|
22
|
+
- Pass 4: `references/pass-4-alignment.md`
|
|
23
|
+
- Pass 5: `references/pass-5-executability.md`
|
|
24
|
+
3. After each pass starting with pass 2, evaluate convergence using `references/convergence.md`.
|
|
25
|
+
4. If converged, stop.
|
|
26
|
+
5. Produce the final report using `references/final-report.md`.
|
|
27
|
+
|
|
28
|
+
## Review Lens
|
|
29
|
+
|
|
30
|
+
Treat the best issue sets as:
|
|
31
|
+
- thin vertical slices rather than layer tickets
|
|
32
|
+
- independently verifiable or demoable
|
|
33
|
+
- minimal but sufficient dependency graphs
|
|
34
|
+
- explicit about AFK vs HITL work
|
|
35
|
+
- traceable back to stories, plans, or specs
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- Reference issue IDs precisely.
|
|
40
|
+
- Verify issue content before flagging a problem.
|
|
41
|
+
- Prioritize blockers over cosmetic cleanup.
|
|
42
|
+
- Suggest exact tracker edits or commands when practical.
|
|
43
|
+
- Call out horizontal decomposition explicitly: backend-only, schema-only, UI-only, or refactor-only tickets that should be folded into a tracer bullet.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Convergence Check
|
|
2
|
+
|
|
3
|
+
After each pass starting with pass 2, report:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
Convergence Check After Pass [N]:
|
|
7
|
+
|
|
8
|
+
1. New CRITICAL issues: [count]
|
|
9
|
+
2. Total new issues this pass: [count]
|
|
10
|
+
3. Total new issues previous pass: [count]
|
|
11
|
+
4. Estimated false positive rate: [percentage]
|
|
12
|
+
|
|
13
|
+
Status: [CONVERGED | ITERATE | NEEDS_HUMAN]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Criteria:
|
|
17
|
+
- `CONVERGED`: no new CRITICAL issues, <10% new issues vs previous pass, <20% false positives
|
|
18
|
+
- `ITERATE`: continue
|
|
19
|
+
- `NEEDS_HUMAN`: blocking judgment call required
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
## Final Report Template
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
## Issue Tracker Review Final Report
|
|
5
|
+
|
|
6
|
+
System: [Beads/GitHub/Linear/Jira]
|
|
7
|
+
Scope: [All issues / Milestone / Label set]
|
|
8
|
+
Source: [Plan/spec/parent issue if known]
|
|
9
|
+
|
|
10
|
+
### Summary
|
|
11
|
+
|
|
12
|
+
Total Issues Reviewed: [count]
|
|
13
|
+
|
|
14
|
+
Issues Found by Severity:
|
|
15
|
+
- CRITICAL: [count]
|
|
16
|
+
- HIGH: [count]
|
|
17
|
+
- MEDIUM: [count]
|
|
18
|
+
- LOW: [count]
|
|
19
|
+
|
|
20
|
+
Convergence: Pass [N]
|
|
21
|
+
|
|
22
|
+
### Tracer-Bullet Assessment
|
|
23
|
+
|
|
24
|
+
- Slice quality: [Excellent|Good|Fair|Poor]
|
|
25
|
+
- Horizontal-ticket leakage: [None|Low|Moderate|High]
|
|
26
|
+
- AFK/HITL clarity: [Excellent|Good|Fair|Poor]
|
|
27
|
+
|
|
28
|
+
### Top 3 Most Critical Findings
|
|
29
|
+
|
|
30
|
+
1. [ID] [Finding]
|
|
31
|
+
- Impact: [Why it blocks or degrades execution]
|
|
32
|
+
- Fix: [Exact command or edit]
|
|
33
|
+
|
|
34
|
+
2. [ID] [Finding]
|
|
35
|
+
- Impact: [Why it matters]
|
|
36
|
+
- Fix: [Exact command or edit]
|
|
37
|
+
|
|
38
|
+
3. [ID] [Finding]
|
|
39
|
+
- Impact: [Why it matters]
|
|
40
|
+
- Fix: [Exact command or edit]
|
|
41
|
+
|
|
42
|
+
### Recommended Actions
|
|
43
|
+
|
|
44
|
+
- Provide exact tracker commands where practical.
|
|
45
|
+
- Collapse horizontal tickets into tracer bullets when possible.
|
|
46
|
+
- Include file paths, tests, and plan/story references when missing.
|
|
47
|
+
|
|
48
|
+
### Verdict
|
|
49
|
+
|
|
50
|
+
[READY_TO_WORK | NEEDS_UPDATES | NEEDS_REPLANNING]
|
|
51
|
+
|
|
52
|
+
Rationale: [1-2 sentences]
|
|
53
|
+
|
|
54
|
+
### Issue Quality Assessment
|
|
55
|
+
|
|
56
|
+
- Clarity: [Excellent|Good|Fair|Poor]
|
|
57
|
+
- Scope: [Excellent|Good|Fair|Poor]
|
|
58
|
+
- Dependencies: [Excellent|Good|Fair|Poor]
|
|
59
|
+
- Completeness: [Excellent|Good|Fair|Poor]
|
|
60
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Pass 1: Completeness and Clarity
|
|
2
|
+
|
|
3
|
+
Focus on:
|
|
4
|
+
- Clear title
|
|
5
|
+
- Sufficient context
|
|
6
|
+
- Concrete file paths and changes
|
|
7
|
+
- Success criteria or tests
|
|
8
|
+
- Unambiguous done criteria
|
|
9
|
+
|
|
10
|
+
Watch for:
|
|
11
|
+
- Vague titles
|
|
12
|
+
- Minimal descriptions
|
|
13
|
+
- "Implement X" without where or how
|
|
14
|
+
- Missing verification steps
|
|
15
|
+
|
|
16
|
+
Output:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
PASS 1: Completeness & Clarity
|
|
20
|
+
|
|
21
|
+
Issues Found:
|
|
22
|
+
|
|
23
|
+
[CLRT-001] [CRITICAL|HIGH|MEDIUM|LOW] - Issue ID/Number
|
|
24
|
+
Title: [Issue title]
|
|
25
|
+
Description: [What's unclear or incomplete]
|
|
26
|
+
Evidence: [Why this is a problem]
|
|
27
|
+
Recommendation: [How to fix]
|
|
28
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Pass 2: Scope, Atomicity, and Tracer-Bullet Shape
|
|
2
|
+
|
|
3
|
+
Focus on:
|
|
4
|
+
- One logical capability per issue
|
|
5
|
+
- Thin vertical slices instead of horizontal layer tickets
|
|
6
|
+
- Issues small enough to finish in one focused session
|
|
7
|
+
- Clear boundaries with no overlap
|
|
8
|
+
- Independent demo or verification value
|
|
9
|
+
|
|
10
|
+
Watch for:
|
|
11
|
+
- Oversized epics disguised as issues
|
|
12
|
+
- Backend-only / schema-only / UI-only tickets that should be part of one slice
|
|
13
|
+
- Preparatory plumbing tickets with no standalone value
|
|
14
|
+
- Trivial issues that should be bundled into a slice
|
|
15
|
+
- Refactor + feature bundles with unclear boundaries
|
|
16
|
+
|
|
17
|
+
Questions to ask:
|
|
18
|
+
- If this issue lands alone, is anything real now possible or testable?
|
|
19
|
+
- Does it cut through the necessary layers for one outcome?
|
|
20
|
+
- Would splitting it by component create worse tickets?
|
|
21
|
+
|
|
22
|
+
Prefix findings with `SCOPE-`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Pass 3: Dependencies and Ordering
|
|
2
|
+
|
|
3
|
+
Focus on:
|
|
4
|
+
- Correct dependency links
|
|
5
|
+
- Missing prerequisites
|
|
6
|
+
- Circular dependencies
|
|
7
|
+
- Avoidable serialization
|
|
8
|
+
- Sensible critical path
|
|
9
|
+
- Whether the issue graph reflects tracer bullets rather than phase gates
|
|
10
|
+
|
|
11
|
+
Watch for:
|
|
12
|
+
- Hidden blockers
|
|
13
|
+
- Cycles
|
|
14
|
+
- Artificial bottlenecks from horizontal decomposition
|
|
15
|
+
- Missing rationale for dependencies
|
|
16
|
+
- Tickets blocked only because the work was split by layer instead of by outcome
|
|
17
|
+
|
|
18
|
+
Questions to ask:
|
|
19
|
+
- Could these issues run in parallel if they were sliced vertically?
|
|
20
|
+
- Is a dependency real, or an artifact of poor decomposition?
|
|
21
|
+
- Are HITL issues isolated so AFK work can continue around them?
|
|
22
|
+
|
|
23
|
+
Prefix findings with `DEP-`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## Pass 4: Plan, Story, and Spec Alignment
|
|
2
|
+
|
|
3
|
+
Focus on:
|
|
4
|
+
- Traceability to plan/spec sections or user stories
|
|
5
|
+
- Coverage of the intended workflow end-to-end
|
|
6
|
+
- Alignment between the chosen issue breakdown and the source material
|
|
7
|
+
- Explicit tests before implementation
|
|
8
|
+
- AFK/HITL classification when relevant
|
|
9
|
+
|
|
10
|
+
Watch for:
|
|
11
|
+
- Missing plan or story references
|
|
12
|
+
- Gaps where a user story is only partially covered across layer tickets
|
|
13
|
+
- Specs with no corresponding issue
|
|
14
|
+
- Issues that contradict the intended implementation approach
|
|
15
|
+
- Breakdown by phase/component when the source material describes user outcomes
|
|
16
|
+
|
|
17
|
+
Prefix findings with `ALIGN-`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## Pass 5: Executability and Handoff
|
|
2
|
+
|
|
3
|
+
Focus on:
|
|
4
|
+
- Can another developer or agent pick this up immediately?
|
|
5
|
+
- Are verification steps concrete and end-to-end?
|
|
6
|
+
- Are priorities and labels sensible?
|
|
7
|
+
- Are HITL handoff points explicit?
|
|
8
|
+
- Is it clear what demo, test, or observable behavior proves completion?
|
|
9
|
+
|
|
10
|
+
Watch for:
|
|
11
|
+
- Hidden conversational context
|
|
12
|
+
- "You know what to do"
|
|
13
|
+
- Missing verification commands or test references
|
|
14
|
+
- HITL work masquerading as AFK
|
|
15
|
+
- Tickets that cannot be closed without information from another issue not listed as a blocker
|
|
16
|
+
|
|
17
|
+
Prefix findings with `EXEC-`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## Gathering Issues to Review
|
|
2
|
+
|
|
3
|
+
### Beads
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bd list
|
|
7
|
+
bd ready
|
|
8
|
+
bd graph
|
|
9
|
+
bd show <id>
|
|
10
|
+
bd dep tree
|
|
11
|
+
bd dep cycles
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### GitHub Issues
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
gh issue list --label "needs-review" --json number,title,body,labels
|
|
18
|
+
gh issue view <number>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Other systems
|
|
22
|
+
|
|
23
|
+
- Export issues to JSON or CSV.
|
|
24
|
+
- Use available CLI or API tooling.
|
|
25
|
+
- Require issue data as input before reviewing.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: iterate-plan
|
|
3
|
+
description: "Refine and improve existing plans based on feedback"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
# Iterate Implementation Plan
|
|
8
|
+
|
|
9
|
+
Update an existing implementation plan based on feedback and current codebase reality.
|
|
10
|
+
|
|
11
|
+
## Procedure
|
|
12
|
+
|
|
13
|
+
1. Read the current plan completely.
|
|
14
|
+
2. Understand the requested changes.
|
|
15
|
+
3. Research only if the requested change requires new technical context.
|
|
16
|
+
4. Confirm your understanding with the user before editing.
|
|
17
|
+
5. Make focused updates to the plan.
|
|
18
|
+
6. Present the changes and iterate until approved.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
- Preserve completed work unless the user explicitly wants to revise it.
|
|
23
|
+
- Prefer surgical edits over wholesale rewrites.
|
|
24
|
+
- Ask normal clarifying questions if the request is ambiguous.
|
|
25
|
+
- If the plan needs substantial restructuring, recommend creating a new plan.
|
|
26
|
+
|
|
27
|
+
## References
|
|
28
|
+
|
|
29
|
+
- Use `references/change-template.md` when summarizing planned edits.
|
|
30
|
+
- Use `references/common-scenarios.md` for common iteration patterns.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```text
|
|
2
|
+
Based on your feedback, I understand you want to:
|
|
3
|
+
- [Change 1]
|
|
4
|
+
- [Change 2]
|
|
5
|
+
|
|
6
|
+
[If research was done]
|
|
7
|
+
My research found:
|
|
8
|
+
- [Relevant pattern or constraint]
|
|
9
|
+
|
|
10
|
+
I plan to update the plan by:
|
|
11
|
+
1. [Specific modification]
|
|
12
|
+
2. [Specific modification]
|
|
13
|
+
|
|
14
|
+
Does this align with your intent?
|
|
15
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Common Iteration Scenarios
|
|
2
|
+
|
|
3
|
+
- Adding a new phase
|
|
4
|
+
- Changing the implementation approach
|
|
5
|
+
- Adding missing detail
|
|
6
|
+
- Removing scope
|
|
7
|
+
- Splitting an oversized phase
|
|
8
|
+
- Correcting a technical error
|
|
9
|
+
|
|
10
|
+
For each case:
|
|
11
|
+
- identify the affected sections,
|
|
12
|
+
- research only what changed,
|
|
13
|
+
- update success criteria and dependencies if needed,
|
|
14
|
+
- preserve completed work.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: julia-performance-diagnostician
|
|
3
|
+
description: "Diagnose Julia performance pathologies — type instabilities, heap allocation floods, cache-hostile access, dynamic dispatch — and map findings to optimization patterns grounded in the compilation pipeline"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
<!-- Full version: content/prompt-task-julia-performance-diagnostician.md -->
|
|
8
|
+
You are a Julia Performance Analyst. Diagnose performance pathologies — type instabilities, heap allocation floods, cache-hostile memory access, dynamic dispatch overhead, and type system misuse — and map each finding to a specific optimization pattern grounded in Julia's compilation pipeline. Do NOT modify any files — advisory only.
|
|
9
|
+
|
|
10
|
+
**GUARD:** Do not apply when the problem is algorithmic complexity rather than Julia-specific pathology, when the codebase already passes JET.jl and AllocCheck.jl cleanly, or for distributed computing (MPI.jl/Distributed.jl) issues. Union return types with 2-3 variants may be handled efficiently by union-splitting — only flag unions with 4+ variants or in hot loops. Local mutation (loop accumulators, pre-allocated buffers) is idiomatic Julia — only flag mutation that causes type instability or allocation.
|
|
11
|
+
|
|
12
|
+
**INPUT**
|
|
13
|
+
- Target files/directory: [SPECIFY]
|
|
14
|
+
- Benchmark baseline (optional): [@time or @btime output OR "none"]
|
|
15
|
+
- @code_warntype output (optional): [PASTE OR "none"]
|
|
16
|
+
- High-churn files (optional): [git log output OR "none"]
|
|
17
|
+
- Julia version (optional): [e.g., "1.10" — or "infer from Project.toml"]
|
|
18
|
+
|
|
19
|
+
**PROTOCOL (Five-Step Pipeline)**
|
|
20
|
+
|
|
21
|
+
Step 1 — Detect Performance Signals: Read all files. Identify:
|
|
22
|
+
- Type Instability / Unnecessary Boxing (Critical): return type or internal variables depend on runtime values, not argument types; conditionals returning different types; `Union` types wider than 3-4 variants; frequent numeric type conversions mid-computation; `Any`/`Union` in `@code_warntype`
|
|
23
|
+
- Untyped Global Variable (Critical): module-level variables without `const` read inside functions — compiler abandons inference entirely
|
|
24
|
+
- Abstract Container Parameter (High): `Vector{Real}`, `Array{Any}`, `Dict{String, Any}` — forces pointer-based storage, destroys contiguous layout
|
|
25
|
+
- Abstractly-Typed Struct Field (High): `data::AbstractArray` without type parameterization — every field access requires dispatch
|
|
26
|
+
- Cache-Hostile Memory Access (High): inner loops varying second+ index on multidimensional arrays — violates column-major, causes cache misses
|
|
27
|
+
- Heap Allocation in Hot Loop (High): `x[2:end]` without `@views`, string concatenation, temporary objects inside tight loops
|
|
28
|
+
- Dynamic Dispatch in Hot Path (High): function calls on abstract-typed values in loops — blocks inlining and SIMD
|
|
29
|
+
- GPU Scalar Indexing (Critical): element-by-element CuArray access in loops — kernel launch + PCIe transfer per element
|
|
30
|
+
- Missing Function Barrier (Medium): computation immediately after dynamic parsing (JSON/CSV) — entire block inherits instability
|
|
31
|
+
- Deep Recursion (Medium): recursive algorithms without depth bounds — Julia lacks guaranteed TCO
|
|
32
|
+
- Dict for Static Keys (Medium): `Dict` with compile-time-known keys — runtime hashing vs. zero-cost NamedTuple
|
|
33
|
+
Note file, line range, and description for each.
|
|
34
|
+
|
|
35
|
+
Step 2 — Classify Performance Impact: For each signal, assess:
|
|
36
|
+
- Scope: Hot Loop (Critical) / Per-Call (High) / Initialization (Low) / API Boundary (High — propagates to callers)
|
|
37
|
+
- Allocation impact: heap allocs in loop? (Critical if yes — floods GC)
|
|
38
|
+
- Dispatch impact: forces dynamic dispatch? (High if blocks inlining/SIMD)
|
|
39
|
+
- Cache impact: causes cache misses? (High for strided access or pointer-chasing through boxed values)
|
|
40
|
+
|
|
41
|
+
Step 3 — Analyze Type Flow: For each flagged function, trace type inference:
|
|
42
|
+
- Return type stability: does return type depend solely on argument types?
|
|
43
|
+
- Internal groundedness: are all internal variables inferrable? (red in `@code_warntype` even if return is stable = intermediate boxing)
|
|
44
|
+
- Caller propagation: do callers inherit the instability?
|
|
45
|
+
- Container element types: concrete or abstract parameterization?
|
|
46
|
+
- Memory layout: column-major access in loop nests?
|
|
47
|
+
Describe type flow for top 5-10 functions by severity.
|
|
48
|
+
|
|
49
|
+
Step 4 — Map to Optimization Pattern:
|
|
50
|
+
- Type-unstable return → **Type-Stable Refactoring**: ensure all paths return same concrete type
|
|
51
|
+
- Untyped global → **Const Declaration / Encapsulation**: `const` to freeze binding, or wrap in function + pass as argument, or annotate `local_x = global_x::ConcreteType`
|
|
52
|
+
- Abstract container → **Concrete Parameterization**: `Vector{Float64}` instead of `Vector{Real}`
|
|
53
|
+
- Abstract struct field → **Parametric Struct**: `struct S{T<:AbstractArray} data::T end`
|
|
54
|
+
- Cache-hostile loop → **Column-Major Reordering**: innermost loop varies first index; use `eachcol`/`eachrow`; `@views` for slicing
|
|
55
|
+
- Allocs in hot loop → **@views + In-Place Operations**: `@views`, `mul!`/`ldiv!`, pre-allocate buffers outside loop
|
|
56
|
+
- Dynamic dispatch in hot path OR dynamic data → computation → **Function Barrier**: extract loop/kernel into separate function receiving concrete-typed args; for parsed data (JSON/CSV), convert at boundary: `_kernel(Float64(cfg["dt"]), ...)`
|
|
57
|
+
- GPU scalar indexing → **Bulk Broadcasting**: `.=`, `map`; enforce `GPUArraysCore.allowscalar(false)`
|
|
58
|
+
- Deep recursion → **Explicit Loop + Accumulator**: `for`/`while` with function-barrier widening for type-varying accumulation
|
|
59
|
+
- Dict for static config → **NamedTuple / Struct**: `(; key=val)` — zero-cost, stack-allocated
|
|
60
|
+
- Missing SIMD → **Dot-Syntax Broadcasting / @simd**: `A .= B .+ C .* D` for loop fusion; `@simd` for explicit vectorization; `@turbo` only for proven bottlenecks with non-aliasing guarantee (verify LoopVectorization.jl compatibility)
|
|
61
|
+
|
|
62
|
+
Step 5 — Prioritize: Score = Allocation Impact (Loop allocs=3, Per-call=2, None=1) × Dispatch Impact (Dynamic=3, Partial=2, Mono=1) × Scope (Hot loop=3, Per-call/API=2, Init=1). Sequence: type stability fixes first (unblock all downstream opts), global elimination next (largest single-fix gain), concrete parameterization (contiguous layout), function barriers (isolate instability), memory reordering + @views (cache + GC), SIMD/broadcasting last (polish). Each fix independently deployable and benchmarkable.
|
|
63
|
+
|
|
64
|
+
**OUTPUT**
|
|
65
|
+
|
|
66
|
+
Summary table:
|
|
67
|
+
| Location | Performance Signal | Impact Scope | Type Flow | Optimization Pattern | Priority |
|
|
68
|
+
|
|
69
|
+
If multiple signals share root cause, consolidate. Then per finding: signal (files, lines, function names, type signatures), impact scope (allocation/dispatch/cache impact), type flow analysis (inference chain showing where stability breaks), recommended pattern (sketch, not full code), verification method (specific `@code_warntype`, `@btime`, `@allocated`, JET.jl, or AllocCheck.jl invocations), optimization sequence (safe steps), success signals (`@code_warntype` all concrete, `@btime` zero allocs, profiler shows computation not GC/dispatch).
|
|
70
|
+
|
|
71
|
+
Tooling recommendations per finding category: type instability → `@code_warntype`; call-tree → Cthulhu.jl `@descend`; whole-module → JET.jl `@report_opt`; allocation count → `@btime` with `$`-interpolation; allocation source → `@profview_allocs`; zero-alloc proof → AllocCheck.jl `@check_allocs`; CI regression → AirspeedVelocity.jl.
|
|
72
|
+
|
|
73
|
+
Needs Human Review: list ambiguous cases — type instabilities in cold paths, small `Union` types where union-splitting suffices, mutable pre-allocated buffers (idiomatic), `@turbo` compatibility concerns, intentional `allowscalar(true)` for debugging, struct parameterization risking compilation explosion, intentionally generic functions for dispatch extensibility, multi-threaded code (`Threads.@threads`/`@spawn`) where data races or false sharing are outside this diagnostic's scope.
|
|
74
|
+
|
|
75
|
+
If no signals found: "No performance pathologies found. Functions are type-stable, containers use concrete parameters, memory access follows column-major ordering, and hot loops are allocation-free." Do not fabricate findings.
|
|
76
|
+
|
|
77
|
+
Stop when all files analyzed. Do not modify anything.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: modularity-diagnostician
|
|
3
|
+
description: "Diagnose modularity violations — high coupling, low cohesion, cyclic dependencies, God Objects, boundary erosion, temporal coupling — and map findings to decomposition patterns grounded in the Unix philosophy"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
<!-- Full version: content/prompt-task-modularity-diagnostician.md -->
|
|
8
|
+
You are a Software Modularity Analyst. Diagnose modularity violations — high coupling, low cohesion, cyclic dependencies, God Objects, boundary erosion, temporal coupling — and map each finding to a decomposition or restructuring pattern grounded in the Unix philosophy of "Do One Thing And Do It Well." Do NOT modify any files — advisory only.
|
|
9
|
+
|
|
10
|
+
**GUARD:** Do not apply to greenfield projects or when the problem is composition friction in pipelines (use composability-diagnostician), mutable state entanglement (use mutability-diagnostician), or structural rigidity from inheritance (use rigidity-diagnostician). Requires accumulated integration surface to diagnose.
|
|
11
|
+
|
|
12
|
+
**INPUT**
|
|
13
|
+
- Target files/directory: [SPECIFY]
|
|
14
|
+
- High-churn files (optional): [git log output OR "none"]
|
|
15
|
+
- Co-change data (optional): [co-change analysis output OR "none"]
|
|
16
|
+
- Architecture reference (optional): [AGENTS.md rules OR "none"]
|
|
17
|
+
- Language/framework (optional): [e.g., "Python/Django" — or "infer"]
|
|
18
|
+
|
|
19
|
+
**PROTOCOL (Five-Step Pipeline)**
|
|
20
|
+
|
|
21
|
+
Step 1 — Detect Modularity Signals: Read all files. Identify:
|
|
22
|
+
- God Object / God Class (Critical): excessive responsibilities — high method/attribute count, LCOM violation showing methods operate on disjoint state subsets, modified for multiple unrelated reasons
|
|
23
|
+
- Cyclic Dependency (Critical): Module A → B → C → A. Makes isolated extraction, testing, and deployment impossible. Dependency graph must form a DAG
|
|
24
|
+
- Shotgun Surgery (High): single logical change requires modifications scattered across many files in different modules — things that change together not packaged together
|
|
25
|
+
- Divergent Change (High): single class modified for entirely different reasons (e.g., authentication changes AND email format changes)
|
|
26
|
+
- Feature Envy (High): method interacts more with another class's data than its own — suggests method belongs elsewhere
|
|
27
|
+
- Inappropriate Intimacy (High): two classes overly reliant on each other's internal details, breaking encapsulation
|
|
28
|
+
- High Efferent Coupling (Medium): module depends on many externals — fragile, many import statements spanning packages
|
|
29
|
+
- High Afferent Coupling (Medium): module depended upon by many consumers — alterations trigger widespread ripple effects
|
|
30
|
+
- Temporal Coupling (Medium): files co-changing in commits despite no static dependency — reveals hidden dependencies (skip if no git/co-change data provided)
|
|
31
|
+
- Missing Boundary (Medium): related functionality spread across modules with no clear owning package
|
|
32
|
+
Note file, line range, and description for each.
|
|
33
|
+
|
|
34
|
+
Step 2 — Classify Modularity Scope: For each signal, assess:
|
|
35
|
+
- Scope: Local (within class) / Module (within package) / Cross-Module (between packages/layers) / System-Wide (affects entire topology)
|
|
36
|
+
- Change amplification: how many files change for a single requirement? (High if >5 files across >2 modules)
|
|
37
|
+
- Extraction difficulty: could this module be extracted today? (Blocked / Hard / Moderate / Easy)
|
|
38
|
+
- Test isolation: can the module be unit tested without mocking >3 external dependencies? (Poor if excessive mocking — flag as risk)
|
|
39
|
+
|
|
40
|
+
Step 3 — Analyze Dependency Structure: Map relationships between modules:
|
|
41
|
+
- Map `A → B`, `B → C`, etc. Flag bidirectional or cyclic dependencies
|
|
42
|
+
- Compute Instability Index per module: `I = Ce / (Ca + Ce)`. Flag unstable modules at the foundation or stable modules at the periphery
|
|
43
|
+
- Assess cohesion: do methods within each class share state or operate on disjoint subsets? (LCOM violation if disjoint)
|
|
44
|
+
- Assess boundary clarity: do callers use a public API/interface or reach into internal implementation?
|
|
45
|
+
Draw dependency map for top 5-10 modules by severity, identifying cut points.
|
|
46
|
+
|
|
47
|
+
Step 4 — Map to Remediation Pattern:
|
|
48
|
+
- God Object centralizing multiple responsibilities → **Extract Class / Extract Module**: identify method clusters via attribute access analysis; extract each cluster into cohesive class with single responsibility
|
|
49
|
+
- Cyclic dependency between modules → **Dependency Inversion + Interface Extraction**: introduce interface owned by depended-upon module; invert one edge direction to break cycle
|
|
50
|
+
- Shotgun Surgery across modules → **Move Method / Move Class to Owning Module**: relocate scattered logic into domain-owning module. Create new bounded context if none exists
|
|
51
|
+
- Divergent Change in single class → **Split by Reason for Change**: identify distinct axes of change, extract each into own class/module
|
|
52
|
+
- Feature Envy → **Move Method**: relocate method to class whose data it primarily accesses
|
|
53
|
+
- Inappropriate Intimacy → **Encapsulate Field + Extract Interface**: hide internals behind methods; extract minimal cross-class interface
|
|
54
|
+
- High Ce → **Facade / Adapter Consolidation**: consolidate external dependencies behind single interface
|
|
55
|
+
- High Ca → **Interface Segregation**: split public API into role-specific interfaces so consumers depend only on what they use
|
|
56
|
+
- Temporal coupling without static dependency → **Colocate Co-Evolving Code**: move co-changing files to same module, or make dependency explicit via interface/event contract
|
|
57
|
+
- Missing boundary → **Extract Bounded Context**: aggregate domain-related code into new cohesive module with clear public API
|
|
58
|
+
|
|
59
|
+
Step 5 — Prioritize: Score = Change Amplification (>10 files=3, 5-10=2, <5=1) × Extraction Difficulty (Blocked=3, Hard=2, Moderate/Easy=1) × Modularity Scope (System-wide=3, Cross-module=2, Module/Local=1). Sequence: break cycles first (unblocks all extractions), God Object decomposition next (largest modularity gain), Shotgun Surgery consolidation (groups co-changing code), interface extractions (stabilize boundaries), temporal coupling resolution last (requires team negotiation). Each step independently deployable.
|
|
60
|
+
|
|
61
|
+
**OUTPUT**
|
|
62
|
+
|
|
63
|
+
Summary table:
|
|
64
|
+
| Location | Modularity Signal | Modularity Scope | Dependency Structure | Remediation Pattern | Priority |
|
|
65
|
+
|
|
66
|
+
If multiple signals share root cause, consolidate. Then per finding: signal (files, lines, import chains), modularity scope (propagation + change amplification/extraction difficulty/test isolation), dependency structure (coupling map with direction, cycles, instability scores, cut points), recommended pattern (sketch, not full code), metrics to track (CBO ≤ 9, LCOM-HS ≤ 30%, Instability targets), remediation sequence (safe steps), success signals (modules extractable independently, changes localized, dependency graph forms DAG).
|
|
67
|
+
|
|
68
|
+
Needs Human Review: list ambiguous cases — God Objects that are intentional facades/orchestrators, temporal coupling reflecting legitimate business transactions, high Ca modules that are stable shared libraries, framework-mandated cross-module dependencies, modules mid-migration.
|
|
69
|
+
|
|
70
|
+
If no signals found: "No modularity violations found. Modules have clear boundaries, dependencies flow unidirectionally, cohesion is high within each component, and changes are localized." Do not fabricate findings.
|
|
71
|
+
|
|
72
|
+
Tooling: SonarQube/JDepend/NDepend (CBO, LCOM, Ca/Ce threshold gates in CI), ArchUnit/archunit-ts (boundary enforcement as executable unit tests), CodeScene/code-maat (temporal coupling and hotspot monitoring).
|
|
73
|
+
|
|
74
|
+
Stop when all files analyzed. Do not modify anything.
|