Skip to content

Enable direct file editing in developer-docs-consolidator workflow#3444

Merged
pelikhan merged 2 commits intomainfrom
copilot/enable-direct-file-editing
Nov 7, 2025
Merged

Enable direct file editing in developer-docs-consolidator workflow#3444
pelikhan merged 2 commits intomainfrom
copilot/enable-direct-file-editing

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

The developer-docs-consolidator workflow was analyzing files and reporting what should change, but not actually making changes. The safe-outputs configuration for PR creation was present but the instructions didn't tell the agent to use it.

Changes

  • Mission statement: Added explicit directive that agent can directly edit files and create PRs via safe-outputs
  • Phase 3 (Content Adjustment): Emphasized using edit tool to apply changes directly, not just identify issues
  • Phase 5 (Create Pull Request): Restructured into two-step process:
    1. Apply changes using Serena/edit tools (replace_symbol_body, insert_after_symbol, standard edit/create)
    2. PR created automatically via safe-outputs
  • Success criteria: Changed from passive reporting to active editing with edit tools

Example

Before:

### 1. Fix Tone Issues

For each file with tone issues, use the edit tool to:

After:

### 1. Fix Tone Issues

For each file with tone issues, **use the edit tool to make the changes directly**:

**Action**: Use `edit` tool to make these changes in the spec files directly.

This enables full autonomous operation: analyze → fix → consolidate → PR.

Original prompt

This section details on the original issue you should resolve

<issue_title>[q] Enable Direct File Editing in Developer Documentation Consolidator</issue_title>
<issue_description># Developer Documentation Consolidator: Enable Direct File Editing and PR Creation

Summary

Updated the developer-docs-consolidator workflow to explicitly inform the AI agent that it should directly edit files and create pull requests with its changes. This addresses the request from discussion #3416.

Changes Made

Updated .github/workflows/developer-docs-consolidator.md

  1. Enhanced Mission Statement (lines 56-60):

    • Added explicit statement: "apply changes directly to the repository"
    • Added prominent note: "YOU CAN DIRECTLY EDIT FILES AND CREATE PULL REQUESTS"
    • Clarified that safe-outputs for PR creation is pre-configured
  2. Updated Phase 3: Content Adjustment (lines 190-220):

    • Added emphasis: "Apply changes directly to files" - Don't just identify issues, fix them
    • Explicitly mentioned using edit tool to make changes directly
    • Added action items: "Use edit tool to make these changes in the spec files directly"
    • Made it clear the agent should apply formatting fixes directly
  3. Completely Rewrote Phase 5 (lines 462-535):

    • Renamed from "Create Pull Request (If Changes Made)" to include two-step process
    • Added Step 1: Apply Changes Directly to Files
      • Listed specific tools available: serena-replace_symbol_body, serena-insert_after_symbol, standard edit and create tools
      • Provided clear instructions on updating .github/instructions/developer.instructions.md
      • Emphasized making all consolidation changes directly to files
    • Added Step 2: PR Created Automatically
      • Explained that PR creation happens automatically via safe-outputs
      • Provided the expected PR description format
      • Made it clear the agent doesn't need to manually create the PR
  4. Updated Success Criteria (lines 569-580):

    • Changed from passive reporting to active editing
    • Added emphasis on "by directly editing files" and "using edit tools"
    • Added final criterion: "Makes actual file changes that will be included in the automatic PR"
    • Updated final instruction to "directly apply changes"

Context

This change was requested in discussion #3416 with the comment:

"/q add create pull request safe output so that the agent is able to apply the changes. Update the prompt accordingly. Applies to the developer documentation consolidator workflow."

The safe-output configuration was already present in the workflow frontmatter:

safe-outputs:
  create-discussion:
    category: "General"
    max: 1
  create-pull-request:
    title-prefix: "[docs] "
    labels: [documentation, automation]
    draft: false

The issue was that the workflow instructions didn't make it clear to the AI agent that it should:

  1. Directly edit files using available tools
  2. Make actual changes rather than just report recommendations
  3. Rely on safe-outputs to automatically create the PR

This PR fixes that by making the instructions explicit and actionable.

