name: Skill Docs Freshness
on: [push, pull_request]
jobs:
  check-freshness:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: oven-sh/setup-bun@v2
      - run: bun install
      - name: Check Claude host freshness
        run: bun run gen:skill-docs
      - name: Verify Claude skill docs are fresh
        run: |
          git diff --exit-code || {
            echo "Generated SKILL.md files are stale. Run: bun run gen:skill-docs"
            exit 1
          }
      - name: Check Codex host freshness
        run: bun run gen:skill-docs --host codex
      - name: Verify Codex skill docs are fresh
        run: |
          git diff --exit-code -- .agents/ || {
            echo "Generated Codex SKILL.md files are stale. Run: bun run gen:skill-docs --host codex"
            exit 1
          }
      - name: Generate Factory skill docs
        run: bun run gen:skill-docs --host factory
      - name: Verify Factory skill docs are fresh
        run: |
          git diff --exit-code -- .factory/ || {
            echo "Generated Factory SKILL.md files are stale. Run: bun run gen:skill-docs --host factory"
            exit 1
          }
