feat: /optimize --continue überspringt Implementierungsphase

This commit is contained in:
Dieter Schlüter 2026-05-20 01:42:26 +02:00
commit 7cb299ff66
5 changed files with 43 additions and 14 deletions

View file

@ -277,11 +277,14 @@ Empfohlene Sofortmaßnahmen: keine
### Syntax ### Syntax
``` ```
/optimize <auftrag> [--rounds N] [--with-doku] /optimize <auftrag> [--rounds N] [--with-doku] [--continue]
``` ```
- `--rounds N` — maximale Anzahl Runden (Standard: 3) - `--rounds N` — maximale Anzahl Runden (Standard: 3)
- `--with-doku` — nach SHIP automatisch `/update_doku` ausführen - `--with-doku` — nach SHIP automatisch `/update_doku` ausführen
- `--continue` — überspringt die Implementierungsphase und startet direkt mit dem
Judge→Fix-Zyklus ab dem aktuellen Code-Stand. Nützlich wenn man bereits manuell
`/coder`, `/judge` und `/fix` durchgeführt hat und den Rest automatisieren möchte.
### Beispiel: einfacher Auftrag ### Beispiel: einfacher Auftrag
@ -319,6 +322,26 @@ Nach SHIP werden automatisch ausgeführt:
2. README.md schreiben 2. README.md schreiben
3. BEDIENUNGSANLEITUNG.md schreiben 3. BEDIENUNGSANLEITUNG.md schreiben
### Vom manuellen Workflow in den automatischen wechseln
Du hast bereits `/coder`, `/judge` und `/fix` manuell durchgeführt und möchtest
den Rest automatisch ablaufen lassen:
```
/optimize --continue
```
```
/optimize --continue --rounds 5
```
```
/optimize --continue --with-doku
```
Die Implementierungsphase wird übersprungen — der Judge prüft sofort den aktuellen
Stand und der Fix-Zyklus läuft automatisch bis PASS oder max. N Runden.
### Loop-Erkennung ### Loop-Erkennung
Wenn zweimal hintereinander genau dieselben Blocker auftreten, bricht `/optimize` ab: Wenn zweimal hintereinander genau dieselben Blocker auftreten, bricht `/optimize` ab:

View file

@ -283,6 +283,7 @@ wenn pi agent Folgeanfragen schnell hintereinander schickt.
| `/fix [hinweis]` | Coder | Judge-Kritik beheben, committen | | `/fix [hinweis]` | Coder | Judge-Kritik beheben, committen |
| `/shipit` | Judge | Finale Freigabeprüfung | | `/shipit` | Judge | Finale Freigabeprüfung |
| `/optimize <auftrag> [--rounds N] [--with-doku]` | beide | Vollautomatische Schleife bis PASS | | `/optimize <auftrag> [--rounds N] [--with-doku]` | beide | Vollautomatische Schleife bis PASS |
| `/optimize --continue [--rounds N] [--with-doku]` | beide | Judge→Fix-Schleife ab aktuellem Stand (überspringt Implementierung) |
| `/patch <änderung>` | Coder | Gezielte Minimaländerung ohne Review | | `/patch <änderung>` | Coder | Gezielte Minimaländerung ohne Review |
| `/quick_check [was]` | Judge | Schnelle Prüfung der letzten Änderung | | `/quick_check [was]` | Judge | Schnelle Prüfung der letzten Änderung |
| `/update_doku` | Coder | Code kommentieren + README + Bedienungsanleitung | | `/update_doku` | Coder | Code kommentieren + README + Bedienungsanleitung |

Binary file not shown.

Binary file not shown.

View file

@ -547,31 +547,36 @@ export default function (pi: ExtensionAPI) {
// ── Automatische Optimierungsschleife ──────────────────────────────────── // ── Automatische Optimierungsschleife ────────────────────────────────────
pi.registerCommand("optimize", { pi.registerCommand("optimize", {
description: "Coder→Judge→Fix-Schleife bis PASS + optional Doku. /optimize <auftrag> [--rounds N] [--with-doku]", description: "Coder→Judge→Fix-Schleife bis PASS + optional Doku. /optimize <auftrag> [--rounds N] [--with-doku] [--continue]",
handler: async function (args: string, ctx: ExtensionCommandContext) { handler: async function (args: string, ctx: ExtensionCommandContext) {
const roundsMatch = (args || "").match(/--rounds\s+(\d+)/); const roundsMatch = (args || "").match(/--rounds\s+(\d+)/);
const maxRounds = roundsMatch ? Math.max(1, parseInt(roundsMatch[1], 10)) : 3; const maxRounds = roundsMatch ? Math.max(1, parseInt(roundsMatch[1], 10)) : 3;
const withDoku = /--with-doku/.test(args || ""); const withDoku = /--with-doku/.test(args || "");
const continueMode = /--continue/.test(args || "");
const task = (args || "") const task = (args || "")
.replace(/--rounds\s+\d+/, "") .replace(/--rounds\s+\d+/, "")
.replace(/--with-doku/, "") .replace(/--with-doku/, "")
.replace(/--continue/, "")
.trim(); .trim();
if (!task) { if (!continueMode && !task) {
ctx.ui.notify("Benutzung: /optimize <auftrag> [--rounds N] [--with-doku]", "error"); ctx.ui.notify("Benutzung: /optimize <auftrag> [--rounds N] [--with-doku] [--continue]", "error");
return; return;
} }
// TASK.md anlegen if (continueMode) {
await writeTaskMd(pi, ctx, task); // --continue: Implementierungsphase überspringen, direkt in Judge→Fix-Schleife
ctx.ui.setStatus("optimize", `Setze fort (max ${maxRounds} Runden Judge→Fix)…`);
ctx.ui.setStatus("optimize", `Starte Optimierung (max ${maxRounds} Runden)…`); ctx.ui.notify("--continue: Überspringe Implementierung, starte direkt mit Judge-Prüfung.", "info");
} else {
// Phase 1: Initiale Implementierung // TASK.md anlegen und Implementierung starten
ctx.ui.setStatus("optimize", "Phase 1: Coder implementiert…"); await writeTaskMd(pi, ctx, task);
await switchModel(pi, ctx, "llama-cpp-coder", "qwen3.5-coder"); ctx.ui.setStatus("optimize", `Starte Optimierung (max ${maxRounds} Runden)…`);
await sendAndWait(pi, ctx, coderKickoff(task)); ctx.ui.setStatus("optimize", "Phase 1: Coder implementiert…");
await tickTaskMdStatus(pi, ctx, "Implementierung"); await switchModel(pi, ctx, "llama-cpp-coder", "qwen3.5-coder");
await sendAndWait(pi, ctx, coderKickoff(task));
await tickTaskMdStatus(pi, ctx, "Implementierung");
}
let lastBlockers = ""; let lastBlockers = "";
let verdict = ""; let verdict = "";