feat(ci): add agentic workflow code-simplifier#222
Merged
YousefHadder merged 2 commits intomainfrom Mar 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new "Code Simplifier" agentic workflow that runs daily via GitHub Copilot CLI to analyze recently modified code, identify simplification opportunities, and create pull requests with refactoring improvements. The workflow includes a shared reporting template and an auto-generated lockfile.
Changes:
- New agentic workflow source (
.github/workflows/code-simplifier.md) with a multi-phase prompt: find recent changes → analyze & simplify → validate → create PR - New shared reporting guidelines (
.github/workflows/shared/reporting.md) imported by the code-simplifier for report formatting - Auto-generated lockfile (
.github/workflows/code-simplifier.lock.yml) produced bygh aw compile
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/code-simplifier.md |
Agentic workflow source defining the code simplifier agent prompt, frontmatter config (daily schedule, safe-outputs, expiry), and multi-phase instructions for finding, simplifying, validating, and PR-creating code changes |
.github/workflows/shared/reporting.md |
Shared template imported by code-simplifier with guidelines for report header levels, progressive disclosure, and workflow run references |
.github/workflows/code-simplifier.lock.yml |
Auto-generated lockfile (compiled from the .md source via gh aw compile) containing the full GitHub Actions workflow definition |
Comments suppressed due to low confidence (2)
.github/workflows/code-simplifier.md:131
- The "Review Project Standards" and "Key Standards to Apply" sections list conventions for Go, JavaScript/TypeScript, Python, and .NET/C# but have no mention of Lua at all. This repository is a Lua/Neovim plugin. The agent should be instructed to check
.github/CLAUDE_CONTEXT.md,CONTRIBUTING.md,.luacheckrc,.stylua.toml, andlua/markdown-plus/types.luafor project conventions. Consider adding a Lua section covering LuaCATS annotations, Lua 5.1 compatibility, stylua formatting, and luacheck linting.
Before simplifying, review the project's coding standards from relevant documentation:
- For Go projects: Check `AGENTS.md`, `DEVGUIDE.md`, or similar files
- For JavaScript/TypeScript: Look for `CLAUDE.md`, style guides, or coding conventions
- For Python: Check for style guides, PEP 8 adherence, or project-specific conventions
- For .NET/C#: Check `.editorconfig`, `Directory.Build.props`, or coding conventions in docs
**Key Standards to Apply:**
For **JavaScript/TypeScript** projects:
- Use ES modules with proper import sorting and extensions
- Prefer `function` keyword over arrow functions for top-level functions
- Use explicit return type annotations for top-level functions
- Follow proper React component patterns with explicit Props types
- Use proper error handling patterns (avoid try/catch when possible)
- Maintain consistent naming conventions
For **Go** projects:
- Use `any` instead of `interface{}`
- Follow console formatting for CLI output
- Use semantic type aliases for domain concepts
- Prefer small, focused files (200-500 lines ideal)
- Use table-driven tests with descriptive names
For **Python** projects:
- Follow PEP 8 style guide
- Use type hints for function signatures
- Prefer explicit over implicit code
- Use list/dict comprehensions where they improve clarity (not complexity)
For **.NET/C#** projects:
- Follow Microsoft C# coding conventions
- Use `var` only when the type is obvious from the right side
- Use file-scoped namespaces (`namespace X;`) where supported
- Prefer pattern matching over type casting
- Use `async`/`await` consistently, avoid `.Result` or `.Wait()`
- Use nullable reference types and annotate nullability
.github/workflows/code-simplifier.md:265
- The test, lint, and build commands listed here don't include the correct commands for this Lua/Neovim project. This repository uses
make test(notmake test-unit),make lint(luacheck), andmake format-check(stylua). There is no build step. Since the agent will try these generic commands and likely fail or skip validation, consider adding Lua-specific instructions such asmake check(which runs lint + format-check + test).
### 3.1 Run Tests
After making simplifications, run the project's test suite to ensure no functionality was broken:
```bash
# For Go projects
make test-unit
# For JavaScript/TypeScript projects
npm test
# For Python projects
pytest
# For .NET projects
dotnet test
If tests fail:
- Review the failures carefully
- Revert changes that broke functionality
- Adjust simplifications to preserve behavior
- Re-run tests until they pass
3.2 Run Linters
Ensure code style is consistent:
# For Go projects
make lint
# For JavaScript/TypeScript projects
npm run lint
# For Python projects
flake8 . || pylint .
# For .NET projects
dotnet format --verify-no-changesFix any linting issues introduced by the simplifications.
3.3 Check Build
Verify the project still builds successfully:
# For Go projects
make build
# For JavaScript/TypeScript projects
npm run build
# For Python projects
# (typically no build step, but check imports)
python -m py_compile changed_files.py
# For .NET projects
dotnet build</details>
Address PR review feedback: add .lua to file extension list, include Lua/Neovim standards section (LuaCATS, stylua, luacheck, module pattern), add Lua-specific test/lint/build commands, and fix grammar typo.
This was referenced Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add agentic workflow code-simplifier