Skip to content

feat(core): enrich hardcoded system prompts in container templates#190

Open
konard wants to merge 6 commits intoProverCoderAI:mainfrom
konard:issue-189-ba783568b6b3
Open

feat(core): enrich hardcoded system prompts in container templates#190
konard wants to merge 6 commits intoProverCoderAI:mainfrom
konard:issue-189-ba783568b6b3

Conversation

@konard
Copy link
Contributor

@konard konard commented Mar 24, 2026

Summary

Fixes #189

The system prompts injected into docker-git containers (CLAUDE.md, AGENTS.md, GEMINI.md at startup) were minimal — just agent identity and workspace context. The user requested enriching them based on all prompt-related issues.

What changed

New file: packages/lib/src/core/templates-entrypoint/system-prompt-content.ts

  • Shared behavioral instructions module — single source of truth for all agents
  • Contains enriched prompt sections extracted from issues

Modified template files (import and inject systemPromptBehavior):

  • packages/lib/src/core/templates-entrypoint/claude-extra-config.ts — Claude prompt
  • packages/lib/src/core/templates-entrypoint/codex.ts — Codex/AGENTS prompt
  • packages/lib/src/core/templates-entrypoint/gemini.ts — Gemini prompt

Modified test:

  • packages/app/tests/docker-git/entrypoint-auth.test.ts — updated assertions for new prompt structure

Docs (from previous commit):

  • CLAUDE.md and AGENTS.md — project-level instructions aligned with container prompts

New prompt sections (from issues)

Issue Requirement Added
#90 Isolated environment awareness
#41 Role definition (mathematician-programmer)
#41 Deep Research process rule
#41 Rational comments format (CHANGE/WHY/REF)
#41 Research loop on failures
#41 Instrumental behavior (execute, don't guide)
#101, #4 Mandatory subagent delegation + micro-agents
#54 Plan mode on clone
#96 Mandatory response contract (trust gap)
#96 Claim safety rule (no "fixed" without proof)
#96 Visibility rule (why user may not see result)
#96 CI/CD rule (failing step + reproduce command)
#92 Proof of execution in PRs (detailed)
#78 Public API, no localhost URLs

Architecture

