hns-workflow-ci-loop

Polls GitHub PR checks and applies bounded automated fixes to failing CI.

1.2k|222|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/modu-ai/moai-adk --skill hns-workflow-ci-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hns-workflow-ci-loop
Source: https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/hns-workflow-ci-loop
Command: npx skills add https://github.com/modu-ai/moai-adk --skill hns-workflow-ci-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

After a pull request is created, developers waste time manually polling CI status and re-running trivial fixes. This Skill automates the watch-and-fix loop: it monitors required GitHub checks, classifies failures as mechanical or semantic, and applies safe patches within strict iteration limits.

Core Features & Use Cases

  • CI Watch Loop: Polls gh pr checks every 30 seconds against the .github/required-checks.yml source of truth, distinguishing required from auxiliary failures, with a 30-minute hard timeout.
  • Bounded Auto-Fix: On required-check failure, runs up to 3 patch iterations via a diagnosis subagent, committing each fix as a new commit (force-push prohibited) and escalating semantic failures immediately.
  • Use Case: After /moai sync creates a PR, the skill watches CI, detects a gofmt failure, applies the formatting fix automatically, pushes a new commit, and resumes watching until all required checks pass.

Quick Start

Ask the AI to watch the CI checks for the current pull request and automatically fix any mechanical failures that appear.

Frequently Asked Questions about hns-workflow-ci-loop

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

FAQPage Schema
How do I automatically watch GitHub PR checks until they pass?

Run the ci-watch script with the PR number and branch, which polls gh pr checks every 30 seconds and exits when required checks pass, fail, or hit the 30-minute timeout. For long-running PRs it uses gh pr checks --watch in the background.

How to auto-fix failing CI checks on a pull request?

When a required check fails, the skill classifies the failure as mechanical or semantic, then attempts up to 3 automated patch iterations for mechanical issues like formatting or import order. Each patch becomes a new commit, and semantic failures are escalated to the user instead.

What is the difference between required and auxiliary GitHub checks?

Required checks are defined in .github/required-checks.yml under branch patterns and must pass before merge. Auxiliary checks are advisory only and never block the ready-to-merge decision, regardless of their failure status.

Does this CI auto-fix workflow allow force-pushing?

No, force-push is absolutely prohibited, including --force, -f, and --force-with-lease. Every automated fix is pushed as a new commit so reviewers retain full diff visibility across iterations.

What happens when CI auto-fix reaches the iteration limit?

After 3 failed iterations, the skill triggers a mandatory blocking prompt offering three options: fix manually, revise the SPEC and restart implementation, or abandon the PR. Silent timeouts and automatic continuation are prohibited.

Which files are protected from automated CI patches?

Protected files include .env files, credentials and secret files, .claude/settings.json variants, .github/required-checks.yml, and scripts/ci-watch/run.sh. Any proposed patch touching these is rejected and escalated to the user.