Skip to content

feat(assistant): add engineering principles to system prompt - #250

Merged
omarluq merged 1 commit into
mainfrom
feat/internal-engineering-principles
Aug 4, 2026
Merged

feat(assistant): add engineering principles to system prompt#250
omarluq merged 1 commit into
mainfrom
feat/internal-engineering-principles

Conversation

@omarluq

@omarluq omarluq commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • add qualified engineering principles to AGENTS.md
  • inject the principles into the internal assistant system prompt
  • add regression coverage for prompt composition

Validation

  • mise exec -- go test ./...
  • mise exec -- task build
  • mise exec -- task ci

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Added engineering principles covering contract preservation, simplicity, incremental development, modularity, reliable dependencies, code inspection, and durable architecture.
  • Improvements

    • Integrated these principles into the assistant’s baseline guidance to support more consistent and maintainable responses.

Walkthrough

The change adds engineering principles to AGENTS.md and to the assistant base system prompt. Tests verify the heading and five principles in the generated prompt.

Changes

Engineering Principles

Layer / File(s) Summary
Engineering principles prompt integration
internal/assistant/runtime_context.go, AGENTS.md, internal/assistant/agent_runtime_wrappers_internal_test.go
The base system prompt now includes guidance on compatibility, simplicity, incremental development, modularity, dependency reuse, code inspection, and long-term architecture. AGENTS.md documents the guidance, and tests verify key prompt content.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

I’m a rabbit with principles neat,
Prompt guidance makes the system complete.
Contracts stay sound,
Simple steps go round,
And durable designs take root beneath my feet.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description accurately summarizes the engineering principles, system prompt changes, regression coverage, and validation commands.
Title check ✅ Passed The title clearly and concisely describes adding engineering principles to the assistant system prompt.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/internal-engineering-principles

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
internal/assistant/agent_runtime_wrappers_internal_test.go (1)

147-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert all seven engineering principles.

The test checks five principle strings. It does not fail if the compatibility, incremental-delivery, or dependency-reuse guidance is removed from baseSystemPrompt. Add all seven expected strings, preferably in a table-driven loop, to protect the AGENTS.md and runtime prompt contract.

As per coding guidelines, **/*_test.go should prefer table-driven tests for core behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assistant/agent_runtime_wrappers_internal_test.go` around lines 147
- 151, Update the test around the prompt assertions in the relevant test
function to cover all seven engineering principles, adding the missing
compatibility, incremental-delivery, and dependency-reuse strings from
baseSystemPrompt. Prefer a table-driven loop over individual assert.Contains
calls while preserving the existing prompt validation.

Source: Coding guidelines

internal/assistant/runtime_context.go (1)

92-107: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Keep engineering principles in one source.

LoadAgentInstructions includes the repository-root AGENTS.md, whose seven engineering principles duplicate engineeringPrinciplesPrompt. This duplicate text increases SystemTokens. De-duplicate the principles or retain only one source of truth.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assistant/runtime_context.go` around lines 92 - 107, Update
LoadAgentInstructions and engineeringPrinciplesPrompt so the seven engineering
principles are supplied from only one source of truth; remove the duplicated
principle text from the runtime prompt or exclude it from the AGENTS.md
instructions, while preserving the remaining agent guidance and reducing
SystemTokens.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@internal/assistant/agent_runtime_wrappers_internal_test.go`:
- Around line 147-151: Update the test around the prompt assertions in the
relevant test function to cover all seven engineering principles, adding the
missing compatibility, incremental-delivery, and dependency-reuse strings from
baseSystemPrompt. Prefer a table-driven loop over individual assert.Contains
calls while preserving the existing prompt validation.

In `@internal/assistant/runtime_context.go`:
- Around line 92-107: Update LoadAgentInstructions and
engineeringPrinciplesPrompt so the seven engineering principles are supplied
from only one source of truth; remove the duplicated principle text from the
runtime prompt or exclude it from the AGENTS.md instructions, while preserving
the remaining agent guidance and reducing SystemTokens.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dfc21abc-1d51-4cdb-a3cb-5cb6ea2ed382

📥 Commits

Reviewing files that changed from the base of the PR and between 617e934 and 52cd7c8.

📒 Files selected for processing (3)
  • AGENTS.md
  • internal/assistant/agent_runtime_wrappers_internal_test.go
  • internal/assistant/runtime_context.go

@omarluq
omarluq merged commit 707a127 into main Aug 4, 2026
9 checks passed
@omarluq
omarluq deleted the feat/internal-engineering-principles branch August 4, 2026 18:30
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.80%. Comparing base (617e934) to head (52cd7c8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #250      +/-   ##
==========================================
- Coverage   84.81%   84.80%   -0.02%     
==========================================
  Files         320      320              
  Lines       30586    30588       +2     
==========================================
- Hits        25943    25940       -3     
- Misses       3172     3176       +4     
- Partials     1471     1472       +1     
Flag Coverage Δ
unittests 84.80% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant