Class: XAeonAgents::Agents::CoderAgent

Inherits:
ComposableAgents::Cline::Agent
  • Object
show all
Includes:
XAeonAgents::AgentDefaults
Defined in:
lib/x_aeon_agents/agents/coder_agent.rb

Overview

Agent responsible for implementing tasks following an implementation plan

Instance Method Summary collapse

Methods included from XAeonAgents::AgentDefaults

#new_agent, prepended, singleton_session_id

Constructor Details

#initialize(**agent_params) ⇒ CoderAgent

Constructor

Parameters:

  • agent_params (Hash{Symbol => Object})

    Extra agent parameters



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/x_aeon_agents/agents/coder_agent.rb', line 18

def initialize(**agent_params)
  super(
    name: 'Coder',
    role: 'You are a Coder agent',
    objective: <<~EO_OBJECTIVE,
    system_instructions: <<~EO_INSTRUCTIONS,
    constraints: <<~EO_CONSTRAINTS,
      Remember:
      - Always adhere to existing code conventions and patterns.
      - Use only libraries and frameworks that are confirmed to be in use in the current codebase.
      - Provide complete and functional code without omissions or placeholders.
      - Be explicit about any assumptions or limitations in your solution.
      - Always show your planning process before executing any task.
        This will help ensure that you have a clear understanding of the requirements and that your approach aligns with the user's needs.
      - Always use absolute paths when referring to files.
      - You can call multiple tools in a single response.
        Before using tools, identify every independent read, search, command, or edit needed for the next step and emit all of those tool calls now, either as multiple tool calls or as one batched input for tools that accept arrays.
        Do not wait for one independent result before requesting another.
        Do not split independent reads, searches, checks, or edits across separate turns.
      - Good parallelism examples: read all known relevant files in one read_files call;
        run independent inspection commands in one run_commands call;
        emit independent read_files, search_codebase, and run_commands calls together in one response;
        emit multiple editor calls together when editing different files or non-overlapping regions.
      - Always verify the files you have edited or created at the end of the task to ensure they are completed and working as expected.

      REMEMBER, be helpful and proactive!
      Don't ask for permission to do something when you can do it!
      Do not indicates you will be using a tool unless you are actually going to use it.

      IMPORTANT: Always includes tool calls in your response until the task is completed.
      Response without tool calls will be considered as completed with the final answer.

      Do not indicate that you will perform an action without actually doing it.
      Always provide the final result in your response.
      Always validate your answer with checking the code and running it if possible.
    EO_CONSTRAINTS
    skills: %w[
      applying-ruby-conventions
      applying-test-conventions
      enforcing-project-rules
    ],
    **agent_params
  )
end

Instance Method Details

#input_artifacts_contractsHash{Symbol => Object}

Define input artifacts contracts

Returns:

  • (Hash{Symbol => Object})

    Set of input artifacts description, per artifact name



11
12
13
# File 'lib/x_aeon_agents/agents/coder_agent.rb', line 11

def input_artifacts_contracts
  super.merge(plan: 'The implementation plan that you must follow')
end