dsh-compound-engineering 0.0.0-stage → 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 +21 -0
- package/README.md +160 -2
- package/README.zh.md +161 -0
- package/cordis.patch.yml +6 -0
- package/lib/frontmatter.js +167 -0
- package/lib/index.js +46 -0
- package/lib/provider.js +201 -0
- package/package.json +62 -4
- package/skills/CODING_STANDARDS.md +68 -0
- package/skills/ce-babysit-pr/SKILL.md +59 -0
- package/skills/ce-babysit-pr/references/branch-currency.md +22 -0
- package/skills/ce-babysit-pr/references/envelope.md +44 -0
- package/skills/ce-babysit-pr/references/pipeline.md +15 -0
- package/skills/ce-babysit-pr/references/report.md +20 -0
- package/skills/ce-babysit-pr/references/settle.md +37 -0
- package/skills/ce-babysit-pr/references/setup.md +33 -0
- package/skills/ce-babysit-pr/references/stack-commands.md +39 -0
- package/skills/ce-babysit-pr/references/stack.md +43 -0
- package/skills/ce-babysit-pr/references/tick.md +102 -0
- package/skills/ce-babysit-pr/references/watch-loop.md +222 -0
- package/skills/ce-babysit-pr/scripts/pr-snapshot +3656 -0
- package/skills/ce-bakeoff/SKILL.md +48 -0
- package/skills/ce-bakeoff/references/candidates.md +37 -0
- package/skills/ce-bakeoff/references/judging.md +19 -0
- package/skills/ce-bakeoff/references/output.md +11 -0
- package/skills/ce-bakeoff/references/verification.md +15 -0
- package/skills/ce-brainstorm/SKILL.md +69 -0
- package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
- package/skills/ce-brainstorm/references/approaches.md +57 -0
- package/skills/ce-brainstorm/references/bakeoff.md +9 -0
- package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
- package/skills/ce-brainstorm/references/brainstorm-sections.md +458 -0
- package/skills/ce-brainstorm/references/dialogue.md +89 -0
- package/skills/ce-brainstorm/references/handoff.md +187 -0
- package/skills/ce-brainstorm/references/html-rendering.md +638 -0
- package/skills/ce-brainstorm/references/interaction-rules.md +33 -0
- package/skills/ce-brainstorm/references/markdown-rendering.md +242 -0
- package/skills/ce-brainstorm/references/model-tiers.md +13 -0
- package/skills/ce-brainstorm/references/output-mode.md +26 -0
- package/skills/ce-brainstorm/references/phase-0.md +104 -0
- package/skills/ce-brainstorm/references/plan-write.md +32 -0
- package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
- package/skills/ce-brainstorm/references/reasoning-elevation.md +124 -0
- package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
- package/skills/ce-brainstorm/references/synthesis-summary.md +149 -0
- package/skills/ce-brainstorm/references/universal-brainstorming.md +72 -0
- package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
- package/skills/ce-brainstorm/references/visual-probes.md +164 -0
- package/skills/ce-brainstorm/scripts/elevation-dispatch.sh +288 -0
- package/skills/ce-brainstorm/scripts/light-webserver.js +1275 -0
- package/skills/ce-brainstorm/scripts/packs-resolve.py +737 -0
- package/skills/ce-brainstorm/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-code-review/SKILL.md +40 -0
- package/skills/ce-code-review/references/action-class-rubric.md +67 -0
- package/skills/ce-code-review/references/cross-model-recovery.md +38 -0
- package/skills/ce-code-review/references/cross-model-review.md +191 -0
- package/skills/ce-code-review/references/depth-paths.md +32 -0
- package/skills/ce-code-review/references/diff-scope.md +59 -0
- package/skills/ce-code-review/references/dispatch-reviewers.md +135 -0
- package/skills/ce-code-review/references/findings-schema.json +125 -0
- package/skills/ce-code-review/references/finish-input.md +118 -0
- package/skills/ce-code-review/references/finish-review.md +202 -0
- package/skills/ce-code-review/references/intent-and-plan.md +73 -0
- package/skills/ce-code-review/references/modes-and-output.md +156 -0
- package/skills/ce-code-review/references/persona-catalog.md +66 -0
- package/skills/ce-code-review/references/personas/adversarial-reviewer.md +111 -0
- package/skills/ce-code-review/references/personas/agent-native-reviewer.md +173 -0
- package/skills/ce-code-review/references/personas/api-contract-reviewer.md +44 -0
- package/skills/ce-code-review/references/personas/correctness-reviewer.md +48 -0
- package/skills/ce-code-review/references/personas/data-migration-reviewer.md +111 -0
- package/skills/ce-code-review/references/personas/deployment-verification-agent.md +157 -0
- package/skills/ce-code-review/references/personas/julik-frontend-races-reviewer.md +45 -0
- package/skills/ce-code-review/references/personas/learnings-researcher.md +260 -0
- package/skills/ce-code-review/references/personas/maintainability-reviewer.md +85 -0
- package/skills/ce-code-review/references/personas/performance-reviewer.md +45 -0
- package/skills/ce-code-review/references/personas/previous-comments-reviewer.md +59 -0
- package/skills/ce-code-review/references/personas/project-standards-reviewer.md +77 -0
- package/skills/ce-code-review/references/personas/reliability-reviewer.md +49 -0
- package/skills/ce-code-review/references/personas/security-reviewer.md +50 -0
- package/skills/ce-code-review/references/personas/swift-ios-reviewer.md +99 -0
- package/skills/ce-code-review/references/personas/testing-reviewer.md +51 -0
- package/skills/ce-code-review/references/review-output-template.md +172 -0
- package/skills/ce-code-review/references/scope.md +176 -0
- package/skills/ce-code-review/references/select-and-route.md +93 -0
- package/skills/ce-code-review/references/subagent-template.md +206 -0
- package/skills/ce-code-review/references/validator-batch-template.md +67 -0
- package/skills/ce-code-review/scripts/cross-model-adversarial-review.sh +1275 -0
- package/skills/ce-code-review/scripts/findings-mechanics.py +274 -0
- package/skills/ce-code-review/scripts/packs-resolve.py +737 -0
- package/skills/ce-code-review/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-code-review/scripts/review-scope.py +419 -0
- package/skills/ce-code-review/scripts/run-log.py +280 -0
- package/skills/ce-commit/SKILL.md +60 -0
- package/skills/ce-commit-push-pr/SKILL.md +69 -0
- package/skills/ce-commit-push-pr/references/apply-and-handoff.md +79 -0
- package/skills/ce-commit-push-pr/references/branch-creation.md +47 -0
- package/skills/ce-commit-push-pr/references/commit-and-push.md +26 -0
- package/skills/ce-commit-push-pr/references/compose.md +29 -0
- package/skills/ce-commit-push-pr/references/context.md +42 -0
- package/skills/ce-commit-push-pr/references/gh-stack-cli.md +83 -0
- package/skills/ce-commit-push-pr/references/pr-description-writing.md +208 -0
- package/skills/ce-commit-push-pr/references/stack-submit.md +81 -0
- package/skills/ce-compound/SKILL.md +79 -0
- package/skills/ce-compound/assets/resolution-template.md +96 -0
- package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
- package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
- package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
- package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
- package/skills/ce-compound/references/agents/session-historian.md +82 -0
- package/skills/ce-compound/references/assembly.md +127 -0
- package/skills/ce-compound/references/concepts-vocabulary.md +98 -0
- package/skills/ce-compound/references/enhancement.md +42 -0
- package/skills/ce-compound/references/grounding-validation.md +89 -0
- package/skills/ce-compound/references/lightweight.md +56 -0
- package/skills/ce-compound/references/modes.md +13 -0
- package/skills/ce-compound/references/refresh-and-discoverability.md +96 -0
- package/skills/ce-compound/references/report.md +115 -0
- package/skills/ce-compound/references/research.md +144 -0
- package/skills/ce-compound/references/schema.yaml +236 -0
- package/skills/ce-compound/references/session-history.md +73 -0
- package/skills/ce-compound/references/yaml-schema.md +130 -0
- package/skills/ce-compound/scripts/packs-resolve.py +737 -0
- package/skills/ce-compound/scripts/session-history/__pycache__/dsh_session.cpython-314.pyc +0 -0
- package/skills/ce-compound/scripts/session-history/discover-sessions.sh +290 -0
- package/skills/ce-compound/scripts/session-history/discover_dsh.py +123 -0
- package/skills/ce-compound/scripts/session-history/dsh_session.py +225 -0
- package/skills/ce-compound/scripts/session-history/extract-errors.py +178 -0
- package/skills/ce-compound/scripts/session-history/extract-metadata.py +301 -0
- package/skills/ce-compound/scripts/session-history/extract-skeleton.py +346 -0
- package/skills/ce-compound/scripts/validate-doc-claims.py +497 -0
- package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
- package/skills/ce-compound-refresh/SKILL.md +88 -0
- package/skills/ce-compound-refresh/assets/resolution-template.md +96 -0
- package/skills/ce-compound-refresh/references/classify.md +42 -0
- package/skills/ce-compound-refresh/references/commit.md +7 -0
- package/skills/ce-compound-refresh/references/concepts-vocabulary.md +116 -0
- package/skills/ce-compound-refresh/references/discoverability.md +15 -0
- package/skills/ce-compound-refresh/references/investigate.md +23 -0
- package/skills/ce-compound-refresh/references/modes.md +27 -0
- package/skills/ce-compound-refresh/references/per-action-flows.md +142 -0
- package/skills/ce-compound-refresh/references/report.md +23 -0
- package/skills/ce-compound-refresh/references/schema.yaml +236 -0
- package/skills/ce-compound-refresh/references/scope.md +18 -0
- package/skills/ce-compound-refresh/references/worth-audit.md +35 -0
- package/skills/ce-compound-refresh/references/yaml-schema.md +130 -0
- package/skills/ce-compound-refresh/scripts/validate-doc-claims.py +497 -0
- package/skills/ce-compound-refresh/scripts/validate-frontmatter.py +137 -0
- package/skills/ce-debug/SKILL.md +122 -0
- package/skills/ce-debug/references/anti-patterns.md +91 -0
- package/skills/ce-debug/references/defense-in-depth.md +39 -0
- package/skills/ce-debug/references/fix.md +21 -0
- package/skills/ce-debug/references/investigate.md +114 -0
- package/skills/ce-debug/references/investigation-techniques.md +384 -0
- package/skills/ce-debug/references/pipeline-mode.md +78 -0
- package/skills/ce-debug/references/post-fix-handoff.md +60 -0
- package/skills/ce-debug/references/return-to-caller.md +57 -0
- package/skills/ce-doc-review/SKILL.md +75 -0
- package/skills/ce-doc-review/references/bulk-preview.md +146 -0
- package/skills/ce-doc-review/references/cross-model-review.md +207 -0
- package/skills/ce-doc-review/references/decision-primer.md +47 -0
- package/skills/ce-doc-review/references/dispatch.md +56 -0
- package/skills/ce-doc-review/references/document-intake.md +44 -0
- package/skills/ce-doc-review/references/findings-schema.json +85 -0
- package/skills/ce-doc-review/references/modes.md +20 -0
- package/skills/ce-doc-review/references/open-questions-defer.md +158 -0
- package/skills/ce-doc-review/references/persona-selection.md +41 -0
- package/skills/ce-doc-review/references/personas/adversarial-document-reviewer.md +109 -0
- package/skills/ce-doc-review/references/personas/coherence-reviewer.md +69 -0
- package/skills/ce-doc-review/references/personas/design-lens-reviewer.md +48 -0
- package/skills/ce-doc-review/references/personas/feasibility-reviewer.md +50 -0
- package/skills/ce-doc-review/references/personas/product-lens-reviewer.md +85 -0
- package/skills/ce-doc-review/references/personas/scope-guardian-reviewer.md +83 -0
- package/skills/ce-doc-review/references/personas/security-lens-reviewer.md +41 -0
- package/skills/ce-doc-review/references/personas/whole-doc-reviewer.md +25 -0
- package/skills/ce-doc-review/references/rendering-floor.md +175 -0
- package/skills/ce-doc-review/references/review-output-template.md +123 -0
- package/skills/ce-doc-review/references/subagent-template.md +188 -0
- package/skills/ce-doc-review/references/synthesis-and-presentation.md +350 -0
- package/skills/ce-doc-review/references/walkthrough.md +347 -0
- package/skills/ce-doc-review/scripts/cross-model-doc-review.sh +1270 -0
- package/skills/ce-doc-review/scripts/packs-resolve.py +737 -0
- package/skills/ce-doc-review/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-dogfood/SKILL.md +66 -0
- package/skills/ce-dogfood/agents/openai.yaml +2 -0
- package/skills/ce-dogfood/references/dogfood-report-template.md +97 -0
- package/skills/ce-dogfood/references/phases.md +167 -0
- package/skills/ce-dogfood/references/test-matrix-taxonomy.md +62 -0
- package/skills/ce-dogfood/scripts/packs-resolve.py +737 -0
- package/skills/ce-explain/SKILL.md +81 -0
- package/skills/ce-explain/references/agents/behavior-trace-scout.md +19 -0
- package/skills/ce-explain/references/agents/work-recap-scout.md +23 -0
- package/skills/ce-explain/references/check-in.md +18 -0
- package/skills/ce-explain/references/destinations.md +35 -0
- package/skills/ce-explain/references/explainer-html.md +29 -0
- package/skills/ce-explain/references/explainer-markdown.md +24 -0
- package/skills/ce-explain/references/intake.md +50 -0
- package/skills/ce-explain/references/orchestration.md +46 -0
- package/skills/ce-handoff/SKILL.md +54 -0
- package/skills/ce-handoff/references/create.md +88 -0
- package/skills/ce-handoff/references/resume.md +46 -0
- package/skills/ce-ideate/SKILL.md +75 -0
- package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +166 -0
- package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
- package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
- package/skills/ce-ideate/references/decomposition.md +39 -0
- package/skills/ce-ideate/references/divergent-ideation.md +112 -0
- package/skills/ce-ideate/references/grounding.md +138 -0
- package/skills/ce-ideate/references/html-rendering.md +638 -0
- package/skills/ce-ideate/references/ideation-sections.md +191 -0
- package/skills/ce-ideate/references/issue-intelligence.md +44 -0
- package/skills/ce-ideate/references/markdown-rendering.md +242 -0
- package/skills/ce-ideate/references/output-mode.md +34 -0
- package/skills/ce-ideate/references/post-ideation-workflow.md +169 -0
- package/skills/ce-ideate/references/scope-gates.md +148 -0
- package/skills/ce-ideate/references/universal-ideation.md +119 -0
- package/skills/ce-ideate/references/user-research-artifacts.md +28 -0
- package/skills/ce-ideate/references/web-research-cache.md +56 -0
- package/skills/ce-noslop/SKILL.md +45 -0
- package/skills/ce-noslop/references/patterns.md +61 -0
- package/skills/ce-noslop/references/terminology.md +3 -0
- package/skills/ce-optimize/SKILL.md +64 -0
- package/skills/ce-optimize/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-optimize/references/agents/repo-research-analyst.md +258 -0
- package/skills/ce-optimize/references/example-expensive-benchmark-spec.yaml +88 -0
- package/skills/ce-optimize/references/example-hard-spec.yaml +64 -0
- package/skills/ce-optimize/references/example-judge-spec.yaml +83 -0
- package/skills/ce-optimize/references/example-text-target-spec.yaml +80 -0
- package/skills/ce-optimize/references/experiment-log-schema.yaml +563 -0
- package/skills/ce-optimize/references/experiment-prompt-template.md +143 -0
- package/skills/ce-optimize/references/judge-prompt-template.md +117 -0
- package/skills/ce-optimize/references/loop.md +286 -0
- package/skills/ce-optimize/references/measurement.md +168 -0
- package/skills/ce-optimize/references/optimize-spec-schema.yaml +570 -0
- package/skills/ce-optimize/references/persistence.md +93 -0
- package/skills/ce-optimize/references/spec.md +107 -0
- package/skills/ce-optimize/references/text-targets.md +51 -0
- package/skills/ce-optimize/references/usage-guide.md +147 -0
- package/skills/ce-optimize/references/wrap-up.md +54 -0
- package/skills/ce-optimize/scripts/decide.mjs +676 -0
- package/skills/ce-optimize/scripts/experiment-worktree.sh +330 -0
- package/skills/ce-optimize/scripts/measure.sh +140 -0
- package/skills/ce-optimize/scripts/parallel-probe.sh +134 -0
- package/skills/ce-plan/SKILL.md +60 -0
- package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +66 -0
- package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
- package/skills/ce-plan/references/agents/best-practices-researcher.md +118 -0
- package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-plan/references/agents/framework-docs-researcher.md +97 -0
- package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
- package/skills/ce-plan/references/agents/learnings-researcher.md +268 -0
- package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
- package/skills/ce-plan/references/agents/repo-research-analyst.md +262 -0
- package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
- package/skills/ce-plan/references/agents/slack-researcher.md +131 -0
- package/skills/ce-plan/references/agents/spec-flow-analyzer.md +84 -0
- package/skills/ce-plan/references/agents/web-researcher.md +125 -0
- package/skills/ce-plan/references/approach-altitude.md +55 -0
- package/skills/ce-plan/references/bakeoff.md +9 -0
- package/skills/ce-plan/references/deepening-workflow.md +263 -0
- package/skills/ce-plan/references/final-review.md +134 -0
- package/skills/ce-plan/references/html-rendering.md +638 -0
- package/skills/ce-plan/references/intake.md +158 -0
- package/skills/ce-plan/references/markdown-rendering.md +242 -0
- package/skills/ce-plan/references/output-contracts.md +29 -0
- package/skills/ce-plan/references/output-mode.md +45 -0
- package/skills/ce-plan/references/plan-handoff.md +116 -0
- package/skills/ce-plan/references/plan-sections.md +489 -0
- package/skills/ce-plan/references/reasoning-elevation.md +124 -0
- package/skills/ce-plan/references/research.md +211 -0
- package/skills/ce-plan/references/resume.md +61 -0
- package/skills/ce-plan/references/settled-decisions.md +45 -0
- package/skills/ce-plan/references/structure.md +207 -0
- package/skills/ce-plan/references/synthesis-summary.md +260 -0
- package/skills/ce-plan/references/universal-planning.md +170 -0
- package/skills/ce-plan/scripts/elevation-dispatch.sh +288 -0
- package/skills/ce-plan/scripts/packs-resolve.py +737 -0
- package/skills/ce-plan/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-polish/SKILL.md +22 -0
- package/skills/ce-polish/agents/openai.yaml +2 -0
- package/skills/ce-polish/references/dev-server-astro.md +58 -0
- package/skills/ce-polish/references/dev-server-detection.md +40 -0
- package/skills/ce-polish/references/dev-server-next.md +61 -0
- package/skills/ce-polish/references/dev-server-nuxt.md +58 -0
- package/skills/ce-polish/references/dev-server-procfile.md +59 -0
- package/skills/ce-polish/references/dev-server-rails.md +50 -0
- package/skills/ce-polish/references/dev-server-remix.md +58 -0
- package/skills/ce-polish/references/dev-server-sveltekit.md +58 -0
- package/skills/ce-polish/references/dev-server-vite.md +48 -0
- package/skills/ce-polish/references/install-riffrec.md +35 -0
- package/skills/ce-polish/references/launch-json-schema.md +177 -0
- package/skills/ce-polish/references/live-loop.md +98 -0
- package/skills/ce-polish/references/live-remote.md +35 -0
- package/skills/ce-polish/references/live-start.md +93 -0
- package/skills/ce-polish/references/live-stream-contract.md +253 -0
- package/skills/ce-polish/references/run.md +67 -0
- package/skills/ce-polish/scripts/detect-project-type.sh +277 -0
- package/skills/ce-polish/scripts/detect-riffrec.sh +225 -0
- package/skills/ce-polish/scripts/live-endpoint.js +2841 -0
- package/skills/ce-polish/scripts/read-launch-json.sh +117 -0
- package/skills/ce-polish/scripts/resolve-package-manager.sh +95 -0
- package/skills/ce-polish/scripts/resolve-port.sh +307 -0
- package/skills/ce-pov/SKILL.md +64 -0
- package/skills/ce-pov/references/agents/external-evidence-researcher.md +26 -0
- package/skills/ce-pov/references/agents/pov-peer.md +43 -0
- package/skills/ce-pov/references/agents/precedent-activity-scout.md +21 -0
- package/skills/ce-pov/references/agents/project-grounding-scout.md +32 -0
- package/skills/ce-pov/references/boundaries.md +36 -0
- package/skills/ce-pov/references/cross-model-panel.md +596 -0
- package/skills/ce-pov/references/followup.md +9 -0
- package/skills/ce-pov/references/grounding.md +47 -0
- package/skills/ce-pov/references/intake.md +61 -0
- package/skills/ce-pov/references/invocation.md +47 -0
- package/skills/ce-pov/references/method.md +68 -0
- package/skills/ce-pov/references/pov-schema.json +56 -0
- package/skills/ce-pov/references/report.md +7 -0
- package/skills/ce-pov/scripts/cross-model-pov.sh +1110 -0
- package/skills/ce-pov/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-product-pulse/SKILL.md +81 -0
- package/skills/ce-product-pulse/agents/openai.yaml +2 -0
- package/skills/ce-product-pulse/references/config.md +20 -0
- package/skills/ce-product-pulse/references/interview.md +260 -0
- package/skills/ce-product-pulse/references/report-template.md +89 -0
- package/skills/ce-product-pulse/references/run.md +46 -0
- package/skills/ce-product-pulse/references/setup.md +43 -0
- package/skills/ce-promote/SKILL.md +90 -0
- package/skills/ce-promote/agents/openai.yaml +2 -0
- package/skills/ce-promote/references/spiral-cli.md +149 -0
- package/skills/ce-proof/SKILL.md +65 -0
- package/skills/ce-proof/references/api.md +176 -0
- package/skills/ce-proof/references/workflows.md +124 -0
- package/skills/ce-prototype/SKILL.md +59 -0
- package/skills/ce-prototype/assets/annotate.css +206 -0
- package/skills/ce-prototype/assets/annotate.js +837 -0
- package/skills/ce-prototype/references/annotation-loop.md +32 -0
- package/skills/ce-prototype/references/build.md +39 -0
- package/skills/ce-prototype/references/craft-floor.md +43 -0
- package/skills/ce-prototype/references/preview.md +118 -0
- package/skills/ce-prototype/references/scoping.md +38 -0
- package/skills/ce-prototype/references/write-back.md +37 -0
- package/skills/ce-prototype/scripts/light-webserver.js +1275 -0
- package/skills/ce-resolve-pr-feedback/SKILL.md +60 -0
- package/skills/ce-resolve-pr-feedback/references/agents/pr-comment-resolver.md +59 -0
- package/skills/ce-resolve-pr-feedback/references/evaluation-rubric.md +141 -0
- package/skills/ce-resolve-pr-feedback/references/full-mode.md +336 -0
- package/skills/ce-resolve-pr-feedback/references/pipeline-mode.md +23 -0
- package/skills/ce-resolve-pr-feedback/references/resume.md +60 -0
- package/skills/ce-resolve-pr-feedback/references/return-to-caller.md +111 -0
- package/skills/ce-resolve-pr-feedback/references/targeted-mode.md +48 -0
- package/skills/ce-resolve-pr-feedback/scripts/get-pr-comments +176 -0
- package/skills/ce-resolve-pr-feedback/scripts/get-thread-for-comment +84 -0
- package/skills/ce-resolve-pr-feedback/scripts/pending-feedback.py +287 -0
- package/skills/ce-resolve-pr-feedback/scripts/reply-to-pr-thread +57 -0
- package/skills/ce-resolve-pr-feedback/scripts/resolve-pr-thread +23 -0
- package/skills/ce-retune/SKILL.md +42 -0
- package/skills/ce-retune/agents/openai.yaml +2 -0
- package/skills/ce-retune/references/baseline-mining.md +122 -0
- package/skills/ce-retune/references/corpus-audit.md +128 -0
- package/skills/ce-retune/references/cut-passes.md +129 -0
- package/skills/ce-retune/references/halt-taxonomy.md +123 -0
- package/skills/ce-retune/references/noise-floor.md +131 -0
- package/skills/ce-retune/references/workflow-shapes.md +73 -0
- package/skills/ce-riffrec-feedback-analysis/SKILL.md +33 -0
- package/skills/ce-riffrec-feedback-analysis/references/analyzer.md +18 -0
- package/skills/ce-riffrec-feedback-analysis/references/compound-engineering-feedback-format.md +116 -0
- package/skills/ce-riffrec-feedback-analysis/references/extensive-analysis.md +98 -0
- package/skills/ce-riffrec-feedback-analysis/references/install-riffrec.md +27 -0
- package/skills/ce-riffrec-feedback-analysis/references/quick-bug-report.md +38 -0
- package/skills/ce-riffrec-feedback-analysis/scripts/analyze_riffrec_zip.py +1306 -0
- package/skills/ce-setup/SKILL.md +103 -0
- package/skills/ce-setup/agents/openai.yaml +2 -0
- package/skills/ce-setup/assets/compounding-directive.md +11 -0
- package/skills/ce-setup/assets/noslop-directive.md +7 -0
- package/skills/ce-setup/assets/pack-rule-template.md +11 -0
- package/skills/ce-setup/references/acpx-cache-warm.md +14 -0
- package/skills/ce-setup/references/config-template.yaml +210 -0
- package/skills/ce-setup/references/legacy-codex-tool-map.md +15 -0
- package/skills/ce-setup/references/pack-scaffold.md +45 -0
- package/skills/ce-setup/references/repo-fixes.md +121 -0
- package/skills/ce-setup/scripts/check-health +929 -0
- package/skills/ce-setup/scripts/packs-resolve.py +737 -0
- package/skills/ce-simplify-code/SKILL.md +76 -0
- package/skills/ce-simplify-code/references/personas/code-quality-reviewer.md +17 -0
- package/skills/ce-simplify-code/references/personas/code-reuse-reviewer.md +7 -0
- package/skills/ce-simplify-code/references/personas/comment-reviewer.md +24 -0
- package/skills/ce-simplify-code/references/personas/efficiency-reviewer.md +11 -0
- package/skills/ce-simplify-code/references/personas/test-value-reviewer.md +23 -0
- package/skills/ce-simplify-code/references/reviewer-dispatch.md +11 -0
- package/skills/ce-simplify-code/references/standalone-report.md +25 -0
- package/skills/ce-strategy/SKILL.md +61 -0
- package/skills/ce-strategy/references/grounding.md +22 -0
- package/skills/ce-strategy/references/interview.md +179 -0
- package/skills/ce-strategy/references/strategy-template.md +94 -0
- package/skills/ce-strategy/references/update-run.md +33 -0
- package/skills/ce-sweep/SKILL.md +93 -0
- package/skills/ce-sweep/agents/openai.yaml +2 -0
- package/skills/ce-sweep/references/agents/media-analyzer.md +54 -0
- package/skills/ce-sweep/references/interview.md +208 -0
- package/skills/ce-sweep/references/model-tiers.md +13 -0
- package/skills/ce-sweep/references/plan-template.md +62 -0
- package/skills/ce-sweep/references/run.md +126 -0
- package/skills/ce-sweep/references/sources/email.md +57 -0
- package/skills/ce-sweep/references/sources/github-issues.md +59 -0
- package/skills/ce-sweep/references/sources/slack.md +61 -0
- package/skills/ce-sweep/references/state-schema.md +157 -0
- package/skills/ce-sweep/references/subagent-template.md +60 -0
- package/skills/ce-sweep/scripts/analyze_riffrec_zip.py +1306 -0
- package/skills/ce-sweep/scripts/sweep-state.py +793 -0
- package/skills/ce-test-browser/SKILL.md +50 -0
- package/skills/ce-test-browser/references/agent-browser-driver.md +47 -0
- package/skills/ce-test-browser/references/pipeline-orchestration.md +45 -0
- package/skills/ce-test-browser/references/route-and-report.md +129 -0
- package/skills/ce-test-browser/scripts/resolve-port.sh +41 -0
- package/skills/ce-test-xcode/SKILL.md +26 -0
- package/skills/ce-test-xcode/agents/openai.yaml +2 -0
- package/skills/ce-test-xcode/references/setup-and-build.md +32 -0
- package/skills/ce-test-xcode/references/test-and-report.md +64 -0
- package/skills/ce-work/SKILL.md +62 -0
- package/skills/ce-work/references/agents/figma-design-sync.md +27 -0
- package/skills/ce-work/references/agents/implementation-worker.md +17 -0
- package/skills/ce-work/references/cross-model-execution.md +191 -0
- package/skills/ce-work/references/execution-engines.md +64 -0
- package/skills/ce-work/references/execution-strategy.md +73 -0
- package/skills/ce-work/references/implementation-loop.md +107 -0
- package/skills/ce-work/references/implementation-result-schema.json +52 -0
- package/skills/ce-work/references/input-triage.md +50 -0
- package/skills/ce-work/references/non-code-execution.md +23 -0
- package/skills/ce-work/references/return-to-caller.md +33 -0
- package/skills/ce-work/references/review-findings-followup.md +82 -0
- package/skills/ce-work/references/shipping-workflow.md +89 -0
- package/skills/ce-work/references/tracker-defer.md +150 -0
- package/skills/ce-work/references/work-intake.md +51 -0
- package/skills/ce-work/references/workspace-setup.md +27 -0
- package/skills/ce-work/scripts/__pycache__/unit_workspace_jobs.cpython-314.pyc +0 -0
- package/skills/ce-work/scripts/__pycache__/unit_workspace_state.cpython-314.pyc +0 -0
- package/skills/ce-work/scripts/cross-model-work.sh +1385 -0
- package/skills/ce-work/scripts/peer-job-runner.py +2594 -0
- package/skills/ce-work/scripts/unit-workspace.py +215 -0
- package/skills/ce-work/scripts/unit_workspace_ignored.py +93 -0
- package/skills/ce-work/scripts/unit_workspace_integration.py +677 -0
- package/skills/ce-work/scripts/unit_workspace_jobs.py +1216 -0
- package/skills/ce-work/scripts/unit_workspace_lifecycle.py +981 -0
- package/skills/ce-work/scripts/unit_workspace_state.py +1379 -0
- package/skills/ce-work/scripts/unit_workspace_transaction.py +612 -0
- package/skills/ce-worktree/SKILL.md +54 -0
- package/skills/lfg/SKILL.md +59 -0
- package/skills/lfg/references/debug-return.md +25 -0
- package/skills/lfg/references/intake.md +30 -0
- package/skills/lfg/references/next-work-handoff.md +96 -0
- package/skills/lfg/references/plan-brief.md +36 -0
- package/skills/lfg/references/review-followup.md +78 -0
- package/skills/lfg/references/shipping.md +65 -0
- package/skills/lfg/references/stage-routing.md +49 -0
- package/skills/lfg/references/task-visibility.md +11 -0
- package/skills/lfg/references/tracker-defer.md +150 -0
- package/skills/lfg/references/work-return.md +27 -0
- package/skills/wtf/SKILL.md +33 -0
- package/skills/wtf/agents/openai.yaml +2 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# Investigation Techniques
|
|
2
|
+
|
|
3
|
+
Techniques for deeper investigation when standard code tracing is not enough. Load this when a bug does not reproduce reliably, involves timing or concurrency, is a performance regression, or requires framework-specific tracing.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Root-Cause Tracing
|
|
8
|
+
|
|
9
|
+
When a bug manifests deep in the call stack, the instinct is to fix where the error appears. That treats a symptom. Instead, trace backward through the call chain to find where the bad state originated.
|
|
10
|
+
|
|
11
|
+
**Backward tracing:**
|
|
12
|
+
|
|
13
|
+
- Start at the error
|
|
14
|
+
- At each level, ask: where did this value come from? Who called this function? What state was passed in?
|
|
15
|
+
- Keep going upstream until finding the point where valid state first became invalid — that is the root cause
|
|
16
|
+
|
|
17
|
+
**Worked example:**
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Symptom: API returns 500 with "Cannot read property 'email' of undefined"
|
|
21
|
+
Where it crashes: sendWelcomeEmail(user.email) in NotificationService
|
|
22
|
+
Who called this? UserController.create() after saving the user record
|
|
23
|
+
What was passed? user = await UserRepo.create(params) — but create() returns undefined on duplicate key
|
|
24
|
+
Original cause: UserRepo.create() silently swallows duplicate key errors and returns undefined instead of throwing
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The fix belongs at the origin (UserRepo.create should throw on duplicate key), not where the error appeared (NotificationService).
|
|
28
|
+
|
|
29
|
+
**When manual tracing stalls**, add instrumentation:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
// Before the problematic operation
|
|
33
|
+
const stack = new Error().stack;
|
|
34
|
+
console.error('DEBUG [operation]:', { value, cwd: process.cwd(), stack });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use `console.error()` in tests — logger output may be suppressed. Log before the dangerous operation, not after it fails.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Multi-Component Boundary Instrumentation
|
|
42
|
+
|
|
43
|
+
Root-cause tracing walks one call chain. When a bug crosses subsystems — CI → build → signing, API → service → database, frontend → API → background worker — the failure localizes poorly to a single chain. Instead, instrument every component boundary in one run, capture what enters and what exits each, and let the evidence point to the failing layer.
|
|
44
|
+
|
|
45
|
+
**Shape:**
|
|
46
|
+
|
|
47
|
+
1. List the component boundaries data crosses from trigger to observed symptom.
|
|
48
|
+
2. At each boundary, log what enters and what exits — include the values, relevant environment, and a short tag identifying the boundary.
|
|
49
|
+
3. Run the scenario once.
|
|
50
|
+
4. Read the log linearly, comparing each "exits" value to the next "enters" value.
|
|
51
|
+
5. The boundary where data first stops matching expectation is the failing layer.
|
|
52
|
+
|
|
53
|
+
**Worked example (app signing on CI):**
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Layer 1: workflow env
|
|
57
|
+
echo "=== workflow env ==="
|
|
58
|
+
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
|
59
|
+
|
|
60
|
+
# Layer 2: build script env
|
|
61
|
+
echo "=== build script env ==="
|
|
62
|
+
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
|
63
|
+
|
|
64
|
+
# Layer 3: signing stage keychain state
|
|
65
|
+
echo "=== keychain ==="
|
|
66
|
+
security list-keychains
|
|
67
|
+
security find-identity -v
|
|
68
|
+
|
|
69
|
+
# Layer 4: the actual signing call
|
|
70
|
+
codesign --sign "$IDENTITY" --verbose=4 "$APP"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
One run, and the log shows precisely which layer drops the value — secrets → workflow ✓, workflow → build ✗ → focus investigation on the workflow-to-build-script inheritance, not on signing.
|
|
74
|
+
|
|
75
|
+
**When this beats backward tracing:** When the symptom is far from the trigger (many components apart), when components are owned by different systems (CI vs app code), when the "call stack" is conceptual rather than literal (message bus, HTTP, process boundaries). Backward tracing still applies within each layer once the failing layer is identified.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Git Bisect for Regressions
|
|
80
|
+
|
|
81
|
+
When a bug is a regression ("it worked before"), use binary search to find the breaking commit:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git bisect start
|
|
85
|
+
git bisect bad # current commit is broken
|
|
86
|
+
git bisect good <known-good-ref> # a commit where it worked
|
|
87
|
+
# git bisect will checkout a middle commit — test it
|
|
88
|
+
# mark as good or bad, repeat until the breaking commit is found
|
|
89
|
+
git bisect reset # return to original branch when done
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For automated bisection with a test script:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git bisect start HEAD <known-good-ref>
|
|
96
|
+
git bisect run <test-command>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The test command should exit 0 for good, non-zero for bad.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Intermittent Bug Techniques
|
|
104
|
+
|
|
105
|
+
When a bug does not reproduce reliably after 2-3 attempts:
|
|
106
|
+
|
|
107
|
+
**Logging traps.** Add targeted logging at the suspected failure point and run the scenario repeatedly. Capture the state that differs between passing and failing runs.
|
|
108
|
+
|
|
109
|
+
**Statistical reproduction.** Run the failing scenario in a loop to establish a reproduction rate:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
for i in $(seq 1 20); do echo "Run $i:"; <test-command> && echo "PASS" || echo "FAIL"; done
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
A 5% reproduction rate confirms the bug exists but suggests timing or data sensitivity.
|
|
116
|
+
|
|
117
|
+
**Environment isolation.** Systematically eliminate variables:
|
|
118
|
+
- Same test, different machine?
|
|
119
|
+
- Same test, different data seed?
|
|
120
|
+
- Same test, serial vs parallel execution?
|
|
121
|
+
- Same test, with vs without network access?
|
|
122
|
+
|
|
123
|
+
**Data-dependent triggers.** If the bug only appears with certain data, identify the trigger condition:
|
|
124
|
+
- What is unique about the failing input?
|
|
125
|
+
- Does the input size, encoding, or edge value matter?
|
|
126
|
+
- Is the data order significant (sorted vs random)?
|
|
127
|
+
|
|
128
|
+
**Test-order pollution.** If an individual test passes in isolation but fails when the suite runs, tests are leaking state between each other:
|
|
129
|
+
|
|
130
|
+
- Run the failing test alone — if it passes, pollution is confirmed
|
|
131
|
+
- Run the failing test's file alone — narrows pollution to same-file or cross-file
|
|
132
|
+
- Run the suite with randomized test order (most runners support a seed flag) — a different failing-test neighbor each run implies global state mutation
|
|
133
|
+
- Bisect the preceding tests: run the failing test with just the first half of the earlier tests, then the second half, then narrow
|
|
134
|
+
|
|
135
|
+
Common culprits once isolated: module-level state, mocks not torn down, temp files not cleaned up, database rows not rolled back, environment variables mutated and not restored.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Repro Minimization
|
|
140
|
+
|
|
141
|
+
Once a bug reproduces reliably, the reproduction is often large — a 500-line integration test, a huge payload, a lengthy form-filling sequence. A smaller reproduction makes every subsequent investigation step faster and localizes the actual trigger.
|
|
142
|
+
|
|
143
|
+
**Delta debugging (manual):**
|
|
144
|
+
|
|
145
|
+
1. Cut the reproduction in half.
|
|
146
|
+
2. Does it still fail? If yes, discard the other half; recurse on what remains. If no, the failing behavior depends on something in the half you cut — put it back and cut the other half instead.
|
|
147
|
+
3. Continue until no further reduction is possible without losing the failure.
|
|
148
|
+
|
|
149
|
+
**For input payloads:**
|
|
150
|
+
|
|
151
|
+
- Remove fields one at a time (or half at a time) while confirming the bug persists
|
|
152
|
+
- Shrink string values until the minimum length that still triggers the bug
|
|
153
|
+
- Replace complex nested structures with the smallest shape that reproduces
|
|
154
|
+
|
|
155
|
+
**For test sequences:**
|
|
156
|
+
|
|
157
|
+
- Remove setup steps that don't appear to affect the failing assertion
|
|
158
|
+
- Inline helpers into the test to see what actually runs
|
|
159
|
+
- Remove other assertions to isolate which one fails and on what state
|
|
160
|
+
|
|
161
|
+
The minimized repro often reveals the root cause directly — "the bug only triggers when the string contains a tab character" is a much louder signal than "the bug triggers in this 500-line integration test."
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Framework-Specific Debugging
|
|
166
|
+
|
|
167
|
+
### Rails
|
|
168
|
+
- Check callbacks: `before_save`, `after_commit`, `around_action` — these execute implicitly and can alter state
|
|
169
|
+
- Check middleware chain: `rake middleware` lists the full stack
|
|
170
|
+
- Check Active Record query generation: `.to_sql` on any relation
|
|
171
|
+
- Use `Rails.logger.debug` with tagged logging for request tracing
|
|
172
|
+
|
|
173
|
+
### Node.js
|
|
174
|
+
- Async stack traces: run with `--async-stack-traces` flag for full async call chains
|
|
175
|
+
- Unhandled rejections: check for missing `.catch()` or `await` on promises
|
|
176
|
+
- Event loop delays: `process.hrtime()` before and after suspect operations
|
|
177
|
+
- Memory leaks: `--inspect` flag + Chrome DevTools heap snapshots
|
|
178
|
+
|
|
179
|
+
### Python
|
|
180
|
+
- Traceback enrichment: `traceback.print_exc()` in except blocks
|
|
181
|
+
- `pdb.set_trace()` or `breakpoint()` for interactive debugging
|
|
182
|
+
- `sys.settrace()` for execution tracing
|
|
183
|
+
- `logging.basicConfig(level=logging.DEBUG)` for verbose output
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Stepping Debugger vs Instrumentation
|
|
188
|
+
|
|
189
|
+
Print-debugging is the default reach — it is fast to add and scales across many cases. But there are cases where an interactive stepping debugger converges to the root cause far faster. The rule of thumb:
|
|
190
|
+
|
|
191
|
+
- **Reach for a stepping debugger when:** the failing code path is localized (a specific function or tight call chain), the bug is reliably reproducible, and you need precise state at a known point — values of many locals at once, the exact shape of a structure, or the progression of state across a loop. One break, inspect everything.
|
|
192
|
+
- **Reach for instrumentation when:** the bug is intermittent, spans many calls or distributed components, or happens in a context where breaking execution is disruptive (production, concurrent code whose timing matters, long-running processes). Instrumentation captures diffuse behavior across time and environments.
|
|
193
|
+
|
|
194
|
+
Mixed use is common: instrument first to localize, then attach a debugger at the localized point.
|
|
195
|
+
|
|
196
|
+
**Entry points by language:**
|
|
197
|
+
|
|
198
|
+
| Language | Interactive breakpoint | Attach to running process |
|
|
199
|
+
|----------|------------------------|---------------------------|
|
|
200
|
+
| Python | `breakpoint()` in code, or `python -m pdb script.py` | `python -m pdb -p <pid>` (Python 3.14+ only); on earlier versions, instrument the target with `rpdb` / `remote-pdb` and connect after it triggers |
|
|
201
|
+
| Node.js | `debugger;` in code + `node --inspect-brk`, then connect via Chrome DevTools or VS Code | `kill -SIGUSR1 <pid>` to enable the inspector on the running process (Linux/macOS), then connect Chrome DevTools or VS Code to the default port 9229 |
|
|
202
|
+
| Ruby | `binding.irb` (stdlib), `binding.pry` (pry gem), `debugger` (debug gem), `rdbg` | `rdbg --attach <pid>` with `debug` gem loaded |
|
|
203
|
+
| Go | `dlv debug` or `dlv test`, then `break`, `continue`, `print` | `dlv attach <pid>` |
|
|
204
|
+
| Rust / C / C++ | `lldb target/debug/binary` or `gdb binary`, then `break`, `run`, `print` | `lldb -p <pid>` / `gdb -p <pid>` |
|
|
205
|
+
| Browser JS | `debugger;` in code, or DevTools Sources → set breakpoint | DevTools attaches to page automatically |
|
|
206
|
+
|
|
207
|
+
For test runs, most test runners integrate with the above — e.g., `node --inspect-brk $(which jest)`, `pytest --pdb`, `rspec` with `binding.pry`, `dlv test`. Prefer the runner's integration over trying to attach post-hoc.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Performance Regressions
|
|
212
|
+
|
|
213
|
+
When the symptom is "slow" rather than "wrong", logs and code reading mislead: intuition about where time goes is unreliable, and a plausible-looking hot spot is a hypothesis, not evidence. Measure first, change second:
|
|
214
|
+
|
|
215
|
+
- Establish a numeric baseline before touching anything — a timing harness around the slow operation, a profiler run, a query plan (`EXPLAIN ANALYZE`). The baseline is Phase 1's reproduction check for a perf bug: the number is the red, and the fix is verified by re-measuring the same thing, not by reasoning that the change should be faster.
|
|
216
|
+
- Attribute before optimizing: a profile or per-stage timings that show where the time actually goes. Optimizing an unmeasured suspect is the perf version of shotgun debugging.
|
|
217
|
+
- If the slowness is a regression, bisect against the measurement (see Git Bisect above) rather than reading diffs for something that looks expensive.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Race Condition Investigation
|
|
222
|
+
|
|
223
|
+
When timing or concurrency is suspected:
|
|
224
|
+
|
|
225
|
+
**Timing isolation.** Add deliberate delays at suspect points to widen the race window and make it reproducible:
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
// Simulate slow operation to expose race
|
|
229
|
+
await new Promise(r => setTimeout(r, 100));
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Shared mutable state.** Search for variables, caches, or database rows accessed by multiple threads or processes without synchronization. Common patterns:
|
|
233
|
+
- Global or module-level mutable state
|
|
234
|
+
- Cache reads without locks
|
|
235
|
+
- Database rows read then updated without optimistic locking
|
|
236
|
+
|
|
237
|
+
**Async ordering.** Check whether operations assume a specific execution order that is not guaranteed:
|
|
238
|
+
- Promise.all with dependent operations
|
|
239
|
+
- Event handlers that assume emission order
|
|
240
|
+
- Database writes that assume read consistency
|
|
241
|
+
|
|
242
|
+
**Condition-based waits instead of arbitrary delays.** Flaky tests are often built on `setTimeout`/`sleep` calls that guess at how long an operation takes. These pass on fast machines and fail under load or in CI. Replace the guess with polling the condition the test actually depends on, bounded by a timeout:
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
// before: races under load
|
|
246
|
+
await new Promise(r => setTimeout(r, 50));
|
|
247
|
+
expect(getResult()).toBeDefined();
|
|
248
|
+
|
|
249
|
+
// after: waits for the condition
|
|
250
|
+
await waitFor(() => getResult() !== undefined, 'result available', 5000);
|
|
251
|
+
expect(getResult()).toBeDefined();
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Arbitrary delays remain correct only when testing actual timing behavior (debounce intervals, throttle windows) — in that case, comment why the specific duration is needed.
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Heisenbugs and the Observer Effect
|
|
259
|
+
|
|
260
|
+
When adding `console.log`, attaching a debugger, or inserting instrumentation causes the bug to disappear, the observation is changing the system's behavior. That is itself diagnostic — do not conclude "fixed." The bug is still present; your instrumentation perturbed it out of sight.
|
|
261
|
+
|
|
262
|
+
**What the disappearance tells you:**
|
|
263
|
+
|
|
264
|
+
- **Timing-sensitive:** Instrumentation slowed the code enough that a race condition no longer wins. Investigate concurrency, async ordering, and shared mutable state rather than the nominal logic.
|
|
265
|
+
- **Garbage-collection-sensitive:** Logging allocated memory and triggered a GC that hid the symptom. Look at memory pressure, finalizers, object lifecycle.
|
|
266
|
+
- **Optimization-dependent:** Instrumentation prevented a compiler/JIT optimization that was producing wrong results. Rare but real (especially in C/C++/Rust release builds).
|
|
267
|
+
- **Buffering-dependent:** Log flushing changed I/O ordering. Often indicates unflushed writes elsewhere.
|
|
268
|
+
- **Async-ordering-sensitive:** Log I/O introduced a microtask boundary that reorders subsequent operations. Look for code that implicitly depends on synchronous ordering.
|
|
269
|
+
|
|
270
|
+
**How to investigate without perturbing:**
|
|
271
|
+
|
|
272
|
+
- Non-blocking instrumentation: write to a ring buffer in memory, dump it only after failure is observed
|
|
273
|
+
- Sampling profilers instead of tracing: external observation of what's running without injecting code into the path
|
|
274
|
+
- Platform-level instrumentation: `strace`, `dtrace`, eBPF, platform profilers that don't require code changes
|
|
275
|
+
- Post-mortem evidence: core dumps, heap snapshots, captured state from after the failure, without observing during
|
|
276
|
+
|
|
277
|
+
The defining rule: if the bug is sensitive to observation, the fix must survive re-introduction of the observation. A fix that only works while instrumentation is present is itself a heisenbug.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Browser Debugging
|
|
282
|
+
|
|
283
|
+
When investigating UI bugs with `agent-browser` or equivalent tools:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Open the affected page
|
|
287
|
+
agent-browser open http://localhost:${PORT:-3000}/affected/route
|
|
288
|
+
|
|
289
|
+
# Capture current state
|
|
290
|
+
agent-browser snapshot -i
|
|
291
|
+
|
|
292
|
+
# Interact with the page
|
|
293
|
+
agent-browser click @ref # click an element
|
|
294
|
+
agent-browser fill @ref "text" # fill a form field
|
|
295
|
+
agent-browser snapshot -i # capture state after interaction
|
|
296
|
+
|
|
297
|
+
# Save visual evidence
|
|
298
|
+
agent-browser screenshot bug-evidence.png
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Port detection:** If your in-context project instructions explicitly state the dev-server port, use it (don't grep instruction prose for a port — it's false-positive-prone); otherwise check `package.json` dev scripts, then `.env` files, falling back to `3000`.
|
|
302
|
+
|
|
303
|
+
**Console errors:** Check browser console output for JavaScript errors, failed network requests, and CORS issues. These often reveal the root cause of UI bugs before any code tracing is needed.
|
|
304
|
+
|
|
305
|
+
**Network tab:** Check for failed API requests, unexpected response codes, or missing CORS headers. A 422 or 500 response from the backend narrows the investigation immediately.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Evidence Harvesting Across Systems
|
|
310
|
+
|
|
311
|
+
When a bug spans a real environment — production, staging, a multi-service setup — the richest evidence usually already exists in logs, traces, and error-tracker payloads. Use it rather than reproducing from scratch when possible.
|
|
312
|
+
|
|
313
|
+
**Follow a single request end-to-end.** Pick one concrete failing request (an exact timestamp, user ID, or event ID from an error tracker). Then:
|
|
314
|
+
|
|
315
|
+
- Search every relevant log source for that identifier — correlation ID, request ID, trace ID, user ID
|
|
316
|
+
- Assemble the timeline in order: edge → API → service → database → downstream calls → response
|
|
317
|
+
- Note where the timeline has gaps (missing logs) or contradictions (timestamps out of order, IDs that don't propagate)
|
|
318
|
+
|
|
319
|
+
One traced request usually reveals the root cause faster than a dozen attempts to reproduce.
|
|
320
|
+
|
|
321
|
+
**Correlation IDs.** Most web frameworks either attach a request ID automatically or accept one via header (`X-Request-ID`, `traceparent`). When the project has one, every log line and every downstream call should carry it. If it's missing or not propagated, that is itself a finding — propagation gaps mean the agent cannot assemble the timeline, and neither could the on-call human who investigates the next incident.
|
|
322
|
+
|
|
323
|
+
**Timestamp triangulation.** When the failing operation has no shared ID, timestamps are the fallback. Constrain every log query to a narrow window around the observed failure, then look for the first anomaly in order. Watch for clock skew between services — a 30-second drift between two hosts reorders evidence and misleads triangulation.
|
|
324
|
+
|
|
325
|
+
**Error tracker payloads.** Sentry, Bugsnag, Honeybadger, AppSignal and similar tools capture stack traces, breadcrumbs, user context, request state, and release metadata at the moment of failure. Read the full payload before tracing code — it often contains the exact file:line, the variable state, and the breadcrumbs leading to the error. Grouping rules sometimes hide frequency and variant information; expand to see every instance rather than just the representative one.
|
|
326
|
+
|
|
327
|
+
**APM / distributed traces.** When the project has Datadog APM, Honeycomb, New Relic, or an OpenTelemetry collector, the trace view shows the full call tree across services with timings. Look for: unexpectedly long spans (blocking or slow dependency), failed spans in the middle of the chain, spans that should exist but don't (missing instrumentation also masks bugs).
|
|
328
|
+
|
|
329
|
+
**Preserve before investigating.** Error trackers and log systems have retention windows. Before starting a long investigation, export or snapshot the key evidence (event ID, trace ID, full stack trace, breadcrumbs) so it doesn't age out mid-session.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## System Boundary Checks
|
|
334
|
+
|
|
335
|
+
Many bugs live at the boundary between an application and the system it runs on — network, database, filesystem, OS. A fast pass through these boundaries often eliminates whole categories of suspicion before deep code tracing.
|
|
336
|
+
|
|
337
|
+
**Network.**
|
|
338
|
+
|
|
339
|
+
- DNS resolution: `dig <host>`, `nslookup <host>`, `host <host>` — does the name resolve to what you expect from this host?
|
|
340
|
+
- Reachability: `curl -v https://host/path` — full headers, redirects, TLS errors
|
|
341
|
+
- Status codes and headers: check response for 4xx/5xx, unexpected redirects, missing CORS headers, content-encoding surprises
|
|
342
|
+
- Connection state: `ss -tan` / `netstat -an` / `lsof -i` — open connections, listening ports, connections in TIME_WAIT or CLOSE_WAIT
|
|
343
|
+
- TLS: `openssl s_client -connect host:443` — certificate chain, expiry, SNI mismatches
|
|
344
|
+
|
|
345
|
+
**Database.**
|
|
346
|
+
|
|
347
|
+
- Query plan: `EXPLAIN` / `EXPLAIN ANALYZE` on the suspect query — is it using the expected index, or scanning a large table?
|
|
348
|
+
- Slow query log / recent queries: most databases can show the N slowest recent queries, and failing queries often show up there
|
|
349
|
+
- Locks and transactions: inspect the lock/transaction tables (`pg_locks`, `information_schema.innodb_trx`, `sys.dm_tran_locks`) — is the operation waiting on a long-held lock?
|
|
350
|
+
- Connection pool: is the app exhausting its pool? Are connections leaking?
|
|
351
|
+
- Replication lag (if read replicas are in the path): a read right after a write may hit a replica that hasn't caught up yet
|
|
352
|
+
|
|
353
|
+
**Filesystem.**
|
|
354
|
+
|
|
355
|
+
- Existence and permissions: `ls -la <path>` — does the file exist, is it readable/writable by the running user?
|
|
356
|
+
- Case sensitivity: bugs that only appear on Linux (not macOS) are often case mismatches
|
|
357
|
+
- Open handles: `lsof <path>` or `lsof -p <pid>` — is something still holding the file, preventing write/unlink?
|
|
358
|
+
- Disk space: `df -h`. Out-of-space errors sometimes appear as cryptic write failures elsewhere
|
|
359
|
+
- File watching / inotify limits: EMFILE or "too many open files" often means an inotify/FD limit, not a leak in your code
|
|
360
|
+
- Path separators and encoding: Windows-style paths in Unix code, or UTF-8 paths in a non-UTF-8 locale
|
|
361
|
+
|
|
362
|
+
**Processes and signals.** Check whether the process is actually the version you think is running (`ps aux | grep`, cross-reference pid to build time). Zombies, orphaned workers, and crashed-then-restarted-with-old-code processes all masquerade as code bugs.
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Bug-Class Pattern Checklist
|
|
367
|
+
|
|
368
|
+
Before deep tracing, run down this checklist. Many bugs match a recognizable class, and the class implies where to look first. Check whether the observed symptom fits any of these patterns:
|
|
369
|
+
|
|
370
|
+
- **Time and timezone:** off-by-hours errors near midnight, failures specifically during DST transitions, epoch/milliseconds confusion, naive vs timezone-aware datetimes mixed, UTC-vs-local assumed incorrectly
|
|
371
|
+
- **Encoding and locale:** mojibake in output, byte-vs-character length off-by-one, BOM at the start of a file breaking parsers, non-ASCII characters missing, locale-sensitive comparisons producing inconsistent results
|
|
372
|
+
- **Floating-point precision:** comparisons that "should" be equal but aren't, NaN propagating through a calculation and silently corrupting downstream results, very large or very small numbers losing precision
|
|
373
|
+
- **Integer overflow / underflow:** wraparound on bounded integer types, `int32` overflows in languages without arbitrary-precision integers, negative values where non-negative was assumed
|
|
374
|
+
- **Off-by-one and boundaries:** empty-collection edge case, first or last element missing, inclusive vs exclusive range mismatch, fencepost errors
|
|
375
|
+
- **Cache staleness:** correct behavior immediately after a change, wrong behavior after some time, fixed by restart or cache flush; includes HTTP caches, CDN caches, app-level memoization, browser service workers
|
|
376
|
+
- **Permissions / auth:** works for one user and not another, works in dev without auth layer but fails in prod with it, works with superuser but not with the actual operating identity
|
|
377
|
+
- **Dependency or version drift:** works on one machine but not another, lockfile out of sync with manifest, transitive dependency updated and changed behavior, native module built against a different runtime version
|
|
378
|
+
- **Path / case sensitivity:** works on macOS and fails on Linux (case), works on Linux and fails on Windows (path separators, reserved names like `CON`/`PRN`)
|
|
379
|
+
- **Concurrency / ordering:** works in serial test mode, fails in parallel; works one way and fails another when randomized
|
|
380
|
+
- **Stale build artifacts:** `dist/`, `.next/`, compiled `.pyc`, generated code, Docker image layers — rebuild from clean and see if it reproduces
|
|
381
|
+
- **Observer effect (heisenbug):** bug vanishes when logging, debugger, or profiler is attached — see the Heisenbugs section above
|
|
382
|
+
- **TOCTOU (time-of-check vs time-of-use):** a check passed a moment ago but the underlying state changed before the dependent action ran
|
|
383
|
+
|
|
384
|
+
Pattern-matching here is cheap. Spending 30 seconds checking whether the symptom fits a known class can eliminate hours of speculative tracing.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# ce-debug — pipeline mode (non-interactive)
|
|
2
|
+
|
|
3
|
+
Loaded when `ce-debug` is invoked with `mode:pipeline` by an orchestrator (`ce-babysit-pr`, `lfg`). The skill runs to completion without ever asking the user and returns a structured result the caller composes. The investigation rigor is unchanged. Only the interaction and the fix-authority boundary change.
|
|
4
|
+
|
|
5
|
+
## Authority: you act under the orchestrator's inherited scope
|
|
6
|
+
|
|
7
|
+
Being invoked by an orchestrator is **not** itself authorization. You mutate under the **inherited** scope the orchestrator holds from the user: **actions** = fix / commit / push on the current branch; **exclusions** = merge, rebase, force-push, approve a gated CI run. That authorized scope is fixed. You may *narrow* it (defer a fix, return `needs-human`) but never *broaden* it. If the only way to make CI green is an excluded action (a rebase or force-push to untangle history, or approving a gated run), that action is outside the authorized scope: **defer as `needs-human`** with a `decision_context`, do not perform it. This is a boundary on the *mechanism* of a change. It sits alongside the convergent/divergent *content* boundary below. A fix can be convergent in content yet still outside the authorized scope in mechanism.
|
|
8
|
+
|
|
9
|
+
## Non-interactive overrides (per phase)
|
|
10
|
+
|
|
11
|
+
- **Phase 0 (triage):** If an issue fetch fails, do not ask the user to paste content. Proceed with the input you have and note the gap in the return. Do not ask "what have you tried"; infer prior attempts from the input.
|
|
12
|
+
- **Phase 1 (reproduce):** When reproduction cannot run in this environment (a CI- or production-only failure), do not ask for access, artifacts, or a go-ahead. Continue on the best evidence already in reach: the failing job's logs, captured artifacts, the seeded log tails. If a gap-free root cause is still established, the ordinary statuses apply. If not, return `needs-human` with a `decision_context` naming what reproduction requires and what was tried.
|
|
13
|
+
- **Phase 2 (root cause + fix gate):** There is no "Fix it now / Diagnosis only" question. The caller invoked this skill to fix, so **fix by default, but only convergent fixes** (see the boundary below). A divergent fix is deferred, not applied.
|
|
14
|
+
- **Phase 3 (workspace/branch):** Operate on the current branch. The orchestrator decides branch context, so never prompt to create a branch and never prompt about uncommitted work. Commit the fix using the project's commit message conventions already in context; otherwise follow the recent log pattern, then use conventional commits (`fix(ci): <summary>` for a CI failure, `fix: <summary>` otherwise). User override wins. Push the fix. Never weaken, skip, or mock a failing assertion to make it pass. Repair the real issue or defer.
|
|
15
|
+
- **Phase 4 (handoff):** No prompt. Emit the structured return below as the last thing this skill writes, then skip the compound offer. The return ends this skill, not the turn. The caller runs in this same session, and its next step follows the return.
|
|
16
|
+
- **Post-fix simplify and review steps:** Skip them in pipeline to bound cost and nesting depth; the orchestrator scopes review at its own level. Keep the Phase 3 tests.
|
|
17
|
+
|
|
18
|
+
## The fix-authority boundary: convergent vs divergent
|
|
19
|
+
|
|
20
|
+
Apply a fix only when it **converges to intended behavior**. That means it repairs the real defect so the code meets its planned/tested intent (a genuine bug: null deref, off-by-one, a broken call, a regression against a test that encodes intended behavior).
|
|
21
|
+
|
|
22
|
+
**Defer** (do not apply) any fix that would **diverge from intended behavior**: it would change a deliberate contract, API shape, default, or product/UX decision rather than repair a bug; or the "failure" is a test asserting a deliberate behavior that the fix would reverse; or making CI green would require a product/design call. This mirrors the `ce-resolve-pr-feedback` intent-conflict check. It requires evidence and is rare, and it is never a reason to dodge a real fix. When genuinely unsure whether a failure is a bug or a deliberate-behavior conflict, prefer deferring with a crisp `decision_context` over guessing.
|
|
23
|
+
|
|
24
|
+
### Emergent trade-offs (when the caller passes a `trajectory`)
|
|
25
|
+
|
|
26
|
+
Some divergence is not visible in one pass. It emerges across rounds as **ping-pong**: your fix for A causes B to appear, and the fix for B brings A back. When the orchestrator seeds you with a `trajectory` (`recurring_checks`, `check_recur_max`, `heads_since_progress`), reason over it before fixing again, and do not raise a false alarm:
|
|
27
|
+
|
|
28
|
+
- **Progressive failure migration** (A fixed, B appears *once*, you fix B, done) is ordinary multi-step repair. **Keep fixing.** Do not park it.
|
|
29
|
+
- **Oscillation** (the *same* check/invariant returns after a fix aimed at it, defects cycle, or each fix trades one failure for another) means A and B cannot both hold without a larger change. That larger change is a **product/design decision**, so **defer**: apply nothing this round and return `needs-human`, with a `decision_context` that names the two failures in tension, why they cannot be reconciled without a divergent change, the options, and your lean.
|
|
30
|
+
- **Moving-target guard:** if the recurrence traces to an external cause (a base-branch merge, a dep bump, flaky infra) rather than your fixes fighting each other, it is *not* an emergent trade-off. Keep fixing, and note the external cause. Recurrence is only meaningful when your own fixes are what oscillate.
|
|
31
|
+
|
|
32
|
+
To defer, name the invariant the fix would need to satisfy and why no bounded convergent change satisfies it. If unsure whether it is genuine oscillation or one more real bug, prefer one more convergent attempt over a premature park.
|
|
33
|
+
|
|
34
|
+
## Reporting a deferred (divergent / needs-human) item
|
|
35
|
+
|
|
36
|
+
Never write a PR-body section. Never block. Report it so the human sees it after the run:
|
|
37
|
+
|
|
38
|
+
- If it maps to an **open review thread**, leave that thread open (and attach the `decision_context` as a reply when a thread reply is in scope).
|
|
39
|
+
- Otherwise, **return it in the `residuals` list** for the caller to place in its single run-report comment. For a bare `ce-debug` invocation with no orchestrator and no PR, file it as a ticket in the project's tracker (detected in Phase 1.4) with enough background to action it standalone. When no tracker is reachable, return it in the structured result and say plainly that nothing else recorded it.
|
|
40
|
+
|
|
41
|
+
Return each decision in the shared typed residual contract. Its `sources` enumerate every item this one decision covers: each failing check key with `kind: "check"`, plus the stable ID and kind of every open review thread, comment, or review body represented by the same decision. `decision_context` contains the quoted failure, investigation, decision reason, options with tradeoffs, and nullable recommendation. `thread_urls` includes every owned open thread (every open thread this decision covers) and is empty only when no source is a thread. The caller persists and invalidates the complete source set as one unit, so never split, omit, or summarize which items a decision covers.
|
|
42
|
+
|
|
43
|
+
## Structured return
|
|
44
|
+
|
|
45
|
+
The return in pipeline mode is machine-readable (the caller parses it):
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"status": "fixed-and-pushed | fixed-not-pushed | diagnosed-no-fix | flaky-infra | needs-human",
|
|
50
|
+
"summary": "<one line: what happened>",
|
|
51
|
+
"root_cause": "<causal chain, brief>",
|
|
52
|
+
"changed_files": ["..."],
|
|
53
|
+
"head_sha": "<sha of the fix commit, when fixed-and-pushed or fixed-not-pushed>",
|
|
54
|
+
"residuals": [
|
|
55
|
+
{
|
|
56
|
+
"type": "needs-human",
|
|
57
|
+
"sources": [
|
|
58
|
+
{ "id": "<failing-check-key>", "kind": "check" },
|
|
59
|
+
{ "id": "<owned-open-thread-id, when any>", "kind": "thread" }
|
|
60
|
+
],
|
|
61
|
+
"decision_context": {
|
|
62
|
+
"quoted_feedback": "<the failure or constraint in tension>",
|
|
63
|
+
"investigation": "<what was inspected and found>",
|
|
64
|
+
"decision_reason": "<why no bounded convergent fix is safe>",
|
|
65
|
+
"options": [ { "option": "<choice>", "tradeoff": "<gain and loss>" } ],
|
|
66
|
+
"recommendation": "<lean and why, or null>"
|
|
67
|
+
},
|
|
68
|
+
"thread_urls": ["<URL for every owned open thread, or empty when none>"]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- `fixed-and-pushed`: a convergent fix was applied, tests pass, committed, and the push succeeded.
|
|
75
|
+
- `fixed-not-pushed`: the same fix is applied and committed locally, but the push did not happen (no remote, no push access, an authorized scope that excludes pushing, a rejected push). `head_sha` is the local commit; the first residual says why. Never report this as `fixed-and-pushed` (the caller re-snapshots a remote head that has not moved) or as `diagnosed-no-fix` (the fix is applied).
|
|
76
|
+
- `flaky-infra`: a flake or infrastructure failure, not a code defect (the caller may retry).
|
|
77
|
+
- `needs-human`: the failure requires a divergent/product decision; nothing applied; see `residuals`.
|
|
78
|
+
- `diagnosed-no-fix`: root cause found but no safe convergent fix available this run; see `residuals`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# ce-debug — post-fix handoff (interactive)
|
|
2
|
+
|
|
3
|
+
Loaded at Phase 4 when Phase 3 actually applied a fix in interactive mode. Not used in `mode:pipeline` (see `pipeline-mode.md`) and not used when the user chose "Diagnosis only". In both of those cases Phase 4 ends at the Debug Summary.
|
|
4
|
+
|
|
5
|
+
The goal of these post-fix steps is a **PR-ready** fix, not merely a locally green one, while never letting polish or review reach outside the bug's scope.
|
|
6
|
+
|
|
7
|
+
## Post-fix polish and review steps (before commit or PR)
|
|
8
|
+
|
|
9
|
+
**Contextual overrides first.** Check the user's original prompt, loaded memories, and the project's active instructions already in your context for explicit, clearly applicable preferences that conflict with automatic polish or review, such as "minimal hotfix only", "do not run review", "always ask before cleanup", or "ship the smallest possible diff". Honor them and state what was skipped.
|
|
10
|
+
|
|
11
|
+
**Skip these steps only with a reason:** purely mechanical fixes (typo/import-only, formatting/lint-only, dependency-only, generated artifacts, docs-only, or roughly under 10 changed lines that touch nothing sensitive). Keep the Phase 3 tests and self-review regardless, and carry the skip reason into the summary.
|
|
12
|
+
|
|
13
|
+
**Scope rule for both passes below: never let either pass reach work the user did not offer up.** Phase 3 recorded the fix-owned files (the files this fix changed) and which files were already dirty; that is the scope. Never widen it to the branch because the branch looks safe. A branch diff equals the fix scope only when the tree was clean anyway, so widening buys nothing there, and it silently swallows the user's WIP when the tree was not clean. Branch creation is not evidence of a clean tree: `git checkout -b` carries uncommitted work forward.
|
|
14
|
+
|
|
15
|
+
**Simplify before review when useful.** Invoke `ce-simplify-code` with `mode:pipeline` when the fix diff is non-mechanical and large enough to benefit (default: >=30 changed lines), touches multiple implementation files, introduces a new helper or abstraction, or affects shared or risky areas (auth/authz, public contracts, persistence, concurrency, background jobs, external services). Always pass the fix-owned files that were clean before Phase 3 as an explicit scope, never the branch diff, and the bug's regression test as `proof-test:<path>`. `ce-simplify-code` treats a named scope as authoritative and will not widen it, and it *modifies* what it is given, so a named scope is the guardrail. If a fix-owned file already had pre-existing user edits, skip it and record `Simplify: skipped for overlapping pre-existing edits`. File-level simplification could rewrite unrelated hunks the user did not authorize.
|
|
16
|
+
|
|
17
|
+
**Review the final fix scope.** Review every non-mechanical fix unless review tooling is unavailable. Run default `ce-code-review` **only when its diff scope is known to be this fix**: the pre-fix tree was clean and you can pass `base:<pre-fix-HEAD>`. Review reads rather than writes, so a base-scoped diff is worth preferring where it is provably the fix. It is the one place the scope may come from a revision rather than the file list. On a pre-existing dirty branch or one with unrelated committed work, standalone review would reach outside the bug scope. In that case use the harness's lightweight review tool if it accepts an explicit file scope; otherwise review the fix-owned files manually and record `Code review: targeted manual due to unrelated branch work`. If `ce-code-review` is unavailable on an otherwise fix-only scope, fall back to the harness's lightweight review tool, else one explicit manual diff scan, and state that dedicated review was unavailable.
|
|
18
|
+
|
|
19
|
+
**Handle residual findings before shipping.** Do not auto-open a PR with unresolved P0/P1 findings, or with findings whose fix needs a product/design decision. Ask whether to fix now, accept/defer durably, or stop. Accepted residuals must not live only in the session. If a PR will be opened, pass them to `ce-commit-push-pr` as a `## Unapplied review findings` checklist section (`- [ ] <severity> — <file:line> — <title>` per finding). On commit-only or stop, file a ticket per finding in the tracker detected in Phase 1.4, with enough background to action it standalone (the finding, why it matters, file:line, severity, a pointer to the review run, and the branch/head SHA so it points at the code even without a PR). Pick the destination and file it; do not ask which destination to use. When no tracker is reachable, name the accepted findings in the final summary and say plainly that nothing else recorded them.
|
|
20
|
+
|
|
21
|
+
**Re-verify after these edits.** If simplification or review changed code, rerun the bug's regression test and any targeted checks those steps identified. Never proceed to commit or PR with a red tree.
|
|
22
|
+
|
|
23
|
+
Then append this block below the Debug Summary, before the commit/PR handoff:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
## Post-Fix Quality
|
|
27
|
+
**Scope**: [fix-only branch / base:<pre-fix-HEAD> / fix-owned files only / targeted manual due to unrelated branch work]
|
|
28
|
+
**Simplify**: [ran/skipped + reason]
|
|
29
|
+
**Review**: [ran/skipped/manual + outcome]
|
|
30
|
+
**Residuals**: [none / unapplied review findings section for PR / filed as tracker tickets / stated in this summary only, no tracker reachable / blocked pending user decision]
|
|
31
|
+
**Re-verification**: [checks rerun after tail edits]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Commit / PR handoff detail
|
|
35
|
+
|
|
36
|
+
SKILL.md's Phase 4 **Routing** block defines the bare per-case actions: which skill runs, and what to do when no PR is possible. It stays there because it must apply even if this file is never read. This section carries only the detail that shapes those actions.
|
|
37
|
+
|
|
38
|
+
**Opening a PR is the default; do not ask for permission.** What varies the route is what else sits on the branch, never whether the user would approve. A branch carrying only this fix ships as a PR whether or not this skill created it.
|
|
39
|
+
|
|
40
|
+
**Why a branch carrying unrelated work stops short of a push.** `ce-commit-push-pr` commits the changed files it finds, pushes the whole branch, and opens a PR spanning every commit on it. On a branch holding someone's in-progress work, that publishes what they never offered up, and hands that PR to `ce-babysit-pr`. The preview cannot catch this, because it does not wait for an answer. This is the same scope rule the polish steps above already apply to simplify and review; shipping gets no exemption from it.
|
|
41
|
+
|
|
42
|
+
**Why the separable case acts and the entangled case asks.** Committing only the fix-owned files is safe and trivially reversible. The user who wanted exactly that pays no round trip, and the user who wanted the PR says one word. The routing offers the PR rather than asking permission for it. Entanglement is different in kind: when a fix-owned file already held the user's edits, every available move loses something real, and no default is defensible. Restricting the question to that state is what keeps it from becoming the reflexive prompt this routing exists to remove. Most runs reach neither state. A fresh branch or clean tree routes straight to the PR.
|
|
43
|
+
|
|
44
|
+
**Contextual overrides come first.** An explicit, clearly applicable instruction such as "always review before pushing", "open PRs as drafts", "don't open PRs from skills", or "commit only" outranks the default routing: skip the PR step, adjust it, or stop, whichever matches what the user said. A vague tonal cue is not an override.
|
|
45
|
+
|
|
46
|
+
**The preview is not a question.** State what gets committed, on what branch, and that a PR will be opened, then proceed without waiting. It exists so the user can interrupt.
|
|
47
|
+
|
|
48
|
+
**`branding:on` is required.** The explicit branding signal records that `ce-debug` produced the fix. A handoff without it loses that provenance.
|
|
49
|
+
|
|
50
|
+
**Link what already exists; never open a new record.** Reference the issue of record from Phase 0, plus any existing ticket Phase 1.4 found for this same bug. Linking something that already exists is always fine, and on an auto-closing tracker it is how the fix closes it. What is forbidden is *creating* a record for this bug. Do not open a ticket in a different system because the repo happens to use it, and do not ask the user whether you should. A Sentry issue, an alert, or a GitHub issue is as much the record as a Linear or Jira ticket, and a duplicate is noise the user then has to close. When Phase 0 found no issue of record (a pasted stack trace, a failing test), this run has none. Ship the fix without one rather than opening a ticket to fill the slot. A new ticket is warranted only for a *different* problem you found along the way, per the residual rule above.
|
|
51
|
+
|
|
52
|
+
**Issue auto-close syntax.** When the issue you are linking lives in a tracker with auto-close support, include that tracker's syntax in the location it requires, so the fix flows back to the issue and closes it on merge. Most trackers parse PR descriptions (`Fixes #N` for GitHub, `Closes ABC-123` for Linear), but some parse only commit messages (Jira Smart Commits). When the record has no such syntax (an error monitor like Sentry, or a pasted alert), just link it in the PR description and say what the fix addresses.
|
|
53
|
+
|
|
54
|
+
## Learning-capture criteria (after a PR is open)
|
|
55
|
+
|
|
56
|
+
Offer once only when the verified fix produced non-obvious, durable project reasoning that is not readily recoverable from the final code, tests, types, comments, or existing documentation, and losing it would plausibly cause recurrence, material risk, or substantial rediscovery.
|
|
57
|
+
|
|
58
|
+
Apply this counterfactual: if the learning document disappeared, would a future engineer reading the final implementation still be likely to repeat the mistake or redo substantial investigation? If not, skip silently. Completion, effort, and diff size do not establish eligibility.
|
|
59
|
+
|
|
60
|
+
These are the criteria only; SKILL.md's Routing block defines what runs when the user accepts.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ce-debug — return-to-caller mode (non-interactive, caller owns the steps after the fix)
|
|
2
|
+
|
|
3
|
+
Loaded when `ce-debug` is invoked with `mode:return-to-caller` by an orchestrator such as `lfg` on its defect route. The caller asked for the bug fixed and owns everything after the fix: simplify, review, compound, commit of anything further, push, PR, and CI. This skill investigates, fixes, verifies, commits on a feature branch, and returns a structured result. It never pushes and never asks.
|
|
4
|
+
|
|
5
|
+
This is not `mode:pipeline`. Pipeline mode serves the babysitter on a PR branch it already owns: it is seeded with failing jobs, pushes its own commit, and skips review because the babysitter scopes review. Here nothing is pushed and the caller reviews.
|
|
6
|
+
|
|
7
|
+
## What stays the same
|
|
8
|
+
|
|
9
|
+
Phases 0 through 3 run as the body defines them, with the investigation rigor unchanged: the causal-chain gate, reproduction, the escalation table, the test-first fix sequence in `references/fix.md`, and the issue-of-record rule. The **Branch** rule in Phase 3 applies in full: on the default branch, detached, or unsure, create a feature branch named from the bug before the first edit and say which branch you moved to. `/lfg fix this bug` invoked on `main` must not commit to `main`. The pre-fix scope record and the fix-owned file list are kept, because the return is built from them: the caller ships only what the user offered, and this return is the only place it can learn what was already in the tree or on the branch before the fix.
|
|
10
|
+
|
|
11
|
+
## What changes
|
|
12
|
+
|
|
13
|
+
- **Phase 0:** if an issue fetch fails, continue with the input you have and record the gap in the return. Never ask the user to paste content.
|
|
14
|
+
- **Phase 2 gate:** there is no fix-choice question. The caller's invocation authorized the fix, so proceed to Phase 3 with a **convergent** fix only. A **divergent** fix, one that would reverse a deliberate contract, behavior, or product decision, including a "failing" test that asserts intended behavior, is deferred as `needs-human` with a `decision_context`, never applied. Never route to `ce-brainstorm`; a design problem is a `needs-human` residual. When reproduction cannot run in this environment, continue on the best evidence in reach; if the causal chain still has a gap, return `needs-human` naming what reproduction requires and what was tried.
|
|
15
|
+
- **Phase 3:** apply the fix on the feature branch, verify it as `references/fix.md` defines (red then green where a test can run here; otherwise the reproduction check or characterization that file allows, recorded in the evidence), and commit only the fix-owned files. Follow the project's commit message conventions already in context; otherwise follow the recent log pattern, then conventional commits (`fix: <summary>` for this bug). User override wins. Do not push. A file the fix must touch that already carries the user's uncommitted edits stops the run before the first edit to it: return `blocked` naming the file, with nothing applied, since no commit could separate their edits from the fix and the caller cannot answer for the user. The pre-fix scope record makes this known before Phase 3 edits anything.
|
|
16
|
+
- **Phase 4:** skip the Debug Summary block, the post-fix polish and review steps (`references/post-fix-handoff.md`), the commit/PR routing, and the learning-capture offer. Emit the structured return below as the last thing this skill writes. The return ends this skill, not the turn. The caller runs in this same session, and its next step follows the return.
|
|
17
|
+
|
|
18
|
+
## Structured return
|
|
19
|
+
|
|
20
|
+
The return is machine-readable; the caller parses it and branches on the exact `status` spellings, so never rename, abbreviate, or add to them.
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"status": "fixed | diagnosed-no-fix | needs-human | blocked",
|
|
25
|
+
"summary": "<one line: what happened>",
|
|
26
|
+
"root_cause": "<the causal chain, trigger to symptom, with file:line references>",
|
|
27
|
+
"changed_files": ["<fix-owned files, tests included>"],
|
|
28
|
+
"head_sha": "<sha of the fix commit, when fixed>",
|
|
29
|
+
"branch": "<branch the fix was committed on, when fixed>",
|
|
30
|
+
"pre_fix_scope": {
|
|
31
|
+
"head": "<HEAD before the fix commit>",
|
|
32
|
+
"dirty_files": ["<files already modified or untracked before Phase 3 that are not fix-owned; left untouched>"],
|
|
33
|
+
"commits_beyond_base": ["<commits the branch carried beyond the default branch before the fix, oldest first; empty on a fresh branch>"],
|
|
34
|
+
"started_on_default_branch": false
|
|
35
|
+
},
|
|
36
|
+
"behavior_change": true,
|
|
37
|
+
"verification_evidence": {
|
|
38
|
+
"regression_test": "<file and case>",
|
|
39
|
+
"existing_tests_inspected": ["..."],
|
|
40
|
+
"tests_added_or_changed": ["..."],
|
|
41
|
+
"red_before_fix": "<the failure observed before the fix, or the characterization when a red run was impossible>",
|
|
42
|
+
"verification_run": "<commands and results>",
|
|
43
|
+
"exception_reason": null
|
|
44
|
+
},
|
|
45
|
+
"residuals": [ { "type": "needs-human", "sources": [ ... ], "decision_context": { ... }, "thread_urls": [] } ],
|
|
46
|
+
"issue_of_record": { "id": "<identifier>", "url": "<url>" },
|
|
47
|
+
"blockers": [],
|
|
48
|
+
"standalone_shipping_skipped": true
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `fixed`: a convergent fix is applied, its regression test went red then green, and the fix-owned files are committed on the feature branch. Nothing was pushed.
|
|
53
|
+
- `diagnosed-no-fix`: the root cause is established but no safe convergent fix exists this run; `residuals` says why.
|
|
54
|
+
- `needs-human`: the fix would be divergent, or the causal chain could not be closed without a decision only a person can make; nothing applied; `residuals` carries the `decision_context` in the same typed residual contract `references/pipeline-mode.md` defines.
|
|
55
|
+
- `blocked`: a required read failed, a fix-owned file carried the user's edits, or the workspace could not be prepared; `blockers` names it and nothing was committed.
|
|
56
|
+
|
|
57
|
+
`pre_fix_scope` is present on every return and records what the branch and tree carried before the fix, as observed facts: the pre-fix `HEAD`, the files that were already dirty and are not fix-owned (the fix never touched them), and the commits beyond the default branch, pushed or not. It carries no verdict about what the user offered; the caller decides that, and this record is what it decides from. `issue_of_record` is `null` when the input carried no ticket. `verification_evidence` is present on every `fixed` return; when `behavior_change` is `false` (a pure test or tooling fix), `exception_reason` says why no red-then-green was possible. `residuals` is an empty array when there are none.
|