Files
pbakaus_impeccable/.github/workflows/sync-generated-output.yml
T
Forgeandplamb 5ce4a5c6b5 Add Hermes Agent as a supported provider
Impeccable now ships a Hermes-compatible bundle under dist/hermes/.hermes/skills/.
Hermes reads the Agent Skills spec as-is, so the bundle uses the four spec
frontmatter fields (name, description, version, license) plus metadata/compatibility
and drops the Claude/Codex-specific extensions Hermes would silently ignore.

The .hermes/skills/ tracked root and the regenerated pin.mjs mirrors will be
produced by .github/workflows/sync-generated-output.yml after this lands; per
AGENTS.md, generated harness churn stays out of feature PRs.

What a Hermes user gets:
- npx impeccable install --providers=hermes --scope=project writes
  .hermes/skills/impeccable/ into the cwd.
- npx impeccable install --providers=hermes --scope=user honors $HERMES_HOME,
  so a profile-scoped install (HERMES_HOME=~/.hermes/profiles/forge) lands in
  the active profile's skills dir, not the default ~/.hermes/. Cross-home
  HERMES_HOME inheritance is ignored so test isolation holds.
- /impeccable registers as a Hermes slash command and routes sub-commands via
  the Commands table in the skill body, since user-invocable / argument-hint
  are not honored by Hermes' skill loader.

What a Hermes user does NOT get, and why:
- No hook surface. Impeccable's PostToolUse/Stop anti-pattern detector on
  Claude/Codex/Cursor/Grok/GitHub does not translate to Hermes, which has no
  equivalent tool event lifecycle. The skill body still ships.
- No writeOpenAIMetadata, agentFormat, or emitHooks. Hermes has no per-skill
  tool ACL, no subagent on-disk format, and no hooks.json equivalent.

Verified end-to-end with hermes-agent v0.18.2: /impeccable polish and
/impeccable critique both load reference/<command>.md and return the
documented first step. parse_frontmatter accepts the generated SKILL.md,
scan_skill_commands registers /impeccable, and the full default test suite
passes (267/267 in the critical files; 0 fail across all suites).
2026-08-06 00:03:12 -07:00

137 lines
4.3 KiB
YAML

name: Sync Generated Provider Output
on:
push:
branches: [main]
paths:
- ".claude-plugin/**"
- "cli/engine/**"
- "skill/**"
- "scripts/**"
- "package.json"
- "bun.lock"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: sync-generated-output
cancel-in-progress: false
env:
GENERATED_PATHS: >-
.agents
.claude
.cursor
.gemini
.github/skills
.grok
.hermes
.kiro
.opencode
.pi
.qoder
.rovodev
.trae
.trae-cn
.vibe
plugin
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
# Optional PAT or GitHub App token. With the default GITHUB_TOKEN,
# GitHub suppresses follow-up workflow runs from the generated commit.
token: ${{ secrets.SYNC_GENERATED_OUTPUT_TOKEN || github.token }}
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: 24
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build release output
run: bun run build:release
- name: Check generated output drift
id: drift
run: |
changes="$(git status --porcelain -- $GENERATED_PATHS)"
if [ -z "$changes" ]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No generated provider output drift."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
printf '%s\n' "$changes"
fi
- name: Commit generated output
id: commit
if: steps.drift.outputs.changed == 'true'
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# A push can lose the race against a human commit landing on main
# during the ~30s build window (issue #388: ~10% of runs). Instead
# of aborting and waiting for an unrelated push to re-trigger the
# sync, re-sync to the latest main, rebuild against the current
# source, and push again, with backoff. Every attempt builds from
# a fresh origin/main, so pushed output always matches the source
# state it lands on.
for attempt in 1 2 3 4 5; do
git add $GENERATED_PATHS
if git diff --cached --quiet; then
# The race that beat us was another sync (or the rebuilt output
# matches the new main); nothing left to push.
echo "No generated output drift after rebuild (attempt $attempt); nothing to push."
echo "pushed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
git commit -m "Sync generated provider output"
git fetch origin main
if git merge-base --is-ancestor origin/main HEAD && git push origin HEAD:main; then
echo "Pushed generated output on attempt $attempt."
echo "pushed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# The recovery work is pointless on the final attempt: nothing
# would consume the rebuild, and the backoff would only delay
# the failure.
if [ "$attempt" = 5 ]; then break; fi
echo "Push did not land on attempt $attempt (main advanced, or the push itself failed); re-syncing and rebuilding."
git reset --hard origin/main
bun install --frozen-lockfile
bun run build:release
sleep $((attempt * 5))
done
echo "::error::Could not push generated output after 5 attempts (main kept advancing, or pushes kept failing); rerun this workflow on the latest main."
exit 1
- name: Summarize generated output commit
if: steps.drift.outputs.changed == 'true'
run: |
if [ "${{ steps.commit.outputs.pushed }}" = "true" ]; then
echo "Committed generated provider output directly to main." >> "$GITHUB_STEP_SUMMARY"
else
echo "Generated output drift resolved itself after a mid-run rebuild; nothing was pushed." >> "$GITHUB_STEP_SUMMARY"
fi