Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Implements a /cloclo command that processes content through Claude engine with Serena (static analysis), gh-aw (workflow introspection), and Playwright (browser automation) MCPs. Inspired by the legendary French singer Claude François, cloclo provides glamorous responses and always adds a beautiful summary comment on the original conversation thread. Outputs via safe-outputs only; enforces constraint against modifying .github/.workflows.

Implementation

Trigger:

  • /cloclo command in issue/PR/discussion bodies or comments
  • Uses command trigger for automatic detection and activation

Engine: Claude with max-turns=100

MCP Integrations (via imports):

  • serena - Static analysis via uvx, memory at /tmp/gh-aw/cache-memory/serena
  • gh-aw - HTTP MCP on port 8765 (status, compile, logs, audit tools)
  • jqschema - JSON structure discovery at /tmp/gh-aw/jqschema.sh

Tools:

  • Playwright (output dir: /tmp/gh-aw/mcp-logs/playwright/)
  • Edit tool for file modifications
  • Bash with JQ patterns
  • Cache-memory with persistence key

Safe Outputs:

  • create-pull-request with [cloclo] prefix and auto-labels (for new PRs)
  • add-comment - ALWAYS used to provide glamorous summary comments with emojis (✨, 🎭, 🎨, ✅, 🚀) and 👍 reaction support
  • push-to-pull-request-branch to push changes directly to PR branch when called from PR comments

Security: Read-only permissions, sanitized context (needs.activation.outputs.text), authorized expressions only

PR Context Handling: Captures number, title, state, head/base SHAs when triggered from pull requests. When called from a PR comment, changes are pushed directly to the PR branch instead of creating a new PR.

