For the complete documentation index, see llms.txt. This page is also available as Markdown.

Developer Productivity Agents

AI-powered agents for feature flag cleanup, framework upgrades, and repository onboarding, automating common engineering workflows that are tedious and time-consuming.

Harness Developer Productivity agents automate common engineering workflows that are tedious and time-consuming. The Feature Flag Cleanup agent removes stale flags from codebases, the React Upgrade agent handles framework upgrades with custom prompts, and the Onboarding agent imports repositories and auto-generates CI pipelines.

Feature Flag Cleanup Agent

The Feature Flag Cleanup agent removes stale feature flags from codebases. Given a feature flag name and the desired treatment (e.g., on or off), it uses Claude AI to find all flag references, remove evaluations while keeping only the selected treatment's code path, and clean up unused imports and variables.

How it works

  1. Task Generation: Generates a detailed cleanup prompt based on the flag name and desired treatment.

  2. Code Analysis: Claude AI (up to 50 iterations) scans the codebase for all flag references.

  3. Flag Removal: Removes flag evaluations, keeping only the code path for the selected treatment.

  4. Cleanup: Removes unused imports, variables, and dead code left by flag removal.

  5. Draft PR: Pushes changes and creates a draft PR via the Harness Code API.

Key inputs

Input
Type
Description

anthropicKey

secret

Anthropic API key for Claude AI

harnessApiKey

secret

Harness API key for creating PRs

featureFlag

string

Name of the feature flag to remove

treatment

string

Desired treatment to keep (default: on)

repo

string

Repository name

branch

string

Target branch

Output artifacts

  • branch.txt: Name of the created branch

  • commit.txt: Commit SHA of the changes

  • pr_title.txt: AI-generated PR title

  • pr_description.txt: AI-generated PR description

Pipeline configuration

DRAFT PR REVIEW

The Feature Flag Cleanup agent creates draft PRs so your team can review the changes before merging. It generates both a PR title and description using AI, making the review process easy to understand.

React Upgrade Agent

The React Upgrade agent automates React version upgrades and code modifications using custom prompts. Despite its name, it's the most flexible agent; it accepts any free-form prompt, making it suitable for framework upgrades, refactoring, dependency updates, and performance optimization.

Use cases

  • Upgrade React from version 17 to 18

  • Refactor class components to functional components with hooks

  • Update deprecated API usage across the codebase

  • Migrate from one state management library to another

  • Apply performance optimizations based on custom criteria

Key inputs

Input
Type
Description

llmConnector

connector

LLM connector for AI operations

harnessKey

secret

Harness API key

gitConnector

connector

Git connector for repository access

repo

string

Repository name

branch

string

Target branch

prompt

string

Custom prompt describing the upgrade/modification task (required)

Pipeline configuration

FLEXIBLE BRANCHING

The React Upgrade agent uses up to 300 AI iterations and creates branches with timestamps (e.g., react-upgrade-code-agent-1706123456) to avoid conflicts when running multiple upgrades.

Onboarding Agent

The Onboarding agent streamlines repository setup in Harness. It imports repositories from GitHub into Harness Code, analyzes the repo structure to detect technologies and build commands, and auto-generates a CI pipeline tailored to the project.

How it works

  1. Repository Import: Clones the source repository from GitHub and imports it into Harness Code.

  2. Technology Detection: Claude Sonnet analyzes the repo structure (languages, frameworks, build tools, dependencies).

  3. Pipeline Generation: Claude Opus generates a complete CI pipeline based on the detected technology stack.

  4. Pipeline Creation: The generated pipeline is created in Harness via the API.

Unique architecture

  • Uses two different Claude models: Sonnet for fast analysis, Opus for high-quality pipeline generation

  • No clone step in the pipeline; the agent container itself handles repository cloning

  • Runs on linux/amd64 platform (unlike most agents that use arm64)

Key inputs

Input
Type
Description

anthropicKey

secret

Anthropic API key for Claude AI

harnessKey

secret

Harness API key for creating repos and pipelines

scmToken

secret

Optional SCM token for private repository access

repoNamespace

string

Source repository namespace/owner (e.g., myorg)

repoName

string

Source repository name

connectorRef

string

Harness connector reference for git operations (optional)

Pipeline configuration

MIGRATION MADE EASY

The Onboarding agent is perfect for teams migrating to Harness. It can import existing GitHub repositories and automatically generate CI pipelines, dramatically reducing the time to get started with Harness CI.

Last updated

Was this helpful?