Skip to content

Comments

Add refiner workflow for automated code style and security analysis#15307

Merged
pelikhan merged 2 commits intomainfrom
copilot/refine-code-style-and-tests
Feb 13, 2026
Merged

Add refiner workflow for automated code style and security analysis#15307
pelikhan merged 2 commits intomainfrom
copilot/refine-code-style-and-tests

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Implements an agentic workflow that analyzes pull requests for style violations, security issues, and test coverage gaps when labeled with "refine". Creates a refinement PR with fixes.

Workflow Configuration

Trigger: pull_request labeled refine
Engine: Copilot with lockdown mode
Safe outputs: create-pull-request, add-comment
Timeout: 30 minutes with per-PR concurrency control

Analysis Phases

  • Style alignment: Validates Go/JS/test files against AGENTS.md and scratchpad/dev.md conventions

    • Console formatting patterns (console.Format*Message())
    • Logger usage (logger.New("pkg:filename"))
    • Error wrapping, channel lifecycle, type patterns
    • Build tags for test files
  • Security scanning: Detects malicious patterns

    • Obfuscated payloads, backdoors, credential harvesting
    • Template/command injection, path traversal
    • Workflow command injection (::command:: patterns)
  • Test improvements: Identifies coverage gaps

    • Missing edge cases and error paths
    • Incorrect use of require.* vs assert.*
    • Table-driven test patterns

Output

Creates PR with [refiner] prefix containing style fixes, security patches, and test additions. Adds comment to original PR linking to refinement.

Exits without creating PR if code already follows conventions or if malicious code detected (reports instead).

Original prompt

Create an agentic workflow that is triggered on a labelled pull request with "refine".

This agentic workflow is meant to align the style of the code of the pull request (the final merge commit) with the general style of this repo according to AGENTS.md and scratchpad/dev.md.

Also look for suspicious code, backdoors or other potential hidden abuses.

Add tests, cleanup. Create a pull request with the updates.

"Refiner"

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refine code style and add tests for pull request Add refiner workflow for automated code style and security analysis Feb 13, 2026
Copilot AI requested a review from pelikhan February 13, 2026 06:45
@pelikhan pelikhan marked this pull request as ready for review February 13, 2026 06:48
Copilot AI review requested due to automatic review settings February 13, 2026 06:48
@pelikhan pelikhan merged commit 570e966 into main Feb 13, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/refine-code-style-and-tests branch February 13, 2026 06:48
Copy link
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 implements an automated "refiner" workflow that analyzes pull requests labeled with "refine" to align code style with repository conventions, detect security issues, and improve test coverage. The workflow creates a refinement PR with fixes when issues are found.

Changes:

  • Adds .github/workflows/refiner.md defining the agentic workflow mission, phases, and detailed instructions for code analysis and refinement
  • Adds .github/workflows/refiner.lock.yml compiled workflow file with job orchestration, safe outputs configuration, and threat detection

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/refiner.md Workflow definition with comprehensive prompt covering style alignment (Go/JS/test conventions), security scanning (malicious patterns, injection vulnerabilities), test improvement guidance, and edge case handling
.github/workflows/refiner.lock.yml Compiled GitHub Actions workflow with label trigger, Copilot engine, lockdown mode, safe outputs (create-pull-request, add-comment), and threat detection job

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pelikhan pushed a commit that referenced this pull request Feb 13, 2026
…15319)

* Add refiner workflow for automated code style and security analysis (#15307)

* test: avoid flaky readonly dir assertion in extractZipFile (#15312)

* docs: add unassign-from-user safe output documentation (#15310)

* Fix TypeScript type errors in error handling for unknown types (#15308)

* Initial plan

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pelikhan pushed a commit that referenced this pull request Feb 13, 2026
* Clean validate_memory_files.cjs - modernize code with arrow functions and optional chaining

* Fix JavaScript formatting in merge_remote_agent_github_folder.cjs (#15316)

* Merge main branch and resolve conflicts in validate_memory_files.cjs (#15319)

* Add refiner workflow for automated code style and security analysis (#15307)

* test: avoid flaky readonly dir assertion in extractZipFile (#15312)

* docs: add unassign-from-user safe output documentation (#15310)

* Fix TypeScript type errors in error handling for unknown types (#15308)

* Initial plan

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: JSweep Bot <jsweep-bot@github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Mark L <73659136+liuxiaopai-ai@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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