oh-my-opencode 4.3.1 → 4.5.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/.agents/command/get-unpublished-changes.md +148 -0
- package/.agents/command/omomomo.md +37 -0
- package/.agents/command/publish.md +376 -0
- package/.agents/command/remove-deadcode.md +221 -0
- package/.agents/command/security-research.md +16 -0
- package/.agents/skills/get-unpublished-changes/SKILL.md +24 -0
- package/.agents/skills/github-triage/SKILL.md +587 -0
- package/.agents/skills/github-triage/scripts/gh_fetch.py +398 -0
- package/.agents/skills/hyperplan/SKILL.md +450 -0
- package/.agents/skills/omomomo/SKILL.md +36 -0
- package/.agents/skills/pre-publish-review/SKILL.md +407 -0
- package/.agents/skills/publish/SKILL.md +428 -0
- package/.agents/skills/remove-deadcode/SKILL.md +216 -0
- package/.agents/skills/security-research/SKILL.md +204 -0
- package/.agents/skills/work-with-pr/SKILL.md +360 -0
- package/.agents/skills/work-with-pr-workspace/evals/evals.json +76 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.json +138 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +57 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +15 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +454 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +136 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +47 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +163 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +15 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +615 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +99 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +50 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +111 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +37 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +11 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +205 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +78 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +87 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +11 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +334 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +86 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +23 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +119 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +221 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +104 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +41 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +84 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +342 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +131 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +39 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +128 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +143 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +82 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +51 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +69 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +252 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +83 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +33 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +101 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +387 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +112 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +51 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +75 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +529 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +127 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +120 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/review.html +1326 -0
- package/.opencode/command/get-unpublished-changes.md +148 -0
- package/.opencode/command/omomomo.md +37 -0
- package/.opencode/command/publish.md +376 -0
- package/.opencode/command/remove-deadcode.md +221 -0
- package/.opencode/command/security-research.md +16 -0
- package/.opencode/skills/github-triage/SKILL.md +587 -0
- package/.opencode/skills/github-triage/scripts/gh_fetch.py +398 -0
- package/.opencode/skills/hyperplan/SKILL.md +450 -0
- package/.opencode/skills/pre-publish-review/SKILL.md +407 -0
- package/.opencode/skills/work-with-pr/SKILL.md +360 -0
- package/.opencode/skills/work-with-pr-workspace/evals/evals.json +76 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.json +138 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +57 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +15 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +454 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +136 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +47 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +163 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +15 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +615 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +99 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +50 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +111 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +37 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +11 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +205 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +78 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +87 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +11 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +334 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +86 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +23 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +119 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +221 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +104 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +41 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +84 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +342 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +131 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +39 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +128 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +143 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +82 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +51 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +69 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +252 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +83 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +33 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +101 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +387 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +112 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +51 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +75 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +529 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +127 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +120 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/review.html +1326 -0
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/dist/agents/atlas/agent.d.ts +6 -6
- package/dist/agents/prometheus/gemini.d.ts +0 -11
- package/dist/agents/prometheus/gpt.d.ts +0 -10
- package/dist/agents/prometheus/system-prompt.d.ts +2 -20
- package/dist/agents/types.d.ts +1 -16
- package/dist/cli/index.js +60 -20
- package/dist/config/schema/agent-names.d.ts +3 -3
- package/dist/config/schema/agent-overrides.d.ts +208 -208
- package/dist/config/schema/categories.d.ts +28 -28
- package/dist/config/schema/fallback-models.d.ts +20 -20
- package/dist/config/schema/oh-my-opencode-config.d.ts +208 -208
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +19 -0
- package/dist/features/background-agent/parent-wake-notifier.d.ts +8 -19
- package/dist/help/schema/acp.d.ts +95 -0
- package/dist/help/schema/doctor.d.ts +147 -0
- package/dist/help/schema/sandbox.d.ts +74 -0
- package/dist/help/schema/status.d.ts +139 -0
- package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/hyperplan/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/team/default.d.ts +2 -7
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -9
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -16
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -10
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -5
- package/dist/hooks/ralph-loop/no-progress-turn-detector.d.ts +7 -0
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +1 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +1 -0
- package/dist/hooks/tool-pair-validator/hook.d.ts +6 -1
- package/dist/index.js +51976 -50299
- package/dist/plugin-handlers/provider-config-handler.d.ts +1 -0
- package/dist/shared/migration/model-versions.d.ts +6 -0
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -0
- package/dist/shared/prompt-async-gate/types.d.ts +4 -3
- package/package.json +19 -13
- package/dist/agents/atlas/default-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/default.d.ts +0 -2
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/gemini.d.ts +0 -2
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/gpt.d.ts +0 -2
- package/dist/agents/atlas/kimi-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/kimi.d.ts +0 -2
- package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/opus-4-7.d.ts +0 -2
- package/dist/agents/atlas/shared-prompt.d.ts +0 -9
- package/dist/agents/prometheus/behavioral-summary.d.ts +0 -6
- package/dist/agents/prometheus/high-accuracy-mode.d.ts +0 -6
- package/dist/agents/prometheus/identity-constraints.d.ts +0 -7
- package/dist/agents/prometheus/interview-mode.d.ts +0 -7
- package/dist/agents/prometheus/plan-generation.d.ts +0 -7
- package/dist/agents/prometheus/plan-template.d.ts +0 -7
- package/dist/agents/prometheus/spec-driven-mode.d.ts +0 -7
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: publish
|
|
3
|
+
description: "Publish oh-my-opencode to npm via GitHub Actions workflow. Argument: <patch|minor|major>. Triggers: publish, release, deploy, npm publish."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the release manager for oh-my-opencode. Execute the FULL publish workflow from start to finish.
|
|
7
|
+
|
|
8
|
+
## CRITICAL: FULL WORKFLOW MEANS DISCORD TOO
|
|
9
|
+
|
|
10
|
+
Publishing is not complete until the Discord release announcement has been attempted.
|
|
11
|
+
|
|
12
|
+
- **DO NOT stop after creating the GitHub release.**
|
|
13
|
+
- **DO NOT stop after drafting or applying release notes.**
|
|
14
|
+
- **DO NOT wait for a second user acknowledgement if the user already confirmed the publish.**
|
|
15
|
+
- After the release notes are finalized, immediately run Step 7.5 and post to Discord.
|
|
16
|
+
- If Discord posting fails after authentication/retry, report the failure clearly and continue the remaining verification steps. A skipped Discord step is a workflow failure.
|
|
17
|
+
|
|
18
|
+
## CRITICAL: ARGUMENT REQUIREMENT
|
|
19
|
+
|
|
20
|
+
**You MUST receive a version bump type from the user.** Valid options:
|
|
21
|
+
- `patch`: Bug fixes, backward-compatible (1.1.7 → 1.1.8)
|
|
22
|
+
- `minor`: New features, backward-compatible (1.1.7 → 1.2.0)
|
|
23
|
+
- `major`: Breaking changes (1.1.7 → 2.0.0)
|
|
24
|
+
|
|
25
|
+
**If the user did not provide a bump type argument, STOP IMMEDIATELY and ask:**
|
|
26
|
+
> "To proceed with deployment, please specify a version bump type: `patch`, `minor`, or `major`"
|
|
27
|
+
|
|
28
|
+
**DO NOT PROCEED without explicit user confirmation of bump type.**
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## STEP 0: REGISTER TODO LIST (MANDATORY FIRST ACTION)
|
|
33
|
+
|
|
34
|
+
**Before doing ANYTHING else**, create a detailed todo list using TodoWrite:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
[
|
|
38
|
+
{ "id": "confirm-bump", "content": "Confirm version bump type with user (patch/minor/major)", "status": "in_progress", "priority": "high" },
|
|
39
|
+
{ "id": "check-uncommitted", "content": "Check for uncommitted changes and commit if needed", "status": "pending", "priority": "high" },
|
|
40
|
+
{ "id": "sync-remote", "content": "Sync with remote (pull --rebase && push if unpushed commits)", "status": "pending", "priority": "high" },
|
|
41
|
+
{ "id": "run-workflow", "content": "Trigger GitHub Actions publish workflow", "status": "pending", "priority": "high" },
|
|
42
|
+
{ "id": "wait-workflow", "content": "Wait for workflow completion (poll every 30s)", "status": "pending", "priority": "high" },
|
|
43
|
+
{ "id": "verify-and-preview", "content": "Verify release created + preview auto-generated changelog & contributor thanks", "status": "pending", "priority": "high" },
|
|
44
|
+
{ "id": "draft-summary", "content": "Draft enhanced release summary (mandatory for all release types)", "status": "pending", "priority": "high" },
|
|
45
|
+
{ "id": "apply-summary", "content": "Prepend enhanced summary to release", "status": "pending", "priority": "high" },
|
|
46
|
+
{ "id": "discord-announce", "content": "MANDATORY: post release announcement to Discord channel immediately after release notes are finalized", "status": "pending", "priority": "high" },
|
|
47
|
+
{ "id": "verify-npm", "content": "Verify npm package published successfully", "status": "pending", "priority": "high" },
|
|
48
|
+
{ "id": "wait-platform-workflow", "content": "Wait for publish-platform workflow completion", "status": "pending", "priority": "high" },
|
|
49
|
+
{ "id": "verify-platform-binaries", "content": "Verify all 7 platform binary packages published", "status": "pending", "priority": "high" },
|
|
50
|
+
{ "id": "final-confirmation", "content": "Final confirmation to user with links", "status": "pending", "priority": "low" }
|
|
51
|
+
]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Mark each todo as `in_progress` when starting, `completed` when done. ONE AT A TIME.**
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## STEP 1: CONFIRM BUMP TYPE
|
|
59
|
+
|
|
60
|
+
If bump type provided as argument, confirm with user:
|
|
61
|
+
> "Version bump type: `{bump}`. Proceed? (y/n)"
|
|
62
|
+
|
|
63
|
+
Wait for user confirmation before proceeding.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## STEP 2: CHECK UNCOMMITTED CHANGES
|
|
68
|
+
|
|
69
|
+
Run: `git status --porcelain`
|
|
70
|
+
|
|
71
|
+
- If there are uncommitted changes, warn user and ask if they want to commit first
|
|
72
|
+
- If clean, proceed
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## STEP 2.5: SYNC WITH REMOTE (MANDATORY)
|
|
77
|
+
|
|
78
|
+
Check if there are unpushed commits:
|
|
79
|
+
```bash
|
|
80
|
+
git log origin/master..HEAD --oneline
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**If there are unpushed commits, you MUST sync before triggering workflow:**
|
|
84
|
+
```bash
|
|
85
|
+
git pull --rebase && git push
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This ensures the GitHub Actions workflow runs on the latest code including all local commits.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## STEP 3: TRIGGER GITHUB ACTIONS WORKFLOW
|
|
93
|
+
|
|
94
|
+
Run the publish workflow:
|
|
95
|
+
```bash
|
|
96
|
+
gh workflow run publish -f bump={bump_type}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Wait 3 seconds, then get the run ID:
|
|
100
|
+
```bash
|
|
101
|
+
gh run list --workflow=publish --limit=1 --json databaseId,status --jq '.[0]'
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## STEP 4: WAIT FOR WORKFLOW COMPLETION
|
|
107
|
+
|
|
108
|
+
Poll workflow status every 30 seconds until completion:
|
|
109
|
+
```bash
|
|
110
|
+
gh run view {run_id} --json status,conclusion --jq '{status: .status, conclusion: .conclusion}'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Status flow: `queued` → `in_progress` → `completed`
|
|
114
|
+
|
|
115
|
+
**IMPORTANT: Use polling loop, NOT sleep commands.**
|
|
116
|
+
|
|
117
|
+
If conclusion is `failure`, show error and stop:
|
|
118
|
+
```bash
|
|
119
|
+
gh run view {run_id} --log-failed
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## STEP 5: VERIFY RELEASE & PREVIEW AUTO-GENERATED CONTENT
|
|
125
|
+
|
|
126
|
+
Two goals: confirm the release exists, then show the user what the workflow already generated.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Pull latest (workflow committed version bump)
|
|
130
|
+
git pull --rebase
|
|
131
|
+
NEW_VERSION=$(node -p "require('./package.json').version")
|
|
132
|
+
|
|
133
|
+
# Verify release exists on GitHub
|
|
134
|
+
gh release view "v${NEW_VERSION}" --json tagName,url --jq '{tag: .tagName, url: .url}'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**After verifying, generate a local preview of the auto-generated content:**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bun run script/generate-changelog.ts
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
<agent-instruction>
|
|
144
|
+
After running the preview, present the output to the user and say:
|
|
145
|
+
|
|
146
|
+
> **The following content is ALREADY included in the release automatically:**
|
|
147
|
+
> - Commit changelog (grouped by feat/fix/refactor)
|
|
148
|
+
> - Contributor thank-you messages (for non-team contributors)
|
|
149
|
+
>
|
|
150
|
+
> You do NOT need to write any of this. It's handled.
|
|
151
|
+
>
|
|
152
|
+
> **For all release types**, an enhanced summary is **required** — I'll draft one in the next step.
|
|
153
|
+
|
|
154
|
+
Wait for the user to acknowledge before proceeding.
|
|
155
|
+
|
|
156
|
+
If the user already confirmed the publish workflow and did not explicitly ask to review the generated changelog before release-note editing, treat the publish confirmation as sufficient acknowledgement and continue. Do not end the assistant turn here.
|
|
157
|
+
</agent-instruction>
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## STEP 6: DRAFT ENHANCED RELEASE SUMMARY
|
|
162
|
+
|
|
163
|
+
<decision-gate>
|
|
164
|
+
|
|
165
|
+
| Release Type | Action |
|
|
166
|
+
|-------------|--------|
|
|
167
|
+
| **patch** | MANDATORY. Draft a concise bug-fix / change summary. Do NOT proceed without one. |
|
|
168
|
+
| **minor** | MANDATORY. Draft a concise feature summary. Do NOT proceed without one. |
|
|
169
|
+
| **major** | MANDATORY. Draft a full release narrative with migration notes if applicable. Do NOT proceed without one. |
|
|
170
|
+
|
|
171
|
+
</decision-gate>
|
|
172
|
+
|
|
173
|
+
### What You're Writing (and What You're NOT)
|
|
174
|
+
|
|
175
|
+
You are writing the **headline layer** — a product announcement that sits ABOVE the auto-generated commit log. Think "release blog post", not "git log".
|
|
176
|
+
|
|
177
|
+
<rules>
|
|
178
|
+
- NEVER duplicate commit messages. The auto-generated section already lists every commit.
|
|
179
|
+
- NEVER write generic filler like "Various bug fixes and improvements" or "Several enhancements".
|
|
180
|
+
- ALWAYS focus on USER IMPACT: what can users DO now that they couldn't before?
|
|
181
|
+
- ALWAYS group by THEME or CAPABILITY, not by commit type (feat/fix/refactor).
|
|
182
|
+
- ALWAYS use concrete language: "You can now do X" not "Added X feature".
|
|
183
|
+
</rules>
|
|
184
|
+
|
|
185
|
+
<examples>
|
|
186
|
+
<bad title="Commit regurgitation — DO NOT do this">
|
|
187
|
+
## What's New
|
|
188
|
+
- feat(auth): add JWT refresh token rotation
|
|
189
|
+
- fix(auth): handle expired token edge case
|
|
190
|
+
- refactor(auth): extract middleware
|
|
191
|
+
</bad>
|
|
192
|
+
|
|
193
|
+
<good title="User-impact narrative — DO this">
|
|
194
|
+
## 🔐 Smarter Authentication
|
|
195
|
+
|
|
196
|
+
Token refresh is now automatic and seamless. Sessions no longer expire mid-task — the system silently rotates credentials in the background. If you've been frustrated by random logouts, this release fixes that.
|
|
197
|
+
</good>
|
|
198
|
+
|
|
199
|
+
<bad title="Vague filler — DO NOT do this">
|
|
200
|
+
## Improvements
|
|
201
|
+
- Various performance improvements
|
|
202
|
+
- Bug fixes and stability enhancements
|
|
203
|
+
</bad>
|
|
204
|
+
|
|
205
|
+
<good title="Specific and measurable — DO this">
|
|
206
|
+
## ⚡ 3x Faster Rule Parsing
|
|
207
|
+
|
|
208
|
+
Rules are now cached by file modification time. If your project has 50+ rule files, you'll notice startup is noticeably faster — we measured a 3x improvement in our test suite.
|
|
209
|
+
</good>
|
|
210
|
+
</examples>
|
|
211
|
+
|
|
212
|
+
### Drafting Process
|
|
213
|
+
|
|
214
|
+
1. **Analyze** the commit list from Step 5's preview. Identify 2-5 themes that matter to users.
|
|
215
|
+
2. **Write** the summary to `/tmp/release-summary-v${NEW_VERSION}.md`.
|
|
216
|
+
3. **Present** the draft to the user for review and approval before applying.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# Write your draft here
|
|
220
|
+
cat > /tmp/release-summary-v${NEW_VERSION}.md << 'SUMMARY_EOF'
|
|
221
|
+
{your_enhanced_summary}
|
|
222
|
+
SUMMARY_EOF
|
|
223
|
+
|
|
224
|
+
cat /tmp/release-summary-v${NEW_VERSION}.md
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
<agent-instruction>
|
|
228
|
+
After drafting, ask the user:
|
|
229
|
+
> "Here's the release summary I drafted. This will appear AT THE TOP of the release notes, above the auto-generated commit changelog and contributor thanks. Want me to adjust anything before applying?"
|
|
230
|
+
|
|
231
|
+
If the user already confirmed the publish workflow and did not explicitly request a release-note review hold, proceed to Step 7 after presenting the draft. Do not stop before Step 7.5, because the Discord announcement is mandatory.
|
|
232
|
+
</agent-instruction>
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## STEP 7: APPLY ENHANCED SUMMARY TO RELEASE
|
|
237
|
+
|
|
238
|
+
This step is MANDATORY. The enhanced summary from Step 6 must always be applied.
|
|
239
|
+
|
|
240
|
+
<architecture>
|
|
241
|
+
The final release note structure:
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
┌─────────────────────────────────────┐
|
|
245
|
+
│ Enhanced Summary (from Step 6) │ ← You wrote this
|
|
246
|
+
│ - Theme-based, user-impact focused │
|
|
247
|
+
├─────────────────────────────────────┤
|
|
248
|
+
│ --- (separator) │
|
|
249
|
+
├─────────────────────────────────────┤
|
|
250
|
+
│ Auto-generated Commit Changelog │ ← Workflow wrote this
|
|
251
|
+
│ - feat/fix/refactor grouped │
|
|
252
|
+
│ - Contributor thank-you messages │
|
|
253
|
+
└─────────────────────────────────────┘
|
|
254
|
+
```
|
|
255
|
+
</architecture>
|
|
256
|
+
|
|
257
|
+
<zero-content-loss-policy>
|
|
258
|
+
- Fetch the existing release body FIRST
|
|
259
|
+
- PREPEND your summary above it
|
|
260
|
+
- The existing auto-generated content must remain 100% INTACT
|
|
261
|
+
- NOT A SINGLE CHARACTER of existing content may be removed or modified
|
|
262
|
+
</zero-content-loss-policy>
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# 1. Fetch existing auto-generated body
|
|
266
|
+
EXISTING_BODY=$(gh release view "v${NEW_VERSION}" --json body --jq '.body')
|
|
267
|
+
|
|
268
|
+
# 2. Combine: enhanced summary on top, auto-generated below
|
|
269
|
+
{
|
|
270
|
+
cat /tmp/release-summary-v${NEW_VERSION}.md
|
|
271
|
+
echo ""
|
|
272
|
+
echo "---"
|
|
273
|
+
echo ""
|
|
274
|
+
echo "$EXISTING_BODY"
|
|
275
|
+
} > /tmp/final-release-v${NEW_VERSION}.md
|
|
276
|
+
|
|
277
|
+
# 3. Update the release (additive only)
|
|
278
|
+
gh release edit "v${NEW_VERSION}" --notes-file /tmp/final-release-v${NEW_VERSION}.md
|
|
279
|
+
|
|
280
|
+
# 4. Confirm
|
|
281
|
+
echo "✅ Release v${NEW_VERSION} updated with enhanced summary."
|
|
282
|
+
gh release view "v${NEW_VERSION}" --json url --jq '.url'
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## STEP 7.5: POST RELEASE NOTES TO DISCORD
|
|
288
|
+
|
|
289
|
+
After the release notes are finalized, post them to the Discord channel. This step is mandatory for every publish run.
|
|
290
|
+
|
|
291
|
+
<hard-gate>
|
|
292
|
+
The workflow is not complete until this step has either:
|
|
293
|
+
1. Sent a Discord message successfully and recorded the message ID, or
|
|
294
|
+
2. Failed after `agent-discordbot auth status` plus one send retry, with the Jobdori bot-token failure reported to the user.
|
|
295
|
+
|
|
296
|
+
Never skip this step because the release summary was awaiting approval. If the user already confirmed the publish, continue through Discord before stopping.
|
|
297
|
+
</hard-gate>
|
|
298
|
+
|
|
299
|
+
<agent-discord-instruction>
|
|
300
|
+
1. Use the Jobdori bot token through `agent-discordbot` for release announcements. This is the required release path; do not use the personal `agent-discord` token unless the bot path is unavailable and the user explicitly approves the fallback. Pin the bot id so release messages go out as the Jobdori bot even if the local `agent-discordbot` current bot changes.
|
|
301
|
+
```bash
|
|
302
|
+
JOBDORI_BOT_ID=1486173823354146917
|
|
303
|
+
agent-discordbot auth status --bot "$JOBDORI_BOT_ID"
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
2. **Read recent messages** in the channel to match the existing announcement style:
|
|
307
|
+
```bash
|
|
308
|
+
JOBDORI_BOT_ID=1486173823354146917
|
|
309
|
+
agent-discordbot message list 1454708427392680067 --bot "$JOBDORI_BOT_ID" --limit 5
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
3. If `agent-discordbot` is unavailable or unauthorized, stop and report that the Jobdori token path failed. Only then may a human decide whether to use `agent-discord`.
|
|
313
|
+
|
|
314
|
+
4. Post the release announcement to channel `1454708427392680067` matching the style of previous announcements. The message should follow this structure:
|
|
315
|
+
```
|
|
316
|
+
@here
|
|
317
|
+
|
|
318
|
+
🎉 **oh-my-opencode v{VERSION} — {Short Tagline}**
|
|
319
|
+
|
|
320
|
+
**Feature 1** — one-line description.
|
|
321
|
+
|
|
322
|
+
**Feature 2** — one-line description.
|
|
323
|
+
|
|
324
|
+
**Feature 3** — one-line description.
|
|
325
|
+
|
|
326
|
+
Plus {summary of remaining changes}.
|
|
327
|
+
|
|
328
|
+
📦 Install / upgrade:
|
|
329
|
+
`bun i -g oh-my-opencode@{VERSION}` (or `npm`)
|
|
330
|
+
|
|
331
|
+
📝 Full release notes: {RELEASE_URL}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
JOBDORI_BOT_ID=1486173823354146917
|
|
336
|
+
RELEASE_URL=$(gh release view "v${NEW_VERSION}" --json url --jq '.url')
|
|
337
|
+
agent-discordbot message send 1454708427392680067 "{your message following the style above}" --bot "$JOBDORI_BOT_ID"
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
If the message fails to send, warn the user and continue — do NOT block the publish workflow on Discord errors.
|
|
341
|
+
</agent-discord-instruction>
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## STEP 8: VERIFY NPM PUBLICATION
|
|
346
|
+
|
|
347
|
+
Poll npm registry until the new version appears:
|
|
348
|
+
```bash
|
|
349
|
+
npm view oh-my-opencode version
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Compare with expected version. If not matching after 2 minutes, warn user about npm propagation delay.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## STEP 8.5: WAIT FOR PLATFORM WORKFLOW COMPLETION
|
|
357
|
+
|
|
358
|
+
The main publish workflow triggers a separate `publish-platform` workflow for platform-specific binaries.
|
|
359
|
+
|
|
360
|
+
1. Find the publish-platform workflow run triggered by the main workflow:
|
|
361
|
+
```bash
|
|
362
|
+
gh run list --workflow=publish-platform --limit=1 --json databaseId,status,conclusion --jq '.[0]'
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
2. Poll workflow status every 30 seconds until completion:
|
|
366
|
+
```bash
|
|
367
|
+
gh run view {platform_run_id} --json status,conclusion --jq '{status: .status, conclusion: .conclusion}'
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**IMPORTANT: Use polling loop, NOT sleep commands.**
|
|
371
|
+
|
|
372
|
+
If conclusion is `failure`, show error logs:
|
|
373
|
+
```bash
|
|
374
|
+
gh run view {platform_run_id} --log-failed
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## STEP 8.6: VERIFY PLATFORM BINARY PACKAGES
|
|
380
|
+
|
|
381
|
+
After publish-platform workflow completes, verify all 7 platform packages are published:
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
PLATFORMS="darwin-arm64 darwin-x64 linux-x64 linux-arm64 linux-x64-musl linux-arm64-musl windows-x64"
|
|
385
|
+
for PLATFORM in $PLATFORMS; do
|
|
386
|
+
npm view "oh-my-opencode-${PLATFORM}" version
|
|
387
|
+
done
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
All 7 packages should show the same version as the main package (`${NEW_VERSION}`).
|
|
391
|
+
|
|
392
|
+
**Expected packages:**
|
|
393
|
+
| Package | Description |
|
|
394
|
+
|---------|-------------|
|
|
395
|
+
| `oh-my-opencode-darwin-arm64` | macOS Apple Silicon |
|
|
396
|
+
| `oh-my-opencode-darwin-x64` | macOS Intel |
|
|
397
|
+
| `oh-my-opencode-linux-x64` | Linux x64 (glibc) |
|
|
398
|
+
| `oh-my-opencode-linux-arm64` | Linux ARM64 (glibc) |
|
|
399
|
+
| `oh-my-opencode-linux-x64-musl` | Linux x64 (musl/Alpine) |
|
|
400
|
+
| `oh-my-opencode-linux-arm64-musl` | Linux ARM64 (musl/Alpine) |
|
|
401
|
+
| `oh-my-opencode-windows-x64` | Windows x64 |
|
|
402
|
+
|
|
403
|
+
If any platform package version doesn't match, warn the user and suggest checking the publish-platform workflow logs.
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## STEP 9: FINAL CONFIRMATION
|
|
408
|
+
|
|
409
|
+
Report success to user with:
|
|
410
|
+
- New version number
|
|
411
|
+
- GitHub release URL: https://github.com/code-yeongyu/oh-my-opencode/releases/tag/v{version}
|
|
412
|
+
- npm package URL: https://www.npmjs.com/package/oh-my-opencode
|
|
413
|
+
- Platform packages status: List all 7 platform packages with their versions
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## ERROR HANDLING
|
|
418
|
+
|
|
419
|
+
- **Workflow fails**: Show failed logs, suggest checking Actions tab
|
|
420
|
+
- **Release not found**: Wait and retry, may be propagation delay
|
|
421
|
+
- **npm not updated**: npm can take 1-5 minutes to propagate, inform user
|
|
422
|
+
- **Permission denied**: User may need to re-authenticate with `gh auth login`
|
|
423
|
+
- **Platform workflow fails**: Show logs from publish-platform workflow, check which platform failed
|
|
424
|
+
- **Platform package missing**: Some platforms may fail due to cross-compilation issues, suggest re-running publish-platform workflow manually
|
|
425
|
+
|
|
426
|
+
## LANGUAGE
|
|
427
|
+
|
|
428
|
+
Respond to user in English.
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remove-deadcode
|
|
3
|
+
description: "Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic commits. Triggers: remove dead code, dead code, cleanup, remove unused."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Dead code removal via massively parallel deep agents. You are the ORCHESTRATOR — you scan, verify, batch, then delegate ALL removals to parallel agents.
|
|
8
|
+
|
|
9
|
+
<rules>
|
|
10
|
+
- **LSP is law.** Verify with `LspFindReferences(includeDeclaration=false)` before ANY removal decision.
|
|
11
|
+
- **Never remove entry points.** `src/index.ts`, `src/cli/index.ts`, test files, config files, `packages/` — off-limits.
|
|
12
|
+
- **You do NOT remove code yourself.** You scan, verify, batch, then fire deep agents. They do the work.
|
|
13
|
+
</rules>
|
|
14
|
+
|
|
15
|
+
<false-positive-guards>
|
|
16
|
+
NEVER mark as dead:
|
|
17
|
+
- Symbols in `src/index.ts` or barrel `index.ts` re-exports
|
|
18
|
+
- Symbols referenced in test files (tests are valid consumers)
|
|
19
|
+
- Symbols with `@public` / `@api` JSDoc tags
|
|
20
|
+
- Hook factories (`createXXXHook`), tool factories (`createXXXTool`), agent definitions in `agentSources`
|
|
21
|
+
- Command templates, skill definitions, MCP configs
|
|
22
|
+
- Symbols in `package.json` exports
|
|
23
|
+
</false-positive-guards>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## PHASE 1: SCAN — Find Dead Code Candidates
|
|
28
|
+
|
|
29
|
+
Run ALL of these in parallel:
|
|
30
|
+
|
|
31
|
+
<parallel-scan>
|
|
32
|
+
|
|
33
|
+
**TypeScript strict mode (your primary scanner — run this FIRST):**
|
|
34
|
+
```bash
|
|
35
|
+
bunx tsc --noEmit --noUnusedLocals --noUnusedParameters 2>&1
|
|
36
|
+
```
|
|
37
|
+
This gives you the definitive list of unused locals, imports, parameters, and types with exact file:line locations.
|
|
38
|
+
|
|
39
|
+
**Explore agents (fire ALL simultaneously as background):**
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
task(subagent_type="explore", run_in_background=true, load_skills=[],
|
|
43
|
+
description="Find orphaned files",
|
|
44
|
+
prompt="Find files in src/ NOT imported by any other file. Check all import statements. EXCLUDE: index.ts, *.test.ts, entry points, .md, packages/. Return: file paths.")
|
|
45
|
+
|
|
46
|
+
task(subagent_type="explore", run_in_background=true, load_skills=[],
|
|
47
|
+
description="Find unused exported symbols",
|
|
48
|
+
prompt="Find exported functions/types/constants in src/ that are never imported by other files. Cross-reference: for each export, grep the symbol name across src/ — if it only appears in its own file, it's a candidate. EXCLUDE: src/index.ts exports, test files. Return: file path, line, symbol name, export type.")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
</parallel-scan>
|
|
52
|
+
|
|
53
|
+
Collect all results into a master candidate list.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## PHASE 2: VERIFY — LSP Confirmation (Zero False Positives)
|
|
58
|
+
|
|
59
|
+
For EACH candidate from Phase 1:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
LspFindReferences(filePath, line, character, includeDeclaration=false)
|
|
63
|
+
// 0 references → CONFIRMED dead
|
|
64
|
+
// 1+ references → NOT dead, drop from list
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Also apply the false-positive-guards above. Produce a confirmed list:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
| # | File | Symbol | Type | Action |
|
|
71
|
+
|---|------|--------|------|--------|
|
|
72
|
+
| 1 | src/foo.ts:42 | unusedFunc | function | REMOVE |
|
|
73
|
+
| 2 | src/bar.ts:10 | OldType | type | REMOVE |
|
|
74
|
+
| 3 | src/baz.ts:7 | ctx | parameter | PREFIX _ |
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Action types:**
|
|
78
|
+
- `REMOVE` — delete the symbol/import/file entirely
|
|
79
|
+
- `PREFIX _` — unused function parameter required by signature → rename to `_paramName`
|
|
80
|
+
|
|
81
|
+
If ZERO confirmed: report "No dead code found" and STOP.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## PHASE 3: BATCH — Group by File for Conflict-Free Parallelism
|
|
86
|
+
|
|
87
|
+
<batching-rules>
|
|
88
|
+
|
|
89
|
+
**Goal: maximize parallel agents with ZERO git conflicts.**
|
|
90
|
+
|
|
91
|
+
1. Group confirmed dead code items by FILE PATH
|
|
92
|
+
2. All items in the SAME file go to the SAME batch (prevents two agents editing the same file)
|
|
93
|
+
3. If a dead FILE (entire file deletion) exists, it's its own batch
|
|
94
|
+
4. Target 5-15 batches. If fewer than 5 items total, use 1 batch per item.
|
|
95
|
+
|
|
96
|
+
**Example batching:**
|
|
97
|
+
```
|
|
98
|
+
Batch A: [src/hooks/foo/hook.ts — 3 unused imports]
|
|
99
|
+
Batch B: [src/features/bar/manager.ts — 2 unused constants, 1 dead function]
|
|
100
|
+
Batch C: [src/tools/baz/tool.ts — 1 unused param, src/tools/baz/types.ts — 1 unused type]
|
|
101
|
+
Batch D: [src/dead-file.ts — entire file deletion]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Files in the same directory CAN be batched together (they won't conflict as long as no two agents edit the same file). Maximize batch count for parallelism.
|
|
105
|
+
|
|
106
|
+
</batching-rules>
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## PHASE 4: EXECUTE — Fire Parallel Deep Agents
|
|
111
|
+
|
|
112
|
+
For EACH batch, fire a deep agent:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
task(
|
|
116
|
+
category="deep",
|
|
117
|
+
load_skills=["typescript-programmer", "git-master"],
|
|
118
|
+
run_in_background=true,
|
|
119
|
+
description="Remove dead code batch N: [brief description]",
|
|
120
|
+
prompt="[see template below]"
|
|
121
|
+
)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
<agent-prompt-template>
|
|
125
|
+
|
|
126
|
+
Every deep agent gets this prompt structure (fill in the specifics per batch):
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
## TASK: Remove dead code from [file list]
|
|
130
|
+
|
|
131
|
+
## DEAD CODE TO REMOVE
|
|
132
|
+
|
|
133
|
+
### [file path] line [N]
|
|
134
|
+
- Symbol: `[name]` — [type: unused import / unused constant / unused function / unused parameter / dead file]
|
|
135
|
+
- Action: [REMOVE entirely / REMOVE from import list / PREFIX with _]
|
|
136
|
+
|
|
137
|
+
### [file path] line [N]
|
|
138
|
+
- ...
|
|
139
|
+
|
|
140
|
+
## PROTOCOL
|
|
141
|
+
|
|
142
|
+
1. Read each file to understand exact syntax at the target lines
|
|
143
|
+
2. For each symbol, run LspFindReferences to RE-VERIFY it's still dead (another agent may have changed things)
|
|
144
|
+
3. Apply the change:
|
|
145
|
+
- Unused import (only symbol in line): remove entire import line
|
|
146
|
+
- Unused import (one of many): remove only that symbol from the import list
|
|
147
|
+
- Unused constant/function/type: remove the declaration. Clean up trailing blank lines.
|
|
148
|
+
- Unused parameter: prefix with `_` (do NOT remove — required by signature)
|
|
149
|
+
- Dead file: delete with `rm`
|
|
150
|
+
4. After ALL edits in this batch, run: `bun run typecheck`
|
|
151
|
+
5. If typecheck fails: `git checkout -- [files]` and report failure
|
|
152
|
+
6. If typecheck passes: stage ONLY your files and commit:
|
|
153
|
+
`git add [your-specific-files] && git commit -m "refactor: remove dead code from [brief file list]"`
|
|
154
|
+
7. Report what you removed and the commit hash
|
|
155
|
+
|
|
156
|
+
## CRITICAL
|
|
157
|
+
- Stage ONLY your batch's files (`git add [specific files]`). NEVER `git add -A` — other agents are working in parallel.
|
|
158
|
+
- If typecheck fails after your edits, REVERT all changes and report. Do not attempt to fix.
|
|
159
|
+
- Pre-existing test failures in other files are expected. Only typecheck matters for your batch.
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
</agent-prompt-template>
|
|
163
|
+
|
|
164
|
+
Fire ALL batches simultaneously. Wait for all to complete.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## PHASE 5: FINAL VERIFICATION
|
|
169
|
+
|
|
170
|
+
After ALL agents complete:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
bun run typecheck # must pass
|
|
174
|
+
bun test # note any NEW failures vs pre-existing
|
|
175
|
+
bun run build # must pass
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Produce summary:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
## Dead Code Removal Complete
|
|
182
|
+
|
|
183
|
+
### Removed
|
|
184
|
+
| # | Symbol | File | Type | Commit | Agent |
|
|
185
|
+
|---|--------|------|------|--------|-------|
|
|
186
|
+
| 1 | unusedFunc | src/foo.ts | function | abc1234 | Batch A |
|
|
187
|
+
|
|
188
|
+
### Skipped (agent reported failure)
|
|
189
|
+
| # | Symbol | File | Reason |
|
|
190
|
+
|---|--------|------|--------|
|
|
191
|
+
|
|
192
|
+
### Verification
|
|
193
|
+
- Typecheck: PASS/FAIL
|
|
194
|
+
- Tests: X passing, Y failing (Z pre-existing)
|
|
195
|
+
- Build: PASS/FAIL
|
|
196
|
+
- Total removed: N symbols across M files
|
|
197
|
+
- Total commits: K atomic commits
|
|
198
|
+
- Parallel agents used: P
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## SCOPE CONTROL
|
|
204
|
+
|
|
205
|
+
If `$ARGUMENTS` is provided, narrow the scan:
|
|
206
|
+
- File path → only that file
|
|
207
|
+
- Directory → only that directory
|
|
208
|
+
- Symbol name → only that symbol
|
|
209
|
+
- `all` or empty → full project scan (default)
|
|
210
|
+
|
|
211
|
+
## ABORT CONDITIONS
|
|
212
|
+
|
|
213
|
+
STOP and report if:
|
|
214
|
+
- More than 50 candidates found (ask user to narrow scope or confirm proceeding)
|
|
215
|
+
- Build breaks and cannot be fixed by reverting
|
|
216
|
+
|