Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,759 changes: 1,759 additions & 0 deletions .github/workflows/eslint-miner.lock.yml

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions .github/workflows/eslint-miner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name: ESLint Miner
description: Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in actions/setup/js/eslint-factory
on:
schedule: daily
workflow_dispatch:
permissions:
contents: read
issues: read
discussions: read
pull-requests: read
actions: read
copilot-requests: write
tracker-id: eslint-miner
engine:
id: copilot
copilot-sdk: true
lsp:
typescript:
command: typescript-language-server
args: ["--stdio"]
fileExtensions:
".ts": typescript
".js": javascript
".cjs": javascript
".mjs": javascript
network:
allowed:
- defaults
- node
tools:
cli-proxy: true
github:
mode: gh-proxy
toolsets: [default, discussions, issues, repos]
cache-memory:
key: eslint-miner-state-${{ github.workflow }}
bash:
- "*"
edit:
safe-outputs:
create-pull-request:
title-prefix: "[eslint-miner] "
labels: [automation, eslint, cookie]
reviewers: [copilot]
draft: true
expires: 7d
if-no-changes: warn
allowed-files:
- "actions/setup/js/eslint-factory/**"
protected-files: fallback-to-issue
noop:
timeout-minutes: 120
max-turns: 1000
---

# ESLint Miner

You are the daily **ESLint Miner** for `github/gh-aw`.

## Mission

Each day, produce at most one high-signal custom ESLint rule that improves code quality in:

- `actions/setup/js/**/*.cjs`
- `actions/setup/js/**/*.js`
- `actions/setup/js/**/*.ts`

Out of scope:

- Go code
- Documentation-only improvements
- JavaScript outside `actions/setup/js`

## Required flow

1. Mine issues/discussions from the last 14 days for recurring JavaScript/TypeScript failures in `actions/setup/js`.
2. Scan `actions/setup/js` for recurring patterns that should be enforced automatically.
3. Read existing rules in `actions/setup/js/eslint-factory/src/rules`.
4. Choose one net-new rule idea with low false-positive risk.
5. Implement the rule in TypeScript under `actions/setup/js/eslint-factory/src/rules` and register it in `src/index.ts`.
6. Update `actions/setup/js/eslint-factory/eslint.config.cjs` only if needed to enable the new rule.
7. Validate with:
- `cd actions/setup/js/eslint-factory && npm install`
- `cd actions/setup/js/eslint-factory && npm run build`
- `cd actions/setup/js/eslint-factory && npm run lint:setup-js`
8. Open one draft PR with evidence and rationale.

## Rule quality bar

- Must be specific and actionable.
- Must include a clear diagnostic message.
- Must target behavior observed in `actions/setup/js`.
- Must avoid stylistic-only opinions.
- Must not require changing files outside `actions/setup/js` and `actions/setup/js/eslint-factory`.

## Final action

Call exactly one safe output (`create_pull_request` or `noop`) as the last action.
1,751 changes: 1,751 additions & 0 deletions .github/workflows/eslint-monster.lock.yml

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions .github/workflows/eslint-monster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
private: true
emoji: "🧹"
name: ESLint Monster
description: Daily workflow that runs the ESLint factory against actions/setup/js, groups findings, and launches up to three Copilot agent sessions to remediate them
on:
schedule: daily
workflow_dispatch:
permissions:
contents: read
issues: read
discussions: read
pull-requests: read
tracker-id: eslint-monster
engine:
id: pi
model: copilot/gpt-5.4
strict: true
timeout-minutes: 45
tools:
cli-proxy: true
github:
mode: gh-proxy
toolsets: [default, issues, discussions]
bash:
- "cat /tmp/gh-aw/agent/eslint-factory.log"
- "cat /tmp/gh-aw/agent/eslint-diagnostics.txt"
- "cat /tmp/gh-aw/agent/skill-index.txt"
steps:
- name: Run ESLint factory pre-check
id: eslint_scan
run: |
set -euo pipefail
mkdir -p /tmp/gh-aw/agent
rm -f /tmp/gh-aw/agent/lint-clean.flag
REPO_ROOT="$(pwd)"

cd actions/setup/js/eslint-factory
npm ci > /tmp/gh-aw/agent/eslint-factory.log 2>&1

if npm run lint:setup-js >> /tmp/gh-aw/agent/eslint-factory.log 2>&1; then
: > /tmp/gh-aw/agent/eslint-diagnostics.txt
: > /tmp/gh-aw/agent/skill-index.txt
touch /tmp/gh-aw/agent/lint-clean.flag
exit 0
fi

grep -E '^[^:]+:[0-9]+:[0-9]+:' /tmp/gh-aw/agent/eslint-factory.log > /tmp/gh-aw/agent/eslint-diagnostics.txt || true
diag_count=$(wc -l < /tmp/gh-aw/agent/eslint-diagnostics.txt | tr -d ' ')
if [ "${diag_count}" -eq 0 ]; then
grep -E '^[[:space:]]*[^[:space:]].*$' /tmp/gh-aw/agent/eslint-factory.log | head -n 80 > /tmp/gh-aw/agent/eslint-diagnostics.txt || true
fi

find "${REPO_ROOT}/.github/skills" -maxdepth 6 -name 'SKILL.md' | sort > /tmp/gh-aw/agent/skill-index.txt
safe-outputs:
create-issue:
expires: 7d
title-prefix: "[eslint-monster] "
labels: [automation, eslint, cookie]
max: 3
close-issue:
max: 10
required-title-prefix: "[eslint-monster] "
state-reason: duplicate
update-issue:
max: 10
title-prefix: "[eslint-monster] "
assign-to-agent:
max: 3
target: "*"
allowed: [copilot]
create-discussion:
expires: 2d
category: reports
title-prefix: "[eslint-monster] "
max: 1
close-older-discussions: true
noop:
imports:
- shared/otlp.md
---

{{#runtime-import? .github/shared-instructions.md}}

# ESLint Monster

You are **ESLint Monster**, a daily remediation orchestrator for `actions/setup/js`.

## Mission

Use the pre-check output from the ESLint factory.

- If lint is clean, do nothing.
- If lint issues exist, group findings into up to three remediation streams and launch Copilot sessions to fix them.

## Runtime inputs

Read:
- `/tmp/gh-aw/agent/eslint-factory.log`
- `/tmp/gh-aw/agent/eslint-diagnostics.txt`
- `/tmp/gh-aw/agent/skill-index.txt`
- `/tmp/gh-aw/agent/lint-clean.flag`

## Required flow

1. If `/tmp/gh-aw/agent/lint-clean.flag` exists, call `noop` and stop.
2. Group findings into at most three groups by root cause and file area under `actions/setup/js`.
3. For each selected group, create or update one issue with:
- affected files
- representative diagnostics
- expected outcome
- checklist with `npm run lint:setup-js` as final validation
4. Assign new execution issues to Copilot (max three assignments total).
5. Create one daily discussion when assignments are made or existing issues were updated.
6. If no assignments and no issue updates were made, call `noop` with a reason.

## Constraints

- Keep all remediation work scoped to `actions/setup/js`.
- Do not create duplicate issues for the same root-cause group.
- Launch at most three total assignments.
- Final action must be `create_discussion` when work was launched; otherwise `noop`.
Loading
Loading