The prompt has three layers:

  1. Static code (system-prompt-content.ts → templates) — behavioral instructions injected at container startup
  2. Dynamic (generated by templates-entrypoint/*.ts) — workspace context, permissions, tool access
  3. Project-level (CLAUDE.md, AGENTS.md in repo root) — coding standards for this repo

This PR updates layer 1 (the code-embedded prompts) as requested.

Verification

  • npm run lint — 0 errors, 0 warnings
  • npm test — 192 tests pass (73 app + 119 lib)
  • All three agent templates now inject the enriched prompt
  • Main branch merged, no conflicts

Математические гарантии

Инварианты:

  • ∀ agent ∈ {claude, codex, gemini}: prompt(agent) ⊇ systemPromptBehavior
  • Single source of truth: system-prompt-content.ts → all templates

Доказательства выполнения:

  • All 192 tests pass: verified locally after merge with main
  • Lint clean: 0 errors, 0 warnings
  • Code changes in template files (hardcoded prompts in code), not just docs

🤖 Generated with Claude Code

konard and others added 2 commits March 24, 2026 09:06
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#189
Analyzed all prompt-related issues (ProverCoderAI#96, ProverCoderAI#101, ProverCoderAI#78, ProverCoderAI#41, ProverCoderAI#54, ProverCoderAI#92, ProverCoderAI#90,
ProverCoderAI#109, ProverCoderAI#110, ProverCoderAI#111, ProverCoderAI#122, ProverCoderAI#4, ProverCoderAI#143, ProverCoderAI#108) and synthesized a comprehensive
system prompt that incorporates:

- Reasoning model from AGENTS.md (role simulation, not personal opinions)
- Deep Research process rule (internal, not response format)
- Instrumental behavior requirements (use tools, don't offer guides)
- Mandatory subagent usage for task delegation (ProverCoderAI#101, ProverCoderAI#4)
- Plan mode on clone (ProverCoderAI#54)
- Mandatory response contract addressing trust gap (ProverCoderAI#96):
  status, root cause, what changed, verification, where to check
- Proof of execution requirements in PRs (ProverCoderAI#92):
  screenshots, logs, artifacts in .knowledge/evidence/
- Research loop for uncertainty/failures
- Stricter type safety rules (unknown/as boundaries)
- Monadic composition bans (async/await, Promise chains in prod code)
- Effect-TS resource management (acquireRelease + scoped)
- Boundary data decoding requirement

Both CLAUDE.md and AGENTS.md are now aligned with each other and with
the more comprehensive version that was already in AGENTS.md, plus the
new requirements from the issues listed above.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Пройдись по всем моим Issues в которых я писал информацию об промте и составь мне системный промт исходя из того что я там просил + того что есть уже сейчас docs(prompt): unify system prompt from all issue requirements Mar 24, 2026
@konard konard marked this pull request as ready for review March 24, 2026 09:21
@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $4.654270
  • Calculated by Anthropic: $2.908727 USD
  • Difference: $-1.745543 (-37.50%)

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1678KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@skulidropek
Copy link
Contributor

Ты не понял. Я хотел обновить системный прмот для docker-git контейнерах. ОН зашит в коде

@konard konard marked this pull request as draft March 24, 2026 11:17
@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-03-24T11:17:02.908Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

Update the code-embedded system prompts that are injected into
CLAUDE.md, AGENTS.md, and GEMINI.md when docker-git containers start.

Extracts shared behavioral instructions into a new
system-prompt-content.ts module and injects them into all three
agent templates (claude, codex, gemini).

New prompt sections based on issues ProverCoderAI#96, ProverCoderAI#101, ProverCoderAI#78, ProverCoderAI#41, ProverCoderAI#54, ProverCoderAI#92, ProverCoderAI#90:
- Isolated environment awareness
- Instrumental behavior (execute, don't guide)
- Deep Research process rule
- Mandatory subagent delegation with plan mode
- Mandatory response contract (status, root cause, changes, verification)
- Proof of execution requirements in PRs
- Public API usage (no localhost URLs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title docs(prompt): unify system prompt from all issue requirements feat(core): enrich hardcoded system prompts in container templates Mar 24, 2026
@konard konard marked this pull request as ready for review March 24, 2026 11:54
@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $6.379617
  • Calculated by Anthropic: $4.165636 USD
  • Difference: $-2.213981 (-34.70%)

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1754KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit or discard them.

Uncommitted files:

?? ci-logs/

Auto-restart will stop after changes are committed or discarded, or after 2 more iterations. Please wait until working session will end and give your feedback.

konard and others added 2 commits March 24, 2026 12:04
…equirements

Add missing behavioral sections from issues ProverCoderAI#96, ProverCoderAI#41, ProverCoderAI#92, ProverCoderAI#4, ProverCoderAI#54:
- Role/goal definition (mathematician-programmer, ProverCoderAI#41)
- Research loop on failures (ProverCoderAI#41, AGENTS.md)
- Claim safety rule - no "fixed" without proof (ProverCoderAI#96)
- Visibility rule - check why user may not see result (ProverCoderAI#96)
- CI/CD rule - always return failing step + reproduce command (ProverCoderAI#96)
- Rational comments format (CHANGE/WHY/REF, ProverCoderAI#41)
- Micro-agent creation capability (ProverCoderAI#4)
- Detailed proof-of-execution requirements (ProverCoderAI#92)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

🔄 Auto-restart 1/3 Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.236396
  • Calculated by Anthropic: $1.770646 USD
  • Difference: $-1.465750 (-45.29%)

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (2978KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 24, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants