Skip to content

feat(ci): add agentic workflow code-simplifier#222

Merged
YousefHadder merged 2 commits intomainfrom
add-workflow-code-simplifier-5827
Mar 7, 2026
Merged

feat(ci): add agentic workflow code-simplifier#222
YousefHadder merged 2 commits intomainfrom
add-workflow-code-simplifier-5827

Conversation

@YousefHadder
Copy link
Copy Markdown
Owner

Add agentic workflow code-simplifier

Copilot AI review requested due to automatic review settings March 7, 2026 05:40
@YousefHadder YousefHadder changed the title Add agentic workflow code-simplifier feat(ci): add agentic workflow code-simplifier Mar 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by gh 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, and lua/markdown-plus/types.lua for 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 (not make test-unit), make lint (luacheck), and make 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 as make 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-changes

Fix 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.
@YousefHadder YousefHadder merged commit d4d836b into main Mar 7, 2026
15 checks passed
@YousefHadder YousefHadder deleted the add-workflow-code-simplifier-5827 branch March 7, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants