@wrongstack/core 0.4.0 → 0.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.
Files changed (62) hide show
  1. package/dist/{agent-bridge-DaOnnHNW.d.ts → agent-bridge-BkjOkSkD.d.ts} +1 -1
  2. package/dist/{compactor-CFky6JKM.d.ts → compactor-CTHjZAwf.d.ts} +1 -1
  3. package/dist/{config-RlhKLjme.d.ts → config-DO2eCKgq.d.ts} +1 -1
  4. package/dist/{context-B1kBj1lY.d.ts → context-P207fTpo.d.ts} +11 -0
  5. package/dist/coordination/index.d.ts +10 -891
  6. package/dist/coordination/index.js +407 -236
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +19 -18
  9. package/dist/defaults/index.js +2163 -301
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/{events-BBaKeMfb.d.ts → events-DYAbU84e.d.ts} +41 -1
  12. package/dist/execution/index.d.ts +19 -13
  13. package/dist/execution/index.js +15 -6
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/extension/index.d.ts +6 -6
  16. package/dist/index-BHL8QDCL.d.ts +899 -0
  17. package/dist/{index-meJRuQtc.d.ts → index-BNzUUDVR.d.ts} +8 -6
  18. package/dist/index.d.ts +30 -27
  19. package/dist/index.js +3792 -1466
  20. package/dist/index.js.map +1 -1
  21. package/dist/infrastructure/index.d.ts +6 -6
  22. package/dist/infrastructure/index.js +71 -18
  23. package/dist/infrastructure/index.js.map +1 -1
  24. package/dist/kernel/index.d.ts +10 -9
  25. package/dist/kernel/index.js.map +1 -1
  26. package/dist/{mcp-servers-Cf4-bJnd.d.ts → mcp-servers-CLkhKdnF.d.ts} +18 -3
  27. package/dist/models/index.d.ts +2 -2
  28. package/dist/models/index.js +106 -0
  29. package/dist/models/index.js.map +1 -1
  30. package/dist/{multi-agent-D5m66hzB.d.ts → multi-agent-B1Nn9eC0.d.ts} +71 -16
  31. package/dist/observability/index.d.ts +2 -2
  32. package/dist/{path-resolver-Bg4OP5fi.d.ts → path-resolver-mPccVA0l.d.ts} +9 -2
  33. package/dist/{provider-runner-CU9gnU2E.d.ts → provider-runner-D7lHu07L.d.ts} +3 -3
  34. package/dist/{skill-DayhFUBb.d.ts → retry-policy-CnYVKGPv.d.ts} +2 -28
  35. package/dist/sdd/index.d.ts +419 -5
  36. package/dist/sdd/index.js +1580 -1
  37. package/dist/sdd/index.js.map +1 -1
  38. package/dist/{secret-scrubber-Dyh5LVYL.d.ts → secret-scrubber-BSgec8CU.d.ts} +1 -1
  39. package/dist/{secret-scrubber-DyUAWS09.d.ts → secret-scrubber-Buo9zLGs.d.ts} +1 -1
  40. package/dist/security/index.d.ts +8 -4
  41. package/dist/security/index.js +24 -5
  42. package/dist/security/index.js.map +1 -1
  43. package/dist/{selector-DBEiwXBk.d.ts → selector-B-CGOshv.d.ts} +1 -1
  44. package/dist/{session-reader-D-z0AgHs.d.ts → session-reader-DmOEmSkq.d.ts} +1 -1
  45. package/dist/skill-CxuWrsKK.d.ts +29 -0
  46. package/dist/skills/index.d.ts +136 -0
  47. package/dist/skills/index.js +478 -0
  48. package/dist/skills/index.js.map +1 -0
  49. package/dist/storage/index.d.ts +5 -5
  50. package/dist/storage/index.js +9 -1
  51. package/dist/storage/index.js.map +1 -1
  52. package/dist/{system-prompt-DNetCecu.d.ts → system-prompt-CzY1zrbC.d.ts} +1 -1
  53. package/dist/{tool-executor-B5bgmEgE.d.ts → tool-executor-CYe5cp5U.d.ts} +4 -4
  54. package/dist/types/index.d.ts +16 -15
  55. package/dist/types/index.js +132 -5
  56. package/dist/types/index.js.map +1 -1
  57. package/dist/utils/index.d.ts +35 -2
  58. package/dist/utils/index.js +49 -1
  59. package/dist/utils/index.js.map +1 -1
  60. package/package.json +5 -1
  61. package/skills/sdd/SKILL.md +93 -6
  62. package/skills/skill-creator/SKILL.md +98 -0
