Skip to content

Add workflow tools #21

@janole

Description

@janole

Plan: Create Dedicated Workflow Tools

Objective

To improve the robustness, maintainability, and simplicity of the agent's workflow, we will encapsulate the logic for creating Pull Request descriptions and Release Notes into dedicated tools. This moves complex, multi-step procedures from documentation (AGENTS.md) into code, making the agent's instructions simpler and the process more reliable.

Proposed File Location

New tools will be created in a dedicated file: src/ai/tools/workflow-tools.ts


Task Breakdown

Phase 1: Core Tool Development

  • Create the new file src/ai/tools/workflow-tools.ts.

    • Set up the basic structure for defining and exporting tools.
  • Implement the createPullRequestDescription tool.

    • Define the tool's schema (name, description, parameters). It should not require any parameters.
    • The tool's logic will:
      1. Automatically detect the current git branch name.
      2. Execute git diff main...<current-branch> to get the changes.
      3. Return the formatted diff output, ready for the agent to summarize.
  • Implement the createReleaseNotes tool.

    • Define the tool's schema. It might take an optional previousTag parameter, or automatically find the latest tag.
    • The tool's logic will:
      1. Find the most recent git tag (e.g., git describe --tags --abbrev=0).
      2. Get the list of commit messages between the tag and HEAD (e.g., git log <latest-tag>..HEAD --oneline).
      3. Return the formatted list of commits, ready for the agent to turn into release notes.

Phase 2: Integration & Documentation

  • Integrate the new tools into the agent's toolbelt.

    • Import the new tools in the main application logic where tools are registered.
    • Add them to the list of available tools for the AI model.
  • Update AGENTS.md documentation.

    • Remove the detailed, multi-step instructions for creating PR descriptions and release notes.
    • Replace them with simple instructions advising the agent to use the createPullRequestDescription and createReleaseNotes tools directly.

Phase 3: Verification

  • Manually test the createPullRequestDescription tool.
    • Run the agent and ask it to create a PR description to verify it uses the new tool correctly and produces the expected output.
  • Manually test the createReleaseNotes tool.
    • Run the agent and ask it to create release notes to verify the tool works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions