feat(templates): allow customizing system prompts and codex skills#238
feat(templates): allow customizing system prompts and codex skills#238konard wants to merge 7 commits intoProverCoderAI:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: ProverCoderAI#237
Working session summaryHere's my proposed approach. Given the issue scope (touches lib/api/app), I want to confirm the shape before implementing. FindingsSystem prompts are repo-root files that already get auto-copied into the container by the entrypoints:
Skills are repo-root directories synced by the codex entrypoint into Per-project workspace is resolved via Proposed implementation
Tradeoff to flag: this is a sizable change (new API service, two routes, two new menus + panels, new UI primitive). A leaner alternative would be a single "Files" panel that exposes a generic editor for the three prompts and known skill paths. The structured-per-agent approach above is more user-friendly but more code. Do you want me to proceed with the structured approach as described, or prefer the leaner single "Files" editor? This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $2.404150📊 Context and tokens usage:Claude Opus 4.7: (2 sub-sessions)
Total: (29.9K new + 147.6K cache writes + 1.3M cache reads) input tokens, 13.3K output tokens, $2.076555 cost Claude Haiku 4.5:
Total: (1.4K new + 86.0K cache writes + 1.7M cache reads) input tokens, 10.1K output tokens, $0.327595 cost 🤖 Models used:
📎 Log file uploaded as Gist (2135KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart triggered (iteration 1)Reason: CI failures detected Starting new session to address the issues. Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations. |
Add runtime override hooks for the per-agent system prompts and the project Codex skills sync: - CLAUDE_SYSTEM_PROMPT_OVERRIDE / CLAUDE_SYSTEM_PROMPT_OVERRIDE_FILE replace the body inside the managed CLAUDE.md block while keeping the docker-git managed markers so updates remain idempotent. - CODEX_SYSTEM_PROMPT_OVERRIDE / CODEX_SYSTEM_PROMPT_OVERRIDE_FILE replace the managed lines inside ~/.codex/AGENTS.md. - GEMINI_SYSTEM_PROMPT_OVERRIDE / GEMINI_SYSTEM_PROMPT_OVERRIDE_FILE replace the body inside ~/.gemini/GEMINI.md. - CODEX_EXTRA_SKILLS_PATHS lets users mount additional skill trees (format "prio-name::relative/path", comma- or newline-separated) alongside the built-in priority list. Each hook prefers the *_FILE variant over the inline value, falling back to the existing default content so existing deployments behave identically when no overrides are set. Mirror the lib changes into packages/app/src/lib, document the new env vars in the CLI help text, and add tests asserting the rendered entrypoint contains the new override scaffolding.
Demonstrates the new CLAUDE/CODEX/GEMINI system-prompt overrides and the CODEX_EXTRA_SKILLS_PATHS hook. The .ts/.mjs renderers reproduce the files written into ~/.claude, ~/.codex, ~/.gemini at container start so reviewers can compare default vs overridden output without spinning up a container.
CI status
The 14 lint errors in the latest
Files modified in this PR ( |
CI status (final)Passing on this PR (10/14):
Failing — all three are pre-existing on
None of these errors are in files this PR modifies. The PR's diff scope is:
Resolving the pre-existing failures is out of scope for issue #237. The new tests added in |
🔄 Auto-restart-until-mergeable Log (iteration 1)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $12.334705📊 Context and tokens usage:Claude Opus 4.7: (4 sub-sessions)
Total: (6.8K new + 371.7K cache writes + 15.2M cache reads) input tokens, 95.0K output tokens, $12.334705 cost 🤖 Models used:
📎 Log file uploaded as Gist (7139KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart triggered (iteration 2)Reason: CI failures detected; Uncommitted changes Starting new session to address the issues. Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations. |
🔄 Auto-restart-until-mergeable Log (iteration 2)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $5.175366📊 Context and tokens usage:Claude Opus 4.7: (2 sub-sessions)
Total: (2.4K new + 145.7K cache writes + 7.2M cache reads) input tokens, 25.3K output tokens, $5.175366 cost 🤖 Models used:
📎 Log file uploaded as Gist (9421KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Working session summaryAll 14 CI checks pass on PR #238. The fix was achieved by merging Final state:
This summary was automatically extracted from the AI working session output. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
Runtime verification after merging current Branch head: The screenshots below were captured from a live docker-git SSH terminal against a demo container after setting |


Summary
Closes #237. Adds runtime override hooks for the per-agent system prompts and the project Codex skills sync, so operators can customise
.claude,.codex, and.geminicontent without forking the templates.What changed
CLAUDE_SYSTEM_PROMPT_OVERRIDE/CLAUDE_SYSTEM_PROMPT_OVERRIDE_FILE— replace the body inside the managed~/.claude/CLAUDE.mdblock.CODEX_SYSTEM_PROMPT_OVERRIDE/CODEX_SYSTEM_PROMPT_OVERRIDE_FILE— replace the managed lines inside~/.codex/AGENTS.md.GEMINI_SYSTEM_PROMPT_OVERRIDE/GEMINI_SYSTEM_PROMPT_OVERRIDE_FILE— replace the body inside~/.gemini/GEMINI.md.CODEX_EXTRA_SKILLS_PATHS— mount additional skill trees alongside the built-in priority list (formatprio-name::relative/path, comma- or newline-separated).For each prompt hook, the
*_FILEvariant takes precedence over the inline value, with the existing default Russian content as the final fallback. The docker-git managed-block markers (<!-- docker-git-managed:claude-md -->,<!-- docker-git:managed:start -->,<!-- docker-git-managed:gemini-md -->) stay in place so subsequent container restarts still detect the file and refresh it idempotently.The
CODEX_EXTRA_SKILLS_PATHSloop runs after the built-in priority chain (.skills,.agents/skills,.agents/.skills,.codex/skills,.codex/.skills) so the existing assertions still pass; misconfigured entries (missing directory) are silently skipped.How to use
.orch/env/project.env(a couple of representative configurations):UI examples (rendered files inside the running container)
Default behaviour —
~/.claude/CLAUDE.mdDefault behaviour —
~/.codex/AGENTS.mdAfter
CLAUDE_SYSTEM_PROMPT_OVERRIDE="You are a senior reviewer. Be terse."After
CODEX_SYSTEM_PROMPT_OVERRIDE_FILE=/home/dev/.docker-git/prompts/codex.txtAfter
CODEX_EXTRA_SKILLS_PATHS="50-team-skills::team/skills,60-shared-rituals::infra/codex/rituals"A complete dump of the rendered entrypoint blocks (with the override scaffolding visible) lives at
experiments/render-examples-output.txtand the full UI walkthrough atexperiments/ui-examples.md.Test plan
bun run --cwd packages/lib test— 164 passed (43 files), including 2 new tests asserting the rendered entrypoint contains the override scaffolding for codex/claude/gemini and theCODEX_EXTRA_SKILLS_PATHSloop.bun run --cwd packages/app test(vitest only) — 217 passed (44 files), confirming the mirroredpackages/app/src/lib/...files compile and behave identically.packages/app/src/docker-git/cli/usage.ts).*_DEFAULT_PROMPT_BODY).