go-agent-development

Develop and integrate Go-based build agents with heartbeat and task execution.

2.5k|521|Updated May 29, 2019
One-click install
npx skills add https://github.com/TencentBlueKing/bk-ci --skill go-agent-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-agent-development
Source: https://github.com/TencentBlueKing/bk-ci/tree/main/ai/skills/go-agent-development
Command: npx skills add https://github.com/TencentBlueKing/bk-ci --skill go-agent-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers in building and integrating a Go-based CI agent, covering architecture, heartbeat mechanisms, task execution, log reporting, upgrade flows, and interactions with the Dispatch module. It helps teams implement and extend agents to reliably communicate with the backend and perform build tasks.

Core Features & Use Cases

  • Architecture & Heartbeat: Design the agent core with a heartbeat mechanism to ensure liveness and health checks.
  • Task Execution & Logging: Implement task runners, collect and report logs, and handle task status updates.
  • Upgrade & Dispatch Interaction: Define upgrade paths and interact with the Dispatch module for task distribution and agent management.
  • Go Tooling & Conventions: Follow the repository's core structure (api/config/collector/job/util) and coding standards for Go projects.

Quick Start

Start by reviewing the Go Agent development guide to understand the architecture, then locate agent components under src/agent/ and implement or extend functionality following the guide.

Frequently Asked Questions about go-agent-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a heartbeat mechanism for a Go build agent?

To implement a heartbeat mechanism for a Go build agent, design the agent core to continuously send liveness signals to the backend. This ensures reliable health checks and maintains agent availability during task execution.

What is the recommended package layout for Go agent development?

The recommended package layout for Go agent development enforces a core structure using api, config, collector, job, and util directories. Following these conventions ensures proper logging, error handling, and parallelism in agent projects.

How does a Go CI agent handle task execution and log reporting?

A Go CI agent handles task execution by implementing task runners that execute build jobs and collect execution logs. The agent then reports these logs and updates task statuses through backend communication.

Can I use Go tooling to interact with the Dispatch module for task distribution?

Yes, you can use Go tooling to interact with the Dispatch module for task distribution. The agent communicates with Dispatch to manage task allocation, execute build jobs, and handle agent upgrade paths reliably.

What's the best way to structure agent-backend communication in a Go build agent?

The best way to structure agent-backend communication in a Go build agent is by using the provided HTTP client. This enforces conventions for secure data exchange, heartbeat transmission, and log reporting between the agent and backend.

Related Skills