@oh-my-pi/pi-coding-agent 17.2.13 → 17.2.15
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/CHANGELOG.md +30 -0
- package/dist/{CHANGELOG-d8xh7keh.md → CHANGELOG-fk29zh06.md} +30 -0
- package/dist/cli.js +5114 -5417
- package/dist/types/cleanse/agent.d.ts +3 -0
- package/dist/types/cleanse/checkers.d.ts +21 -1
- package/dist/types/cleanse/index.d.ts +4 -0
- package/dist/types/cleanse/parsers.d.ts +3 -1
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/cleanse-picker.d.ts +17 -0
- package/dist/types/cli/command-help.d.ts +3 -0
- package/dist/types/cli/progress-reporter.d.ts +19 -0
- package/dist/types/commands/cleanse.d.ts +11 -0
- package/dist/types/commands/compress.d.ts +37 -0
- package/dist/types/commands/launch-help.d.ts +3 -0
- package/dist/types/commands/launch.d.ts +3 -0
- package/dist/types/compress/index.d.ts +27 -0
- package/dist/types/compress/protocol.d.ts +49 -0
- package/dist/types/compress/session.d.ts +15 -0
- package/dist/types/compress/types.d.ts +54 -0
- package/dist/types/config/settings-schema.d.ts +10 -0
- package/dist/types/internal-urls/local-protocol.d.ts +8 -0
- package/dist/types/mcp/transports/header-policy.d.ts +8 -0
- package/dist/types/mcp/transports/http.d.ts +2 -0
- package/dist/types/mcp/types.d.ts +19 -0
- package/dist/types/modes/components/late-diagnostics-message.d.ts +2 -0
- package/dist/types/modes/components/todo-reminder.d.ts +2 -0
- package/dist/types/modes/components/tool-activity.d.ts +17 -0
- package/dist/types/modes/components/transcript-container.d.ts +2 -0
- package/dist/types/modes/components/ttsr-notification.d.ts +2 -0
- package/dist/types/modes/interactive-mode.d.ts +3 -1
- package/dist/types/modes/types.d.ts +3 -1
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +2 -1
- package/dist/types/modes/utils/ui-helpers.d.ts +3 -1
- package/dist/types/session/agent-session-types.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +2 -0
- package/dist/types/session/session-tools.d.ts +13 -0
- package/dist/types/tools/builtin-names.d.ts +1 -2
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/think.d.ts +41 -0
- package/dist/types/utils/zip.d.ts +19 -9
- package/package.json +13 -13
- package/src/cleanse/agent.ts +67 -2
- package/src/cleanse/checkers.ts +252 -21
- package/src/cleanse/index.ts +90 -36
- package/src/cleanse/parsers.ts +243 -20
- package/src/cleanse/prompts/discovery.md +74 -0
- package/src/cli/args.ts +3 -0
- package/src/cli/cleanse-picker.ts +86 -0
- package/src/cli/command-help.ts +4 -0
- package/src/cli/flag-tables.ts +1 -0
- package/src/cli/gallery-fixtures/agentic.ts +16 -0
- package/src/{cleanse/progress.ts → cli/progress-reporter.ts} +12 -7
- package/src/cli-commands.ts +5 -0
- package/src/commands/cleanse.ts +19 -4
- package/src/commands/compress.ts +45 -0
- package/src/commands/launch-help.ts +3 -0
- package/src/commit/agentic/prompts/analyze-file.md +6 -6
- package/src/commit/agentic/prompts/session-user.md +4 -4
- package/src/compress/index.ts +318 -0
- package/src/compress/prompts/request.md +11 -0
- package/src/compress/prompts/review.md +17 -0
- package/src/compress/prompts/system.md +81 -0
- package/src/compress/protocol.ts +210 -0
- package/src/compress/session.ts +72 -0
- package/src/compress/types.ts +59 -0
- package/src/config/settings-schema.ts +11 -0
- package/src/discovery/builtin-rules/go-add-cleanup.md +8 -8
- package/src/discovery/builtin-rules/go-exp-promoted.md +8 -8
- package/src/discovery/builtin-rules/go-ioutil.md +12 -12
- package/src/discovery/builtin-rules/go-new-expr.md +8 -8
- package/src/discovery/builtin-rules/go-range-int.md +5 -5
- package/src/discovery/builtin-rules/rs-box-leak.md +7 -7
- package/src/discovery/builtin-rules/rs-future-prelude.md +4 -4
- package/src/discovery/builtin-rules/rs-parking-lot.md +6 -6
- package/src/discovery/builtin-rules/ts-no-any.md +5 -5
- package/src/discovery/builtin-rules/ts-no-deprecated-leftovers.md +8 -8
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +13 -14
- package/src/discovery/builtin-rules/ts-no-local-is-record.md +7 -7
- package/src/discovery/builtin-rules/ts-no-test-timers.md +3 -9
- package/src/discovery/builtin-rules/ts-no-tiny-functions.md +7 -7
- package/src/discovery/builtin-rules/ts-promise-with-resolvers.md +2 -2
- package/src/discovery/builtin-rules/ts-redundant-clear-guard.md +3 -9
- package/src/discovery/builtin-rules/ts-set-map.md +2 -4
- package/src/internal-urls/local-protocol.ts +42 -0
- package/src/live/prompts/live-instructions.md +10 -10
- package/src/main.ts +4 -0
- package/src/mcp/client.ts +7 -3
- package/src/mcp/transports/header-policy.ts +28 -0
- package/src/mcp/transports/http.ts +200 -35
- package/src/mcp/types.ts +21 -0
- package/src/modes/components/chat-transcript-builder.ts +17 -5
- package/src/modes/components/late-diagnostics-message.ts +12 -1
- package/src/modes/components/todo-reminder.ts +12 -0
- package/src/modes/components/tool-activity.ts +45 -0
- package/src/modes/components/transcript-container.ts +16 -0
- package/src/modes/components/ttsr-notification.ts +12 -0
- package/src/modes/controllers/event-controller.ts +3 -6
- package/src/modes/controllers/input-controller.ts +6 -6
- package/src/modes/controllers/selector-controller.ts +8 -6
- package/src/modes/interactive-mode.ts +5 -40
- package/src/modes/print-mode.ts +13 -54
- package/src/modes/types.ts +1 -1
- package/src/modes/utils/transcript-render-helpers.ts +3 -2
- package/src/modes/utils/ui-helpers.ts +17 -7
- package/src/prompts/advisor/active-repo-watchdog.md +3 -4
- package/src/prompts/advisor/advise-tool.md +3 -3
- package/src/prompts/advisor/context-files.md +1 -1
- package/src/prompts/advisor/system.md +45 -65
- package/src/prompts/agents/designer.md +44 -44
- package/src/prompts/agents/init.md +18 -18
- package/src/prompts/agents/librarian.md +31 -31
- package/src/prompts/agents/reviewer.md +34 -39
- package/src/prompts/agents/security-reviewer.md +3 -5
- package/src/prompts/agents/task.md +11 -12
- package/src/prompts/bench.md +2 -5
- package/src/prompts/ci-green-request.md +13 -15
- package/src/prompts/dry-balance-bench.md +5 -5
- package/src/prompts/goals/goal-budget-limit.md +4 -5
- package/src/prompts/goals/goal-continuation.md +11 -11
- package/src/prompts/goals/goal-mode-active.md +7 -7
- package/src/prompts/goals/goal-todo-context.md +2 -2
- package/src/prompts/goals/guided-goal-interview.md +18 -24
- package/src/prompts/memories/read-path.md +9 -9
- package/src/prompts/memories/stage_one_system.md +9 -11
- package/src/prompts/review-custom-request.md +8 -11
- package/src/prompts/review-headless-request.md +3 -10
- package/src/prompts/security/scan-coordinator.md +6 -5
- package/src/prompts/security/validate-request.md +4 -7
- package/src/prompts/skills/user-invocation.md +2 -2
- package/src/prompts/steering/parent-irc.md +1 -1
- package/src/prompts/steering/user-interjection.md +1 -3
- package/src/prompts/system/active-repo-context.md +4 -2
- package/src/prompts/system/agent-creation-architect.md +22 -37
- package/src/prompts/system/agent-creation-user.md +3 -3
- package/src/prompts/system/auto-continue.md +1 -1
- package/src/prompts/system/auto-thinking-difficulty-local.md +5 -7
- package/src/prompts/system/auto-thinking-difficulty.md +8 -10
- package/src/prompts/system/autolearn-guidance-learn.md +2 -1
- package/src/prompts/system/autolearn-guidance.md +5 -4
- package/src/prompts/system/autolearn-nudge-autocontinue.md +3 -3
- package/src/prompts/system/background-tan-dispatch.md +3 -3
- package/src/prompts/system/btw-user.md +2 -2
- package/src/prompts/system/commit-message-system.md +8 -6
- package/src/prompts/system/eager-task.md +3 -3
- package/src/prompts/system/empty-stop-retry.md +1 -1
- package/src/prompts/system/gemini-tool-call-reminder.md +5 -5
- package/src/prompts/system/interrupted-thinking.md +3 -3
- package/src/prompts/system/irc-autoreply.md +1 -1
- package/src/prompts/system/irc-incoming.md +3 -3
- package/src/prompts/system/manual-continue.md +3 -3
- package/src/prompts/system/mcp-xdev-guidance.md +2 -2
- package/src/prompts/system/memory-consolidation-system.md +2 -2
- package/src/prompts/system/mid-run-todo-nudge.md +1 -1
- package/src/prompts/system/orchestrate-notice.md +25 -25
- package/src/prompts/system/personalities/default.md +9 -9
- package/src/prompts/system/personalities/friendly.md +11 -11
- package/src/prompts/system/personalities/pragmatic.md +8 -8
- package/src/prompts/system/plan-mode-active.md +61 -64
- package/src/prompts/system/plan-mode-approved.md +10 -11
- package/src/prompts/system/plan-mode-compact-instructions.md +11 -11
- package/src/prompts/system/plan-mode-reference.md +5 -5
- package/src/prompts/system/plan-yolo-handoff.md +2 -2
- package/src/prompts/system/prewalk-checklist.md +5 -5
- package/src/prompts/system/prewalk-continue.md +1 -1
- package/src/prompts/system/prewalk-plan.md +8 -9
- package/src/prompts/system/project-prompt.md +11 -12
- package/src/prompts/system/recap-user.md +1 -1
- package/src/prompts/system/resolve-device-reminder.md +1 -1
- package/src/prompts/system/rewind-report.md +3 -3
- package/src/prompts/system/side-channel-no-tools.md +3 -1
- package/src/prompts/system/snapcompact-context-stub.md +1 -1
- package/src/prompts/system/snapcompact-system-frames-note.md +1 -1
- package/src/prompts/system/snapcompact-system-stub.md +1 -1
- package/src/prompts/system/snapcompact-toolresult-note.md +1 -1
- package/src/prompts/system/speech-rewrite.md +11 -13
- package/src/prompts/system/subagent-async-pending.md +5 -5
- package/src/prompts/system/subagent-system-prompt.md +5 -15
- package/src/prompts/system/subagent-user-prompt.md +1 -1
- package/src/prompts/system/subagent-yield-reminder.md +12 -12
- package/src/prompts/system/system-prompt.md +110 -136
- package/src/prompts/system/tan-context-switch.md +8 -14
- package/src/prompts/system/task-label.md +3 -3
- package/src/prompts/system/thinking-loop-redirect.md +6 -6
- package/src/prompts/system/title-marker-instruction.md +2 -1
- package/src/prompts/system/title-system.md +3 -5
- package/src/prompts/system/ttsr-interrupt.md +3 -3
- package/src/prompts/system/ttsr-tool-reminder.md +1 -1
- package/src/prompts/system/ultrathink-notice.md +1 -1
- package/src/prompts/system/unexpected-stop-classifier.md +3 -3
- package/src/prompts/system/vibe-mode-active.md +15 -15
- package/src/prompts/system/web-search.md +16 -16
- package/src/prompts/system/workflow-notice.md +35 -33
- package/src/prompts/system/xdev-mount-notice.md +4 -4
- package/src/prompts/tools/apply-patch.md +22 -23
- package/src/prompts/tools/approve.md +5 -0
- package/src/prompts/tools/ask.md +10 -10
- package/src/prompts/tools/checkpoint.md +7 -7
- package/src/prompts/tools/computer.md +16 -16
- package/src/prompts/tools/github.md +12 -12
- package/src/prompts/tools/goal.md +8 -9
- package/src/prompts/tools/grep.md +5 -5
- package/src/prompts/tools/image-attachment-describe-system.md +6 -6
- package/src/prompts/tools/image-attachment-describe.md +3 -8
- package/src/prompts/tools/image-gen.md +4 -4
- package/src/prompts/tools/inspect-image-system.md +10 -10
- package/src/prompts/tools/inspect-image.md +10 -13
- package/src/prompts/tools/learn.md +4 -4
- package/src/prompts/tools/manage-skill.md +9 -6
- package/src/prompts/tools/memory-edit.md +8 -8
- package/src/prompts/tools/recall.md +4 -4
- package/src/prompts/tools/reflect.md +2 -2
- package/src/prompts/tools/replace.md +13 -11
- package/src/prompts/tools/retain.md +3 -4
- package/src/prompts/tools/rewind.md +7 -8
- package/src/prompts/tools/rewrite.md +12 -0
- package/src/prompts/tools/security-publish.md +5 -1
- package/src/prompts/tools/security-scan.md +10 -1
- package/src/prompts/tools/task-async-contract.md +7 -1
- package/src/prompts/tools/todo.md +27 -25
- package/src/prompts/tools/vibe-kill.md +2 -2
- package/src/prompts/tools/vibe-list.md +2 -2
- package/src/prompts/tools/vibe-send.md +6 -7
- package/src/prompts/tools/vibe-spawn.md +8 -6
- package/src/prompts/tools/web-search.md +5 -5
- package/src/sdk.ts +10 -1
- package/src/session/agent-session-types.ts +2 -0
- package/src/session/agent-session.ts +28 -0
- package/src/session/session-handoff.ts +21 -0
- package/src/session/session-tools.ts +47 -0
- package/src/tools/builtin-names.ts +1 -2
- package/src/tools/index.ts +10 -0
- package/src/tools/read-format.ts +8 -3
- package/src/tools/read.ts +18 -7
- package/src/tools/renderers.ts +2 -0
- package/src/tools/think.ts +84 -0
- package/src/tools/write.ts +1 -1
- package/src/utils/file-mentions.ts +8 -2
- package/src/utils/zip.ts +858 -94
- package/dist/types/cleanse/progress.d.ts +0 -14
|
@@ -98,7 +98,6 @@ import { renderSegmentTrack } from "../components/segment-track";
|
|
|
98
98
|
import { SessionAccountSelectorComponent } from "../components/session-account-selector";
|
|
99
99
|
import { SessionSelectorComponent, type SessionSelectorOptions } from "../components/session-selector";
|
|
100
100
|
import { SettingsSelectorComponent } from "../components/settings-selector";
|
|
101
|
-
import { StrippedToolCallsPlaceholder } from "../components/stripped-tool-calls-placeholder";
|
|
102
101
|
import { ToolExecutionComponent } from "../components/tool-execution";
|
|
103
102
|
import { TranscriptBlock } from "../components/transcript-container";
|
|
104
103
|
import { TreeSelectorComponent } from "../components/tree-selector";
|
|
@@ -479,6 +478,11 @@ export class SelectorController {
|
|
|
479
478
|
this.ctx.showError(`Failed to apply vision mode: ${err}`);
|
|
480
479
|
});
|
|
481
480
|
break;
|
|
481
|
+
case "externalThinking":
|
|
482
|
+
void this.ctx.session.setThinkToolEnabled(value as boolean).catch(err => {
|
|
483
|
+
this.ctx.showError(`Failed to apply external thinking: ${err}`);
|
|
484
|
+
});
|
|
485
|
+
break;
|
|
482
486
|
|
|
483
487
|
case "autocompleteMaxVisible":
|
|
484
488
|
this.ctx.editor.setAutocompleteMaxVisible(typeof value === "number" ? value : Number(value));
|
|
@@ -490,15 +494,13 @@ export class SelectorController {
|
|
|
490
494
|
this.ctx.hideToolActivity = hidden;
|
|
491
495
|
if (!hidden) this.ctx.toolOutputExpanded = false;
|
|
492
496
|
for (const child of this.ctx.chatContainer.children) {
|
|
493
|
-
if (child instanceof ToolExecutionComponent || child instanceof ReadToolGroupComponent) {
|
|
494
|
-
|
|
495
|
-
child.setToolActivityVisible(!hidden);
|
|
497
|
+
if (!hidden && (child instanceof ToolExecutionComponent || child instanceof ReadToolGroupComponent)) {
|
|
498
|
+
child.setExpanded(false);
|
|
496
499
|
} else if (child instanceof AssistantMessageComponent) {
|
|
497
500
|
child.setToolResultImagesVisible(!hidden);
|
|
498
|
-
} else if (child instanceof StrippedToolCallsPlaceholder) {
|
|
499
|
-
child.setToolActivityVisible(!hidden);
|
|
500
501
|
}
|
|
501
502
|
}
|
|
503
|
+
this.ctx.chatContainer.setToolActivityVisible(!hidden);
|
|
502
504
|
if (hidden) this.ctx.ui.clearInlineImages();
|
|
503
505
|
this.ctx.ui.resetDisplay();
|
|
504
506
|
break;
|
|
@@ -81,7 +81,7 @@ import type { CompactOptions } from "../extensibility/extensions/types";
|
|
|
81
81
|
import type { Skill } from "../extensibility/skills";
|
|
82
82
|
import { loadSlashCommands } from "../extensibility/slash-commands";
|
|
83
83
|
import type { Goal, GoalModeState } from "../goals/state";
|
|
84
|
-
import { resolveLocalUrlToPath } from "../internal-urls";
|
|
84
|
+
import { copyLocalArtifacts, resolveLocalUrlToPath } from "../internal-urls";
|
|
85
85
|
import { LSP_STARTUP_EVENT_CHANNEL, type LspStartupEvent } from "../lsp/startup-events";
|
|
86
86
|
import type { MCPManager } from "../mcp";
|
|
87
87
|
import {
|
|
@@ -838,6 +838,7 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
838
838
|
this.editor.setTopBorderProvider(availableWidth => this.statusLine.getTopBorder(availableWidth));
|
|
839
839
|
|
|
840
840
|
this.hideToolActivity = settings.get("display.hideToolActivity");
|
|
841
|
+
this.chatContainer.setToolActivityVisible(!this.hideToolActivity);
|
|
841
842
|
this.hideThinkingBlock = settings.get("hideThinkingBlock");
|
|
842
843
|
this.proseOnlyThinking = settings.get("proseOnlyThinking");
|
|
843
844
|
|
|
@@ -3167,42 +3168,6 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
3167
3168
|
});
|
|
3168
3169
|
}
|
|
3169
3170
|
|
|
3170
|
-
async #copyLocalArtifactsForFreshSession(sourceRoot: string, destinationRoot: string): Promise<void> {
|
|
3171
|
-
if (sourceRoot === destinationRoot) return;
|
|
3172
|
-
|
|
3173
|
-
let sourceRootStat: { isDirectory(): boolean };
|
|
3174
|
-
try {
|
|
3175
|
-
sourceRootStat = await fs.lstat(sourceRoot);
|
|
3176
|
-
} catch (error) {
|
|
3177
|
-
if (isEnoent(error)) return;
|
|
3178
|
-
throw error;
|
|
3179
|
-
}
|
|
3180
|
-
|
|
3181
|
-
if (!sourceRootStat.isDirectory()) return;
|
|
3182
|
-
|
|
3183
|
-
await fs.mkdir(destinationRoot, { recursive: true });
|
|
3184
|
-
await this.#copyLocalArtifactEntries(sourceRoot, destinationRoot);
|
|
3185
|
-
}
|
|
3186
|
-
|
|
3187
|
-
async #copyLocalArtifactEntries(sourceDir: string, destinationDir: string): Promise<void> {
|
|
3188
|
-
const entries = await fs.readdir(sourceDir, { withFileTypes: true });
|
|
3189
|
-
for (const entry of entries) {
|
|
3190
|
-
const sourcePath = path.join(sourceDir, entry.name);
|
|
3191
|
-
const destinationPath = path.join(destinationDir, entry.name);
|
|
3192
|
-
|
|
3193
|
-
if (entry.isDirectory()) {
|
|
3194
|
-
await fs.mkdir(destinationPath, { recursive: true });
|
|
3195
|
-
await this.#copyLocalArtifactEntries(sourcePath, destinationPath);
|
|
3196
|
-
continue;
|
|
3197
|
-
}
|
|
3198
|
-
|
|
3199
|
-
if (entry.isFile()) {
|
|
3200
|
-
await fs.mkdir(path.dirname(destinationPath), { recursive: true });
|
|
3201
|
-
await fs.copyFile(sourcePath, destinationPath);
|
|
3202
|
-
}
|
|
3203
|
-
}
|
|
3204
|
-
}
|
|
3205
|
-
|
|
3206
3171
|
async #approvePlan(
|
|
3207
3172
|
planContent: string,
|
|
3208
3173
|
options: {
|
|
@@ -3236,7 +3201,7 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
3236
3201
|
const oldLocalRoot = this.#resolveLocalRoot();
|
|
3237
3202
|
await this.handleClearCommand();
|
|
3238
3203
|
const newLocalRoot = this.#resolveLocalRoot();
|
|
3239
|
-
await
|
|
3204
|
+
await copyLocalArtifacts(oldLocalRoot, newLocalRoot);
|
|
3240
3205
|
const newLocalPath = resolveLocalUrlToPath(options.planFilePath, {
|
|
3241
3206
|
getArtifactsDir: () => this.sessionManager.getArtifactsDir(),
|
|
3242
3207
|
getSessionId: () => this.sessionManager.getSessionId(),
|
|
@@ -4402,8 +4367,8 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
4402
4367
|
this.ui.requestRender();
|
|
4403
4368
|
}
|
|
4404
4369
|
|
|
4405
|
-
showWarning(message: string): void {
|
|
4406
|
-
this.#uiHelpers.showWarning(message);
|
|
4370
|
+
showWarning(message: string, options?: { hideWithToolActivity?: boolean }): void {
|
|
4371
|
+
this.#uiHelpers.showWarning(message, options);
|
|
4407
4372
|
}
|
|
4408
4373
|
|
|
4409
4374
|
#handleLspStartupEvent(event: LspStartupEvent): void {
|
package/src/modes/print-mode.ts
CHANGED
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
9
9
|
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import { logger, sanitizeText } from "@oh-my-pi/pi-utils";
|
|
11
|
-
import { resolvePlanModelTransition } from "../plan-mode/model-transition";
|
|
12
11
|
import { type AgentSession, type AgentSessionEvent, SHUTDOWN_CONSOLIDATE_BUDGET_MS } from "../session/agent-session";
|
|
13
12
|
import { isSilentAbort } from "../session/messages";
|
|
14
13
|
import { flushTelemetryExport } from "../telemetry-export";
|
|
15
|
-
import { PROPOSE_DEVICE_NAME, writeDeviceDispatch } from "../tools/resolve";
|
|
16
14
|
import { initializeExtensions } from "./runtime-init";
|
|
17
15
|
|
|
18
16
|
/**
|
|
@@ -128,66 +126,27 @@ export async function runPrintMode(session: AgentSession, options: PrintModeOpti
|
|
|
128
126
|
},
|
|
129
127
|
});
|
|
130
128
|
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
// `plan.defaultOnStartup` opens fresh *interactive* sessions in plan mode so a
|
|
130
|
+
// human can review the plan before it executes. Headless print mode has no
|
|
131
|
+
// surface to review, approve, or exit a plan from, and the turn carries no
|
|
132
|
+
// deterministic way out of plan mode — the model must voluntarily emit a valid
|
|
133
|
+
// `xd://propose` execute-dispatch, and when it does not the run strands until
|
|
134
|
+
// the deadline (issue #8272). So do not honor the startup default here; the
|
|
135
|
+
// supported headless plan flow is `--plan-yolo` (auto-approve → implement),
|
|
136
|
+
// which is wired independently through the prewalk coordinator.
|
|
137
|
+
const planStartupIgnored =
|
|
137
138
|
session.settings.get("plan.defaultOnStartup") &&
|
|
138
139
|
session.settings.get("plan.enabled") &&
|
|
139
140
|
session.sessionManager.buildSessionContext().messages.length === 0 &&
|
|
140
141
|
!session.sessionManager.getEntries().some(entry => entry.type === "mode_change");
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
await session.setActiveToolsByName(planTools);
|
|
146
|
-
session.setPlanModeState({
|
|
147
|
-
enabled: true,
|
|
148
|
-
planFilePath,
|
|
149
|
-
workflow: "parallel",
|
|
150
|
-
});
|
|
151
|
-
session.sessionManager.appendModeChange("plan", { planFilePath });
|
|
152
|
-
abortAfterPlanProposal = true;
|
|
153
|
-
session.setPlanProposalHandler(async title => {
|
|
154
|
-
const result = await session.preparePlanForReview(title);
|
|
155
|
-
const details = result.details;
|
|
156
|
-
if (details) {
|
|
157
|
-
const state = session.getPlanModeState();
|
|
158
|
-
if (state?.enabled) {
|
|
159
|
-
session.setPlanModeState({ ...state, planFilePath: details.planFilePath });
|
|
160
|
-
}
|
|
161
|
-
session.sessionManager.appendModeChange("plan", { planFilePath: details.planFilePath });
|
|
162
|
-
}
|
|
163
|
-
return result;
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
const resolved = session.resolveRoleModelWithThinking("plan");
|
|
167
|
-
const transition = resolvePlanModelTransition(session.model, resolved, false);
|
|
168
|
-
if (transition.kind === "thinking") {
|
|
169
|
-
session.setThinkingLevel(transition.thinkingLevel);
|
|
170
|
-
} else if (transition.kind === "apply") {
|
|
171
|
-
try {
|
|
172
|
-
await session.setModelTemporary(transition.model, transition.thinkingLevel);
|
|
173
|
-
} catch (error) {
|
|
174
|
-
logger.warn("Failed to switch to plan model for print mode", { error: String(error) });
|
|
175
|
-
}
|
|
176
|
-
}
|
|
142
|
+
if (planStartupIgnored) {
|
|
143
|
+
process.stderr.write(
|
|
144
|
+
"Note: plan.defaultOnStartup is ignored in print mode (no interactive surface to review the plan). Use --plan-yolo for a headless plan flow.\n",
|
|
145
|
+
);
|
|
177
146
|
}
|
|
178
147
|
|
|
179
148
|
// Always subscribe to enable session persistence via _handleAgentEvent
|
|
180
149
|
session.subscribe(event => {
|
|
181
|
-
if (abortAfterPlanProposal && event.type === "tool_execution_end" && !event.isError) {
|
|
182
|
-
const dispatch = writeDeviceDispatch(event.toolName, event.result);
|
|
183
|
-
if (dispatch?.tool === PROPOSE_DEVICE_NAME && dispatch.mode === "execute") {
|
|
184
|
-
abortAfterPlanProposal = false;
|
|
185
|
-
session.markPlanInternalAbortPending();
|
|
186
|
-
void session.abort().finally(() => {
|
|
187
|
-
session.clearPlanInternalAbortPending();
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
150
|
// In JSON mode, output all events
|
|
192
151
|
if (mode === "json") {
|
|
193
152
|
writeStdoutLine(`${JSON.stringify(printableEvent(event))}\n`);
|
package/src/modes/types.ts
CHANGED
|
@@ -271,7 +271,7 @@ export interface InteractiveModeContext {
|
|
|
271
271
|
showError(message: string): void;
|
|
272
272
|
showPinnedError(message: string): void;
|
|
273
273
|
clearPinnedError(): void;
|
|
274
|
-
showWarning(message: string): void;
|
|
274
|
+
showWarning(message: string, options?: { hideWithToolActivity?: boolean }): void;
|
|
275
275
|
showNewVersionNotification(newVersion: string): void;
|
|
276
276
|
clearEditor(): void;
|
|
277
277
|
updatePendingMessagesDisplay(): void;
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { createIrcMessageCard } from "../../tools/hub";
|
|
17
17
|
import { replaceTabs, TRUNCATE_LENGTHS, truncateToWidth } from "../../tools/render-utils";
|
|
18
18
|
import { canonicalizeMessage } from "../../utils/thinking-display";
|
|
19
|
+
import { ToolActivityContainer } from "../components/tool-activity";
|
|
19
20
|
import { TranscriptBlock } from "../components/transcript-container";
|
|
20
21
|
import { theme } from "../theme/theme";
|
|
21
22
|
|
|
@@ -27,7 +28,7 @@ type AssistantAgentMessage = Extract<AgentMessage, { role: "assistant" }>;
|
|
|
27
28
|
* or a batch of them) as a transcript block of one "Background job completed"
|
|
28
29
|
* row per job.
|
|
29
30
|
*/
|
|
30
|
-
export function buildAsyncResultBlock(message: CustomOrHookMessage):
|
|
31
|
+
export function buildAsyncResultBlock(message: CustomOrHookMessage): ToolActivityContainer {
|
|
31
32
|
const details = (
|
|
32
33
|
message as CustomMessage<{
|
|
33
34
|
jobId?: string;
|
|
@@ -63,7 +64,7 @@ export function buildAsyncResultBlock(message: CustomOrHookMessage): TranscriptB
|
|
|
63
64
|
.join(" ");
|
|
64
65
|
block.addChild(new Text(line, 1, 0));
|
|
65
66
|
}
|
|
66
|
-
return block;
|
|
67
|
+
return new ToolActivityContainer(block);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
/**
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
} from "../../modes/components/read-tool-group";
|
|
33
33
|
import { SkillMessageComponent } from "../../modes/components/skill-message";
|
|
34
34
|
import { StrippedToolCallsPlaceholder } from "../../modes/components/stripped-tool-calls-placeholder";
|
|
35
|
+
import { ToolActivityContainer } from "../../modes/components/tool-activity";
|
|
35
36
|
import { ToolExecutionComponent } from "../../modes/components/tool-execution";
|
|
36
37
|
import { TranscriptBlock } from "../../modes/components/transcript-container";
|
|
37
38
|
import { createUsageRowBlock } from "../../modes/components/usage-row";
|
|
@@ -40,6 +41,7 @@ import { decodeStreamedToolArgs, streamingStringKeysForTool } from "../../modes/
|
|
|
40
41
|
import { materializeImageReferenceLinksSync } from "../../modes/image-references";
|
|
41
42
|
import { theme } from "../../modes/theme/theme";
|
|
42
43
|
import type { CompactionQueuedMessage, InteractiveModeContext, RenderSessionContextOptions } from "../../modes/types";
|
|
44
|
+
import { LAUNCH_COMPLETION_MESSAGE_TYPE } from "../../session/launch-completion";
|
|
43
45
|
import {
|
|
44
46
|
BACKGROUND_TAN_DISPATCH_MESSAGE_TYPE,
|
|
45
47
|
type CustomMessage,
|
|
@@ -160,7 +162,8 @@ export class UiHelpers {
|
|
|
160
162
|
case "custom": {
|
|
161
163
|
if (message.display) {
|
|
162
164
|
if (message.customType === "async-result") {
|
|
163
|
-
|
|
165
|
+
const component = buildAsyncResultBlock(message);
|
|
166
|
+
this.ctx.chatContainer.addChild(component);
|
|
164
167
|
break;
|
|
165
168
|
}
|
|
166
169
|
if (message.customType === LSP_LATE_DIAGNOSTIC_MESSAGE_TYPE) {
|
|
@@ -174,6 +177,16 @@ export class UiHelpers {
|
|
|
174
177
|
this.ctx.chatContainer.addChild(component);
|
|
175
178
|
break;
|
|
176
179
|
}
|
|
180
|
+
if (message.customType === LAUNCH_COMPLETION_MESSAGE_TYPE) {
|
|
181
|
+
const messageComponent = new CustomMessageComponent(
|
|
182
|
+
message as CustomMessage<unknown>,
|
|
183
|
+
this.ctx.viewSession.extensionRunner?.getMessageRenderer(message.customType),
|
|
184
|
+
);
|
|
185
|
+
messageComponent.setExpanded(this.ctx.toolOutputExpanded);
|
|
186
|
+
const component = new ToolActivityContainer(messageComponent);
|
|
187
|
+
this.ctx.chatContainer.addChild(component);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
177
190
|
if (message.customType === COLLAB_PROMPT_MESSAGE_TYPE) {
|
|
178
191
|
const component = new CollabPromptMessageComponent(message as CustomMessage<CollabPromptDetails>);
|
|
179
192
|
this.ctx.chatContainer.addChild(component);
|
|
@@ -445,7 +458,6 @@ export class UiHelpers {
|
|
|
445
458
|
showContentPreview: this.ctx.settings.get("read.toolResultPreview"),
|
|
446
459
|
});
|
|
447
460
|
readGroup.setExpanded(this.ctx.toolOutputExpanded);
|
|
448
|
-
readGroup.setToolActivityVisible(!this.ctx.hideToolActivity);
|
|
449
461
|
this.ctx.chatContainer.addChild(readGroup);
|
|
450
462
|
}
|
|
451
463
|
readGroup.updateArgs(content.arguments, content.id);
|
|
@@ -460,7 +472,6 @@ export class UiHelpers {
|
|
|
460
472
|
showContentPreview: this.ctx.settings.get("read.toolResultPreview"),
|
|
461
473
|
});
|
|
462
474
|
readGroup.setExpanded(this.ctx.toolOutputExpanded);
|
|
463
|
-
readGroup.setToolActivityVisible(!this.ctx.hideToolActivity);
|
|
464
475
|
this.ctx.chatContainer.addChild(readGroup);
|
|
465
476
|
}
|
|
466
477
|
readGroup.updateArgs(content.arguments, content.id);
|
|
@@ -514,7 +525,6 @@ export class UiHelpers {
|
|
|
514
525
|
content.id,
|
|
515
526
|
);
|
|
516
527
|
component.setExpanded(this.ctx.toolOutputExpanded);
|
|
517
|
-
component.setToolActivityVisible(!this.ctx.hideToolActivity);
|
|
518
528
|
this.ctx.chatContainer.addChild(component);
|
|
519
529
|
|
|
520
530
|
if (hasErrorStop && errorMessage) {
|
|
@@ -574,7 +584,6 @@ export class UiHelpers {
|
|
|
574
584
|
showContentPreview: this.ctx.settings.get("read.toolResultPreview"),
|
|
575
585
|
});
|
|
576
586
|
readGroup.setExpanded(this.ctx.toolOutputExpanded);
|
|
577
|
-
readGroup.setToolActivityVisible(!this.ctx.hideToolActivity);
|
|
578
587
|
this.ctx.chatContainer.addChild(readGroup);
|
|
579
588
|
}
|
|
580
589
|
const args = readToolCallArgs.get(message.toolCallId);
|
|
@@ -735,9 +744,10 @@ export class UiHelpers {
|
|
|
735
744
|
this.ctx.present([new Spacer(1), text]);
|
|
736
745
|
}
|
|
737
746
|
|
|
738
|
-
showWarning(warningMessage: string): void {
|
|
747
|
+
showWarning(warningMessage: string, options?: { hideWithToolActivity?: boolean }): void {
|
|
739
748
|
const text = new Text(`Warning: ${warningMessage}`, 1, 0).setStyleFn(t => theme.fg("warning", t));
|
|
740
|
-
|
|
749
|
+
const content = [new Spacer(1), text];
|
|
750
|
+
this.ctx.present(options?.hideWithToolActivity ? new ToolActivityContainer(content) : content);
|
|
741
751
|
}
|
|
742
752
|
|
|
743
753
|
showNewVersionNotification(newVersion: string): void {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
Especially pay attention to:
|
|
2
1
|
<attention>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Session cwd: outside git; exactly 1 direct-child git repo: `{{relativeRepoRoot}}`.
|
|
3
|
+
Active project: paths under `{{relativeRepoRoot}}/`.
|
|
4
|
+
Before claiming work missing, destroyed, or absent at parent cwd, check `{{relativeRepoRoot}}/`.
|
|
6
5
|
</attention>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Watched agent: send 1 concrete, terse advice.
|
|
2
|
+
Use sparingly; stay silent when nothing matters.
|
|
3
|
+
Call to avert likely-wrong or materially wasteful work.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<project-context>
|
|
2
|
-
|
|
2
|
+
Context files: user's standing project instructions (AGENTS.md etc.); binding on driving agent. Enforce; flag drift immediately; NEVER advise against mandates.
|
|
3
3
|
{{#each contextFiles}}
|
|
4
4
|
<file path="{{path}}">
|
|
5
5
|
{{content}}
|
|
@@ -1,98 +1,78 @@
|
|
|
1
1
|
<system-conventions>
|
|
2
|
-
RFC 2119
|
|
2
|
+
RFC 2119: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. `NEVER`=`MUST NOT`; `AVOID`=`SHOULD NOT`.
|
|
3
3
|
</system-conventions>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- Pull them out of rabbit holes, overthinking, and edge cases before they get baked in.
|
|
5
|
+
User, code-quality, robustness advocate; peer-shadow main agent.
|
|
6
|
+
- Sharpen strategy, problem-solving, judgment; identify cleaner approach.
|
|
7
|
+
- Challenge premature "done", thin verification, skipped reasoning.
|
|
8
|
+
- Enforce user ask; flag drift immediately.
|
|
9
|
+
- Prevent rabbit holes, overthinking, baked-in edge cases.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
Offer that view before they sink work into the wrong direction.
|
|
11
|
+
Cover skipped angles; NEVER re-run reasoning agent already has. Advise before wrong-direction work.
|
|
14
12
|
|
|
15
13
|
<workflow>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- 2–3 tool calls per advise.
|
|
20
|
-
- Exception: critical bugs may need deeper verification before raising a blocker.
|
|
14
|
+
Receive incremental agent transcript, including thoughts.
|
|
15
|
+
Verify suspicions with session-granted tools. Default read-only: `read`, `grep`, `glob`; operators MAY extend grant via `WATCHDOG.yml`. Advice primary; use granted mutating tools only when verification genuinely needs them.
|
|
16
|
+
Per `advise`: 2–3 tool calls. Critical bugs MAY need deeper verification before a `blocker`.
|
|
21
17
|
</workflow>
|
|
22
18
|
|
|
23
19
|
<communication>
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- Address
|
|
27
|
-
-
|
|
28
|
-
- NEVER
|
|
29
|
-
-
|
|
30
|
-
- NEVER
|
|
31
|
-
- When an update heading is tagged `[in progress — more steps follow]`, the agent is mid-turn and has not finished yet. Withhold critique on partial work — the agent may already be resolving it in the next step. Only raise a `blocker` for an unrecoverable side effect that is actively executing right now.
|
|
32
|
-
- NEVER nitpick about things user stated they are okay with. You are the advocate for the user.
|
|
33
|
-
- You are user-aligned: treat the user's word as truth, their frustration as justified, their stated requirements as binding.
|
|
20
|
+
- Surface commentary via `advise`: max 1/update.
|
|
21
|
+
- Silence preferred when agent on track.
|
|
22
|
+
- Address agent directly; offer alternatives, not lectures.
|
|
23
|
+
- NEVER restate information agent has, including seen errors: type errors, LSP diagnostics, failed builds/tests, lint.
|
|
24
|
+
- NEVER repeat prior advice or send identical advice twice; allow action before revisiting its theme.
|
|
25
|
+
- `[in progress — more steps follow]` update heading: agent mid-turn. Withhold critique of partial work; only raise `blocker` for unrecoverable side effect actively executing now.
|
|
26
|
+
- NEVER nitpick what user accepts. User-aligned: their word truth, frustration justified, requirements binding.
|
|
34
27
|
</communication>
|
|
35
28
|
|
|
36
29
|
<critical>
|
|
37
|
-
|
|
38
|
-
- Generic uncertainty, vague unease, or user-intent ambiguity → stay SILENT.
|
|
30
|
+
Advise only on concrete technical risk; generic uncertainty, vague unease, user-intent ambiguity → SILENT.
|
|
39
31
|
|
|
40
|
-
NEVER
|
|
32
|
+
NEVER second-guess decisions the agent understands and commits to unless certain.
|
|
41
33
|
|
|
42
34
|
NEVER advise on intent or process:
|
|
43
|
-
- Do not
|
|
44
|
-
- Do not question
|
|
45
|
-
- Intent
|
|
35
|
+
- Do not tell agent to seek clarification, confirm scope, or summarize input before acting.
|
|
36
|
+
- Do not question clarity of user ask.
|
|
37
|
+
- Intent agent's domain; default informed action.
|
|
46
38
|
- Your lane: correctness, edge cases, design, process.
|
|
47
39
|
|
|
48
40
|
NEVER police scope or ambition:
|
|
49
|
-
-
|
|
50
|
-
- Object to
|
|
41
|
+
- Large diff, wholesale rewrite, expanding plan alone NOT a problem; often user wants it.
|
|
42
|
+
- Object to change size/reach ONLY if it contradicts explicit transcript instruction (e.g. "minimal change", "don't touch X"); cite it.
|
|
51
43
|
|
|
52
|
-
NEVER raise backwards compatibility unless
|
|
53
|
-
- No unsolicited
|
|
54
|
-
-
|
|
44
|
+
NEVER raise backwards compatibility unless user or standing project rule explicitly requires it:
|
|
45
|
+
- No unsolicited breaking-change, deprecation-shim, migration-path, legacy-fallback, or API-stability concerns/blockers.
|
|
46
|
+
- Without requirement: clean cutover—delete old path, update every caller—default correct.
|
|
55
47
|
|
|
56
|
-
Cite only transcript evidence or tool output
|
|
57
|
-
|
|
48
|
+
Cite only transcript evidence or personally inspected tool output.
|
|
49
|
+
Unrendered arguments UNKNOWN:
|
|
58
50
|
- NEVER assert concrete values, array indexes, serialization shapes, or caller mistakes for hidden arguments.
|
|
59
|
-
- Hidden/omitted arguments + failure
|
|
60
|
-
- Example:
|
|
61
|
-
Cite
|
|
51
|
+
- Hidden/omitted arguments + failure: state observable facts; suggest inspecting missing field.
|
|
52
|
+
- Example: timed-out `grep` showing only `pattern` NEVER establishes `paths[0]`, array flattening, or malformed `paths`.
|
|
53
|
+
Cite exact instruction or risk.
|
|
62
54
|
</critical>
|
|
63
55
|
|
|
64
56
|
<completeness>
|
|
65
57
|
**`nit`**
|
|
66
58
|
- Non-urgent cleanup, refactor, style, missed opportunity.
|
|
67
|
-
-
|
|
68
|
-
- Examples:
|
|
69
|
-
- Edge cases that don't break correctness.
|
|
70
|
-
- Simplifications.
|
|
71
|
-
- Better approach the agent can consider.
|
|
59
|
+
- Fold at next step boundary; agent continues.
|
|
60
|
+
- Examples: non-breaking edge cases; simplifications; better approach to consider.
|
|
72
61
|
|
|
73
62
|
**`concern`**
|
|
74
|
-
- Agent
|
|
75
|
-
-
|
|
76
|
-
- Use when:
|
|
77
|
-
- Exploring wrong code path.
|
|
78
|
-
- Picking fragile approach when better exists.
|
|
79
|
-
- Not parallelizing when user request is obviously parallelizable.
|
|
80
|
-
- Missing constraint.
|
|
81
|
-
- Edge case about to be baked in.
|
|
82
|
-
- Churning — repeating failed attempts or cycling approaches without making progress.
|
|
83
|
-
- User shows frustration or keeps correcting the agent, and it isn't adjusting.
|
|
63
|
+
- Agent may head wrong or miss material issue; offer view, agent decides.
|
|
64
|
+
- Use for wrong code path; fragile-over-better approach; failure to parallelize obviously parallelizable user request; missing constraint; soon-baked edge case; churn/repeated failed attempts/cycling without progress; user frustration or repeated corrections the agent does not adjust to.
|
|
84
65
|
|
|
85
66
|
**`blocker`**
|
|
86
|
-
- Stop
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- Will require
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
67
|
+
- Stop/reconsider.
|
|
68
|
+
- ONLY when continued progress clearly:
|
|
69
|
+
- Contradicts explicit transcript instruction—cite it; size, rewrite breadth, evolving plan alone NEVER trigger.
|
|
70
|
+
- Will require later user interruption because agent circles without solution.
|
|
71
|
+
- Fundamentally unsound.
|
|
72
|
+
- Hands off as "done" work never exercised against user's actual ask.
|
|
73
|
+
- Ships verification too thin for risk just taken.
|
|
74
|
+
- Is plainly stalling user's goal through overthinking/rabbit hole.
|
|
94
75
|
- Verify thoroughly before raising.
|
|
95
76
|
</completeness>
|
|
96
77
|
|
|
97
|
-
|
|
98
|
-
Offer the better designs, not just the warning.
|
|
78
|
+
MAY suggest approach/fix after enough exploration for confidence. Offer better designs, not only warning.
|
|
@@ -4,71 +4,71 @@ description: UI/UX specialist for design implementation, review, visual refineme
|
|
|
4
4
|
model: "@designer"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Implement
|
|
7
|
+
Implement/review UI designs; edit files, create components, run commands as needed.
|
|
8
8
|
|
|
9
9
|
<strengths>
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Accessibility: contrast, focus states, semantic markup, screen
|
|
13
|
-
- Visual consistency: spacing, typography, color
|
|
14
|
-
- Responsive design
|
|
10
|
+
- Design intent → working UI code
|
|
11
|
+
- UX issues: unclear states, missing feedback, poor hierarchy
|
|
12
|
+
- Accessibility: contrast, focus states, semantic markup, screen-reader compatibility
|
|
13
|
+
- Visual consistency: spacing, typography, color, component patterns
|
|
14
|
+
- Responsive design and layout structure
|
|
15
15
|
</strengths>
|
|
16
16
|
|
|
17
17
|
<design-system>
|
|
18
|
-
|
|
19
|
-
1. **Token-first analysis (before
|
|
20
|
-
2. **No coherent system? Build
|
|
21
|
-
3. **Compose with
|
|
22
|
-
4. **Verify before done.** Every color
|
|
18
|
+
Design system: foundation; UI without one becomes inconsistent. Four phases, in order:
|
|
19
|
+
1. **Token-first analysis (before CSS/JSX/Svelte).** Use `grep` and `read` for tokens (colors, spacing, typography, shadows, radii), theme files (CSS variables, Tailwind config, `theme.ts`), shared primitives (Button, Card, Input, Layout). Read 5-10 existing components for naming, spacing grid, color use, type scale before deciding.
|
|
20
|
+
2. **No coherent system? Build minimal system first.** Extract existing patterns; define palette, type scale, spacing scale (4px/8px base), radii/shadows/transitions, primitives; THEN implement the request against it.
|
|
21
|
+
3. **Compose with, NEVER around, the system.** Colors: tokens/CSS variables, NEVER hardcoded hex; spacing: scale values, NEVER arbitrary px; type: scale steps; components: extend/compose existing primitives, not one-off div soup. Outside-system need: add token first, then use it; NEVER one-off override.
|
|
22
|
+
4. **Verify before done.** Every color token; spacing on scale; component follows existing composition pattern; zero magic numbers; consistency across old/new. Any no → not done.
|
|
23
23
|
</design-system>
|
|
24
24
|
|
|
25
25
|
<procedure>
|
|
26
26
|
## Implementation
|
|
27
|
-
1. Read existing components, tokens, patterns
|
|
28
|
-
2. Identify aesthetic direction
|
|
29
|
-
3. Implement
|
|
30
|
-
4. Verify accessibility: contrast, focus rings, semantic HTML
|
|
31
|
-
5. Test responsive behavior
|
|
27
|
+
1. Read existing components, tokens, patterns; reuse before inventing.
|
|
28
|
+
2. Identify aesthetic direction: minimal, bold, editorial, etc.
|
|
29
|
+
3. Implement states: loading, empty, error, disabled, hover, focus.
|
|
30
|
+
4. Verify accessibility: contrast, focus rings, semantic HTML.
|
|
31
|
+
5. Test responsive behavior.
|
|
32
32
|
|
|
33
33
|
## Review
|
|
34
|
-
1. Read files
|
|
35
|
-
2. Check
|
|
36
|
-
3. Cite file, line, concrete issue
|
|
37
|
-
4. Suggest specific fixes
|
|
34
|
+
1. Read reviewed files.
|
|
35
|
+
2. Check UX issues, accessibility gaps, visual inconsistencies.
|
|
36
|
+
3. Cite file, line, concrete issue; no vague feedback.
|
|
37
|
+
4. Suggest specific fixes; code when applicable.
|
|
38
38
|
</procedure>
|
|
39
39
|
|
|
40
40
|
<directives>
|
|
41
|
-
-
|
|
42
|
-
- Changes MUST be minimal and
|
|
43
|
-
-
|
|
41
|
+
- SHOULD prefer editing existing files to creating new ones.
|
|
42
|
+
- Changes MUST be minimal and match existing code style.
|
|
43
|
+
- NEVER create documentation files (`*.md`) unless explicitly requested.
|
|
44
44
|
</directives>
|
|
45
45
|
|
|
46
46
|
<avoid>
|
|
47
47
|
## AI Slop Patterns
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
48
|
+
- Glassmorphism everywhere: decorative blur, glass cards, glow borders
|
|
49
|
+
- Cyan-on-dark with purple gradients: 2024 AI palette
|
|
50
|
+
- Gradient text on metrics/headings: meaningless decoration
|
|
51
|
+
- Identical card grids: repeated icon + heading + text
|
|
52
|
+
- Nested cards: visual noise; flattened hierarchy
|
|
53
|
+
- Large rounded-corner icons above every heading: templated, no value
|
|
54
|
+
- Hero metric layouts: big number, small label, gradient accent; overused
|
|
55
|
+
- Same spacing everywhere: no rhythm; monotony
|
|
56
|
+
- Center-aligning everything: left alignment with asymmetry feels more designed
|
|
57
|
+
- Modals for everything: lazy, rarely best
|
|
58
|
+
- Overused fonts: Inter, Roboto, Open Sans, system defaults
|
|
59
|
+
- Pure black (`#000`) or white (`#fff`): ALWAYS tint neutrals
|
|
60
|
+
- Gray text on colored backgrounds: use a background shade instead
|
|
61
|
+
- Bounce/elastic easing: dated, tacky; use exponential easing (`ease-out-quart`/`expo`)
|
|
62
62
|
|
|
63
63
|
## UX Anti-Patterns
|
|
64
|
-
- Missing
|
|
65
|
-
- Redundant information
|
|
66
|
-
- Every button
|
|
67
|
-
- Empty states
|
|
64
|
+
- Missing loading, empty, error states
|
|
65
|
+
- Redundant information: heading restates intro text
|
|
66
|
+
- Every button primary: hierarchy matters
|
|
67
|
+
- Empty states saying "nothing here" rather than guiding users
|
|
68
68
|
</avoid>
|
|
69
69
|
|
|
70
70
|
<critical>
|
|
71
|
-
Every interface
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
Every interface: "how was this made?", not "which AI made this?"
|
|
72
|
+
MUST commit to clear aesthetic direction; execute precisely.
|
|
73
|
+
MUST continue until implementation complete.
|
|
74
74
|
</critical>
|