feat(lib): extract Claude system prompt into dedicated file#191
Open
skulidropek wants to merge 3 commits intomainfrom
Open
feat(lib): extract Claude system prompt into dedicated file#191skulidropek wants to merge 3 commits intomainfrom
skulidropek wants to merge 3 commits intomainfrom
Conversation
Move the agent system prompt from the embedded heredoc in claude-extra-config.ts into a standalone module (claude-system-prompt.ts) so the prompt can be edited in one place without touching the entrypoint generation logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace per-agent hardcoded prompts with imports from claude-system-prompt.ts (single source of truth): - PROMPT_INTRO / PROMPT_INTERNET / PROMPT_SUBAGENTS / PROMPT_FILES – shared string constants used by Codex's variable-based injection - renderSharedPrompt(workspaceContextBashVar) – builds the full prompt for Claude/Gemini heredoc injection, accepting the per-agent bash variable that resolves the workspace context at container start-up Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- claude-system-prompt.ts: single clean template string via
renderSharedPrompt(targetDir, workspaceContext) with ${} params;
export PROMPT_* constants + renderFocusLine() for Codex
- claude-extra-config.ts: renderClaudeGlobalPromptSetup() builds bash
script inline — no module-level template, no .replaceAll() chains
- gemini.ts: renderEntrypointGeminiNotice() same approach
- codex.ts: FOCUS_LINE uses renderFocusLine() via __FOCUS_LINE__ stub
(kept because the 100-line managed-block template stays module-level)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude-extra-config.tsв отдельный модульclaude-system-prompt.tsclaude-extra-config.tsтеперь импортируетclaudeSystemPromptContentи подставляет его в генерируемый bash-скрипт__TARGET_DIR__,$CLAUDE_WORKSPACE_CONTEXT) не измениласьКак редактировать промт
Теперь для изменения промта нужно отредактировать один файл:
Поддерживаемые плейсхолдеры:
__TARGET_DIR__— абсолютный путь к клонированному репозиторию внутри контейнера$CLAUDE_WORKSPACE_CONTEXT— bash-переменная, разрешается при старте контейнера (repository/issue #N/PR #N)Test plan
pnpm -r buildпроходит без ошибок (TypeScript + Vite)~/.claude/CLAUDE.mdгенерируется с правильным содержимым🤖 Generated with Claude Code