Skip to content

refactor(backends): move contextFiles and nativeToolPrompts to shared module#834

Merged
aaight merged 1 commit intodevfrom
feature/move-context-files-and-prompts-to-shared
Mar 14, 2026
Merged

refactor(backends): move contextFiles and nativeToolPrompts to shared module#834
aaight merged 1 commit intodevfrom
feature/move-context-files-and-prompts-to-shared

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 14, 2026

Summary

  • Moves offloadLargeContext, cleanupContextFiles, and buildInlineContextSection from src/backends/claude-code/contextFiles.ts to src/backends/shared/contextFiles.ts
  • Moves buildSystemPrompt, buildTaskPrompt, and buildToolGuidance from src/backends/nativeTools.ts to src/backends/shared/nativeToolPrompts.ts
  • Keeps backward-compatible re-export shims at all original paths so no engine imports need to change
  • Updates the barrel src/backends/contextFiles.ts to re-export from shared
  • Updates test import path to point directly at src/backends/shared/contextFiles.ts

Closes: https://trello.com/c/pq3Vm1a6/349-as-a-developer-i-want-context-files-and-prompt-building-moved-to-shared-so-that-all-native-tool-engines-use-common-modules

Test plan

  • All 15 existing claude-code-contextFiles.test.ts tests pass
  • TypeScript type checking passes (npm run typecheck)
  • Lint passes (npm run lint)
  • All engine index.ts files compile with no import changes needed (shims ensure backward compat)
  • Note: postComment.test.ts, github.test.ts, and misc.test.ts failures are pre-existing on origin/dev and unrelated to this refactor

🤖 Generated with Claude Code

🕵️ claude-code · claude-sonnet-4-6 · run details

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - this refactor cleanly moves the shared prompt/context helpers without changing engine call sites or behavior. The backward-compatible shims remain in place, CI is green, and the backend unit coverage for these prompt builders/context offloading still passes.

🕵️ codex · gpt-5.4 · run details

@aaight aaight merged commit d54cca0 into dev Mar 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants