-
Notifications
You must be signed in to change notification settings - Fork 2
feat(cortex-prompt-harness): add top-agent prompts integration #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
echobt
wants to merge
3
commits into
main
Choose a base branch
from
feature/top-agent-prompts-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Greptile OverviewGreptile SummaryThis PR successfully integrates Platform Network's top-agent autonomous coding prompts into the Cortex prompt harness system, providing a comprehensive and well-structured addition to the codebase. Key Changes
Code Quality
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/cortex-prompt-harness/src/prompts/top_agent.rs | Adds comprehensive top-agent prompt system with 23 modular sections, builder API, and 6 presets |
| src/cortex-prompt-harness/src/prompts/mod.rs | Integrates top_agent module with proper documentation and re-exports |
Sequence Diagram
sequenceDiagram
participant User
participant Cortex
participant TopAgentPrompts
participant Builder
participant Presets
User->>Cortex: Request top-agent prompt
Cortex->>TopAgentPrompts: Import module
alt Use Preset
Cortex->>Presets: coding_assistant()
Presets->>Builder: new()
Builder->>Builder: Load 23 sections
Presets->>Builder: with_code_execution()
Presets->>Builder: with_file_operations()
Builder->>Presets: build() → prompt string
Presets->>Cortex: Return preset prompt
else Custom Build
Cortex->>Builder: new()
Builder->>Builder: Load all sections (enabled)
Cortex->>Builder: without_section("CLEANUP")
Builder->>Builder: Disable section
Cortex->>Builder: with_variable("key", "val")
Builder->>Builder: Store variable
Cortex->>Builder: build()
Builder->>Builder: Filter enabled sections
Builder->>Builder: Apply variable substitution
Builder->>Builder: Join sections with separators
Builder->>Cortex: Return custom prompt
else Direct Access
Cortex->>TopAgentPrompts: TOP_AGENT_SYSTEM_PROMPT
TopAgentPrompts->>Cortex: Return full prompt constant
end
Cortex->>User: Provide configured prompt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
Port Platform Network's top-agent system prompts to Cortex CLI: - Add top_agent.rs with full system prompt and section constants - TopAgentPromptBuilder for dynamic prompt construction - TopAgentPresets for coding_assistant, research_assistant, code_reviewer, minimal - Tool mapping constants (read_file→Read, write_file→Write, etc.) - 23 unit tests covering all functionality
9dd0557 to
973f9ab
Compare
…p-agent prompts
- Remove SECTION_WORKSPACE_CLEANUP constant and all references
- Remove WORKSPACE_CLEANUP from TOP_AGENT_SECTION_NAMES array
- Remove WORKSPACE_CLEANUP from TopAgentPromptBuilder sections
- Remove .without_section("WORKSPACE_CLEANUP") from presets
- Update module documentation
- Update tests that referenced WORKSPACE_CLEANUP
All sections are now unconditionally included in the system prompt.
…sections - Remove conditional capability context checks (code_execution, file_operations, web_search flags) - Add CODE_EXECUTION, FILE_OPERATIONS, and WEB_SEARCH_CAPABILITY as proper sections - All capability contexts are now treated as sections that can be enabled/disabled - No more 'if keyword in prompt' patterns - all prompts are in the system prompt directly - Maintain backward compatibility with with_code_execution(), with_file_operations(), with_web_search() methods
echobt
added a commit
that referenced
this pull request
Feb 3, 2026
feat(prompts): implement skill-based dynamic prompt architecture This PR transforms the monolithic system prompt architecture into a modular skill-based system where the agent loads specialized skills on-demand based on task requirements. This reduces context window usage by only including relevant instructions. Changes: - Add builtin_skills.rs with six built-in skills (git, code-quality, file-operations, debugging, security, planning) - Add base_agent.rs with minimal base prompt and skill loading mechanism - Integrate skill system with prompt builder in cortex-engine - Add built-in skill support to UseSkill handler - Integrate top_agent module from PR #20 Benefits: - Reduced context usage (~500 tokens base vs ~2000+ monolithic) - Modular updates: skills can be updated independently - Clear organization: instructions organized by domain - Backward compatible: original monolithic prompt still available Testing: 200+ tests covering all new functionality
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
Port Platform Network's top-agent system prompts to Cortex prompt harness.
Source: Top Agent from Term Challenge - ranked top with 11/15 challenges completed.
Changes
top_agent.rsmodule with system prompt constantsTopAgentPromptBuilderfor fluent prompt constructionTopAgentPresets:coding_assistant,research_assistant,code_reviewer,minimalTesting
Compatibility
Fully compatible with existing prompt system - no breaking changes.