@@ -1,4 +1,4 @@
1
- import { T as TextBlock, b as ContentBlock, u as Tool } from './context-B1kBj1lY.js';
1
+ import { T as TextBlock, b as ContentBlock, u as Tool } from './context-P207fTpo.js';
2
2
 
3
3
  /**
4
4
  * Container — dependency injection with explicit bind / override / decorate.
@@ -1,8 +1,8 @@
1
- import { a0 as Context, h as ProviderError, u as Tool, D as ToolUseBlock, z as ToolResultBlock } from './context-B1kBj1lY.js';
2
- import { a as Compactor, C as CompactReport } from './compactor-CFky6JKM.js';
3
- import { c as RecoveryDecision, E as ErrorHandler, R as RetryPolicy } from './skill-DayhFUBb.js';
1
+ import { a0 as Context, h as ProviderError, u as Tool, D as ToolUseBlock, z as ToolResultBlock } from './context-P207fTpo.js';
2
+ import { a as Compactor, C as CompactReport } from './compactor-CTHjZAwf.js';
3
+ import { a as RecoveryDecision, E as ErrorHandler, R as RetryPolicy } from './retry-policy-CnYVKGPv.js';
4
4
  import { M as ModelsRegistry } from './models-registry-Y2xbog0E.js';
5
- import { k as ToolExecutorOptions, l as ToolExecutorStrategy, m as ToolBatchResult } from './index-meJRuQtc.js';
5
+ import { k as ToolExecutorOptions, l as ToolExecutorStrategy, m as ToolBatchResult } from './index-BNzUUDVR.js';
6
6
 
7
7
  interface CompactorOptions {
8
8
  preserveK?: number;
@@ -1,26 +1,27 @@
1
- export { A as AgentError, C as Capabilities, a as ConfigError, b as ContentBlock, E as ErrorCode, c as ErrorSeverity, d as ErrorSubsystem, I as ImageBlock, J as JSONSchema, M as Message, e as MessageRole, P as Permission, f as PluginError, g as Provider, h as ProviderError, i as ProviderErrorBody, R as Request, j as Response, k as ResumedSession, S as SessionData, l as SessionError, m as SessionEvent, n as SessionMetadata, o as SessionStore, p as SessionSummary, q as SessionWriter, r as StopReason, s as StreamEvent, T as TextBlock, t as ThinkingBlock, u as Tool, v as ToolCallContext, w as ToolError, x as ToolFinalEvent, y as ToolProgressEvent, z as ToolResultBlock, B as ToolStreamEvent, D as ToolUseBlock, U as Usage, W as WrongStackError, F as asBlocks, G as asText, H as isAgentError, K as isConfigError, L as isImageBlock, N as isPluginError, O as isSessionError, Q as isTextBlock, V as isThinkingBlock, X as isToolError, Y as isToolResultBlock, Z as isToolUseBlock, _ as isWrongStackError, $ as toWrongStackError } from '../context-B1kBj1lY.js';
2
- export { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-CU9gnU2E.js';
3
- export { C as CONTEXT_WINDOW_MODES, a as Config, b as ConfigLoader, c as ConfigStore, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, L as LogConfig, M as MCPServerConfig, P as PluginConfig, k as ProviderApiKey, l as ProviderConfig, T as ToolsConfig, m as formatContextWindowModeList, n as getContextWindowMode, o as isContextWindowModeId, p as listContextWindowModes, r as resolveContextWindowPolicy } from '../config-RlhKLjme.js';
4
- export { C as CompactReport, a as Compactor } from '../compactor-CFky6JKM.js';
5
- export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from '../secret-scrubber-DyUAWS09.js';
6
- export { A as AddAttachmentInput, a as Attachment, b as AttachmentKind, c as AttachmentMeta, d as AttachmentRef, e as AttachmentStore, D as DefaultSessionReader } from '../session-reader-D-z0AgHs.js';
7
- export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-Dyh5LVYL.js';
1
+ export { A as AgentError, C as Capabilities, a as ConfigError, b as ContentBlock, E as ErrorCode, c as ErrorSeverity, d as ErrorSubsystem, I as ImageBlock, J as JSONSchema, M as Message, e as MessageRole, P as Permission, f as PluginError, g as Provider, h as ProviderError, i as ProviderErrorBody, R as Request, j as Response, k as ResumedSession, S as SessionData, l as SessionError, m as SessionEvent, n as SessionMetadata, o as SessionStore, p as SessionSummary, q as SessionWriter, r as StopReason, s as StreamEvent, T as TextBlock, t as ThinkingBlock, u as Tool, v as ToolCallContext, w as ToolError, x as ToolFinalEvent, y as ToolProgressEvent, z as ToolResultBlock, B as ToolStreamEvent, D as ToolUseBlock, U as Usage, W as WrongStackError, F as asBlocks, G as asText, H as isAgentError, K as isConfigError, L as isImageBlock, N as isPluginError, O as isSessionError, Q as isTextBlock, V as isThinkingBlock, X as isToolError, Y as isToolResultBlock, Z as isToolUseBlock, _ as isWrongStackError, $ as toWrongStackError } from '../context-P207fTpo.js';
2
+ export { P as ProviderRunner, R as RunProviderOptions } from '../provider-runner-D7lHu07L.js';
3
+ export { C as CONTEXT_WINDOW_MODES, a as Config, b as ConfigLoader, c as ConfigStore, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, L as LogConfig, M as MCPServerConfig, P as PluginConfig, k as ProviderApiKey, l as ProviderConfig, T as ToolsConfig, m as formatContextWindowModeList, n as getContextWindowMode, o as isContextWindowModeId, p as listContextWindowModes, r as resolveContextWindowPolicy } from '../config-DO2eCKgq.js';
4
+ export { C as CompactReport, a as Compactor } from '../compactor-CTHjZAwf.js';
5
+ export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from '../secret-scrubber-Buo9zLGs.js';
6
+ export { A as AddAttachmentInput, a as Attachment, b as AttachmentKind, c as AttachmentMeta, d as AttachmentRef, e as AttachmentStore, D as DefaultSessionReader } from '../session-reader-DmOEmSkq.js';
7
+ export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-scrubber-BSgec8CU.js';
8
8
  export { D as DefaultLogger, a as DefaultLoggerOptions } from '../logger-BH6AE0W9.js';
9
- export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-Bg4OP5fi.js';
9
+ export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-mPccVA0l.js';
10
10
  export { M as MemoryEntry, a as MemoryScope, b as MemoryStore } from '../memory-CEXuo7sz.js';
11
- export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from '../tool-executor-B5bgmEgE.js';
12
- export { S as SkillEntry, a as SkillLoader, b as SkillManifest } from '../skill-DayhFUBb.js';
13
- export { B as BuildContext, M as ModelCapabilities, R as Renderer, S as SystemPromptBuilder } from '../system-prompt-DNetCecu.js';
11
+ export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from '../tool-executor-CYe5cp5U.js';
12
+ export { S as SkillEntry, a as SkillLoader, b as SkillManifest } from '../skill-CxuWrsKK.js';
13
+ export { B as BuildContext, M as ModelCapabilities, R as Renderer, S as SystemPromptBuilder } from '../system-prompt-CzY1zrbC.js';
14
14
  export { I as InputReader, P as PromptOption } from '../input-reader-E-ffP2ee.js';
15
- export { M as MCPRegistryView, a as MetricsSinkView, P as Plugin, b as PluginAPI, c as PluginCapabilities, d as PluginDependency, e as PluginPipelines, f as ProviderFactory, g as ProviderRegistryView, S as SessionWriterView, h as SlashCommand, i as SlashCommandRegistryView, j as SystemPromptContributor, T as ToolRegistryView } from '../index-meJRuQtc.js';
15
+ export { M as MCPRegistryView, a as MetricsSinkView, P as Plugin, b as PluginAPI, c as PluginCapabilities, d as PluginDependency, e as PluginPipelines, f as ProviderFactory, g as ProviderRegistryView, S as SessionWriterView, h as SlashCommand, i as SlashCommandRegistryView, j as SystemPromptContributor, T as ToolRegistryView } from '../index-BNzUUDVR.js';
16
16
  export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-DqzwpBQy.js';
17
17
  export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest, c as ModeStore } from '../mode-CV077NjV.js';
18
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DaOnnHNW.js';
19
- export { C as CoordinatorEvents, a as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, b as MultiAgentCoordinator, S as SpawnResult, c as SubagentConfig, d as SubagentContext, e as SubagentError, f as SubagentErrorKind, g as SubagentRunContext, h as SubagentRunOutcome, i as SubagentRunner, T as TaskDelegation, j as TaskResult, k as TaskSpec } from '../multi-agent-D5m66hzB.js';
18
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-BkjOkSkD.js';
19
+ export { C as CoordinatorEvents, a as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, b as MultiAgentCoordinator, S as SpawnResult, c as SubagentConfig, d as SubagentContext, e as SubagentError, f as SubagentErrorKind, g as SubagentRunContext, h as SubagentRunOutcome, i as SubagentRunner, T as TaskDelegation, j as TaskResult, k as TaskSpec } from '../multi-agent-B1Nn9eC0.js';
20
20
  export { C as CriticalPathResult, D as DEFAULT_SPEC_TEMPLATE, S as SpecAnalysis, a as SpecApiEndpoint, b as SpecRequirement, c as SpecSection, d as SpecSectionType, e as SpecStatus, f as SpecTemplate, g as SpecValidationResult, h as Specification, T as TaskAssignment, i as TaskDependency, j as TaskEdge, k as TaskFilter, l as TaskGraph, m as TaskNode, n as TaskPriority, o as TaskProgress, p as TaskSort, q as TaskStatus, r as TaskType, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from '../task-graph-BITvWt4t.js';
21
21
  export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from '../observability-BhnVLBLS.js';
22
- import '../events-BBaKeMfb.js';
22
+ import '../events-DYAbU84e.js';
23
23
  import '../logger-BMQgxvdy.js';
24
+ import '../retry-policy-CnYVKGPv.js';
24
25
  import '../models-registry-Y2xbog0E.js';
25
26
  import '../secret-vault-DoISxaKO.js';
26
27
  import '../path-resolver-CPRj4bFY.js';
@@ -393,7 +393,7 @@ function walkCount(node, vault, counter) {
393
393
  if (Array.isArray(node)) {
394
394
  return node.map((item) => walkCount(item, vault, counter));
395
395
  }
396
- const out = {};
396
+ const out = /* @__PURE__ */ Object.create(null);
397
397
  for (const [k, v] of Object.entries(node)) {
398
398
  if (typeof v === "string" && isSecretField(k) && !vault.isEncrypted(v) && v.length > 0) {
399
399
  out[k] = vault.encrypt(v);
@@ -406,7 +406,15 @@ function walkCount(node, vault, counter) {
406
406
  }
407
407
  return out;
408
408
  }
409
- var FORBIDDEN_PROTO_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
409
+ var FORBIDDEN_PROTO_KEYS = /* @__PURE__ */ new Set([
410
+ "__proto__",
411
+ "constructor",
412
+ "prototype",
413
+ "__defineGetter__",
414
+ "__defineSetter__",
415
+ "__lookupGetter__",
416
+ "__lookupSetter__"
417
+ ]);
410
418
  function deepMerge(a, b) {
411
419
  const out = { ...a };
412
420
  for (const [k, v] of Object.entries(b)) {
@@ -553,6 +561,9 @@ var DefaultTokenCounter = class {
553
561
  providerId;
554
562
  events;
555
563
  priceCache = /* @__PURE__ */ new Map();
564
+ /** Most recently accounted request's tokens. Used for per-request context pressure. */
565
+ lastInput = 0;
566
+ lastCacheRead = 0;
556
567
  constructor(opts = {}) {
557
568
  this.registry = opts.registry;
558
569
  this.providerId = opts.providerId;
@@ -563,6 +574,8 @@ var DefaultTokenCounter = class {
563
574
  this.output += usage.output;
564
575
  this.cacheRead += usage.cacheRead ?? 0;
565
576
  this.cacheWrite += usage.cacheWrite ?? 0;
577
+ this.lastInput = usage.input;
578
+ this.lastCacheRead = usage.cacheRead ?? 0;
566
579
  const price = model ? this.priceCache.get(model) : void 0;
567
580
  if (price) {
568
581
  this.applyPrice(usage, price);
@@ -585,6 +598,8 @@ var DefaultTokenCounter = class {
585
598
  this.output += usage.output;
586
599
  this.cacheRead += usage.cacheRead ?? 0;
587
600
  this.cacheWrite += usage.cacheWrite ?? 0;
601
+ this.lastInput = usage.input;
602
+ this.lastCacheRead = usage.cacheRead ?? 0;
588
603
  const price = priceFromModel(resolved);
589
604
  this.priceCache.set(resolved.modelId, price);
590
605
  this.applyPrice(usage, price);
@@ -597,6 +612,9 @@ var DefaultTokenCounter = class {
597
612
  cacheWrite: this.cacheWrite
598
613
  };
599
614
  }
615
+ currentRequestTokens() {
616
+ return { input: this.lastInput, cacheRead: this.lastCacheRead };
617
+ }
600
618
  estimateCost() {
601
619
  return {
602
620
  input: round4(this.costInput),
@@ -1152,12 +1170,15 @@ var PATTERNS = [
1152
1170
  { type: "redis_uri", regex: /redis:\/\/[^\s"'`]+/g },
1153
1171
  {
1154
1172
  type: "bearer_token",
1155
- regex: /(?<![A-Za-z0-9_.~+/-])Bearer\s+[A-Za-z0-9._~+/-]{20,}=*(?![A-Za-z0-9_.~+/-])/g
1173
+ // Bounded at 512 chars to prevent catastrophic backtracking on adversarial input.
1174
+ // Negative lookahead is a simple single-char check — no backtracking risk.
1175
+ regex: /(?<![A-Za-z0-9_.~+/-])Bearer\s+[A-Za-z0-9._~+/-]{20,512}=*(?![A-Za-z0-9_.~+/-])/g
1156
1176
  },
1157
1177
  {
1158
1178
  type: "high_entropy_env",
1159
- // Value-side word boundary + length gate to avoid matching short random strings
1160
- regex: /\b([A-Z_]{4,}(?:KEY|TOKEN|SECRET|PASSWORD|PWD))\s*[:=]\s*['"]?([A-Za-z0-9_/+=-]{20,})['"]?(?!\s*[A-Za-z_]{4,}(?:KEY|TOKEN|SECRET|PASSWORD|PWD))/g
1179
+ // Value bounded at 512 chars; negative lookahead simplified to avoid
1180
+ // nested quantifier backtracking on adversarial input.
1181
+ regex: /\b([A-Z_]{4,}(?:KEY|TOKEN|SECRET|PASSWORD|PWD))\s*[:=]\s*['"]?([A-Za-z0-9_/+=-]{20,512})['"]?/g
1161
1182
  }
1162
1183
  ];
1163
1184
  var SCRUB_CHUNK_BYTES = 64 * 1024;
@@ -1572,6 +1593,112 @@ When refactoring code:
1572
1593
  - Keep performance in mind \u2014 don't regress`,
1573
1594
  tags: ["refactor", "modernization", "improvement"],
1574
1595
  toolPreferences: ["read", "edit", "test", "git", "grep"]
1596
+ },
1597
+ {
1598
+ id: "brief",
1599
+ name: "Brief",
1600
+ description: "Fast, no-nonsense \u2014 get to the point",
1601
+ prompt: `## Brief Mode
1602
+
1603
+ You are WrongStack, a fast, no-nonsense AI coding agent.
1604
+
1605
+ You operate inside the user's terminal. Read files, run commands, make changes \u2014 get to the point.
1606
+
1607
+ ### Operating rules
1608
+
1609
+ 1. **Read first.** Inspect relevant files before touching anything.
1610
+ 2. **Edit surgically.** Use edit tool for existing files, write only for new ones.
1611
+ 3. **One sentence before action.** State what you're doing, then do it. No preambles.
1612
+ 4. **Say what happened.** After tool calls, one line: success, failure, or what's next.
1613
+ 5. **Be honest.** Admit when you don't know or something failed. No fake progress.
1614
+ 6. **Keep moving.** Task done? Stop. More work needed? State it and continue.
1615
+
1616
+ ### Decision rules
1617
+
1618
+ - **Ambiguous task?** Ask. One question, get clarity, proceed.
1619
+ - **Clear task, unknown approach?** Pick one reasonable path, execute, report.
1620
+ - **Tool fails?** Retry once with adjusted params, then report.
1621
+ - **Permission denied?** Stop. Acknowledge. Ask what they want instead.
1622
+ - **Context filling up?** Compact proactively, don't wait.
1623
+
1624
+ ### Output style
1625
+
1626
+ - Prose paragraphs (no bullet points unless unavoidable)
1627
+ - Code blocks for code, backticks for paths/commands
1628
+ - One-liner sufficient? One liner.
1629
+ - No "Great question!", "Here's what I did:", or similar filler.
1630
+ - Max 3 sentences per paragraph.
1631
+
1632
+ ### Focus
1633
+
1634
+ Stay on task. Fix only what's asked. Don't refactor surrounding code unless explicitly requested. Own your output \u2014 don't call it "done" or "production-ready"; the user decides that.`,
1635
+ tags: ["fast", "concise", "direct"],
1636
+ toolPreferences: ["read", "edit", "bash"]
1637
+ },
1638
+ {
1639
+ id: "teach",
1640
+ name: "Teach",
1641
+ description: "Mentor mode \u2014 explains why, not just what",
1642
+ prompt: `## Teach Mode
1643
+
1644
+ You are WrongStack, an expert AI coding mentor.
1645
+
1646
+ You operate inside the user's terminal with full access to their codebase. You help developers learn and understand \u2014 not just execute tasks, but build mental models.
1647
+
1648
+ ### Teaching philosophy
1649
+
1650
+ 1. **Explain the why.** When you make a change, explain why it works that way \u2014 not just what you did.
1651
+ 2. **Build mental models.** Use analogies, highlight patterns, connect new concepts to things the user already knows.
1652
+ 3. **Read before teaching.** Always inspect relevant files so your explanations are accurate and specific to the actual code.
1653
+ 4. **Surgical edits with context.** When editing code, explain the approach before doing it, and what trade-offs were considered.
1654
+ 5. **Be thorough but not verbose.** A 2-paragraph explanation beats a 5-paragraph one. Depth without padding.
1655
+ 6. **Admit knowledge gaps.** If you're unsure, say so. Speculating teaches bad patterns.
1656
+
1657
+ ### Teaching style
1658
+
1659
+ - **Before action:** Briefly explain what you're going to do and why.
1660
+ - **After action:** Summarize what happened and what the user should take away from this.
1661
+ - **With code:** Show concrete examples, explain syntax choices, point out gotchas.
1662
+ - **With errors:** Explain why the error occurred, what it's actually complaining about, and how to avoid it in the future.
1663
+ - **General principles:** Offer them when the user's question suggests a deeper concept they'd benefit from understanding.
1664
+
1665
+ ### Decision heuristics
1666
+
1667
+ - **Task is ambiguous?** Ask \u2014 but frame the question as "what would you like to learn from this?"
1668
+ - **Task is clear, approach is unknown?** Execute, then teach the approach as you go.
1669
+ - **Tool fails?** Explain what failed, why it failed, and how to avoid the failure.
1670
+ - **User asks "how do I...?"** Don't just give the answer \u2014 explain the underlying mechanism.
1671
+ - **Context window filling up?** Compact, but summarize what was lost so the teaching continuity isn't broken.
1672
+
1673
+ ### Output format
1674
+
1675
+ - Use headings to structure multi-concept explanations.
1676
+ - Code blocks with brief annotations for code examples.
1677
+ - **Bold** key terms and concepts worth remembering.
1678
+ - Callouts like "Key takeaway:" or "Pattern:" to anchor learning.
1679
+ - Max 3 sentences per paragraph \u2014 readability over completeness.
1680
+
1681
+ ### Don'ts
1682
+
1683
+ - Don't lecture condescendingly \u2014 the user is a developer, not a beginner.
1684
+ - Don't pad explanations with obvious things.
1685
+ - Don't skip the "why" \u2014 even quick tasks deserve one sentence of context.
1686
+ - Don't just say "do X" \u2014 say "do X because Y."
1687
+ - Don't leave the user hanging after a complex operation \u2014 explain what just happened.
1688
+
1689
+ ### Core principles
1690
+
1691
+ You follow these principles, but always with explanation:
1692
+ - Read before write
1693
+ - Surgical edits over rewrites
1694
+ - Show your work (explain your reasoning, not just mechanical steps)
1695
+ - Be honest about limits
1696
+ - Format for scanability
1697
+ - Recover explicitly from failures
1698
+
1699
+ Remember: your job is to make the user a better developer, not just to complete tasks faster.`,
1700
+ tags: ["teaching", "mentor", "learning"],
1701
+ toolPreferences: ["read", "edit", "explain"]
1575
1702
  }
1576
1703
  ];
1577
1704