# Infra Sonarqube Ops

> SonarQube 代码质量平台 day-2 运维：探活、项目管理、质量门禁、扫描触发与结果解读、Token 管理。配套 CLI sonarqubectl。当用户提到 SonarQube、sonarqubectl、代码质量扫描、质量门禁、sonar-scan 时触发。

- **Type:** Skill
- **Install:** `agentstack add skill-seed-forge-harness-ai-kit-infra-sonarqube-ops`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [seed-forge](https://agentstack.voostack.com/s/seed-forge)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [seed-forge](https://github.com/seed-forge)
- **Source:** https://github.com/seed-forge/harness-ai-kit/tree/main/skills/infra-sonarqube-ops
- **Website:** https://pypi.org/project/harness-ai-kit/

## Install

```sh
agentstack add skill-seed-forge-harness-ai-kit-infra-sonarqube-ops
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# infra-sonarqube-ops

SonarQube Community Edition 代码质量平台的 day-2 运维操作手册。覆盖健康检查、项目管理、质量门禁配置与查询、扫描任务触发与结果解读、Token 生命周期管理。

## 平台信息

平台地址通过配置注入（`~/.harness-ai-kit/config.yaml` 的 `assets.sonarqubectl` 段），不在本技能硬编码。版本以实际部署为准（Community Edition 与 Developer Edition 功能差异见下文）。

## 用途

- 平台健康检查与探活
- 项目 CRUD 管理
- 质量门禁列表、详情、项目状态检查
- 扫描任务触发与状态查询
- 项目指标（Bugs/Vulnerabilities/Coverage 等）查看
- 用户 Token 生成/列表/撤销

## 输入

- 项目 Key（project key）
- Token 名称
- 环境变量 `SONARQUBE_URL` + `SONARQUBE_TOKEN`

## 输出

- 健康检查报告（版本、状态）
- 项目列表/详情
- 质量门禁状态（PASSED/ERROR + 条件明细）
- 扫描任务状态（PENDING/IN_PROGRESS/SUCCESS/FAILED）
- 项目指标摘要

## 工作流

### 1. 探活

```bash
# 快速健康检查
sonarqubectl health
# 预期: ✅ SonarQube 10.7.0.96327 — status: UP

# 带 JSON 输出
sonarqubectl --json health
```

### 2. 项目管理

```bash
# 列出所有项目
sonarqubectl project list

# 搜索项目
sonarqubectl project list -q "my-app"

# 查看项目详情
sonarqubectl project get my-project-key

# 创建项目
sonarqubectl project create my-new-project --name "My New Project"

# 删除项目（需确认）
sonarqubectl project delete my-old-project
```

### 3. 质量门禁

```bash
# 列出所有质量门禁
sonarqubectl qualitygate list

# 查看门禁详情（含条件列表）
sonarqubectl qualitygate get 1

# 检查项目的门禁状态
sonarqubectl qualitygate check my-project-key
# 预期输出:
# ✅ Quality Gate: OK
#   new_reliability_rating: A ( 结构化同源见 `decisions.yaml`；以下为人类可读汇总。

| # | 决策点 | 触发条件 | 选项 | 默认行为 |
|---|--------|---------|------|---------|
| HD-1 | 删除项目 | 准备删除 SonarQube 项目时 | 确认后删除 / 取消 | 必问 |
| HD-2 | 重置 Token | 准备重置/重新生成 Token 时 | 确认后重置 / 取消 | 必问 |

参考文档：
- references/REFERENCE-SONARQUBECTL-CLI.md

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [seed-forge](https://github.com/seed-forge)
- **Source:** [seed-forge/harness-ai-kit](https://github.com/seed-forge/harness-ai-kit)
- **License:** Apache-2.0
- **Homepage:** https://pypi.org/project/harness-ai-kit/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-seed-forge-harness-ai-kit-infra-sonarqube-ops
- Seller: https://agentstack.voostack.com/s/seed-forge
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