Expected Improvements

  • Clearer Agent Behavior: The AI agent will now understand it should actively edit files, not just analyze and report
  • More Autonomous Operation: Agent can complete the full consolidation cycle (analyze → fix → consolidate → PR) without manual intervention
  • Better Workflow Execution: Reduces confusion about whether the agent should be analyze-only or analyze-and-fix
  • Leverages Existing Capabilities: Makes full use of the safe-outputs PR creation already configured in frontmatter
  • Consistent with Q Workflow: Follows the same pattern established in the Q workflow enhancement (issue [q] Enhance Q workflow with explicit file editing and PR creation instructions #3429)

Validation

✅ Workflow compiled successfully using gh aw compile:

✓ .github/workflows/developer-docs-consolidator.md (253.3 KB)
✓ Compiled 1 workflow(s): 0 error(s), 1 warning(s)

Note: There's a network firewall warning for Claude engine, which is expected and not blocking.

Files Modified

  • .github/workflows/developer-docs-consolidator.md - Updated with explicit file editing instructions

Note: .lock.yml file will be regenerated automatically by the compilation system after merge.

Review Notes

Please review:

  1. The enhanced mission statement for clarity
  2. Phase 3 instructions emphasizing direct file editing
  3. Phase 5 two-step process (edit files, then auto-PR)
  4. Success criteria updates
  5. Overall tone and actionability of the instructions

This change makes the developer-docs-consolidator workflow more autonomous and capable of actually applying the improvements it identifies, rather than just reporting them.

AI generated by Q


[!NOTE]
This was originally intended as a pull re...


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

…r workflow

Enhanced the workflow to explicitly inform the AI agent that it can:
- Directly edit files using edit tools
- Create pull requests automatically via safe-outputs

Key changes:
- Updated Mission statement to clarify agent can apply changes directly
- Added prominent note about direct file editing capabilities
- Updated Phase 3 to emphasize using edit tools to apply changes
- Rewrote Phase 5 to explain two-step process (edit files, then auto-PR)
- Updated Success Criteria to emphasize making actual file changes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable direct file editing in developer documentation consolidator Enable direct file editing in developer-docs-consolidator workflow Nov 7, 2025
Copilot AI requested a review from pelikhan November 7, 2025 13:24
@pelikhan pelikhan marked this pull request as ready for review November 7, 2025 13:25
Copilot AI review requested due to automatic review settings November 7, 2025 13:25
@pelikhan pelikhan merged commit 9524616 into main Nov 7, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/enable-direct-file-editing branch November 7, 2025 13:25
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 updates the developer-docs-consolidator workflow to emphasize direct file editing capabilities. The changes clarify that the AI agent should make actual file modifications using available edit tools rather than just identifying and reporting issues, with pull requests being created automatically via the safe-outputs mechanism.

Key changes:

  • Updated instructions throughout to emphasize direct file editing over reporting
  • Added explicit guidance on using Serena's editing tools and standard edit tools
  • Restructured PR creation section into two steps: (1) Apply changes directly to files, (2) PR created automatically
  • Added reminders and action items to reinforce the direct editing workflow

Reviewed Changes

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

File Description
.github/workflows/developer-docs-consolidator.md Updated workflow instructions to emphasize direct file editing, restructured PR creation guidance, and added tool usage clarifications
.github/workflows/developer-docs-consolidator.lock.yml Compiled YAML output reflecting the markdown changes, with prompt split location moved from Guidelines section to middle of PR creation instructions

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

Comment on lines +1792 to +1798
PROMPT_EOF
- name: Append prompt (part 2)
env:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
run: |
cat >> "$GH_AW_PROMPT" << 'PROMPT_EOF'
**PR Description** (you should output this for the safe-output processor):
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The prompt split location has moved from the Guidelines section to the middle of the PR creation instructions. The split now occurs between "PR Title" (end of part 1) and "PR Description" (start of part 2), which separates closely related PR creation content across two prompt parts.

This could cause issues because:

  1. The PR Title and PR Description are conceptually part of the same instruction block
  2. The AI agent may not see the full PR creation context in a single prompt part
  3. The previous split location (before "### Mermaid Diagram Guidelines") was more logical as it separated distinct sections

Consider moving the prompt split to a more logical boundary, such as before the "## Guidelines" section or after the entire "Create Pull Request" section is complete.

Copilot uses AI. Check for mistakes.

**Use Serena's tools to make the changes:**
- If the file exists: Use `serena-replace_symbol_body` or standard edit tools to update sections
- If the file doesn't exist: Use `create` tool to create the new file
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The workflow instructions reference a "Standard create tool" on lines 312 and 497, but no create tool is configured in the frontmatter. The tools section only includes edit:, which is documented as a file editing tool.

If the edit tool supports file creation, the instructions should clarify this. If a separate tool is needed for file creation, it should be added to the tools: configuration in the frontmatter. Otherwise, these references should be updated to use only the available edit tool or Serena-specific tools.

Suggested change
- If the file doesn't exist: Use `create` tool to create the new file
- If the file doesn't exist: Use the `edit` tool to create the new file

Copilot uses AI. Check for mistakes.
Comment on lines +497 to +498
- Standard `create` tool - Create new files

Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The workflow instructions reference a "Standard create tool" which is not configured in the frontmatter. This is a duplicate reference to the same issue found on line 312. Either the create tool needs to be added to the tools configuration, or this reference should be updated to use the available edit tool or Serena-specific tools.

Suggested change
- Standard `create` tool - Create new files

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.

[q] Enable Direct File Editing in Developer Documentation Consolidator

3 participants