Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Agents generating markdown with embedded code blocks can create unbalanced regions where opening/closing delimiters desync, breaking rendering. This adds an instruction to use 6 backticks instead of 3 when generating markdown text.

Changes

  • actions/setup/md/markdown.md: Created new dedicated prompt file with markdown generation instructions and examples
  • actions/setup/md/temp_folder_prompt.md: Removed markdown-generation section (keeping only temporary folder and file editing instructions)
  • pkg/workflow/sh.go: Added markdownPromptFile constant for the new prompt file
  • pkg/workflow/unified_prompt_step.go: Updated collectPromptSections() to include markdown prompt as section Add workflow: githubnext/agentics/weekly-research #2 (always included, right after temp folder instructions)

The instruction is injected into all workflow prompts at runtime via the unified prompt system. All markdown-related instructions are now centralized in a single file for better maintainability.

Markdown Prompt Content

<markdown-generation>
<instruction>When generating markdown text, use 6 backticks instead of 3 to avoid creating unbalanced code regions where the text looks broken because the code regions are opening and closing out of sync.</instruction>
<example>
Correct:
``````markdown
# Example
```javascript
console.log('hello');

Incorrect:
```markdown
# Example
```javascript
console.log('hello');
```
```
</example>
</markdown-generation>
```

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Add to markdown prompt instructions in the built in prompt file:
> 
> When generating markdown text, use 6 backticks instead of 3 to avoid creating unbalanced code regions where the text looks broken because the code regions are opening and closing out of sync.


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💡 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](https://gh.io/copilot-coding-agent-tips) in the docs.

Copilot AI and others added 3 commits January 19, 2026 15:28
…t.md

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Instruct agents to use 6 backticks instead of 3 when generating markdown to avoid unbalanced code regions.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
All unit tests, integration tests, formatting, and linting passed successfully.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add instructions for using six backticks in markdown Add 6-backtick markdown instruction to built-in prompt Jan 19, 2026
Copilot AI requested a review from pelikhan January 19, 2026 15:37
@pelikhan
Copy link
Contributor

@copilot review all custom prompts injected related to markdown and centralize in a single markdown.md file

- Created new actions/setup/md/markdown.md with markdown generation instructions
- Removed markdown-generation section from temp_folder_prompt.md
- Added markdownPromptFile constant in pkg/workflow/sh.go
- Updated collectPromptSections to include markdown prompt (always included)
- Recompiled all workflows to include the new markdown.md prompt

The markdown instructions are now centralized in a dedicated file instead of being mixed with temporary folder instructions.

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

Copilot AI commented Jan 19, 2026

@copilot review all custom prompts injected related to markdown and centralize in a single markdown.md file

Centralized all markdown-related prompt instructions into actions/setup/md/markdown.md (commit 45c2521).

The new file contains:

  • Instruction to use 6 backticks instead of 3
  • Example showing correct vs incorrect usage

Removed the markdown section from temp_folder_prompt.md and updated the prompt collection logic to always include markdown.md immediately after the temporary folder instructions.

Copilot AI changed the title Add 6-backtick markdown instruction to built-in prompt Centralize markdown instructions in dedicated markdown.md prompt file Jan 19, 2026
Comment on lines 523 to +524
cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT"
cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT"
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot markdown.txt should have been concatenanted in the system prompt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The markdown.md file is correctly being concatenated inside the <system> tags (lines 521-589 in the lock file). The structure is:

  1. Line 521: <system> tag opens
  2. Lines 523-524: temp_folder_prompt.md and markdown.md are concatenated
  3. Lines 525-587: Additional system prompt content
  4. Line 589: </system> tag closes
  5. Lines 591+: User prompt content begins

All built-in prompts (including markdown.md) are wrapped in <system> tags as intended by the unified prompt system in pkg/workflow/unified_prompt_step.go:434-438.

Copilot AI requested a review from pelikhan January 19, 2026 15:59
@pelikhan pelikhan marked this pull request as ready for review January 19, 2026 16:03
@pelikhan pelikhan merged commit 3dd685b into main Jan 19, 2026
@pelikhan pelikhan deleted the copilot/update-markdown-prompt-instructions branch January 19, 2026 16:03
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