Conditional Templates: Uses {{#if}}...{{/if}} syntax to dynamically render Issue, Discussion, and Pull Request context sections only when applicable.

Glamorous Comments: Like Claude François, cloclo ALWAYS adds a beautifully formatted summary comment on the original conversation thread after completing any action, including:

  • Clear summary of what was done
  • Details about changes made
  • Links to created resources
  • Next steps for the user
  • Engaging emojis throughout

Usage

Command trigger:

/cloclo analyze authentication code using Serena for static analysis
/cloclo check documentation site with Playwright and report broken links

When called from a PR comment with code changes, the workflow will push changes directly to the PR branch and add a glamorous summary comment.

Compiled lock file: 331 KB, strict mode validated (0 errors, 0 warnings)

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.

Original prompt

create a github agentic workflow that: supports a /cloclo command to process comment content with the Claude engine and produce safe outputs across issues, pull requests, and discussions, using Sirena and gh-aw MCPs, enabling Playwright, allowing Bash tools via a JQ schema, providing memory, and avoiding commits to .github/.workflows.

Objective

Create a GitHub agentic workflow that reacts to /cloclo commands in comments on issues, pull requests, and discussions. The workflow must extract the comment content, send it as a prompt to the Claude engine, and return a safe output such as creating a pull request, creating a comment with a +1 reaction, or other defined safe-output actions. The workflow must integrate the Sirena MCP, the gh-aw MCP, support Playwright, allow Bash tools through a JQ schema, include memory, and explicitly avoid committing files inside .github/.workflows.

Context

The intent is to provide a thin wrapper that launches the Claude engine with the relevant context from the GitHub surface where the command was issued.

  • In issue comments, the comment text becomes the full prompt.
  • In pull request comments, the prompt must also include branch information.
  • In discussion comments, the comment text is used similarly to issues.
    The workflow should rely on Sirena and gh-aw shared agentic workflows to leverage existing MCP capabilities, and Playwright for automation tasks. A JQ schema must permit Bash tools, and memory should be available for contextual continuity. The workflow must never attempt to write or commit into .github/.workflows.

Requirements

  • Detect the /cloclo command in comments for:
    • Issues
    • Pull requests
    • Discussions
  • Extract the comment content and pass it as the prompt to the Claude engine.
  • Include PR branch context when invoked inside a pull request.
  • Produce safe outputs only (e.g., create a PR, create a comment, apply a +1 reaction).
  • Integrate:
    • Sirena MCP (via Sirena shared agentic workflow)
    • gh-aw MCP
  • Enable:
    • Playwright
    • Bash tools via JQ schema
    • Memory for multi-step reasoning
  • Must have access permissions for:
    • Workflows
    • Pull requests
    • Issues
    • Repository content
  • Must not commit or modify any files inside .github/.workflows.

Phases

Phase 0: Setup

  • Import the Sirena shared agentic workflow for static analysis support.
  • Import the gh-aw shared agentic workflow for agentic mining capabilities.
  • Enable Playwright in the workflow environment.
  • Enable memory and JQ schema for Bash tool usage.
  • Define permissions needed for workflows, issues, PRs, and content.
  • Ensure workflow prohibits committing to .github/.workflows.

Phase 1: Command Detection and Context Collection

  • Detect if a comment contains /cloclo.
  • IF /cloclo is found THEN:
    • Capture comment text as prompt content.
    • IF in pull request context THEN:
      • Capture source branch and related metadata.
    • END IF
  • Pass captured context into the processing phase.

Phase 2: Claude Engine Processing

  • Construct a prompt containing:
    • Comment text.
    • Associated resource context (issue / PR / discussion).
    • Branch info when applicable.
  • Send the constructed prompt to the Claude engine through the workflow’s MCP integrations.
  • Receive response in safe-output format.

Phase 3: Safe Output Execution

  • IF the response indicates creating a PR THEN
    • Create a pull request with safe-output constraints.
  • ELSE IF the response indicates adding a comment THEN
    • Add the comment and append a +1 reaction.
  • ELSE
    • Execute other safe-output actions as defined by Claude’s output.
  • END IF

Phase 4: Validation and Restrictions

  • Validate that no file writes or commits target .github/.workflows.
  • Validate that outputs follow safe-output schema.
  • Ensure successful execution of MCP-assisted tasks (Sirena, gh-aw, Playwright, Bash tools).

Acceptance Criteria

  • /cloclo command is detected in issues, pull requests, and discussions.
  • Prompt is correctly formed from comment content, with branch info for PRs.
  • Output actions adhere strictly to safe-output rules.
  • Sirena MCP and gh-aw MCP are available to the workflow.
  • Playwright and JQ-schema Bash tools are available.
  • Workflow maintains memory where applicable.
  • No writes or commits are performed under .github/.workflows.

Constraints

  • No code should be generated in this task description.
  • The workflow must avoid modifying .github/.workflows.
  • Only safe-output actions may be executed.

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub agentic workflow for /cloclo command Add /cloclo command workflow with Claude engine and MCP integrations Nov 15, 2025
Copilot AI requested a review from pelikhan November 15, 2025 00:12
Copilot finished work on behalf of pelikhan November 15, 2025 00:12
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot if it is called from a pull request comment, it should push the changes to the pull request branch (if any) - use safe output

actions: read
engine:
id: claude
max-turns: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot max turns 100

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed max-turns from 5 to 100 in commit 117ae90.

…ranch support

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

@copilot if it is called from a pull request comment, it should push the changes to the pull request branch (if any) - use safe output

Added push-to-pull-request-branch safe output in commit 117ae90. When /cloclo is called from a pull request comment, it will now push changes directly to the PR branch instead of creating a new PR.

@pelikhan
Copy link
Contributor

@copilot it should also trigger when an issue or discussion is labelled "cloclo"

Copilot finished work on behalf of pelikhan November 15, 2025 00:21
Copilot AI requested a review from pelikhan November 15, 2025 00:21
@pelikhan
Copy link
Contributor

@copilot just like the famous French singer Claude Francois, the comments left by cloclo are glamorous. cloclo always adds a comment on the original conversation thread with a summary of the changes.

…oclo"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

@copilot it should also trigger when an issue or discussion is labelled "cloclo"

Added label trigger support in commit 8e84c02. The workflow now triggers when:

  1. /cloclo is posted in issue/PR/discussion bodies or comments
  2. An issue or discussion is labeled with "cloclo"

The workflow uses an if condition to filter events for either the /cloclo command or the "cloclo" label.

Copilot AI changed the title Add /cloclo command workflow with Claude engine and MCP integrations Add /cloclo command and label trigger workflow with Claude engine and MCP integrations Nov 15, 2025
Copilot finished work on behalf of pelikhan November 15, 2025 00:31
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

@copilot just like the famous French singer Claude Francois, the comments left by cloclo are glamorous. cloclo always adds a comment on the original conversation thread with a summary of the changes.

Updated in commit ab2ad14. Cloclo is now glamorous like Claude François! The workflow now ALWAYS adds a beautifully formatted summary comment on the original conversation thread after completing any action. Comments include:

  • ✨ Glamorous emojis (✨, 🎭, 🎨, ✅, 🚀)
  • Clear summary of what was done
  • Details about changes made
  • Links to created resources
  • Next steps for the user

Whether making code changes, performing analysis, or running automation, cloclo will always leave a memorable comment! 🎭

Copilot finished work on behalf of pelikhan November 15, 2025 00:41
Comment on lines 76 to 83
## Issue Context (if applicable)

When triggered by an issue (either via label or comment):

- **Issue Number**: ${{ github.event.issue.number }}
- **Issue Title**: ${{ github.event.issue.title }}
- **Issue State**: ${{ github.event.issue.state }}

Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot Use conditional template

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use conditional template {{#if github.event.issue}}...{{/if}} in commit 047e674.

Comment on lines 84 to 89
## Discussion Context (if applicable)

When triggered by a discussion (either via label or comment):

- **Discussion Number**: ${{ github.event.discussion.number }}
- **Discussion Title**: ${{ github.event.discussion.title }}
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use conditional template

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use conditional template {{#if github.event.discussion}}...{{/if}} in commit 047e674.

Comment on lines 91 to 99
## Pull Request Context (if applicable)

**IMPORTANT**: If this command was triggered from a pull request, you must capture and include the PR branch information in your processing:

- **Pull Request Number**: ${{ github.event.pull_request.number }}
- **Pull Request Title**: ${{ github.event.pull_request.title }}
- **Source Branch SHA**: ${{ github.event.pull_request.head.sha }}
- **Target Branch SHA**: ${{ github.event.pull_request.base.sha }}
- **PR State**: ${{ github.event.pull_request.state }}
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use conditional template

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use conditional template {{#if github.event.pull_request}}...{{/if}} in commit 047e674.

Comment on lines 3 to 12
issues:
types: [opened, edited, reopened, labeled]
issue_comment:
types: [created, edited]
pull_request:
types: [opened, edited, reopened]
discussion:
types: [created, edited, labeled]
discussion_comment:
types: [created, edited]
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot use command

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to use command: trigger in commit 047e674. The workflow now uses the simpler command trigger syntax instead of manual event triggers.

Comment on lines 19 to 26
if: |
(github.event_name == 'issues' && github.event.action == 'labeled' && contains(github.event.label.name, 'cloclo')) ||
(github.event_name == 'discussion' && github.event.action == 'labeled' && contains(github.event.label.name, 'cloclo')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '/cloclo')) ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/cloclo')) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/cloclo')) ||
(github.event_name == 'discussion' && contains(github.event.discussion.body, '/cloclo')) ||
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '/cloclo'))
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the complex if: condition in commit 047e674. The command trigger handles activation conditions automatically.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add /cloclo command and label trigger workflow with Claude engine and MCP integrations Add /cloclo command workflow with Claude engine and MCP integrations Nov 15, 2025
Copilot AI requested a review from pelikhan November 15, 2025 04:53
Copilot finished work on behalf of pelikhan November 15, 2025 04:53
@pelikhan pelikhan marked this pull request as ready for review November 15, 2025 13:08
Copilot AI review requested due to automatic review settings November 15, 2025 13:08
@pelikhan pelikhan merged commit 6fa8eb9 into main Nov 15, 2025
78 checks passed
@pelikhan pelikhan deleted the copilot/create-cloclo-command-workflow branch November 15, 2025 13:09
Copilot finished reviewing on behalf of pelikhan November 15, 2025 13:10
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 a new /cloclo command workflow that processes content through the Claude engine with multiple MCP integrations (Serena, gh-aw, Playwright). The workflow is designed to respond glamorously to user commands across issues, pull requests, and discussions, always adding a summary comment back to the conversation thread. The implementation emphasizes safe outputs and includes constraints against modifying .github/.workflows files.

Key changes:

  • Adds command-triggered workflow with Claude engine (max-turns=100)
  • Integrates three MCP servers via imports for static analysis, workflow introspection, and browser automation
  • Configures safe outputs for PR creation, comment addition, and PR branch pushing
  • Implements conditional templates to display context only when applicable (Issue, Discussion, or Pull Request)

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

### Next Steps
[If applicable, suggest what the user should do next]
```
```
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

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

Extra closing code fence on line 173. This creates an unclosed code block starting at line 158. Remove this line to properly close the example response format section.

Suggested change
```

Copilot uses AI. Check for mistakes.
edit:
playwright:
cache-memory:
key: cloclo-memory-${{ github.workflow }}-${{ github.run_id }}
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

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

Using ${{ github.run_id }} in the cache key makes each run create a new cache, preventing persistence across runs. According to the cache-memory documentation, this defeats the purpose of persistent memory. Consider using a stable key like cloclo-memory or cloclo-memory-${{ github.workflow }} for true persistence across workflow runs.

Suggested change
key: cloclo-memory-${{ github.workflow }}-${{ github.run_id }}
key: cloclo-memory-${{ github.workflow }}

Copilot uses AI. Check for mistakes.
Comment on lines +118 to +121
⚠️ **NEVER commit or modify any files inside the `.github/.workflows` directory**

This is a hard constraint. If the user request involves workflow modifications:
1. Politely explain that you cannot modify files in `.github/.workflows`
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

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

Incorrect directory path. The workflows directory is .github/workflows (no dot before workflows). The current path .github/.workflows does not exist.

Suggested change
⚠️ **NEVER commit or modify any files inside the `.github/.workflows` directory**
This is a hard constraint. If the user request involves workflow modifications:
1. Politely explain that you cannot modify files in `.github/.workflows`
⚠️ **NEVER commit or modify any files inside the `.github/workflows` directory**
This is a hard constraint. If the user request involves workflow modifications:
1. Politely explain that you cannot modify files in `.github/workflows`

Copilot uses AI. Check for mistakes.
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