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
```
/optimize <auftrag> [--rounds N] [--with-doku]
/optimize <auftrag> [--rounds N] [--with-doku] [--continue]
```
- `--rounds N` — maximale Anzahl Runden (Standard: 3)
- `--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
@ -319,6 +322,26 @@ Nach SHIP werden automatisch ausgeführt:
2. README.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
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 |
| `/shipit` | Judge | Finale Freigabeprüfung |
| `/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 |
| `/quick_check [was]` | Judge | Schnelle Prüfung der letzten Änderung |
| `/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 ────────────────────────────────────
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) {
const roundsMatch = (args || "").match(/--rounds\s+(\d+)/);
const maxRounds = roundsMatch ? Math.max(1, parseInt(roundsMatch[1], 10)) : 3;
const withDoku = /--with-doku/.test(args || "");
const continueMode = /--continue/.test(args || "");
const task = (args || "")
.replace(/--rounds\s+\d+/, "")
.replace(/--with-doku/, "")
.replace(/--continue/, "")
.trim();
if (!task) {
ctx.ui.notify("Benutzung: /optimize <auftrag> [--rounds N] [--with-doku]", "error");
if (!continueMode && !task) {
ctx.ui.notify("Benutzung: /optimize <auftrag> [--rounds N] [--with-doku] [--continue]", "error");
return;
}
// TASK.md anlegen
await writeTaskMd(pi, ctx, task);
ctx.ui.setStatus("optimize", `Starte Optimierung (max ${maxRounds} Runden)…`);
// Phase 1: Initiale Implementierung
ctx.ui.setStatus("optimize", "Phase 1: Coder implementiert…");
await switchModel(pi, ctx, "llama-cpp-coder", "qwen3.5-coder");
await sendAndWait(pi, ctx, coderKickoff(task));
await tickTaskMdStatus(pi, ctx, "Implementierung");
if (continueMode) {
// --continue: Implementierungsphase überspringen, direkt in Judge→Fix-Schleife
ctx.ui.setStatus("optimize", `Setze fort (max ${maxRounds} Runden Judge→Fix)…`);
ctx.ui.notify("--continue: Überspringe Implementierung, starte direkt mit Judge-Prüfung.", "info");
} else {
// TASK.md anlegen und Implementierung starten
await writeTaskMd(pi, ctx, task);
ctx.ui.setStatus("optimize", `Starte Optimierung (max ${maxRounds} Runden)…`);
ctx.ui.setStatus("optimize", "Phase 1: Coder implementiert…");
await switchModel(pi, ctx, "llama-cpp-coder", "qwen3.5-coder");
await sendAndWait(pi, ctx, coderKickoff(task));
await tickTaskMdStatus(pi, ctx, "Implementierung");
}
let lastBlockers = "";
let verdict = "";