diff --git a/.github/workflows/agent-performance-analyzer.lock.yml b/.github/workflows/agent-performance-analyzer.lock.yml index d01daf5689..ac9088bcc8 100644 --- a/.github/workflows/agent-performance-analyzer.lock.yml +++ b/.github/workflows/agent-performance-analyzer.lock.yml @@ -636,160 +636,162 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/meta-orchestrators` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: ** - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/agent-performance-analyzer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/meta-orchestrators` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: ** + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/agent-performance-analyzer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/agent-persona-explorer.lock.yml b/.github/workflows/agent-persona-explorer.lock.yml index ebf6136b6f..376b4a01ee 100644 --- a/.github/workflows/agent-persona-explorer.lock.yml +++ b/.github/workflows/agent-persona-explorer.lock.yml @@ -530,136 +530,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/agent-persona-explorer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/agent-persona-explorer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml index 8ed69f4d65..2704695a56 100644 --- a/.github/workflows/ai-moderator.lock.yml +++ b/.github/workflows/ai-moderator.lock.yml @@ -513,65 +513,67 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/ai-moderator.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/ai-moderator.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/archie.lock.yml b/.github/workflows/archie.lock.yml index ae17bed95a..5249010b7a 100644 --- a/.github/workflows/archie.lock.yml +++ b/.github/workflows/archie.lock.yml @@ -511,65 +511,67 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/archie.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/archie.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/artifacts-summary.lock.yml b/.github/workflows/artifacts-summary.lock.yml index f144ffed27..be7ff1f7cd 100644 --- a/.github/workflows/artifacts-summary.lock.yml +++ b/.github/workflows/artifacts-summary.lock.yml @@ -480,137 +480,139 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/artifacts-summary.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/artifacts-summary.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/audit-workflows.lock.yml b/.github/workflows/audit-workflows.lock.yml index e9715d1d08..d1af858027 100644 --- a/.github/workflows/audit-workflows.lock.yml +++ b/.github/workflows/audit-workflows.lock.yml @@ -586,291 +586,293 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical audit data and patterns - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/audit-workflows` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/audit-workflows/*.json, memory/audit-workflows/*.jsonl, memory/audit-workflows/*.csv, memory/audit-workflows/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Python Environment Ready - - Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy - Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` - - ## Store Historical Data (JSON Lines) - - ```python - import json - from datetime import datetime - - # Append data point - with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: - f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') - ``` - - ## Generate Charts - - ```python - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - df = pd.read_json('history.jsonl', lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - - sns.set_style("whitegrid") - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - df.groupby('date')['value'].mean().plot(ax=ax, marker='o') - ax.set_title('Trend', fontsize=16, fontweight='bold') - plt.xticks(rotation=45) - plt.tight_layout() - plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') - ``` - - ## Best Practices - - - Use JSON Lines (`.jsonl`) for append-only storage - - Include ISO 8601 timestamps in all data points - - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` - - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/audit-workflows.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical audit data and patterns + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/audit-workflows` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/audit-workflows/*.json, memory/audit-workflows/*.jsonl, memory/audit-workflows/*.csv, memory/audit-workflows/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Python Environment Ready + + Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy + Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` + + ## Store Historical Data (JSON Lines) + + ```python + import json + from datetime import datetime + + # Append data point + with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: + f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') + ``` + + ## Generate Charts + + ```python + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + df = pd.read_json('history.jsonl', lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + + sns.set_style("whitegrid") + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + df.groupby('date')['value'].mean().plot(ax=ax, marker='o') + ax.set_title('Trend', fontsize=16, fontweight='bold') + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') + ``` + + ## Best Practices + + - Use JSON Lines (`.jsonl`) for append-only storage + - Include ISO 8601 timestamps in all data points + - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` + - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/audit-workflows.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/auto-triage-issues.lock.yml b/.github/workflows/auto-triage-issues.lock.yml index 13b0d2f21b..253024222c 100644 --- a/.github/workflows/auto-triage-issues.lock.yml +++ b/.github/workflows/auto-triage-issues.lock.yml @@ -519,135 +519,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/auto-triage-issues.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/auto-triage-issues.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/blog-auditor.lock.yml b/.github/workflows/blog-auditor.lock.yml index d0fa7c8b4d..863592f096 100644 --- a/.github/workflows/blog-auditor.lock.yml +++ b/.github/workflows/blog-auditor.lock.yml @@ -501,136 +501,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/blog-auditor.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/blog-auditor.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/brave.lock.yml b/.github/workflows/brave.lock.yml index edf07837d3..d1b8c4a325 100644 --- a/.github/workflows/brave.lock.yml +++ b/.github/workflows/brave.lock.yml @@ -505,70 +505,72 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/brave.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/brave.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/breaking-change-checker.lock.yml b/.github/workflows/breaking-change-checker.lock.yml index 7c074a2f8a..89d862f17f 100644 --- a/.github/workflows/breaking-change-checker.lock.yml +++ b/.github/workflows/breaking-change-checker.lock.yml @@ -498,62 +498,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/breaking-change-checker.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/breaking-change-checker.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/changeset.lock.yml b/.github/workflows/changeset.lock.yml index 4d69faa4b2..1a898be08f 100644 --- a/.github/workflows/changeset.lock.yml +++ b/.github/workflows/changeset.lock.yml @@ -605,213 +605,215 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Changeset Format Reference - - Based on https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md - - ### Basic Format - - ```markdown - --- - "gh-aw": patch - --- - - Fixed a bug in the component rendering logic - ``` - - ### Version Bump Types - - **patch**: Bug fixes, documentation updates, refactoring, non-breaking additions, new shared workflows (0.0.X) - - **minor**: Breaking changes in the cli (0.X.0) - - **major**: Major breaking changes. Very unlikely to be used often (X.0.0). You should be very careful when using this, it's probably a **minor**. - - ### Changeset File Structure - - Create file in `.changeset/` directory with descriptive kebab-case name - - Format: `-.md` (e.g., `minor-add-new-feature.md`) - - Use quotes around package names in YAML frontmatter - - Brief summary should be from PR title or first line of description - - ### Optional Codemod Section - - For **minor** or **major** changes that introduce breaking changes, include an optional "Codemod" section to help users update their code: - - ```markdown - --- - "gh-aw": minor - --- - - Changed the workflow frontmatter field `engine` to require an object instead of a string. - - ## Codemod - - If you have workflows using the old string format for the `engine` field: - - ```yaml - engine: copilot - ``` - - Update them to use the new object format: - - ```yaml - engine: - id: copilot - ``` - - This change applies to all workflows using the `engine` field in their frontmatter. - ``` - - The codemod section should: - - Explain what code patterns are affected by the breaking change - - Provide clear before/after examples showing how to update existing code - - Specify which files or use cases need to be updated - - Include any automation suggestions if applicable - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/changeset.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Changeset Format Reference + + Based on https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md + + ### Basic Format + + ```markdown + --- + "gh-aw": patch + --- + + Fixed a bug in the component rendering logic + ``` + + ### Version Bump Types + - **patch**: Bug fixes, documentation updates, refactoring, non-breaking additions, new shared workflows (0.0.X) + - **minor**: Breaking changes in the cli (0.X.0) + - **major**: Major breaking changes. Very unlikely to be used often (X.0.0). You should be very careful when using this, it's probably a **minor**. + + ### Changeset File Structure + - Create file in `.changeset/` directory with descriptive kebab-case name + - Format: `-.md` (e.g., `minor-add-new-feature.md`) + - Use quotes around package names in YAML frontmatter + - Brief summary should be from PR title or first line of description + + ### Optional Codemod Section + + For **minor** or **major** changes that introduce breaking changes, include an optional "Codemod" section to help users update their code: + + ```markdown + --- + "gh-aw": minor + --- + + Changed the workflow frontmatter field `engine` to require an object instead of a string. + + ## Codemod + + If you have workflows using the old string format for the `engine` field: + + ```yaml + engine: copilot + ``` + + Update them to use the new object format: + + ```yaml + engine: + id: copilot + ``` + + This change applies to all workflows using the `engine` field in their frontmatter. + ``` + + The codemod section should: + - Explain what code patterns are affected by the breaking change + - Provide clear before/after examples showing how to update existing code + - Specify which files or use cases need to be updated + - Include any automation suggestions if applicable + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/changeset.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/chroma-issue-indexer.lock.yml b/.github/workflows/chroma-issue-indexer.lock.yml index 53ae412fe7..791031d64b 100644 --- a/.github/workflows/chroma-issue-indexer.lock.yml +++ b/.github/workflows/chroma-issue-indexer.lock.yml @@ -296,73 +296,75 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Cache Folders Available - - You have access to persistent cache folders where you can read and write files to create memories and store information: - - - **chroma**: `/tmp/gh-aw/cache-memory-chroma/` - Persistent storage for Chroma vector database - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Persistence**: Files in these folders persist across workflow runs via GitHub Actions cache - - **Last Write Wins**: If multiple processes write to the same file, the last write will be preserved - - **File Share**: Use these as simple file shares - organize files as you see fit - - Examples of what you can store: - - `/tmp/gh-aw/cache-memory-chroma/notes.txt` - general notes and observations - - `/tmp/gh-aw/cache-memory-chroma/preferences.json` - user preferences and settings - - `/tmp/gh-aw/cache-memory-chroma/state/` - organized state files in subdirectories - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/chroma-issue-indexer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Cache Folders Available + + You have access to persistent cache folders where you can read and write files to create memories and store information: + + - **chroma**: `/tmp/gh-aw/cache-memory-chroma/` - Persistent storage for Chroma vector database + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Persistence**: Files in these folders persist across workflow runs via GitHub Actions cache + - **Last Write Wins**: If multiple processes write to the same file, the last write will be preserved + - **File Share**: Use these as simple file shares - organize files as you see fit + + Examples of what you can store: + - `/tmp/gh-aw/cache-memory-chroma/notes.txt` - general notes and observations + - `/tmp/gh-aw/cache-memory-chroma/preferences.json` - user preferences and settings + - `/tmp/gh-aw/cache-memory-chroma/state/` - organized state files in subdirectories + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/chroma-issue-indexer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/ci-coach.lock.yml b/.github/workflows/ci-coach.lock.yml index 2a567aff5a..21108c14ee 100644 --- a/.github/workflows/ci-coach.lock.yml +++ b/.github/workflows/ci-coach.lock.yml @@ -543,496 +543,498 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # CI Data Analysis - - Pre-downloaded CI run data and artifacts are available for analysis: - - ## Available Data - - 1. **CI Runs**: `/tmp/ci-runs.json` - - Last 100 workflow runs with status, timing, and metadata - - 2. **Artifacts**: `/tmp/ci-artifacts/` - - Coverage reports and benchmark results from recent successful runs - - **Fuzz test results**: `*/fuzz-results/*.txt` - Output from fuzz tests - - **Fuzz corpus data**: `*/fuzz-results/corpus/*` - Input corpus for each fuzz test - - 3. **CI Configuration**: `.github/workflows/ci.yml` - - Current CI workflow configuration - - 4. **Cache Memory**: `/tmp/cache-memory/` - - Historical analysis data from previous runs - - 5. **Test Results**: `/tmp/gh-aw/test-results.json` - - JSON output from Go unit tests with performance and timing data - - ## Test Case Locations - - Go test cases are located throughout the repository: - - **Command tests**: `./cmd/gh-aw/*_test.go` - - **Workflow tests**: `./pkg/workflow/*_test.go` - - **CLI tests**: `./pkg/cli/*_test.go` - - **Parser tests**: `./pkg/parser/*_test.go` - - **Campaign tests**: `./pkg/campaign/*_test.go` - - **Other package tests**: Various `./pkg/*/test.go` files - - ## Environment Setup - - The workflow has already completed: - - ✅ **Linting**: Dev dependencies installed, linters run successfully - - ✅ **Building**: Code built with `make build`, lock files compiled with `make recompile` - - ✅ **Testing**: Unit tests run (with performance data collected in JSON format) - - This means you can: - - Make changes to code or configuration files - - Validate changes immediately by running `make lint`, `make build`, or `make test-unit` - - Ensure proposed optimizations don't break functionality before creating a PR - - ## Analyzing Run Data - - Parse the downloaded CI runs data: - - ```bash - # Analyze run data - cat /tmp/ci-runs.json | jq ' - { - total_runs: length, - by_status: group_by(.status) | map({status: .[0].status, count: length}), - by_conclusion: group_by(.conclusion) | map({conclusion: .[0].conclusion, count: length}), - by_branch: group_by(.headBranch) | map({branch: .[0].headBranch, count: length}), - by_event: group_by(.event) | map({event: .[0].event, count: length}) - }' - ``` - - **Metrics to extract:** - - Success rate per job - - Average duration per job - - Failure patterns (which jobs fail most often) - - Cache hit rates from step summaries - - Resource usage patterns - - ## Review Artifacts - - Examine downloaded artifacts for insights: - - ```bash - # List downloaded artifacts - find /tmp/ci-artifacts -type f -name "*.txt" -o -name "*.html" -o -name "*.json" - - # Analyze coverage reports if available - # Check benchmark results for performance trends - ``` - - ## Historical Context - - Check cache memory for previous analyses: - - ```bash - # Read previous optimization recommendations - if [ -f /tmp/cache-memory/ci-coach/last-analysis.json ]; then - cat /tmp/cache-memory/ci-coach/last-analysis.json - fi - - # Check if previous recommendations were implemented - # Compare current metrics with historical baselines - ``` - - # CI Optimization Analysis Strategies - - Comprehensive strategies for analyzing CI workflows to identify optimization opportunities. - - ## Phase 1: CI Configuration Study - - Read and understand the current CI workflow structure: - - ```bash - # Read the CI workflow configuration - cat .github/workflows/ci.yml - - # Understand the job structure - # - lint (runs first) - # - test (depends on lint) - # - integration (depends on test, matrix strategy) - # - build (depends on lint) - # etc. - ``` - - **Key aspects to analyze:** - - Job dependencies and parallelization opportunities - - Cache usage patterns (Go cache, Node cache) - - Matrix strategy effectiveness - - Timeout configurations - - Concurrency groups - - Artifact retention policies - - ## Phase 2: Test Coverage Analysis - - ### Critical: Ensure ALL Tests are Executed - - **Step 1: Get complete list of all tests** - ```bash - # List all test functions in the repository - go test -list='^Test' ./... 2>&1 | grep -E '^Test' > /tmp/all-tests.txt - - # Count total tests - TOTAL_TESTS=$(wc -l < /tmp/all-tests.txt) - echo "Total tests found: $TOTAL_TESTS" - ``` - - **Step 2: Analyze unit test coverage** - ```bash - # Unit tests run all non-integration tests - # Verify the test job's command captures all non-integration tests - # Current: go test -v -parallel=8 -timeout=3m -tags '!integration' -run='^Test' ./... - - # Get list of integration tests (tests with integration build tag) - grep -r "//go:build integration" --include="*_test.go" . | cut -d: -f1 | sort -u > /tmp/integration-test-files.txt - - # Estimate number of integration tests - echo "Files with integration tests:" - wc -l < /tmp/integration-test-files.txt - ``` - - **Step 3: Analyze integration test matrix coverage** - ```bash - # The integration job has a matrix with specific patterns - # Each matrix entry targets specific packages and test patterns - - # CRITICAL CHECK: Are there tests that don't match ANY pattern? - - # Extract all integration test patterns from ci.yml - cat .github/workflows/ci.yml | grep -A 2 'pattern:' | grep 'pattern:' > /tmp/matrix-patterns.txt - - # Check for catch-all groups - cat .github/workflows/ci.yml | grep -B 2 'pattern: ""' | grep 'name:' > /tmp/catchall-groups.txt - ``` - - **Step 4: Identify coverage gaps** - ```bash - # Check if each package with tests is covered by at least one matrix group - # Compare packages with tests vs. packages in CI matrix - # Identify any "orphaned" tests not executed by any job - ``` - - **Required Action if Gaps Found:** - If any tests are not covered by the CI matrix, propose adding: - 1. **Catch-all matrix groups** for packages with specific patterns but no catch-all - 2. **New matrix entries** for packages not in the matrix at all - - Example fix for missing catch-all (add to `.github/workflows/ci.yml`): - ```yaml - # Add to the integration job's matrix.include section: - - name: "CLI Other" # Catch-all for tests not matched by specific patterns - packages: "./pkg/cli" - pattern: "" # Empty pattern runs all remaining tests - ``` - - ## Phase 3: Test Performance Optimization - - ### A. Test Splitting Analysis - - Review current test matrix configuration - - Analyze if test groups are balanced in execution time - - Suggest rebalancing to minimize longest-running group - - ### B. Test Parallelization Within Jobs - - Check if tests run sequentially when they could run in parallel - - Suggest using `go test -parallel=N` to increase parallelism - - Analyze if `-count=1` is necessary for all tests - - ### C. Test Selection Optimization - - Suggest path-based test filtering to skip irrelevant tests - - Recommend running only affected tests for non-main branch pushes - - ### D. Test Timeout Optimization - - Review current timeout settings - - Check if timeouts are too conservative or too tight - - Suggest adjusting per-job timeouts based on historical data - - ### E. Test Dependencies Analysis - - Examine test job dependencies - - Suggest removing unnecessary dependencies to enable more parallelism - - ### F. Selective Test Execution - - Suggest running expensive tests only on main branch or on-demand - - Recommend running security scans conditionally - - ### G. Matrix Strategy Optimization - - Analyze if all integration test matrix jobs are necessary - - Check if some matrix jobs could be combined or run conditionally - - Suggest reducing matrix size for PR builds vs. main branch builds - - ## Phase 4: Resource Optimization - - ### Job Parallelization - - Identify jobs that could run in parallel but currently don't - - Restructure dependencies to reduce critical path - - Example: Could some test jobs start earlier? - - ### Cache Optimization - - Analyze cache hit rates - - Suggest caching more aggressively (dependencies, build artifacts) - - Check if cache keys are properly scoped - - ### Resource Right-Sizing - - Check if timeouts are set appropriately - - Evaluate if jobs could run on faster runners - - Review concurrency groups - - ### Artifact Management - - Check if retention days are optimal - - Identify unnecessary artifacts - - Example: Coverage reports only need 7 days retention - - ### Dependency Installation - - Check for redundant dependency installations - - Suggest using dependency caching more effectively - - Example: Sharing `node_modules` between jobs - - ## Phase 5: Cost-Benefit Analysis - - For each potential optimization: - - **Impact**: How much time/cost savings? - - **Effort**: How difficult to implement? - - **Risk**: Could it break the build or miss issues? - - **Priority**: High/Medium/Low - - ## Optimization Categories - - 1. **Job Parallelization** - Reduce critical path - 2. **Cache Optimization** - Improve cache hit rates - 3. **Test Suite Restructuring** - Balance test execution - 4. **Resource Right-Sizing** - Optimize timeouts and runners - 5. **Artifact Management** - Reduce unnecessary uploads - 6. **Matrix Strategy** - Balance breadth vs. speed - 7. **Conditional Execution** - Skip unnecessary jobs - 8. **Dependency Installation** - Reduce redundant work - - ## Expected Metrics - - Track these metrics before and after optimization: - - Total CI duration (wall clock time) - - Critical path duration - - Cache hit rates - - Test execution time - - Resource utilization - - Cost per CI run - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/ci-coach.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # CI Data Analysis + + Pre-downloaded CI run data and artifacts are available for analysis: + + ## Available Data + + 1. **CI Runs**: `/tmp/ci-runs.json` + - Last 100 workflow runs with status, timing, and metadata + + 2. **Artifacts**: `/tmp/ci-artifacts/` + - Coverage reports and benchmark results from recent successful runs + - **Fuzz test results**: `*/fuzz-results/*.txt` - Output from fuzz tests + - **Fuzz corpus data**: `*/fuzz-results/corpus/*` - Input corpus for each fuzz test + + 3. **CI Configuration**: `.github/workflows/ci.yml` + - Current CI workflow configuration + + 4. **Cache Memory**: `/tmp/cache-memory/` + - Historical analysis data from previous runs + + 5. **Test Results**: `/tmp/gh-aw/test-results.json` + - JSON output from Go unit tests with performance and timing data + + ## Test Case Locations + + Go test cases are located throughout the repository: + - **Command tests**: `./cmd/gh-aw/*_test.go` + - **Workflow tests**: `./pkg/workflow/*_test.go` + - **CLI tests**: `./pkg/cli/*_test.go` + - **Parser tests**: `./pkg/parser/*_test.go` + - **Campaign tests**: `./pkg/campaign/*_test.go` + - **Other package tests**: Various `./pkg/*/test.go` files + + ## Environment Setup + + The workflow has already completed: + - ✅ **Linting**: Dev dependencies installed, linters run successfully + - ✅ **Building**: Code built with `make build`, lock files compiled with `make recompile` + - ✅ **Testing**: Unit tests run (with performance data collected in JSON format) + + This means you can: + - Make changes to code or configuration files + - Validate changes immediately by running `make lint`, `make build`, or `make test-unit` + - Ensure proposed optimizations don't break functionality before creating a PR + + ## Analyzing Run Data + + Parse the downloaded CI runs data: + + ```bash + # Analyze run data + cat /tmp/ci-runs.json | jq ' + { + total_runs: length, + by_status: group_by(.status) | map({status: .[0].status, count: length}), + by_conclusion: group_by(.conclusion) | map({conclusion: .[0].conclusion, count: length}), + by_branch: group_by(.headBranch) | map({branch: .[0].headBranch, count: length}), + by_event: group_by(.event) | map({event: .[0].event, count: length}) + }' + ``` + + **Metrics to extract:** + - Success rate per job + - Average duration per job + - Failure patterns (which jobs fail most often) + - Cache hit rates from step summaries + - Resource usage patterns + + ## Review Artifacts + + Examine downloaded artifacts for insights: + + ```bash + # List downloaded artifacts + find /tmp/ci-artifacts -type f -name "*.txt" -o -name "*.html" -o -name "*.json" + + # Analyze coverage reports if available + # Check benchmark results for performance trends + ``` + + ## Historical Context + + Check cache memory for previous analyses: + + ```bash + # Read previous optimization recommendations + if [ -f /tmp/cache-memory/ci-coach/last-analysis.json ]; then + cat /tmp/cache-memory/ci-coach/last-analysis.json + fi + + # Check if previous recommendations were implemented + # Compare current metrics with historical baselines + ``` + + # CI Optimization Analysis Strategies + + Comprehensive strategies for analyzing CI workflows to identify optimization opportunities. + + ## Phase 1: CI Configuration Study + + Read and understand the current CI workflow structure: + + ```bash + # Read the CI workflow configuration + cat .github/workflows/ci.yml + + # Understand the job structure + # - lint (runs first) + # - test (depends on lint) + # - integration (depends on test, matrix strategy) + # - build (depends on lint) + # etc. + ``` + + **Key aspects to analyze:** + - Job dependencies and parallelization opportunities + - Cache usage patterns (Go cache, Node cache) + - Matrix strategy effectiveness + - Timeout configurations + - Concurrency groups + - Artifact retention policies + + ## Phase 2: Test Coverage Analysis + + ### Critical: Ensure ALL Tests are Executed + + **Step 1: Get complete list of all tests** + ```bash + # List all test functions in the repository + go test -list='^Test' ./... 2>&1 | grep -E '^Test' > /tmp/all-tests.txt + + # Count total tests + TOTAL_TESTS=$(wc -l < /tmp/all-tests.txt) + echo "Total tests found: $TOTAL_TESTS" + ``` + + **Step 2: Analyze unit test coverage** + ```bash + # Unit tests run all non-integration tests + # Verify the test job's command captures all non-integration tests + # Current: go test -v -parallel=8 -timeout=3m -tags '!integration' -run='^Test' ./... + + # Get list of integration tests (tests with integration build tag) + grep -r "//go:build integration" --include="*_test.go" . | cut -d: -f1 | sort -u > /tmp/integration-test-files.txt + + # Estimate number of integration tests + echo "Files with integration tests:" + wc -l < /tmp/integration-test-files.txt + ``` + + **Step 3: Analyze integration test matrix coverage** + ```bash + # The integration job has a matrix with specific patterns + # Each matrix entry targets specific packages and test patterns + + # CRITICAL CHECK: Are there tests that don't match ANY pattern? + + # Extract all integration test patterns from ci.yml + cat .github/workflows/ci.yml | grep -A 2 'pattern:' | grep 'pattern:' > /tmp/matrix-patterns.txt + + # Check for catch-all groups + cat .github/workflows/ci.yml | grep -B 2 'pattern: ""' | grep 'name:' > /tmp/catchall-groups.txt + ``` + + **Step 4: Identify coverage gaps** + ```bash + # Check if each package with tests is covered by at least one matrix group + # Compare packages with tests vs. packages in CI matrix + # Identify any "orphaned" tests not executed by any job + ``` + + **Required Action if Gaps Found:** + If any tests are not covered by the CI matrix, propose adding: + 1. **Catch-all matrix groups** for packages with specific patterns but no catch-all + 2. **New matrix entries** for packages not in the matrix at all + + Example fix for missing catch-all (add to `.github/workflows/ci.yml`): + ```yaml + # Add to the integration job's matrix.include section: + - name: "CLI Other" # Catch-all for tests not matched by specific patterns + packages: "./pkg/cli" + pattern: "" # Empty pattern runs all remaining tests + ``` + + ## Phase 3: Test Performance Optimization + + ### A. Test Splitting Analysis + - Review current test matrix configuration + - Analyze if test groups are balanced in execution time + - Suggest rebalancing to minimize longest-running group + + ### B. Test Parallelization Within Jobs + - Check if tests run sequentially when they could run in parallel + - Suggest using `go test -parallel=N` to increase parallelism + - Analyze if `-count=1` is necessary for all tests + + ### C. Test Selection Optimization + - Suggest path-based test filtering to skip irrelevant tests + - Recommend running only affected tests for non-main branch pushes + + ### D. Test Timeout Optimization + - Review current timeout settings + - Check if timeouts are too conservative or too tight + - Suggest adjusting per-job timeouts based on historical data + + ### E. Test Dependencies Analysis + - Examine test job dependencies + - Suggest removing unnecessary dependencies to enable more parallelism + + ### F. Selective Test Execution + - Suggest running expensive tests only on main branch or on-demand + - Recommend running security scans conditionally + + ### G. Matrix Strategy Optimization + - Analyze if all integration test matrix jobs are necessary + - Check if some matrix jobs could be combined or run conditionally + - Suggest reducing matrix size for PR builds vs. main branch builds + + ## Phase 4: Resource Optimization + + ### Job Parallelization + - Identify jobs that could run in parallel but currently don't + - Restructure dependencies to reduce critical path + - Example: Could some test jobs start earlier? + + ### Cache Optimization + - Analyze cache hit rates + - Suggest caching more aggressively (dependencies, build artifacts) + - Check if cache keys are properly scoped + + ### Resource Right-Sizing + - Check if timeouts are set appropriately + - Evaluate if jobs could run on faster runners + - Review concurrency groups + + ### Artifact Management + - Check if retention days are optimal + - Identify unnecessary artifacts + - Example: Coverage reports only need 7 days retention + + ### Dependency Installation + - Check for redundant dependency installations + - Suggest using dependency caching more effectively + - Example: Sharing `node_modules` between jobs + + ## Phase 5: Cost-Benefit Analysis + + For each potential optimization: + - **Impact**: How much time/cost savings? + - **Effort**: How difficult to implement? + - **Risk**: Could it break the build or miss issues? + - **Priority**: High/Medium/Low + + ## Optimization Categories + + 1. **Job Parallelization** - Reduce critical path + 2. **Cache Optimization** - Improve cache hit rates + 3. **Test Suite Restructuring** - Balance test execution + 4. **Resource Right-Sizing** - Optimize timeouts and runners + 5. **Artifact Management** - Reduce unnecessary uploads + 6. **Matrix Strategy** - Balance breadth vs. speed + 7. **Conditional Execution** - Skip unnecessary jobs + 8. **Dependency Installation** - Reduce redundant work + + ## Expected Metrics + + Track these metrics before and after optimization: + - Total CI duration (wall clock time) + - Critical path duration + - Cache hit rates + - Test execution time + - Resource utilization + - Cost per CI run + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/ci-coach.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/ci-doctor.lock.yml b/.github/workflows/ci-doctor.lock.yml index 42d5faaf74..f8ed0abb9f 100644 --- a/.github/workflows/ci-doctor.lock.yml +++ b/.github/workflows/ci-doctor.lock.yml @@ -558,63 +558,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/ci-doctor.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/ci-doctor.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/claude-code-user-docs-review.lock.yml b/.github/workflows/claude-code-user-docs-review.lock.yml index c12807ec3b..a2c4e9e125 100644 --- a/.github/workflows/claude-code-user-docs-review.lock.yml +++ b/.github/workflows/claude-code-user-docs-review.lock.yml @@ -492,63 +492,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/claude-code-user-docs-review.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/claude-code-user-docs-review.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/cli-consistency-checker.lock.yml b/.github/workflows/cli-consistency-checker.lock.yml index b7aef7bacc..94623e95e3 100644 --- a/.github/workflows/cli-consistency-checker.lock.yml +++ b/.github/workflows/cli-consistency-checker.lock.yml @@ -497,62 +497,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/cli-consistency-checker.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/cli-consistency-checker.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/cli-version-checker.lock.yml b/.github/workflows/cli-version-checker.lock.yml index 1753b8b1c8..1f40f30340 100644 --- a/.github/workflows/cli-version-checker.lock.yml +++ b/.github/workflows/cli-version-checker.lock.yml @@ -520,222 +520,224 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/cli-version-checker.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/cli-version-checker.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/cloclo.lock.yml b/.github/workflows/cloclo.lock.yml index 4e354e2d15..177639c2ef 100644 --- a/.github/workflows/cloclo.lock.yml +++ b/.github/workflows/cloclo.lock.yml @@ -663,158 +663,160 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/cloclo.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/cloclo.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/code-scanning-fixer.lock.yml b/.github/workflows/code-scanning-fixer.lock.yml index c3e8a80f58..4e7ba9fbfe 100644 --- a/.github/workflows/code-scanning-fixer.lock.yml +++ b/.github/workflows/code-scanning-fixer.lock.yml @@ -542,85 +542,87 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Locations Available - - You have access to persistent repo memory folders where you can read and write files that are stored in git branches: - - - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Git Branch Storage**: Each memory is stored in its own git branch - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/history/` - organized history files - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/code-scanning-fixer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Locations Available + + You have access to persistent repo memory folders where you can read and write files that are stored in git branches: + + - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Git Branch Storage**: Each memory is stored in its own git branch + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/history/` - organized history files + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/code-scanning-fixer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/code-simplifier.lock.yml b/.github/workflows/code-simplifier.lock.yml index 21ff4ff494..b0d0ecd04e 100644 --- a/.github/workflows/code-simplifier.lock.yml +++ b/.github/workflows/code-simplifier.lock.yml @@ -493,135 +493,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/code-simplifier.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/code-simplifier.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/codex-github-remote-mcp-test.lock.yml b/.github/workflows/codex-github-remote-mcp-test.lock.yml index 64dbf3ad05..0ad555d0bb 100644 --- a/.github/workflows/codex-github-remote-mcp-test.lock.yml +++ b/.github/workflows/codex-github-remote-mcp-test.lock.yml @@ -265,47 +265,49 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/codex-github-remote-mcp-test.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/codex-github-remote-mcp-test.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/commit-changes-analyzer.lock.yml b/.github/workflows/commit-changes-analyzer.lock.yml index 34cee3de37..21ecff0e26 100644 --- a/.github/workflows/commit-changes-analyzer.lock.yml +++ b/.github/workflows/commit-changes-analyzer.lock.yml @@ -486,135 +486,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/commit-changes-analyzer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/commit-changes-analyzer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/copilot-agent-analysis.lock.yml b/.github/workflows/copilot-agent-analysis.lock.yml index 963e8c1b73..a6560d545d 100644 --- a/.github/workflows/copilot-agent-analysis.lock.yml +++ b/.github/workflows/copilot-agent-analysis.lock.yml @@ -516,249 +516,251 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical agent performance metrics - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/copilot-agent-analysis` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/copilot-agent-analysis/*.json, memory/copilot-agent-analysis/*.jsonl, memory/copilot-agent-analysis/*.csv, memory/copilot-agent-analysis/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/copilot-agent-analysis.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical agent performance metrics + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/copilot-agent-analysis` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/copilot-agent-analysis/*.json, memory/copilot-agent-analysis/*.jsonl, memory/copilot-agent-analysis/*.csv, memory/copilot-agent-analysis/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/copilot-agent-analysis.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/copilot-cli-deep-research.lock.yml b/.github/workflows/copilot-cli-deep-research.lock.yml index 2c51ba2adf..96ead09a55 100644 --- a/.github/workflows/copilot-cli-deep-research.lock.yml +++ b/.github/workflows/copilot-cli-deep-research.lock.yml @@ -491,160 +491,162 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Copilot CLI research notes and analysis history - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/copilot-cli-research` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/copilot-cli-research/*.json, memory/copilot-cli-research/*.md - - **Max File Size**: 204800 bytes (0.20 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/copilot-cli-deep-research.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Copilot CLI research notes and analysis history + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/copilot-cli-research` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/copilot-cli-research/*.json, memory/copilot-cli-research/*.md + - **Max File Size**: 204800 bytes (0.20 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/copilot-cli-deep-research.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/copilot-pr-merged-report.lock.yml b/.github/workflows/copilot-pr-merged-report.lock.yml index 7875c6b10c..7342bf4028 100644 --- a/.github/workflows/copilot-pr-merged-report.lock.yml +++ b/.github/workflows/copilot-pr-merged-report.lock.yml @@ -562,124 +562,126 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. - - **Correct**: - ``` - Use the safeinputs-gh tool with args: "pr list --limit 5" - Use the safeinputs-gh tool with args: "issue view 123" - ``` - - **Incorrect**: - ``` - Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) - Run: gh pr list --limit 5 ❌ (No authentication in bash) - Execute bash: gh issue view 123 ❌ (No authentication in bash) - ``` - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/copilot-pr-merged-report.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. + + **Correct**: + ``` + Use the safeinputs-gh tool with args: "pr list --limit 5" + Use the safeinputs-gh tool with args: "issue view 123" + ``` + + **Incorrect**: + ``` + Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) + Run: gh pr list --limit 5 ❌ (No authentication in bash) + Execute bash: gh issue view 123 ❌ (No authentication in bash) + ``` + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/copilot-pr-merged-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Validate prompt placeholders env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt diff --git a/.github/workflows/copilot-pr-nlp-analysis.lock.yml b/.github/workflows/copilot-pr-nlp-analysis.lock.yml index 9cc5c26766..f5027d1ab2 100644 --- a/.github/workflows/copilot-pr-nlp-analysis.lock.yml +++ b/.github/workflows/copilot-pr-nlp-analysis.lock.yml @@ -570,497 +570,499 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical NLP analysis results - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/nlp-analysis` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/nlp-analysis/*.json, memory/nlp-analysis/*.jsonl, memory/nlp-analysis/*.csv, memory/nlp-analysis/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/copilot-pr-nlp-analysis.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical NLP analysis results + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/nlp-analysis` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/nlp-analysis/*.json, memory/nlp-analysis/*.jsonl, memory/nlp-analysis/*.csv, memory/nlp-analysis/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/copilot-pr-nlp-analysis.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/copilot-pr-prompt-analysis.lock.yml b/.github/workflows/copilot-pr-prompt-analysis.lock.yml index 34ee21a912..fd7c25c1b3 100644 --- a/.github/workflows/copilot-pr-prompt-analysis.lock.yml +++ b/.github/workflows/copilot-pr-prompt-analysis.lock.yml @@ -512,249 +512,251 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical prompt pattern analysis - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/prompt-analysis` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/prompt-analysis/*.json, memory/prompt-analysis/*.jsonl, memory/prompt-analysis/*.csv, memory/prompt-analysis/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/copilot-pr-prompt-analysis.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical prompt pattern analysis + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/prompt-analysis` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/prompt-analysis/*.json, memory/prompt-analysis/*.jsonl, memory/prompt-analysis/*.csv, memory/prompt-analysis/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/copilot-pr-prompt-analysis.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/copilot-session-insights.lock.yml b/.github/workflows/copilot-session-insights.lock.yml index 9f5ee1a092..4afd17d86c 100644 --- a/.github/workflows/copilot-session-insights.lock.yml +++ b/.github/workflows/copilot-session-insights.lock.yml @@ -569,830 +569,832 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical session analysis data - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/session-insights` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/session-insights/*.json, memory/session-insights/*.jsonl, memory/session-insights/*.csv, memory/session-insights/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json - { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - - # Session Analysis Chart Generation - - You are an expert at creating session analysis trend charts that reveal insights about Copilot agent session patterns over time. - - ## 📊 Chart Generation Requirements - - **IMPORTANT**: Generate exactly 2 trend charts that showcase Copilot agent session patterns over time. - - ### Chart Generation Process - - **Phase 1: Data Collection** - - Collect data for the past 30 days (or available data) from cache memory and session logs: - - 1. **Session Completion Data**: - - Count of sessions completed successfully per day - - Count of sessions failed/abandoned per day - - Completion rate percentage per day - - 2. **Session Duration Data**: - - Average session duration per day (in minutes) - - Median session duration per day - - Number of sessions with loops/retries - - **Phase 2: Data Preparation** - - 1. Create CSV files in `/tmp/gh-aw/python/data/` with the collected data: - - `session_completion.csv` - Daily completion counts and rates - - `session_duration.csv` - Daily duration statistics - - 2. Each CSV should have a date column and metric columns with appropriate headers - - **Phase 3: Chart Generation** - - Generate exactly **2 high-quality trend charts**: - - **Chart 1: Session Completion Trends** - - Multi-line chart showing: - - Successful completions (line, green) - - Failed/abandoned sessions (line, red) - - Completion rate percentage (line with secondary y-axis) - - X-axis: Date (last 30 days) - - Y-axis: Count (left), Percentage (right) - - Save as: `/tmp/gh-aw/python/charts/session_completion_trends.png` - - **Chart 2: Session Duration & Efficiency** - - Dual visualization showing: - - Average session duration (line) - - Median session duration (line) - - Sessions with loops (bar chart overlay) - - X-axis: Date (last 30 days) - - Y-axis: Duration in minutes - - Save as: `/tmp/gh-aw/python/charts/session_duration_trends.png` - - **Chart Quality Requirements**: - - DPI: 300 minimum - - Figure size: 12x7 inches for better readability - - Use seaborn styling with a professional color palette - - Include grid lines for easier reading - - Clear, large labels and legend - - Title with context (e.g., "Session Completion Rates - Last 30 Days") - - Annotations for significant changes or anomalies - - **Phase 4: Upload Charts** - - 1. Upload both charts using the `upload asset` tool - 2. Collect the returned URLs for embedding in the discussion - - **Phase 5: Embed Charts in Discussion** - - Include the charts in your analysis report with this structure: - - ```markdown - ## 📈 Session Trends Analysis - - ### Completion Patterns - ![Session Completion Trends](URL_FROM_UPLOAD_ASSET_CHART_1) - - [Brief 2-3 sentence analysis of completion trends, highlighting improvements in success rates or concerning patterns] - - ### Duration & Efficiency - ![Session Duration Trends](URL_FROM_UPLOAD_ASSET_CHART_2) - - [Brief 2-3 sentence analysis of session duration patterns, noting efficiency improvements or areas needing attention] - ``` - - ### Python Implementation Notes - - - Use pandas for data manipulation and date handling - - Use matplotlib.pyplot and seaborn for visualization - - Set appropriate date formatters for x-axis labels - - Use `plt.xticks(rotation=45)` for readable date labels - - Apply `plt.tight_layout()` before saving - - Handle cases where data might be sparse or missing - - ### Error Handling - - If insufficient data is available (less than 7 days): - - Generate the charts with available data - - Add a note in the analysis mentioning the limited data range - - Consider using a bar chart instead of line chart for very sparse data - - # Session Analysis Strategies - - Comprehensive strategies for analyzing Copilot agent sessions to extract insights, identify patterns, and recommend improvements. - - ## Standard Analysis Strategies - - These strategies should be applied to every session analysis: - - ### 1. Completion Analysis - - Did the session complete successfully? - - Was the task abandoned or aborted? - - Look for error messages or failure indicators - - Track completion rate - - ### 2. Loop Detection - - Identify repetitive agent responses - - Detect circular reasoning or stuck patterns - - Count iteration loops without progress - - Flag sessions with excessive retries - - ### 3. Prompt Structure Analysis - - Analyze task description clarity - - Identify effective prompt patterns - - Cluster prompts by keywords or structure - - Correlate prompt quality with success - - ### 4. Context Confusion Detection - - Look for signs of missing context - - Identify requests for clarification - - Track contextual misunderstandings - - Note when agent asks for more information - - ### 5. Error Recovery Analysis - - How does the agent handle errors? - - Track error types and recovery strategies - - Measure time to recover from failures - - Identify successful vs. failed recoveries - - ### 6. Tool Usage Patterns - - Which tools are used most frequently? - - Are tools used effectively? - - Identify missing or unavailable tools - - Track tool execution success rates - - ## Experimental Strategies (30% of runs) - - **Determine if this is an experimental run**: - ```bash - # Generate random number between 0-100 using shell's RANDOM variable - # Note: Requires bash shell. On systems without bash, use: $(od -An -N1 -tu1 /dev/urandom | awk '{print $1}') - RANDOM_VALUE=$((RANDOM % 100)) - # If value < 30, this is an experimental run - ``` - - **Novel Analysis Methods to Try** (rotate through these): - - ### 1. Semantic Clustering - - Group prompts by semantic similarity - - Identify common themes across sessions - - Find outlier prompts that perform differently - - Use keyword extraction and comparison - - ### 2. Temporal Analysis - - Analyze session duration patterns - - Identify time-of-day effects - - Track performance trends over time - - Correlate timing with success rates - - ### 3. Code Quality Metrics - - If sessions produce code, analyze quality - - Check for test coverage mentions - - Look for documentation updates - - Track code review feedback - - ### 4. User Interaction Patterns - - Analyze back-and-forth exchanges - - Measure clarification request frequency - - Track user guidance effectiveness - - Identify optimal interaction patterns - - ### 5. Cross-Session Learning - - Compare similar tasks across sessions - - Identify improvement over time - - Track recurring issues - - Find evolving solution strategies - - **Record Experimental Results**: - - Store strategy name and description - - Record what was measured - - Note insights discovered - - Save to cache for future reference - - ## Data Collection per Session - - For each session, collect: - - **Session ID**: Unique identifier - - **Timestamp**: When the session occurred - - **Task Type**: Category of task (bug fix, feature, refactor, etc.) - - **Duration**: Time from start to completion - - **Status**: Success, failure, abandoned, in-progress - - **Loop Count**: Number of repetitive cycles detected - - **Tool Usage**: List of tools used and their success - - **Error Count**: Number of errors encountered - - **Prompt Quality Score**: Assessed quality (1-10) - - **Context Issues**: Boolean flag for confusion detected - - **Notes**: Any notable observations - - ## Cache Memory Management - - ### Cache Structure - ``` - /tmp/gh-aw/cache-memory/session-analysis/ - ├── history.json # Historical analysis results - ├── strategies.json # Discovered analytical strategies - └── patterns.json # Known behavioral patterns - ``` - - ### Initialize Cache - - If cache files don't exist, create them with initial structure: - ```bash - mkdir -p /tmp/gh-aw/cache-memory/session-analysis/ - - cat > /tmp/gh-aw/cache-memory/session-analysis/history.json << 'EOF' { - "analyses": [], - "last_updated": "YYYY-MM-DD", - "version": "1.0" - } - EOF - ``` - - ### Update Historical Data - - Update cache memory with today's analysis: - ```bash - # Update history.json with today's results - # Include: date, sessions_analyzed, completion_rate, average_duration_minutes - # Include: experimental_strategy (if applicable), key_insights array - ``` - - ### Store Discovered Strategies - - If this was an experimental run, save the new strategy: - - Strategy name and description - - Results and effectiveness metrics - - Save to strategies.json - - ### Update Pattern Database - - Add newly discovered patterns: - - Pattern type and frequency - - Correlation with success/failure - - Save to patterns.json - - ### Maintain Cache Size - - Keep cache manageable: - - Retain last 90 days of analysis history - - Keep top 20 most effective strategies - - Maintain comprehensive pattern database - - ## Insight Synthesis - - Aggregate observations across all analyzed sessions: - - ### Success Factors - - Identify patterns associated with successful completions: - - Common prompt characteristics - - Effective tool combinations - - Optimal context provision - - Successful error recovery strategies - - Clear task descriptions - - **Example Analysis**: - ``` - SUCCESS PATTERNS: - - Sessions with specific file references: 85% success rate - - Prompts including expected outcomes: 78% success rate - - Tasks under 100 lines of change: 90% success rate - ``` - - ### Failure Signals - - Identify common indicators of confusion or inefficiency: - - Vague or ambiguous prompts - - Missing context clues - - Circular reasoning patterns - - Repeated failed attempts - - Tool unavailability - - **Example Analysis**: - ``` - FAILURE INDICATORS: - - Prompts with "just fix it": 45% success rate - - Missing file paths: 40% success rate - - Tasks requiring >5 iterations: 30% success rate - ``` - - ### Prompt Quality Indicators - - Analyze what makes prompts effective: - - Specific vs. general instructions - - Context richness - - Clear acceptance criteria - - File/code references - - Expected behavior descriptions - - **Categorize Prompts**: - - **High Quality**: Specific, contextual, clear outcomes - - **Medium Quality**: Some clarity but missing details - - **Low Quality**: Vague, ambiguous, lacking context - - ## Recommendations Format - - Based on the analysis, generate actionable recommendations: - - 1. **For Users**: How to write better task descriptions - 2. **For System**: Potential improvements to agent behavior - 3. **For Tools**: Missing capabilities or integrations - - Include: - - Prompt improvement templates - - Best practice guidelines - - Tool usage suggestions - - Context provision tips - - Error handling strategies - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/copilot-session-insights.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical session analysis data + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/session-insights` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/session-insights/*.json, memory/session-insights/*.jsonl, memory/session-insights/*.csv, memory/session-insights/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + + # Session Analysis Chart Generation + + You are an expert at creating session analysis trend charts that reveal insights about Copilot agent session patterns over time. + + ## 📊 Chart Generation Requirements + + **IMPORTANT**: Generate exactly 2 trend charts that showcase Copilot agent session patterns over time. + + ### Chart Generation Process + + **Phase 1: Data Collection** + + Collect data for the past 30 days (or available data) from cache memory and session logs: + + 1. **Session Completion Data**: + - Count of sessions completed successfully per day + - Count of sessions failed/abandoned per day + - Completion rate percentage per day + + 2. **Session Duration Data**: + - Average session duration per day (in minutes) + - Median session duration per day + - Number of sessions with loops/retries + + **Phase 2: Data Preparation** + + 1. Create CSV files in `/tmp/gh-aw/python/data/` with the collected data: + - `session_completion.csv` - Daily completion counts and rates + - `session_duration.csv` - Daily duration statistics + + 2. Each CSV should have a date column and metric columns with appropriate headers + + **Phase 3: Chart Generation** + + Generate exactly **2 high-quality trend charts**: + + **Chart 1: Session Completion Trends** + - Multi-line chart showing: + - Successful completions (line, green) + - Failed/abandoned sessions (line, red) + - Completion rate percentage (line with secondary y-axis) + - X-axis: Date (last 30 days) + - Y-axis: Count (left), Percentage (right) + - Save as: `/tmp/gh-aw/python/charts/session_completion_trends.png` + + **Chart 2: Session Duration & Efficiency** + - Dual visualization showing: + - Average session duration (line) + - Median session duration (line) + - Sessions with loops (bar chart overlay) + - X-axis: Date (last 30 days) + - Y-axis: Duration in minutes + - Save as: `/tmp/gh-aw/python/charts/session_duration_trends.png` + + **Chart Quality Requirements**: + - DPI: 300 minimum + - Figure size: 12x7 inches for better readability + - Use seaborn styling with a professional color palette + - Include grid lines for easier reading + - Clear, large labels and legend + - Title with context (e.g., "Session Completion Rates - Last 30 Days") + - Annotations for significant changes or anomalies + + **Phase 4: Upload Charts** + + 1. Upload both charts using the `upload asset` tool + 2. Collect the returned URLs for embedding in the discussion + + **Phase 5: Embed Charts in Discussion** + + Include the charts in your analysis report with this structure: + + ```markdown + ## 📈 Session Trends Analysis + + ### Completion Patterns + ![Session Completion Trends](URL_FROM_UPLOAD_ASSET_CHART_1) + + [Brief 2-3 sentence analysis of completion trends, highlighting improvements in success rates or concerning patterns] + + ### Duration & Efficiency + ![Session Duration Trends](URL_FROM_UPLOAD_ASSET_CHART_2) + + [Brief 2-3 sentence analysis of session duration patterns, noting efficiency improvements or areas needing attention] + ``` + + ### Python Implementation Notes + + - Use pandas for data manipulation and date handling + - Use matplotlib.pyplot and seaborn for visualization + - Set appropriate date formatters for x-axis labels + - Use `plt.xticks(rotation=45)` for readable date labels + - Apply `plt.tight_layout()` before saving + - Handle cases where data might be sparse or missing + + ### Error Handling + + If insufficient data is available (less than 7 days): + - Generate the charts with available data + - Add a note in the analysis mentioning the limited data range + - Consider using a bar chart instead of line chart for very sparse data + + # Session Analysis Strategies + + Comprehensive strategies for analyzing Copilot agent sessions to extract insights, identify patterns, and recommend improvements. + + ## Standard Analysis Strategies + + These strategies should be applied to every session analysis: + + ### 1. Completion Analysis + - Did the session complete successfully? + - Was the task abandoned or aborted? + - Look for error messages or failure indicators + - Track completion rate + + ### 2. Loop Detection + - Identify repetitive agent responses + - Detect circular reasoning or stuck patterns + - Count iteration loops without progress + - Flag sessions with excessive retries + + ### 3. Prompt Structure Analysis + - Analyze task description clarity + - Identify effective prompt patterns + - Cluster prompts by keywords or structure + - Correlate prompt quality with success + + ### 4. Context Confusion Detection + - Look for signs of missing context + - Identify requests for clarification + - Track contextual misunderstandings + - Note when agent asks for more information + + ### 5. Error Recovery Analysis + - How does the agent handle errors? + - Track error types and recovery strategies + - Measure time to recover from failures + - Identify successful vs. failed recoveries + + ### 6. Tool Usage Patterns + - Which tools are used most frequently? + - Are tools used effectively? + - Identify missing or unavailable tools + - Track tool execution success rates + + ## Experimental Strategies (30% of runs) + + **Determine if this is an experimental run**: + ```bash + # Generate random number between 0-100 using shell's RANDOM variable + # Note: Requires bash shell. On systems without bash, use: $(od -An -N1 -tu1 /dev/urandom | awk '{print $1}') + RANDOM_VALUE=$((RANDOM % 100)) + # If value < 30, this is an experimental run + ``` + + **Novel Analysis Methods to Try** (rotate through these): + + ### 1. Semantic Clustering + - Group prompts by semantic similarity + - Identify common themes across sessions + - Find outlier prompts that perform differently + - Use keyword extraction and comparison + + ### 2. Temporal Analysis + - Analyze session duration patterns + - Identify time-of-day effects + - Track performance trends over time + - Correlate timing with success rates + + ### 3. Code Quality Metrics + - If sessions produce code, analyze quality + - Check for test coverage mentions + - Look for documentation updates + - Track code review feedback + + ### 4. User Interaction Patterns + - Analyze back-and-forth exchanges + - Measure clarification request frequency + - Track user guidance effectiveness + - Identify optimal interaction patterns + + ### 5. Cross-Session Learning + - Compare similar tasks across sessions + - Identify improvement over time + - Track recurring issues + - Find evolving solution strategies + + **Record Experimental Results**: + - Store strategy name and description + - Record what was measured + - Note insights discovered + - Save to cache for future reference + + ## Data Collection per Session + + For each session, collect: + - **Session ID**: Unique identifier + - **Timestamp**: When the session occurred + - **Task Type**: Category of task (bug fix, feature, refactor, etc.) + - **Duration**: Time from start to completion + - **Status**: Success, failure, abandoned, in-progress + - **Loop Count**: Number of repetitive cycles detected + - **Tool Usage**: List of tools used and their success + - **Error Count**: Number of errors encountered + - **Prompt Quality Score**: Assessed quality (1-10) + - **Context Issues**: Boolean flag for confusion detected + - **Notes**: Any notable observations + + ## Cache Memory Management + + ### Cache Structure + ``` + /tmp/gh-aw/cache-memory/session-analysis/ + ├── history.json # Historical analysis results + ├── strategies.json # Discovered analytical strategies + └── patterns.json # Known behavioral patterns + ``` + + ### Initialize Cache + + If cache files don't exist, create them with initial structure: + ```bash + mkdir -p /tmp/gh-aw/cache-memory/session-analysis/ + + cat > /tmp/gh-aw/cache-memory/session-analysis/history.json << 'EOF' + { + "analyses": [], + "last_updated": "YYYY-MM-DD", + "version": "1.0" + } + EOF + ``` + + ### Update Historical Data + + Update cache memory with today's analysis: + ```bash + # Update history.json with today's results + # Include: date, sessions_analyzed, completion_rate, average_duration_minutes + # Include: experimental_strategy (if applicable), key_insights array + ``` + + ### Store Discovered Strategies + + If this was an experimental run, save the new strategy: + - Strategy name and description + - Results and effectiveness metrics + - Save to strategies.json + + ### Update Pattern Database + + Add newly discovered patterns: + - Pattern type and frequency + - Correlation with success/failure + - Save to patterns.json + + ### Maintain Cache Size + + Keep cache manageable: + - Retain last 90 days of analysis history + - Keep top 20 most effective strategies + - Maintain comprehensive pattern database + + ## Insight Synthesis + + Aggregate observations across all analyzed sessions: + + ### Success Factors + + Identify patterns associated with successful completions: + - Common prompt characteristics + - Effective tool combinations + - Optimal context provision + - Successful error recovery strategies + - Clear task descriptions + + **Example Analysis**: + ``` + SUCCESS PATTERNS: + - Sessions with specific file references: 85% success rate + - Prompts including expected outcomes: 78% success rate + - Tasks under 100 lines of change: 90% success rate + ``` + + ### Failure Signals + + Identify common indicators of confusion or inefficiency: + - Vague or ambiguous prompts + - Missing context clues + - Circular reasoning patterns + - Repeated failed attempts + - Tool unavailability + + **Example Analysis**: + ``` + FAILURE INDICATORS: + - Prompts with "just fix it": 45% success rate + - Missing file paths: 40% success rate + - Tasks requiring >5 iterations: 30% success rate + ``` + + ### Prompt Quality Indicators + + Analyze what makes prompts effective: + - Specific vs. general instructions + - Context richness + - Clear acceptance criteria + - File/code references + - Expected behavior descriptions + + **Categorize Prompts**: + - **High Quality**: Specific, contextual, clear outcomes + - **Medium Quality**: Some clarity but missing details + - **Low Quality**: Vague, ambiguous, lacking context + + ## Recommendations Format + + Based on the analysis, generate actionable recommendations: + + 1. **For Users**: How to write better task descriptions + 2. **For System**: Potential improvements to agent behavior + 3. **For Tools**: Missing capabilities or integrations + + Include: + - Prompt improvement templates + - Best practice guidelines + - Tool usage suggestions + - Context provision tips + - Error handling strategies + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + PROMPT_EOF + cat << 'PROMPT_EOF' + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/copilot-session-insights.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/craft.lock.yml b/.github/workflows/craft.lock.yml index f0cba4bd81..f26235cc64 100644 --- a/.github/workflows/craft.lock.yml +++ b/.github/workflows/craft.lock.yml @@ -543,65 +543,67 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/craft.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/craft.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-assign-issue-to-user.lock.yml b/.github/workflows/daily-assign-issue-to-user.lock.yml index 4484b5e08b..6c10a5ae14 100644 --- a/.github/workflows/daily-assign-issue-to-user.lock.yml +++ b/.github/workflows/daily-assign-issue-to-user.lock.yml @@ -507,62 +507,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-assign-issue-to-user.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-assign-issue-to-user.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-choice-test.lock.yml b/.github/workflows/daily-choice-test.lock.yml index 90062c414b..640947f30b 100644 --- a/.github/workflows/daily-choice-test.lock.yml +++ b/.github/workflows/daily-choice-test.lock.yml @@ -458,62 +458,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-choice-test.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-choice-test.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-cli-performance.lock.yml b/.github/workflows/daily-cli-performance.lock.yml index 59abc20563..e9619187c1 100644 --- a/.github/workflows/daily-cli-performance.lock.yml +++ b/.github/workflows/daily-cli-performance.lock.yml @@ -679,179 +679,181 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical CLI compilation performance benchmark results - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/cli-performance` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/cli-performance/*.json, memory/cli-performance/*.jsonl, memory/cli-performance/*.txt - - **Max File Size**: 512000 bytes (0.49 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - **IMPORTANT**: Always use the `safeinputs-go` and `safeinputs-make` tools for Go and Make commands instead of running them directly via bash. These safe-input tools provide consistent execution and proper logging. - - **Correct**: - ``` - Use the safeinputs-go tool with args: "test ./..." - Use the safeinputs-make tool with args: "build" - Use the safeinputs-make tool with args: "lint" - Use the safeinputs-make tool with args: "test-unit" - ``` - - **Incorrect**: - ``` - Use the go safe-input tool with args: "test ./..." ❌ (Wrong tool name - use safeinputs-go) - Run: go test ./... ❌ (Use safeinputs-go instead) - Execute bash: make build ❌ (Use safeinputs-make instead) - ``` - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-cli-performance.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical CLI compilation performance benchmark results + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/cli-performance` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/cli-performance/*.json, memory/cli-performance/*.jsonl, memory/cli-performance/*.txt + - **Max File Size**: 512000 bytes (0.49 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + **IMPORTANT**: Always use the `safeinputs-go` and `safeinputs-make` tools for Go and Make commands instead of running them directly via bash. These safe-input tools provide consistent execution and proper logging. + + **Correct**: + ``` + Use the safeinputs-go tool with args: "test ./..." + Use the safeinputs-make tool with args: "build" + Use the safeinputs-make tool with args: "lint" + Use the safeinputs-make tool with args: "test-unit" + ``` + + **Incorrect**: + ``` + Use the go safe-input tool with args: "test ./..." ❌ (Wrong tool name - use safeinputs-go) + Run: go test ./... ❌ (Use safeinputs-go instead) + Execute bash: make build ❌ (Use safeinputs-make instead) + ``` + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-cli-performance.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-code-metrics.lock.yml b/.github/workflows/daily-code-metrics.lock.yml index 482c8d7e66..0c522b74e4 100644 --- a/.github/workflows/daily-code-metrics.lock.yml +++ b/.github/workflows/daily-code-metrics.lock.yml @@ -558,581 +558,583 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical code quality and health metrics - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `daily/default` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: *.json, *.jsonl, *.csv, *.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - # Trends Visualization Guide - - You are an expert at creating compelling trend visualizations that reveal insights from data over time. - - ## Trending Chart Best Practices - - When generating trending charts, focus on: - - ### 1. **Time Series Excellence** - - Use line charts for continuous trends over time - - Add trend lines or moving averages to highlight patterns - - Include clear date/time labels on the x-axis - - Show confidence intervals or error bands when relevant - - ### 2. **Comparative Trends** - - Use multi-line charts to compare multiple trends - - Apply distinct colors for each series with a clear legend - - Consider using area charts for stacked trends - - Highlight key inflection points or anomalies - - ### 3. **Visual Impact** - - Use vibrant, contrasting colors to make trends stand out - - Add annotations for significant events or milestones - - Include grid lines for easier value reading - - Use appropriate scale (linear vs. logarithmic) - - ### 4. **Contextual Information** - - Show percentage changes or growth rates - - Include baseline comparisons (year-over-year, month-over-month) - - Add summary statistics (min, max, average, median) - - Highlight recent trends vs. historical patterns - - ## Example Trend Chart Types - - ### Temporal Trends - ```python - # Line chart with multiple trends - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - for column in data.columns: - ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) - ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ### Growth Rates - ```python - # Bar chart showing period-over-period growth - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) - ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') - ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) - ax.set_ylabel('Growth %', fontsize=12) - ``` - - ### Moving Averages - ```python - # Trend with moving average overlay - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) - ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) - ax.fill_between(dates, values, moving_avg, alpha=0.2) - ``` - - ## Data Preparation for Trends - - ### Time-Based Indexing - ```python - # Convert to datetime and set as index - data['date'] = pd.to_datetime(data['date']) - data.set_index('date', inplace=True) - data = data.sort_index() - ``` - - ### Resampling and Aggregation - ```python - # Resample daily data to weekly - weekly_data = data.resample('W').mean() - - # Calculate rolling statistics - data['rolling_mean'] = data['value'].rolling(window=7).mean() - data['rolling_std'] = data['value'].rolling(window=7).std() - ``` - - ### Growth Calculations - ```python - # Calculate percentage change - data['pct_change'] = data['value'].pct_change() * 100 - - # Calculate year-over-year growth - data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 - ``` - - ## Color Palettes for Trends - - Use these palettes for impactful trend visualizations: - - - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` - - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` - - **Multiple series**: `sns.color_palette("husl", n_colors=8)` - - **Categorical**: `sns.color_palette("Set2", n_colors=6)` - - ## Annotation Best Practices - - ```python - # Annotate key points - max_idx = data['value'].idxmax() - max_val = data['value'].max() - ax.annotate(f'Peak: {max_val:.2f}', - xy=(max_idx, max_val), - xytext=(10, 20), - textcoords='offset points', - arrowprops=dict(arrowstyle='->', color='red'), - fontsize=10, - fontweight='bold') - ``` - - ## Styling for Awesome Charts - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set professional style - sns.set_style("whitegrid") - sns.set_context("notebook", font_scale=1.2) - - # Custom color palette - custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] - sns.set_palette(custom_colors) - - # Figure with optimal dimensions - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - # ... your plotting code ... - - # Tight layout for clean appearance - plt.tight_layout() - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ## Tips for Trending Charts - - 1. **Start with the story**: What trend are you trying to show? - 2. **Choose the right timeframe**: Match granularity to the pattern - 3. **Smooth noise**: Use moving averages for volatile data - 4. **Show context**: Include historical baselines or benchmarks - 5. **Highlight insights**: Use annotations to draw attention - 6. **Test readability**: Ensure labels and legends are clear - 7. **Optimize colors**: Use colorblind-friendly palettes - 8. **Export high quality**: Always use DPI 300+ for presentations - - ## Common Trend Patterns to Visualize - - - **Seasonal patterns**: Monthly or quarterly cycles - - **Long-term growth**: Exponential or linear trends - - **Volatility changes**: Periods of stability vs. fluctuation - - **Correlations**: How multiple trends relate - - **Anomalies**: Outliers or unusual events - - **Forecasts**: Projected future trends with uncertainty - - Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-code-metrics.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical code quality and health metrics + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `daily/default` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: *.json, *.jsonl, *.csv, *.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + # Trends Visualization Guide + + You are an expert at creating compelling trend visualizations that reveal insights from data over time. + + ## Trending Chart Best Practices + + When generating trending charts, focus on: + + ### 1. **Time Series Excellence** + - Use line charts for continuous trends over time + - Add trend lines or moving averages to highlight patterns + - Include clear date/time labels on the x-axis + - Show confidence intervals or error bands when relevant + + ### 2. **Comparative Trends** + - Use multi-line charts to compare multiple trends + - Apply distinct colors for each series with a clear legend + - Consider using area charts for stacked trends + - Highlight key inflection points or anomalies + + ### 3. **Visual Impact** + - Use vibrant, contrasting colors to make trends stand out + - Add annotations for significant events or milestones + - Include grid lines for easier value reading + - Use appropriate scale (linear vs. logarithmic) + + ### 4. **Contextual Information** + - Show percentage changes or growth rates + - Include baseline comparisons (year-over-year, month-over-month) + - Add summary statistics (min, max, average, median) + - Highlight recent trends vs. historical patterns + + ## Example Trend Chart Types + + ### Temporal Trends + ```python + # Line chart with multiple trends + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + for column in data.columns: + ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) + ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ### Growth Rates + ```python + # Bar chart showing period-over-period growth + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) + ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') + ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) + ax.set_ylabel('Growth %', fontsize=12) + ``` + + ### Moving Averages + ```python + # Trend with moving average overlay + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) + ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) + ax.fill_between(dates, values, moving_avg, alpha=0.2) + ``` + + ## Data Preparation for Trends + + ### Time-Based Indexing + ```python + # Convert to datetime and set as index + data['date'] = pd.to_datetime(data['date']) + data.set_index('date', inplace=True) + data = data.sort_index() + ``` + + ### Resampling and Aggregation + ```python + # Resample daily data to weekly + weekly_data = data.resample('W').mean() + + # Calculate rolling statistics + data['rolling_mean'] = data['value'].rolling(window=7).mean() + data['rolling_std'] = data['value'].rolling(window=7).std() + ``` + + ### Growth Calculations + ```python + # Calculate percentage change + data['pct_change'] = data['value'].pct_change() * 100 + + # Calculate year-over-year growth + data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 + ``` + + ## Color Palettes for Trends + + Use these palettes for impactful trend visualizations: + + - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` + - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` + - **Multiple series**: `sns.color_palette("husl", n_colors=8)` + - **Categorical**: `sns.color_palette("Set2", n_colors=6)` + + ## Annotation Best Practices + + ```python + # Annotate key points + max_idx = data['value'].idxmax() + max_val = data['value'].max() + ax.annotate(f'Peak: {max_val:.2f}', + xy=(max_idx, max_val), + xytext=(10, 20), + textcoords='offset points', + arrowprops=dict(arrowstyle='->', color='red'), + fontsize=10, + fontweight='bold') + ``` + + ## Styling for Awesome Charts + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set professional style + sns.set_style("whitegrid") + sns.set_context("notebook", font_scale=1.2) + + # Custom color palette + custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] + sns.set_palette(custom_colors) + + # Figure with optimal dimensions + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + # ... your plotting code ... + + # Tight layout for clean appearance + plt.tight_layout() + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ## Tips for Trending Charts + + 1. **Start with the story**: What trend are you trying to show? + 2. **Choose the right timeframe**: Match granularity to the pattern + 3. **Smooth noise**: Use moving averages for volatile data + 4. **Show context**: Include historical baselines or benchmarks + 5. **Highlight insights**: Use annotations to draw attention + 6. **Test readability**: Ensure labels and legends are clear + 7. **Optimize colors**: Use colorblind-friendly palettes + 8. **Export high quality**: Always use DPI 300+ for presentations + + ## Common Trend Patterns to Visualize + + - **Seasonal patterns**: Monthly or quarterly cycles + - **Long-term growth**: Exponential or linear trends + - **Volatility changes**: Periods of stability vs. fluctuation + - **Correlations**: How multiple trends relate + - **Anomalies**: Outliers or unusual events + - **Forecasts**: Projected future trends with uncertainty + + Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-code-metrics.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-compiler-quality.lock.yml b/.github/workflows/daily-compiler-quality.lock.yml index d6e59b7554..6219b34379 100644 --- a/.github/workflows/daily-compiler-quality.lock.yml +++ b/.github/workflows/daily-compiler-quality.lock.yml @@ -499,136 +499,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-compiler-quality.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-compiler-quality.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-copilot-token-report.lock.yml b/.github/workflows/daily-copilot-token-report.lock.yml index d26ae3d14a..c3dc1fe2a0 100644 --- a/.github/workflows/daily-copilot-token-report.lock.yml +++ b/.github/workflows/daily-copilot-token-report.lock.yml @@ -568,409 +568,411 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical token consumption and cost data - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/token-metrics` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/token-metrics/*.json, memory/token-metrics/*.jsonl, memory/token-metrics/*.csv, memory/token-metrics/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-copilot-token-report.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical token consumption and cost data + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/token-metrics` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/token-metrics/*.json, memory/token-metrics/*.jsonl, memory/token-metrics/*.csv, memory/token-metrics/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-copilot-token-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-doc-updater.lock.yml b/.github/workflows/daily-doc-updater.lock.yml index a8031557ea..9250e5116a 100644 --- a/.github/workflows/daily-doc-updater.lock.yml +++ b/.github/workflows/daily-doc-updater.lock.yml @@ -501,63 +501,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-doc-updater.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-doc-updater.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-fact.lock.yml b/.github/workflows/daily-fact.lock.yml index da2dad04ca..14c3cd8de8 100644 --- a/.github/workflows/daily-fact.lock.yml +++ b/.github/workflows/daily-fact.lock.yml @@ -477,62 +477,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-fact.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-fact.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-file-diet.lock.yml b/.github/workflows/daily-file-diet.lock.yml index 5ae2ba7433..6c9fe498b1 100644 --- a/.github/workflows/daily-file-diet.lock.yml +++ b/.github/workflows/daily-file-diet.lock.yml @@ -512,137 +512,139 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-file-diet.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-file-diet.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-firewall-report.lock.yml b/.github/workflows/daily-firewall-report.lock.yml index 09e13b5dc1..a60b39e697 100644 --- a/.github/workflows/daily-firewall-report.lock.yml +++ b/.github/workflows/daily-firewall-report.lock.yml @@ -582,180 +582,182 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Python Environment Ready - - Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy - Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` - - ## Store Historical Data (JSON Lines) - - ```python - import json - from datetime import datetime - - # Append data point - with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: - f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') - ``` - - ## Generate Charts - - ```python - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - df = pd.read_json('history.jsonl', lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - - sns.set_style("whitegrid") - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - df.groupby('date')['value'].mean().plot(ax=ax, marker='o') - ax.set_title('Trend', fontsize=16, fontweight='bold') - plt.xticks(rotation=45) - plt.tight_layout() - plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') - ``` - - ## Best Practices - - - Use JSON Lines (`.jsonl`) for append-only storage - - Include ISO 8601 timestamps in all data points - - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` - - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-firewall-report.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Python Environment Ready + + Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy + Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` + + ## Store Historical Data (JSON Lines) + + ```python + import json + from datetime import datetime + + # Append data point + with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: + f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') + ``` + + ## Generate Charts + + ```python + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + df = pd.read_json('history.jsonl', lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + + sns.set_style("whitegrid") + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + df.groupby('date')['value'].mean().plot(ax=ax, marker='o') + ax.set_title('Trend', fontsize=16, fontweight='bold') + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') + ``` + + ## Best Practices + + - Use JSON Lines (`.jsonl`) for append-only storage + - Include ISO 8601 timestamps in all data points + - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` + - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-firewall-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-issues-report.lock.yml b/.github/workflows/daily-issues-report.lock.yml index 2b166a1f84..2048eab76a 100644 --- a/.github/workflows/daily-issues-report.lock.yml +++ b/.github/workflows/daily-issues-report.lock.yml @@ -644,729 +644,731 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - - ## Issues Data - - Pre-fetched issues data is available at `/tmp/gh-aw/issues-data/issues.json` containing up to 1000 issues (open and closed). - - ### Schema - - The issues data structure is: - - ```json - [ + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json { - "number": "number", - "title": "string", - "state": "string", - "url": "string", - "body": "string", - "createdAt": "string", - "updatedAt": "string", - "closedAt": "string", - "author": { - "id": "string", - "login": "string", - "name": "string" - }, - "assignees": [ - { - "id": "string", - "login": "string", - "name": "string" - } - ], - "labels": [ - { - "id": "string", - "name": "string", - "color": "string", - "description": "string" - } - ], - "milestone": { - "id": "string", + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + + ## Issues Data + + Pre-fetched issues data is available at `/tmp/gh-aw/issues-data/issues.json` containing up to 1000 issues (open and closed). + + ### Schema + + The issues data structure is: + + ```json + [ + { "number": "number", "title": "string", - "description": "string", - "dueOn": "string" - }, - "comments": [ - { + "state": "string", + "url": "string", + "body": "string", + "createdAt": "string", + "updatedAt": "string", + "closedAt": "string", + "author": { "id": "string", - "url": "string", - "body": "string", - "createdAt": "string", - "author": { + "login": "string", + "name": "string" + }, + "assignees": [ + { "id": "string", "login": "string", "name": "string" } - } - ] - } - ] - ``` - - ### Usage Examples - - ```bash - # Get total number of issues - jq 'length' /tmp/gh-aw/issues-data/issues.json - - # Get only open issues - jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/issues-data/issues.json - - # Get issues from the last 7 days (cross-platform: GNU date first, BSD fallback) - DATE_7_DAYS_AGO=$(date -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-7d '+%Y-%m-%dT%H:%M:%SZ') - jq --arg date "$DATE_7_DAYS_AGO" '[.[] | select(.createdAt >= $date)]' /tmp/gh-aw/issues-data/issues.json - - # Get issue numbers - jq '[.[].number]' /tmp/gh-aw/issues-data/issues.json - - # Get issues with specific label - jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/issues-data/issues.json - ``` - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - # Trends Visualization Guide - - You are an expert at creating compelling trend visualizations that reveal insights from data over time. - - ## Trending Chart Best Practices - - When generating trending charts, focus on: - - ### 1. **Time Series Excellence** - - Use line charts for continuous trends over time - - Add trend lines or moving averages to highlight patterns - - Include clear date/time labels on the x-axis - - Show confidence intervals or error bands when relevant - - ### 2. **Comparative Trends** - - Use multi-line charts to compare multiple trends - - Apply distinct colors for each series with a clear legend - - Consider using area charts for stacked trends - - Highlight key inflection points or anomalies - - ### 3. **Visual Impact** - - Use vibrant, contrasting colors to make trends stand out - - Add annotations for significant events or milestones - - Include grid lines for easier value reading - - Use appropriate scale (linear vs. logarithmic) - - ### 4. **Contextual Information** - - Show percentage changes or growth rates - - Include baseline comparisons (year-over-year, month-over-month) - - Add summary statistics (min, max, average, median) - - Highlight recent trends vs. historical patterns - - ## Example Trend Chart Types - - ### Temporal Trends - ```python - # Line chart with multiple trends - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - for column in data.columns: - ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) - ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ### Growth Rates - ```python - # Bar chart showing period-over-period growth - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) - ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') - ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) - ax.set_ylabel('Growth %', fontsize=12) - ``` - - ### Moving Averages - ```python - # Trend with moving average overlay - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) - ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) - ax.fill_between(dates, values, moving_avg, alpha=0.2) - ``` - - ## Data Preparation for Trends - - ### Time-Based Indexing - ```python - # Convert to datetime and set as index - data['date'] = pd.to_datetime(data['date']) - data.set_index('date', inplace=True) - data = data.sort_index() - ``` - - ### Resampling and Aggregation - ```python - # Resample daily data to weekly - weekly_data = data.resample('W').mean() - - # Calculate rolling statistics - data['rolling_mean'] = data['value'].rolling(window=7).mean() - data['rolling_std'] = data['value'].rolling(window=7).std() - ``` - - ### Growth Calculations - ```python - # Calculate percentage change - data['pct_change'] = data['value'].pct_change() * 100 - - # Calculate year-over-year growth - data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 - ``` - - ## Color Palettes for Trends - - Use these palettes for impactful trend visualizations: - - - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` - - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` - - **Multiple series**: `sns.color_palette("husl", n_colors=8)` - - **Categorical**: `sns.color_palette("Set2", n_colors=6)` - - ## Annotation Best Practices - - ```python - # Annotate key points - max_idx = data['value'].idxmax() - max_val = data['value'].max() - ax.annotate(f'Peak: {max_val:.2f}', - xy=(max_idx, max_val), - xytext=(10, 20), - textcoords='offset points', - arrowprops=dict(arrowstyle='->', color='red'), - fontsize=10, - fontweight='bold') - ``` - - ## Styling for Awesome Charts - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set professional style - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - sns.set_style("whitegrid") - sns.set_context("notebook", font_scale=1.2) - - # Custom color palette - custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] - sns.set_palette(custom_colors) - - # Figure with optimal dimensions - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - # ... your plotting code ... - - # Tight layout for clean appearance - plt.tight_layout() - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ## Tips for Trending Charts - - 1. **Start with the story**: What trend are you trying to show? - 2. **Choose the right timeframe**: Match granularity to the pattern - 3. **Smooth noise**: Use moving averages for volatile data - 4. **Show context**: Include historical baselines or benchmarks - 5. **Highlight insights**: Use annotations to draw attention - 6. **Test readability**: Ensure labels and legends are clear - 7. **Optimize colors**: Use colorblind-friendly palettes - 8. **Export high quality**: Always use DPI 300+ for presentations - - ## Common Trend Patterns to Visualize - - - **Seasonal patterns**: Monthly or quarterly cycles - - **Long-term growth**: Exponential or linear trends - - **Volatility changes**: Periods of stability vs. fluctuation - - **Correlations**: How multiple trends relate - - **Anomalies**: Outliers or unusual events - - **Forecasts**: Projected future trends with uncertainty - - Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-issues-report.md}} - PROMPT_EOF + ], + "labels": [ + { + "id": "string", + "name": "string", + "color": "string", + "description": "string" + } + ], + "milestone": { + "id": "string", + "number": "number", + "title": "string", + "description": "string", + "dueOn": "string" + }, + "comments": [ + { + "id": "string", + "url": "string", + "body": "string", + "createdAt": "string", + "author": { + "id": "string", + "login": "string", + "name": "string" + } + } + ] + } + ] + ``` + + ### Usage Examples + + ```bash + # Get total number of issues + jq 'length' /tmp/gh-aw/issues-data/issues.json + + # Get only open issues + jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/issues-data/issues.json + + # Get issues from the last 7 days (cross-platform: GNU date first, BSD fallback) + DATE_7_DAYS_AGO=$(date -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-7d '+%Y-%m-%dT%H:%M:%SZ') + jq --arg date "$DATE_7_DAYS_AGO" '[.[] | select(.createdAt >= $date)]' /tmp/gh-aw/issues-data/issues.json + + # Get issue numbers + jq '[.[].number]' /tmp/gh-aw/issues-data/issues.json + + # Get issues with specific label + jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/issues-data/issues.json + ``` + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + # Trends Visualization Guide + + You are an expert at creating compelling trend visualizations that reveal insights from data over time. + + ## Trending Chart Best Practices + + When generating trending charts, focus on: + + ### 1. **Time Series Excellence** + - Use line charts for continuous trends over time + - Add trend lines or moving averages to highlight patterns + - Include clear date/time labels on the x-axis + - Show confidence intervals or error bands when relevant + + ### 2. **Comparative Trends** + - Use multi-line charts to compare multiple trends + - Apply distinct colors for each series with a clear legend + - Consider using area charts for stacked trends + - Highlight key inflection points or anomalies + + ### 3. **Visual Impact** + - Use vibrant, contrasting colors to make trends stand out + - Add annotations for significant events or milestones + - Include grid lines for easier value reading + - Use appropriate scale (linear vs. logarithmic) + + ### 4. **Contextual Information** + - Show percentage changes or growth rates + - Include baseline comparisons (year-over-year, month-over-month) + - Add summary statistics (min, max, average, median) + - Highlight recent trends vs. historical patterns + + ## Example Trend Chart Types + + ### Temporal Trends + ```python + # Line chart with multiple trends + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + for column in data.columns: + ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) + ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ### Growth Rates + ```python + # Bar chart showing period-over-period growth + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) + ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') + ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) + ax.set_ylabel('Growth %', fontsize=12) + ``` + + ### Moving Averages + ```python + # Trend with moving average overlay + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) + ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) + ax.fill_between(dates, values, moving_avg, alpha=0.2) + ``` + + ## Data Preparation for Trends + + ### Time-Based Indexing + ```python + # Convert to datetime and set as index + data['date'] = pd.to_datetime(data['date']) + data.set_index('date', inplace=True) + data = data.sort_index() + ``` + + ### Resampling and Aggregation + ```python + # Resample daily data to weekly + weekly_data = data.resample('W').mean() + + # Calculate rolling statistics + data['rolling_mean'] = data['value'].rolling(window=7).mean() + data['rolling_std'] = data['value'].rolling(window=7).std() + ``` + + ### Growth Calculations + ```python + # Calculate percentage change + data['pct_change'] = data['value'].pct_change() * 100 + + # Calculate year-over-year growth + data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 + ``` + + ## Color Palettes for Trends + + Use these palettes for impactful trend visualizations: + + - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` + - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` + - **Multiple series**: `sns.color_palette("husl", n_colors=8)` + - **Categorical**: `sns.color_palette("Set2", n_colors=6)` + + ## Annotation Best Practices + + ```python + # Annotate key points + max_idx = data['value'].idxmax() + max_val = data['value'].max() + ax.annotate(f'Peak: {max_val:.2f}', + xy=(max_idx, max_val), + xytext=(10, 20), + textcoords='offset points', + arrowprops=dict(arrowstyle='->', color='red'), + fontsize=10, + fontweight='bold') + ``` + + ## Styling for Awesome Charts + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set professional style + PROMPT_EOF + cat << 'PROMPT_EOF' + sns.set_style("whitegrid") + sns.set_context("notebook", font_scale=1.2) + + # Custom color palette + custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] + sns.set_palette(custom_colors) + + # Figure with optimal dimensions + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + # ... your plotting code ... + + # Tight layout for clean appearance + plt.tight_layout() + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ## Tips for Trending Charts + + 1. **Start with the story**: What trend are you trying to show? + 2. **Choose the right timeframe**: Match granularity to the pattern + 3. **Smooth noise**: Use moving averages for volatile data + 4. **Show context**: Include historical baselines or benchmarks + 5. **Highlight insights**: Use annotations to draw attention + 6. **Test readability**: Ensure labels and legends are clear + 7. **Optimize colors**: Use colorblind-friendly palettes + 8. **Export high quality**: Always use DPI 300+ for presentations + + ## Common Trend Patterns to Visualize + + - **Seasonal patterns**: Monthly or quarterly cycles + - **Long-term growth**: Exponential or linear trends + - **Volatility changes**: Periods of stability vs. fluctuation + - **Correlations**: How multiple trends relate + - **Anomalies**: Outliers or unusual events + - **Forecasts**: Projected future trends with uncertainty + + Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-issues-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-malicious-code-scan.lock.yml b/.github/workflows/daily-malicious-code-scan.lock.yml index 090b61b1db..dcaf093642 100644 --- a/.github/workflows/daily-malicious-code-scan.lock.yml +++ b/.github/workflows/daily-malicious-code-scan.lock.yml @@ -521,135 +521,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-malicious-code-scan.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-malicious-code-scan.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-multi-device-docs-tester.lock.yml b/.github/workflows/daily-multi-device-docs-tester.lock.yml index fa7bc5cc1e..4d6406611d 100644 --- a/.github/workflows/daily-multi-device-docs-tester.lock.yml +++ b/.github/workflows/daily-multi-device-docs-tester.lock.yml @@ -557,198 +557,200 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Starting the Documentation Preview Server - - **Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. - - Navigate to the docs directory and start the preview server in the background: - - ```bash - cd docs - npm run preview > /tmp/preview.log 2>&1 & - echo $! > /tmp/server.pid - ``` - - This will: - - Start the preview server on port 4321 - - Redirect output to `/tmp/preview.log` - - Save the process ID to `/tmp/server.pid` for later cleanup - - ## Waiting for Server Readiness - - Poll the server with curl to ensure it's ready before use: - - ```bash - for i in {1..30}; do - curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break - echo "Waiting for server... ($i/30)" && sleep 2 - done - ``` - - This will: - - Attempt to connect up to 30 times (60 seconds total) - - Wait 2 seconds between attempts - - Exit successfully when server responds - - ## Verifying Server Accessibility (Optional) - - Optionally verify the server is serving content: - - ```bash - curl -s http://localhost:4321/gh-aw/ | head -20 - ``` - - ## Stopping the Documentation Server - - After you're done using the server, clean up the process: - - ```bash - kill $(cat /tmp/server.pid) 2>/dev/null || true - rm -f /tmp/server.pid /tmp/preview.log - ``` - - This will: - - Kill the server process using the saved PID - - Remove temporary files - - Ignore errors if the process already stopped - - ## Usage Notes - - - The server runs on `http://localhost:4321` - - Documentation is accessible at `http://localhost:4321/gh-aw/` - - Always clean up the server when done to avoid orphan processes - - If the server fails to start, check `/tmp/preview.log` for errors - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-multi-device-docs-tester.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Starting the Documentation Preview Server + + **Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. + + Navigate to the docs directory and start the preview server in the background: + + ```bash + cd docs + npm run preview > /tmp/preview.log 2>&1 & + echo $! > /tmp/server.pid + ``` + + This will: + - Start the preview server on port 4321 + - Redirect output to `/tmp/preview.log` + - Save the process ID to `/tmp/server.pid` for later cleanup + + ## Waiting for Server Readiness + + Poll the server with curl to ensure it's ready before use: + + ```bash + for i in {1..30}; do + curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break + echo "Waiting for server... ($i/30)" && sleep 2 + done + ``` + + This will: + - Attempt to connect up to 30 times (60 seconds total) + - Wait 2 seconds between attempts + - Exit successfully when server responds + + ## Verifying Server Accessibility (Optional) + + Optionally verify the server is serving content: + + ```bash + curl -s http://localhost:4321/gh-aw/ | head -20 + ``` + + ## Stopping the Documentation Server + + After you're done using the server, clean up the process: + + ```bash + kill $(cat /tmp/server.pid) 2>/dev/null || true + rm -f /tmp/server.pid /tmp/preview.log + ``` + + This will: + - Kill the server process using the saved PID + - Remove temporary files + - Ignore errors if the process already stopped + + ## Usage Notes + + - The server runs on `http://localhost:4321` + - Documentation is accessible at `http://localhost:4321/gh-aw/` + - Always clean up the server when done to avoid orphan processes + - If the server fails to start, check `/tmp/preview.log` for errors + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-multi-device-docs-tester.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-news.lock.yml b/.github/workflows/daily-news.lock.yml index 1d4a51ba6a..3db38f3ba5 100644 --- a/.github/workflows/daily-news.lock.yml +++ b/.github/workflows/daily-news.lock.yml @@ -639,671 +639,673 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical news digest data - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/daily-news` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/daily-news/*.json, memory/daily-news/*.jsonl, memory/daily-news/*.csv, memory/daily-news/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Trends Visualization Guide - - You are an expert at creating compelling trend visualizations that reveal insights from data over time. - - ## Trending Chart Best Practices - - When generating trending charts, focus on: - - ### 1. **Time Series Excellence** - - Use line charts for continuous trends over time - - Add trend lines or moving averages to highlight patterns - - Include clear date/time labels on the x-axis - - Show confidence intervals or error bands when relevant - - ### 2. **Comparative Trends** - - Use multi-line charts to compare multiple trends - - Apply distinct colors for each series with a clear legend - - Consider using area charts for stacked trends - - Highlight key inflection points or anomalies - - ### 3. **Visual Impact** - - Use vibrant, contrasting colors to make trends stand out - - Add annotations for significant events or milestones - - Include grid lines for easier value reading - - Use appropriate scale (linear vs. logarithmic) - - ### 4. **Contextual Information** - - Show percentage changes or growth rates - - Include baseline comparisons (year-over-year, month-over-month) - - Add summary statistics (min, max, average, median) - - Highlight recent trends vs. historical patterns - - ## Example Trend Chart Types - - ### Temporal Trends - ```python - # Line chart with multiple trends - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - for column in data.columns: - ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) - ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ### Growth Rates - ```python - # Bar chart showing period-over-period growth - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) - ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') - ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) - ax.set_ylabel('Growth %', fontsize=12) - ``` - - ### Moving Averages - ```python - # Trend with moving average overlay - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) - ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) - ax.fill_between(dates, values, moving_avg, alpha=0.2) - ``` - - ## Data Preparation for Trends - - ### Time-Based Indexing - ```python - # Convert to datetime and set as index - data['date'] = pd.to_datetime(data['date']) - data.set_index('date', inplace=True) - data = data.sort_index() - ``` - - ### Resampling and Aggregation - ```python - # Resample daily data to weekly - weekly_data = data.resample('W').mean() - - # Calculate rolling statistics - data['rolling_mean'] = data['value'].rolling(window=7).mean() - data['rolling_std'] = data['value'].rolling(window=7).std() - ``` - - ### Growth Calculations - ```python - # Calculate percentage change - data['pct_change'] = data['value'].pct_change() * 100 - - # Calculate year-over-year growth - data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 - ``` - - ## Color Palettes for Trends - - Use these palettes for impactful trend visualizations: - - - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` - - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` - - **Multiple series**: `sns.color_palette("husl", n_colors=8)` - - **Categorical**: `sns.color_palette("Set2", n_colors=6)` - - ## Annotation Best Practices - - ```python - # Annotate key points - max_idx = data['value'].idxmax() - max_val = data['value'].max() - ax.annotate(f'Peak: {max_val:.2f}', - xy=(max_idx, max_val), - xytext=(10, 20), - textcoords='offset points', - arrowprops=dict(arrowstyle='->', color='red'), - fontsize=10, - fontweight='bold') - ``` - - ## Styling for Awesome Charts - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set professional style - sns.set_style("whitegrid") - sns.set_context("notebook", font_scale=1.2) - - # Custom color palette - custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] - sns.set_palette(custom_colors) - - # Figure with optimal dimensions - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - # ... your plotting code ... - - # Tight layout for clean appearance - plt.tight_layout() - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ## Tips for Trending Charts - - 1. **Start with the story**: What trend are you trying to show? - 2. **Choose the right timeframe**: Match granularity to the pattern - 3. **Smooth noise**: Use moving averages for volatile data - 4. **Show context**: Include historical baselines or benchmarks - 5. **Highlight insights**: Use annotations to draw attention - 6. **Test readability**: Ensure labels and legends are clear - 7. **Optimize colors**: Use colorblind-friendly palettes - 8. **Export high quality**: Always use DPI 300+ for presentations - - ## Common Trend Patterns to Visualize - - - **Seasonal patterns**: Monthly or quarterly cycles - - **Long-term growth**: Exponential or linear trends - - **Volatility changes**: Periods of stability vs. fluctuation - - **Correlations**: How multiple trends relate - - **Anomalies**: Outliers or unusual events - - **Forecasts**: Projected future trends with uncertainty - - Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-news.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Historical news digest data + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/daily-news` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/daily-news/*.json, memory/daily-news/*.jsonl, memory/daily-news/*.csv, memory/daily-news/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Trends Visualization Guide + + You are an expert at creating compelling trend visualizations that reveal insights from data over time. + + ## Trending Chart Best Practices + + When generating trending charts, focus on: + + ### 1. **Time Series Excellence** + - Use line charts for continuous trends over time + - Add trend lines or moving averages to highlight patterns + - Include clear date/time labels on the x-axis + - Show confidence intervals or error bands when relevant + + ### 2. **Comparative Trends** + - Use multi-line charts to compare multiple trends + - Apply distinct colors for each series with a clear legend + - Consider using area charts for stacked trends + - Highlight key inflection points or anomalies + + ### 3. **Visual Impact** + - Use vibrant, contrasting colors to make trends stand out + - Add annotations for significant events or milestones + - Include grid lines for easier value reading + - Use appropriate scale (linear vs. logarithmic) + + ### 4. **Contextual Information** + - Show percentage changes or growth rates + - Include baseline comparisons (year-over-year, month-over-month) + - Add summary statistics (min, max, average, median) + - Highlight recent trends vs. historical patterns + + ## Example Trend Chart Types + + ### Temporal Trends + ```python + # Line chart with multiple trends + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + for column in data.columns: + ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) + ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ### Growth Rates + ```python + # Bar chart showing period-over-period growth + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) + ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') + ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) + ax.set_ylabel('Growth %', fontsize=12) + ``` + + ### Moving Averages + ```python + # Trend with moving average overlay + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) + ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) + ax.fill_between(dates, values, moving_avg, alpha=0.2) + ``` + + ## Data Preparation for Trends + + ### Time-Based Indexing + ```python + # Convert to datetime and set as index + data['date'] = pd.to_datetime(data['date']) + data.set_index('date', inplace=True) + data = data.sort_index() + ``` + + ### Resampling and Aggregation + ```python + # Resample daily data to weekly + weekly_data = data.resample('W').mean() + + # Calculate rolling statistics + data['rolling_mean'] = data['value'].rolling(window=7).mean() + data['rolling_std'] = data['value'].rolling(window=7).std() + ``` + + ### Growth Calculations + ```python + # Calculate percentage change + data['pct_change'] = data['value'].pct_change() * 100 + + # Calculate year-over-year growth + data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 + ``` + + ## Color Palettes for Trends + + Use these palettes for impactful trend visualizations: + + - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` + - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` + - **Multiple series**: `sns.color_palette("husl", n_colors=8)` + - **Categorical**: `sns.color_palette("Set2", n_colors=6)` + + ## Annotation Best Practices + + ```python + # Annotate key points + max_idx = data['value'].idxmax() + max_val = data['value'].max() + ax.annotate(f'Peak: {max_val:.2f}', + xy=(max_idx, max_val), + xytext=(10, 20), + textcoords='offset points', + arrowprops=dict(arrowstyle='->', color='red'), + fontsize=10, + fontweight='bold') + ``` + + ## Styling for Awesome Charts + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set professional style + sns.set_style("whitegrid") + sns.set_context("notebook", font_scale=1.2) + + # Custom color palette + custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] + sns.set_palette(custom_colors) + + # Figure with optimal dimensions + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + # ... your plotting code ... + + # Tight layout for clean appearance + plt.tight_layout() + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ## Tips for Trending Charts + + 1. **Start with the story**: What trend are you trying to show? + 2. **Choose the right timeframe**: Match granularity to the pattern + 3. **Smooth noise**: Use moving averages for volatile data + 4. **Show context**: Include historical baselines or benchmarks + 5. **Highlight insights**: Use annotations to draw attention + 6. **Test readability**: Ensure labels and legends are clear + 7. **Optimize colors**: Use colorblind-friendly palettes + 8. **Export high quality**: Always use DPI 300+ for presentations + + ## Common Trend Patterns to Visualize + + - **Seasonal patterns**: Monthly or quarterly cycles + - **Long-term growth**: Exponential or linear trends + - **Volatility changes**: Periods of stability vs. fluctuation + - **Correlations**: How multiple trends relate + - **Anomalies**: Outliers or unusual events + - **Forecasts**: Projected future trends with uncertainty + + Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + PROMPT_EOF + cat << 'PROMPT_EOF' + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-news.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-observability-report.lock.yml b/.github/workflows/daily-observability-report.lock.yml index ec171ed981..57aad16954 100644 --- a/.github/workflows/daily-observability-report.lock.yml +++ b/.github/workflows/daily-observability-report.lock.yml @@ -611,135 +611,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-observability-report.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-observability-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-performance-summary.lock.yml b/.github/workflows/daily-performance-summary.lock.yml index 8f84825508..5090c04232 100644 --- a/.github/workflows/daily-performance-summary.lock.yml +++ b/.github/workflows/daily-performance-summary.lock.yml @@ -1105,180 +1105,182 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - # Python Environment Ready - - Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy - Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` - - ## Store Historical Data (JSON Lines) - - ```python - import json - from datetime import datetime - - # Append data point - with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: - f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') - ``` - - ## Generate Charts - - ```python - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - df = pd.read_json('history.jsonl', lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - - sns.set_style("whitegrid") - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - df.groupby('date')['value'].mean().plot(ax=ax, marker='o') - ax.set_title('Trend', fontsize=16, fontweight='bold') - plt.xticks(rotation=45) - plt.tight_layout() - plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') - ``` - - ## Best Practices - - - Use JSON Lines (`.jsonl`) for append-only storage - - Include ISO 8601 timestamps in all data points - - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` - - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-performance-summary.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + # Python Environment Ready + + Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy + Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` + + ## Store Historical Data (JSON Lines) + + ```python + import json + from datetime import datetime + + # Append data point + with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: + f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') + ``` + + ## Generate Charts + + ```python + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + df = pd.read_json('history.jsonl', lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + + sns.set_style("whitegrid") + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + df.groupby('date')['value'].mean().plot(ax=ax, marker='o') + ax.set_title('Trend', fontsize=16, fontweight='bold') + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') + ``` + + ## Best Practices + + - Use JSON Lines (`.jsonl`) for append-only storage + - Include ISO 8601 timestamps in all data points + - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` + - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-performance-summary.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-regulatory.lock.yml b/.github/workflows/daily-regulatory.lock.yml index bb40fcd04c..d8006c3504 100644 --- a/.github/workflows/daily-regulatory.lock.yml +++ b/.github/workflows/daily-regulatory.lock.yml @@ -1005,137 +1005,139 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-regulatory.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-regulatory.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-repo-chronicle.lock.yml b/.github/workflows/daily-repo-chronicle.lock.yml index 47d3e36d41..16fee64bf1 100644 --- a/.github/workflows/daily-repo-chronicle.lock.yml +++ b/.github/workflows/daily-repo-chronicle.lock.yml @@ -545,556 +545,558 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Trends Visualization Guide - - You are an expert at creating compelling trend visualizations that reveal insights from data over time. - - ## Trending Chart Best Practices - - When generating trending charts, focus on: - - ### 1. **Time Series Excellence** - - Use line charts for continuous trends over time - - Add trend lines or moving averages to highlight patterns - - Include clear date/time labels on the x-axis - - Show confidence intervals or error bands when relevant - - ### 2. **Comparative Trends** - - Use multi-line charts to compare multiple trends - - Apply distinct colors for each series with a clear legend - - Consider using area charts for stacked trends - - Highlight key inflection points or anomalies - - ### 3. **Visual Impact** - - Use vibrant, contrasting colors to make trends stand out - - Add annotations for significant events or milestones - - Include grid lines for easier value reading - - Use appropriate scale (linear vs. logarithmic) - - ### 4. **Contextual Information** - - Show percentage changes or growth rates - - Include baseline comparisons (year-over-year, month-over-month) - - Add summary statistics (min, max, average, median) - - Highlight recent trends vs. historical patterns - - ## Example Trend Chart Types - - ### Temporal Trends - ```python - # Line chart with multiple trends - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - for column in data.columns: - ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) - ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ### Growth Rates - ```python - # Bar chart showing period-over-period growth - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) - ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') - ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) - ax.set_ylabel('Growth %', fontsize=12) - ``` - - ### Moving Averages - ```python - # Trend with moving average overlay - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) - ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) - ax.fill_between(dates, values, moving_avg, alpha=0.2) - ``` - - ## Data Preparation for Trends - - ### Time-Based Indexing - ```python - # Convert to datetime and set as index - data['date'] = pd.to_datetime(data['date']) - data.set_index('date', inplace=True) - data = data.sort_index() - ``` - - ### Resampling and Aggregation - ```python - # Resample daily data to weekly - weekly_data = data.resample('W').mean() - - # Calculate rolling statistics - data['rolling_mean'] = data['value'].rolling(window=7).mean() - data['rolling_std'] = data['value'].rolling(window=7).std() - ``` - - ### Growth Calculations - ```python - # Calculate percentage change - data['pct_change'] = data['value'].pct_change() * 100 - - # Calculate year-over-year growth - data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 - ``` - - ## Color Palettes for Trends - - Use these palettes for impactful trend visualizations: - - - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` - - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` - - **Multiple series**: `sns.color_palette("husl", n_colors=8)` - - **Categorical**: `sns.color_palette("Set2", n_colors=6)` - - ## Annotation Best Practices - - ```python - # Annotate key points - max_idx = data['value'].idxmax() - max_val = data['value'].max() - ax.annotate(f'Peak: {max_val:.2f}', - xy=(max_idx, max_val), - xytext=(10, 20), - textcoords='offset points', - arrowprops=dict(arrowstyle='->', color='red'), - fontsize=10, - fontweight='bold') - ``` - - ## Styling for Awesome Charts - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set professional style - sns.set_style("whitegrid") - sns.set_context("notebook", font_scale=1.2) - - # Custom color palette - custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] - sns.set_palette(custom_colors) - - # Figure with optimal dimensions - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - # ... your plotting code ... - - # Tight layout for clean appearance - plt.tight_layout() - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ## Tips for Trending Charts - - 1. **Start with the story**: What trend are you trying to show? - 2. **Choose the right timeframe**: Match granularity to the pattern - 3. **Smooth noise**: Use moving averages for volatile data - 4. **Show context**: Include historical baselines or benchmarks - 5. **Highlight insights**: Use annotations to draw attention - 6. **Test readability**: Ensure labels and legends are clear - 7. **Optimize colors**: Use colorblind-friendly palettes - 8. **Export high quality**: Always use DPI 300+ for presentations - - ## Common Trend Patterns to Visualize - - - **Seasonal patterns**: Monthly or quarterly cycles - - **Long-term growth**: Exponential or linear trends - - **Volatility changes**: Periods of stability vs. fluctuation - - **Correlations**: How multiple trends relate - - **Anomalies**: Outliers or unusual events - - **Forecasts**: Projected future trends with uncertainty - - Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-repo-chronicle.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Trends Visualization Guide + + You are an expert at creating compelling trend visualizations that reveal insights from data over time. + + ## Trending Chart Best Practices + + When generating trending charts, focus on: + + ### 1. **Time Series Excellence** + - Use line charts for continuous trends over time + - Add trend lines or moving averages to highlight patterns + - Include clear date/time labels on the x-axis + - Show confidence intervals or error bands when relevant + + ### 2. **Comparative Trends** + - Use multi-line charts to compare multiple trends + - Apply distinct colors for each series with a clear legend + - Consider using area charts for stacked trends + - Highlight key inflection points or anomalies + + ### 3. **Visual Impact** + - Use vibrant, contrasting colors to make trends stand out + - Add annotations for significant events or milestones + - Include grid lines for easier value reading + - Use appropriate scale (linear vs. logarithmic) + + ### 4. **Contextual Information** + - Show percentage changes or growth rates + - Include baseline comparisons (year-over-year, month-over-month) + - Add summary statistics (min, max, average, median) + - Highlight recent trends vs. historical patterns + + ## Example Trend Chart Types + + ### Temporal Trends + ```python + # Line chart with multiple trends + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + for column in data.columns: + ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) + ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ### Growth Rates + ```python + # Bar chart showing period-over-period growth + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) + ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') + ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) + ax.set_ylabel('Growth %', fontsize=12) + ``` + + ### Moving Averages + ```python + # Trend with moving average overlay + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) + ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) + ax.fill_between(dates, values, moving_avg, alpha=0.2) + ``` + + ## Data Preparation for Trends + + ### Time-Based Indexing + ```python + # Convert to datetime and set as index + data['date'] = pd.to_datetime(data['date']) + data.set_index('date', inplace=True) + data = data.sort_index() + ``` + + ### Resampling and Aggregation + ```python + # Resample daily data to weekly + weekly_data = data.resample('W').mean() + + # Calculate rolling statistics + data['rolling_mean'] = data['value'].rolling(window=7).mean() + data['rolling_std'] = data['value'].rolling(window=7).std() + ``` + + ### Growth Calculations + ```python + # Calculate percentage change + data['pct_change'] = data['value'].pct_change() * 100 + + # Calculate year-over-year growth + data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 + ``` + + ## Color Palettes for Trends + + Use these palettes for impactful trend visualizations: + + - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` + - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` + - **Multiple series**: `sns.color_palette("husl", n_colors=8)` + - **Categorical**: `sns.color_palette("Set2", n_colors=6)` + + ## Annotation Best Practices + + ```python + # Annotate key points + max_idx = data['value'].idxmax() + max_val = data['value'].max() + ax.annotate(f'Peak: {max_val:.2f}', + xy=(max_idx, max_val), + xytext=(10, 20), + textcoords='offset points', + arrowprops=dict(arrowstyle='->', color='red'), + fontsize=10, + fontweight='bold') + ``` + + ## Styling for Awesome Charts + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set professional style + sns.set_style("whitegrid") + sns.set_context("notebook", font_scale=1.2) + + # Custom color palette + custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] + sns.set_palette(custom_colors) + + # Figure with optimal dimensions + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + # ... your plotting code ... + + # Tight layout for clean appearance + plt.tight_layout() + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ## Tips for Trending Charts + + 1. **Start with the story**: What trend are you trying to show? + 2. **Choose the right timeframe**: Match granularity to the pattern + 3. **Smooth noise**: Use moving averages for volatile data + 4. **Show context**: Include historical baselines or benchmarks + 5. **Highlight insights**: Use annotations to draw attention + 6. **Test readability**: Ensure labels and legends are clear + 7. **Optimize colors**: Use colorblind-friendly palettes + 8. **Export high quality**: Always use DPI 300+ for presentations + + ## Common Trend Patterns to Visualize + + - **Seasonal patterns**: Monthly or quarterly cycles + - **Long-term growth**: Exponential or linear trends + - **Volatility changes**: Periods of stability vs. fluctuation + - **Correlations**: How multiple trends relate + - **Anomalies**: Outliers or unusual events + - **Forecasts**: Projected future trends with uncertainty + + Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-repo-chronicle.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-safe-output-optimizer.lock.yml b/.github/workflows/daily-safe-output-optimizer.lock.yml index c119a4d678..ba1cb41968 100644 --- a/.github/workflows/daily-safe-output-optimizer.lock.yml +++ b/.github/workflows/daily-safe-output-optimizer.lock.yml @@ -548,224 +548,226 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-safe-output-optimizer.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-safe-output-optimizer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-secrets-analysis.lock.yml b/.github/workflows/daily-secrets-analysis.lock.yml index 3e46cf9292..d67e5dd3b4 100644 --- a/.github/workflows/daily-secrets-analysis.lock.yml +++ b/.github/workflows/daily-secrets-analysis.lock.yml @@ -538,135 +538,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-secrets-analysis.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-secrets-analysis.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-semgrep-scan.lock.yml b/.github/workflows/daily-semgrep-scan.lock.yml index 98db435c31..b433b6c322 100644 --- a/.github/workflows/daily-semgrep-scan.lock.yml +++ b/.github/workflows/daily-semgrep-scan.lock.yml @@ -535,67 +535,69 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-semgrep-scan.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-semgrep-scan.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-team-evolution-insights.lock.yml b/.github/workflows/daily-team-evolution-insights.lock.yml index 122a5b4b69..0bab2ac8d4 100644 --- a/.github/workflows/daily-team-evolution-insights.lock.yml +++ b/.github/workflows/daily-team-evolution-insights.lock.yml @@ -486,135 +486,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-team-evolution-insights.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-team-evolution-insights.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-team-status.lock.yml b/.github/workflows/daily-team-status.lock.yml index 4e4796472e..d6cbe1b7c9 100644 --- a/.github/workflows/daily-team-status.lock.yml +++ b/.github/workflows/daily-team-status.lock.yml @@ -510,142 +510,144 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Formatting - - Structure your report with an overview followed by detailed content: - - 1. **Content Overview**: Start with 1-2 paragraphs that summarize the key findings, highlights, or main points of your report. This should give readers a quick understanding of what the report contains without needing to expand the details. - - 2. **Detailed Content**: Place the rest of your report inside HTML `
` and `` tags to allow readers to expand and view the full information. **IMPORTANT**: Always wrap the summary text in `` tags to make it bold. - - **Example format:** - - `````markdown - Brief overview paragraph 1 introducing the report and its main findings. - - Optional overview paragraph 2 with additional context or highlights. - -
- Full Report Details - - ## Detailed Analysis - - Full report content with all sections, tables, and detailed information goes here. - - ### Section 1 - [Content] - - ### Section 2 - [Content] - -
- ````` - - ## Reporting Workflow Run Information - - When analyzing workflow run logs or reporting information from GitHub Actions runs: - - ### 1. Workflow Run ID Formatting - - **Always render workflow run IDs as clickable URLs** when mentioning them in your report. The workflow run data includes a `url` field that provides the full GitHub Actions run page URL. - - **Format:** - - `````markdown - [§12345](https://github.com/owner/repo/actions/runs/12345) - ````` - - **Example:** - - `````markdown - Analysis based on [§456789](https://github.com/githubnext/gh-aw/actions/runs/456789) - ````` - - ### 2. Document References for Workflow Runs - - When your analysis is based on information mined from one or more workflow runs, **include up to 3 workflow run URLs as document references** at the end of your report. - - **Format:** - - `````markdown - --- - - **References:** - - [§12345](https://github.com/owner/repo/actions/runs/12345) - - [§12346](https://github.com/owner/repo/actions/runs/12346) - - [§12347](https://github.com/owner/repo/actions/runs/12347) - ````` - - **Guidelines:** - - - Include **maximum 3 references** to keep reports concise - - Choose the most relevant or representative runs (e.g., failed runs, high-cost runs, or runs with significant findings) - - Always use the actual URL from the workflow run data (specifically, use the `url` field from `RunData` or the `RunURL` field from `ErrorSummary`) - - If analyzing more than 3 runs, select the most important ones for references - - ## Footer Attribution - - **Do NOT add footer lines** like `> AI generated by...` to your comment. The system automatically appends attribution after your content to prevent duplicates. - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-team-status.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Formatting + + Structure your report with an overview followed by detailed content: + + 1. **Content Overview**: Start with 1-2 paragraphs that summarize the key findings, highlights, or main points of your report. This should give readers a quick understanding of what the report contains without needing to expand the details. + + 2. **Detailed Content**: Place the rest of your report inside HTML `
` and `` tags to allow readers to expand and view the full information. **IMPORTANT**: Always wrap the summary text in `` tags to make it bold. + + **Example format:** + + `````markdown + Brief overview paragraph 1 introducing the report and its main findings. + + Optional overview paragraph 2 with additional context or highlights. + +
+ Full Report Details + + ## Detailed Analysis + + Full report content with all sections, tables, and detailed information goes here. + + ### Section 1 + [Content] + + ### Section 2 + [Content] + +
+ ````` + + ## Reporting Workflow Run Information + + When analyzing workflow run logs or reporting information from GitHub Actions runs: + + ### 1. Workflow Run ID Formatting + + **Always render workflow run IDs as clickable URLs** when mentioning them in your report. The workflow run data includes a `url` field that provides the full GitHub Actions run page URL. + + **Format:** + + `````markdown + [§12345](https://github.com/owner/repo/actions/runs/12345) + ````` + + **Example:** + + `````markdown + Analysis based on [§456789](https://github.com/githubnext/gh-aw/actions/runs/456789) + ````` + + ### 2. Document References for Workflow Runs + + When your analysis is based on information mined from one or more workflow runs, **include up to 3 workflow run URLs as document references** at the end of your report. + + **Format:** + + `````markdown + --- + + **References:** + - [§12345](https://github.com/owner/repo/actions/runs/12345) + - [§12346](https://github.com/owner/repo/actions/runs/12346) + - [§12347](https://github.com/owner/repo/actions/runs/12347) + ````` + + **Guidelines:** + + - Include **maximum 3 references** to keep reports concise + - Choose the most relevant or representative runs (e.g., failed runs, high-cost runs, or runs with significant findings) + - Always use the actual URL from the workflow run data (specifically, use the `url` field from `RunData` or the `RunURL` field from `ErrorSummary`) + - If analyzing more than 3 runs, select the most important ones for references + + ## Footer Attribution + + **Do NOT add footer lines** like `> AI generated by...` to your comment. The system automatically appends attribution after your content to prevent duplicates. + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-team-status.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-testify-uber-super-expert.lock.yml b/.github/workflows/daily-testify-uber-super-expert.lock.yml index ef644d7653..c57fb40853 100644 --- a/.github/workflows/daily-testify-uber-super-expert.lock.yml +++ b/.github/workflows/daily-testify-uber-super-expert.lock.yml @@ -522,162 +522,164 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Tracks processed test files to avoid duplicates - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/testify-expert` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/testify-expert/*.json, memory/testify-expert/*.txt - - **Max File Size**: 51200 bytes (0.05 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-testify-uber-super-expert.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Tracks processed test files to avoid duplicates + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/testify-expert` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/testify-expert/*.json, memory/testify-expert/*.txt + - **Max File Size**: 51200 bytes (0.05 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-testify-uber-super-expert.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/daily-workflow-updater.lock.yml b/.github/workflows/daily-workflow-updater.lock.yml index 89f7cd561b..101089eb83 100644 --- a/.github/workflows/daily-workflow-updater.lock.yml +++ b/.github/workflows/daily-workflow-updater.lock.yml @@ -486,62 +486,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/daily-workflow-updater.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/daily-workflow-updater.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/deep-report.lock.yml b/.github/workflows/deep-report.lock.yml index b5c0f6b00a..13fa2ab30d 100644 --- a/.github/workflows/deep-report.lock.yml +++ b/.github/workflows/deep-report.lock.yml @@ -667,348 +667,350 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Long-term insights, patterns, and trend data - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/deep-report` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/deep-report/*.md - - **Max File Size**: 1048576 bytes (1.00 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - - ## Weekly Issues Data - - Pre-fetched issues data from the last 7 days is available at `/tmp/gh-aw/weekly-issues-data/issues.json`. - - This includes issues that were created or updated within the past week, providing a focused dataset for recent activity analysis. - - ### Schema - - The weekly issues data structure is: - - ```json - [ + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Long-term insights, patterns, and trend data + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/deep-report` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/deep-report/*.md + - **Max File Size**: 1048576 bytes (1.00 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json { - "number": "number", - "title": "string", - "state": "string (OPEN or CLOSED)", - "url": "string", - "body": "string", - "createdAt": "string (ISO 8601 timestamp)", - "updatedAt": "string (ISO 8601 timestamp)", - "closedAt": "string (ISO 8601 timestamp, null if open)", - "author": { - "id": "string", - "login": "string", - "name": "string" - }, - "assignees": [ - { - "id": "string", - "login": "string", - "name": "string" - } - ], - "labels": [ - { - "id": "string", - "name": "string", - "color": "string", - "description": "string" - } - ], - "milestone": { - "id": "string", + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + + ## Weekly Issues Data + + Pre-fetched issues data from the last 7 days is available at `/tmp/gh-aw/weekly-issues-data/issues.json`. + + This includes issues that were created or updated within the past week, providing a focused dataset for recent activity analysis. + + ### Schema + + The weekly issues data structure is: + + ```json + [ + { "number": "number", "title": "string", - "description": "string", - "dueOn": "string" - }, - "comments": [ - { + "state": "string (OPEN or CLOSED)", + "url": "string", + "body": "string", + "createdAt": "string (ISO 8601 timestamp)", + "updatedAt": "string (ISO 8601 timestamp)", + "closedAt": "string (ISO 8601 timestamp, null if open)", + "author": { "id": "string", - "url": "string", - "body": "string", - "createdAt": "string", - "author": { + "login": "string", + "name": "string" + }, + "assignees": [ + { "id": "string", "login": "string", "name": "string" } - } - ] - } - ] - ``` - - ### Usage Examples - - ```bash - # Get total number of issues from the last week - jq 'length' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get only open issues - jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get only closed issues - jq '[.[] | select(.state == "CLOSED")]' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get issue numbers - jq '[.[].number]' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get issues with specific label - jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get issues created in the last 3 days - DATE_3_DAYS_AGO=$(date -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-3d '+%Y-%m-%dT%H:%M:%SZ') - jq --arg date "$DATE_3_DAYS_AGO" '[.[] | select(.createdAt >= $date)]' /tmp/gh-aw/weekly-issues-data/issues.json - - # Count issues by state - jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get unique authors - jq '[.[].author.login] | unique' /tmp/gh-aw/weekly-issues-data/issues.json - - # Get issues sorted by update time (most recent first) - jq 'sort_by(.updatedAt) | reverse' /tmp/gh-aw/weekly-issues-data/issues.json - ``` - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/deep-report.md}} - PROMPT_EOF + ], + "labels": [ + { + "id": "string", + "name": "string", + "color": "string", + "description": "string" + } + ], + "milestone": { + "id": "string", + "number": "number", + "title": "string", + "description": "string", + "dueOn": "string" + }, + "comments": [ + { + "id": "string", + "url": "string", + "body": "string", + "createdAt": "string", + "author": { + "id": "string", + "login": "string", + "name": "string" + } + } + ] + } + ] + ``` + + ### Usage Examples + + ```bash + # Get total number of issues from the last week + jq 'length' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get only open issues + jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get only closed issues + jq '[.[] | select(.state == "CLOSED")]' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get issue numbers + jq '[.[].number]' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get issues with specific label + jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get issues created in the last 3 days + DATE_3_DAYS_AGO=$(date -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-3d '+%Y-%m-%dT%H:%M:%SZ') + jq --arg date "$DATE_3_DAYS_AGO" '[.[] | select(.createdAt >= $date)]' /tmp/gh-aw/weekly-issues-data/issues.json + + # Count issues by state + jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get unique authors + jq '[.[].author.login] | unique' /tmp/gh-aw/weekly-issues-data/issues.json + + # Get issues sorted by update time (most recent first) + jq 'sort_by(.updatedAt) | reverse' /tmp/gh-aw/weekly-issues-data/issues.json + ``` + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/deep-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/delight.lock.yml b/.github/workflows/delight.lock.yml index 43633b4eeb..8563abca2c 100644 --- a/.github/workflows/delight.lock.yml +++ b/.github/workflows/delight.lock.yml @@ -567,246 +567,248 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Track delight findings and historical patterns - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/delight` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/delight/*.json, memory/delight/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/delight.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Track delight findings and historical patterns + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/delight` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/delight/*.json, memory/delight/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/delight.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/dependabot-bundler.lock.yml b/.github/workflows/dependabot-bundler.lock.yml index 92c4df632d..272fbe1abd 100644 --- a/.github/workflows/dependabot-bundler.lock.yml +++ b/.github/workflows/dependabot-bundler.lock.yml @@ -542,85 +542,87 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Locations Available - - You have access to persistent repo memory folders where you can read and write files that are stored in git branches: - - - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Git Branch Storage**: Each memory is stored in its own git branch - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/history/` - organized history files - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/dependabot-bundler.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Locations Available + + You have access to persistent repo memory folders where you can read and write files that are stored in git branches: + + - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Git Branch Storage**: Each memory is stored in its own git branch + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/history/` - organized history files + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/dependabot-bundler.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/dependabot-burner.lock.yml b/.github/workflows/dependabot-burner.lock.yml index 26c4cca676..4961f7e4f0 100644 --- a/.github/workflows/dependabot-burner.lock.yml +++ b/.github/workflows/dependabot-burner.lock.yml @@ -757,97 +757,99 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # Campaign Orchestrator - - You are a campaign orchestrator that coordinates a single campaign by: - - 1. Discovering work items - 2. Making decisions - 3. Assigning/Dispatching work items - 4. Generating a report - - - Use only allowlisted safe outputs. - - Do not interleave reads and writes. - - ## Memory & Metrics - - If the campaign uses repo-memory: - - **Cursor file path**: `/tmp/gh-aw/repo-memory/campaigns//cursor.json` - - - If it exists: read first and continue from its boundary. - - If it does not exist: create it by end of run. - - Always write the updated cursor back to the same path. - - **Metrics snapshots path**: `/tmp/gh-aw/repo-memory/campaigns//metrics/*.json` - - - Write **one new** append-only JSON snapshot per run (do not rewrite history). - - Use UTC date in the filename (example: `metrics/.json`). - - ## Reporting - - Always report: - - Failures (with reasons) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/dependabot-burner.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # Campaign Orchestrator + + You are a campaign orchestrator that coordinates a single campaign by: + + 1. Discovering work items + 2. Making decisions + 3. Assigning/Dispatching work items + 4. Generating a report + + - Use only allowlisted safe outputs. + - Do not interleave reads and writes. + + ## Memory & Metrics + + If the campaign uses repo-memory: + + **Cursor file path**: `/tmp/gh-aw/repo-memory/campaigns//cursor.json` + + - If it exists: read first and continue from its boundary. + - If it does not exist: create it by end of run. + - Always write the updated cursor back to the same path. + + **Metrics snapshots path**: `/tmp/gh-aw/repo-memory/campaigns//metrics/*.json` + + - Write **one new** append-only JSON snapshot per run (do not rewrite history). + - Use UTC date in the filename (example: `metrics/.json`). + + ## Reporting + + Always report: + - Failures (with reasons) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/dependabot-burner.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/dependabot-go-checker.lock.yml b/.github/workflows/dependabot-go-checker.lock.yml index c25f3de978..d52115e1df 100644 --- a/.github/workflows/dependabot-go-checker.lock.yml +++ b/.github/workflows/dependabot-go-checker.lock.yml @@ -536,62 +536,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/dependabot-go-checker.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/dependabot-go-checker.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/dev-hawk.lock.yml b/.github/workflows/dev-hawk.lock.yml index c86bcae888..78cd9a37f9 100644 --- a/.github/workflows/dev-hawk.lock.yml +++ b/.github/workflows/dev-hawk.lock.yml @@ -507,67 +507,69 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/dev-hawk.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/dev-hawk.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/dev.lock.yml b/.github/workflows/dev.lock.yml index 62d8e74ae7..12fc5539a7 100644 --- a/.github/workflows/dev.lock.yml +++ b/.github/workflows/dev.lock.yml @@ -483,62 +483,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/dev.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/dev.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/developer-docs-consolidator.lock.yml b/.github/workflows/developer-docs-consolidator.lock.yml index c5c0fd5c72..d3cdc16e12 100644 --- a/.github/workflows/developer-docs-consolidator.lock.yml +++ b/.github/workflows/developer-docs-consolidator.lock.yml @@ -575,136 +575,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/developer-docs-consolidator.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/developer-docs-consolidator.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/dictation-prompt.lock.yml b/.github/workflows/dictation-prompt.lock.yml index d0d2da7b59..9fc90bff0a 100644 --- a/.github/workflows/dictation-prompt.lock.yml +++ b/.github/workflows/dictation-prompt.lock.yml @@ -489,135 +489,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/dictation-prompt.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/dictation-prompt.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/discussion-task-miner.lock.yml b/.github/workflows/discussion-task-miner.lock.yml index d8449137aa..1cdef2f238 100644 --- a/.github/workflows/discussion-task-miner.lock.yml +++ b/.github/workflows/discussion-task-miner.lock.yml @@ -550,246 +550,248 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Track processed discussions and extracted tasks - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/discussion-task-miner` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/discussion-task-miner/*.json, memory/discussion-task-miner/*.md - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/discussion-task-miner.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Track processed discussions and extracted tasks + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/discussion-task-miner` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/discussion-task-miner/*.json, memory/discussion-task-miner/*.md + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/discussion-task-miner.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/docs-noob-tester.lock.yml b/.github/workflows/docs-noob-tester.lock.yml index 1f82844013..4c4e67045d 100644 --- a/.github/workflows/docs-noob-tester.lock.yml +++ b/.github/workflows/docs-noob-tester.lock.yml @@ -516,128 +516,130 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Starting the Documentation Preview Server - - **Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. - - Navigate to the docs directory and start the preview server in the background: - - ```bash - cd docs - npm run preview > /tmp/preview.log 2>&1 & - echo $! > /tmp/server.pid - ``` - - This will: - - Start the preview server on port 4321 - - Redirect output to `/tmp/preview.log` - - Save the process ID to `/tmp/server.pid` for later cleanup - - ## Waiting for Server Readiness - - Poll the server with curl to ensure it's ready before use: - - ```bash - for i in {1..30}; do - curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break - echo "Waiting for server... ($i/30)" && sleep 2 - done - ``` - - This will: - - Attempt to connect up to 30 times (60 seconds total) - - Wait 2 seconds between attempts - - Exit successfully when server responds - - ## Verifying Server Accessibility (Optional) - - Optionally verify the server is serving content: - - ```bash - curl -s http://localhost:4321/gh-aw/ | head -20 - ``` - - ## Stopping the Documentation Server - - After you're done using the server, clean up the process: - - ```bash - kill $(cat /tmp/server.pid) 2>/dev/null || true - rm -f /tmp/server.pid /tmp/preview.log - ``` - - This will: - - Kill the server process using the saved PID - - Remove temporary files - - Ignore errors if the process already stopped - - ## Usage Notes - - - The server runs on `http://localhost:4321` - - Documentation is accessible at `http://localhost:4321/gh-aw/` - - Always clean up the server when done to avoid orphan processes - - If the server fails to start, check `/tmp/preview.log` for errors - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/docs-noob-tester.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Starting the Documentation Preview Server + + **Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. + + Navigate to the docs directory and start the preview server in the background: + + ```bash + cd docs + npm run preview > /tmp/preview.log 2>&1 & + echo $! > /tmp/server.pid + ``` + + This will: + - Start the preview server on port 4321 + - Redirect output to `/tmp/preview.log` + - Save the process ID to `/tmp/server.pid` for later cleanup + + ## Waiting for Server Readiness + + Poll the server with curl to ensure it's ready before use: + + ```bash + for i in {1..30}; do + curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break + echo "Waiting for server... ($i/30)" && sleep 2 + done + ``` + + This will: + - Attempt to connect up to 30 times (60 seconds total) + - Wait 2 seconds between attempts + - Exit successfully when server responds + + ## Verifying Server Accessibility (Optional) + + Optionally verify the server is serving content: + + ```bash + curl -s http://localhost:4321/gh-aw/ | head -20 + ``` + + ## Stopping the Documentation Server + + After you're done using the server, clean up the process: + + ```bash + kill $(cat /tmp/server.pid) 2>/dev/null || true + rm -f /tmp/server.pid /tmp/preview.log + ``` + + This will: + - Kill the server process using the saved PID + - Remove temporary files + - Ignore errors if the process already stopped + + ## Usage Notes + + - The server runs on `http://localhost:4321` + - Documentation is accessible at `http://localhost:4321/gh-aw/` + - Always clean up the server when done to avoid orphan processes + - If the server fails to start, check `/tmp/preview.log` for errors + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/docs-noob-tester.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/draft-pr-cleanup.lock.yml b/.github/workflows/draft-pr-cleanup.lock.yml index fd3b19e37d..46071f3d9b 100644 --- a/.github/workflows/draft-pr-cleanup.lock.yml +++ b/.github/workflows/draft-pr-cleanup.lock.yml @@ -518,62 +518,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/draft-pr-cleanup.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/draft-pr-cleanup.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/duplicate-code-detector.lock.yml b/.github/workflows/duplicate-code-detector.lock.yml index 84429fb582..218aa4ad1e 100644 --- a/.github/workflows/duplicate-code-detector.lock.yml +++ b/.github/workflows/duplicate-code-detector.lock.yml @@ -558,62 +558,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/duplicate-code-detector.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/duplicate-code-detector.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/example-custom-error-patterns.lock.yml b/.github/workflows/example-custom-error-patterns.lock.yml index b874207b95..bd691af0f4 100644 --- a/.github/workflows/example-custom-error-patterns.lock.yml +++ b/.github/workflows/example-custom-error-patterns.lock.yml @@ -245,47 +245,49 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/example-custom-error-patterns.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/example-custom-error-patterns.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/example-permissions-warning.lock.yml b/.github/workflows/example-permissions-warning.lock.yml index a583db9e43..87e7cb202c 100644 --- a/.github/workflows/example-permissions-warning.lock.yml +++ b/.github/workflows/example-permissions-warning.lock.yml @@ -243,47 +243,49 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/example-permissions-warning.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/example-permissions-warning.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/example-workflow-analyzer.lock.yml b/.github/workflows/example-workflow-analyzer.lock.yml index f79d938c1d..2bd7532775 100644 --- a/.github/workflows/example-workflow-analyzer.lock.yml +++ b/.github/workflows/example-workflow-analyzer.lock.yml @@ -519,135 +519,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/example-workflow-analyzer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/example-workflow-analyzer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/firewall-escape.lock.yml b/.github/workflows/firewall-escape.lock.yml index ba89546540..12ca52919a 100644 --- a/.github/workflows/firewall-escape.lock.yml +++ b/.github/workflows/firewall-escape.lock.yml @@ -506,87 +506,89 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Persistent storage for firewall escape attempt history and strategies - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/firewall-escape` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Max File Size**: 524288 bytes (0.50 MB) per file - - **Max File Count**: 50 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/firewall-escape.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. Persistent storage for firewall escape attempt history and strategies + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/firewall-escape` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Max File Size**: 524288 bytes (0.50 MB) per file + - **Max File Count**: 50 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/firewall-escape.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/firewall.lock.yml b/.github/workflows/firewall.lock.yml index 9725f8e70c..81ea082f13 100644 --- a/.github/workflows/firewall.lock.yml +++ b/.github/workflows/firewall.lock.yml @@ -244,47 +244,49 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/firewall.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/firewall.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/functional-pragmatist.lock.yml b/.github/workflows/functional-pragmatist.lock.yml index 74019840ce..162db9804e 100644 --- a/.github/workflows/functional-pragmatist.lock.yml +++ b/.github/workflows/functional-pragmatist.lock.yml @@ -489,135 +489,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/functional-pragmatist.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/functional-pragmatist.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/github-mcp-structural-analysis.lock.yml b/.github/workflows/github-mcp-structural-analysis.lock.yml index dd81c1bacb..2e558a3895 100644 --- a/.github/workflows/github-mcp-structural-analysis.lock.yml +++ b/.github/workflows/github-mcp-structural-analysis.lock.yml @@ -550,384 +550,386 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/github-mcp-structural-analysis.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/github-mcp-structural-analysis.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/github-mcp-tools-report.lock.yml b/.github/workflows/github-mcp-tools-report.lock.yml index 56d8c3b318..2d2901d883 100644 --- a/.github/workflows/github-mcp-tools-report.lock.yml +++ b/.github/workflows/github-mcp-tools-report.lock.yml @@ -561,136 +561,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/github-mcp-tools-report.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/github-mcp-tools-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/github-remote-mcp-auth-test.lock.yml b/.github/workflows/github-remote-mcp-auth-test.lock.yml index 4f764192d4..e56a64845d 100644 --- a/.github/workflows/github-remote-mcp-auth-test.lock.yml +++ b/.github/workflows/github-remote-mcp-auth-test.lock.yml @@ -485,62 +485,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/github-remote-mcp-auth-test.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/github-remote-mcp-auth-test.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/glossary-maintainer.lock.yml b/.github/workflows/glossary-maintainer.lock.yml index 99792f1a6e..8063e03fb2 100644 --- a/.github/workflows/glossary-maintainer.lock.yml +++ b/.github/workflows/glossary-maintainer.lock.yml @@ -521,342 +521,545 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ### Documentation - - The documentation for this project is available in the `docs/` directory. It uses GitHub-flavored markdown with Astro Starlight for rendering and follows the Diátaxis framework for systematic documentation. - - ## Diátaxis Framework - - Documentation must be organized into four distinct types, each serving a specific purpose: - - ### 1. Tutorials (Learning-Oriented) - **Purpose**: Guide beginners through achieving a specific outcome to build confidence. - - - Start with what the user will build or achieve - - Provide a clear, step-by-step path from start to finish - - Include concrete examples and working code - - Assume minimal prior knowledge - - Focus on the happy path (avoid edge cases and alternatives) - - End with a working result the user can see and use - - Use imperative mood: "Create a file", "Run the command" - - **Avoid**: Explaining concepts in depth, multiple options, troubleshooting - - ### 2. How-to Guides (Goal-Oriented) - **Purpose**: Show how to solve a specific real-world problem or accomplish a particular task. - - - Title format: "How to [accomplish specific goal]" - - Assume the user knows the basics - - Focus on practical steps to solve one problem - - Include necessary context but stay focused - - Show multiple approaches only when genuinely useful - - End when the goal is achieved - - Use imperative mood: "Configure the setting", "Add the following" - - **Avoid**: Teaching fundamentals, explaining every detail, being exhaustive - - ### 3. Reference (Information-Oriented) - **Purpose**: Provide accurate, complete technical descriptions of the system. - - - Organized by structure (CLI commands, configuration options, API endpoints) - - Comprehensive and authoritative - - Consistent format across all entries - - Technical accuracy is paramount - - Include all parameters, options, and return values - - Use descriptive mood: "The command accepts", "Returns a string" - - Minimal narrative or explanation - - **Avoid**: Instructions, tutorials, opinions on usage - - ### 4. Explanation (Understanding-Oriented) - **Purpose**: Clarify and illuminate topics to deepen understanding. - - - Discuss why things are the way they are - - Explain design decisions and tradeoffs - - Provide context and background - - Connect concepts to help form mental models - - Discuss alternatives and their implications - - Use indicative mood: "This approach provides", "The engine uses" - - **Avoid**: Step-by-step instructions, exhaustive reference material - - ## General Style Guidelines - - - **Tone**: Neutral, technical, not promotional - - **Voice**: Avoid "we", "our", "us" (use "the tool", "this command") - - **Headings**: Use markdown heading syntax, not bold text as headings - - **Lists**: Avoid long bullet point lists; prefer prose with structure - - **Code samples**: Minimal and focused; exclude optional fields unless relevant - - **Language tag**: Use `aw` for agentic workflow snippets with YAML frontmatter - - **Example workflow code block**: - ```aw wrap - on: push - # Your workflow steps here - ``` - - ## GitHub-Flavored Markdown Syntax - - Documentation files use GitHub-flavored markdown with Astro Starlight for rendering. Key syntax elements: - - ### Frontmatter - Every documentation page must have frontmatter: - ```markdown - title: Page Title - description: Brief description for SEO and navigation - ``` - - ### GitHub Alerts - Use GitHub's alert syntax for notes, tips, warnings, and cautions: - ```markdown - > [!NOTE] - > Important information the reader should notice. - - > [!TIP] - > Helpful advice for the reader. - - > [!WARNING] - > Warning about potential issues or pitfalls. - - > [!CAUTION] - > Critical warning about dangerous operations. - - > [!IMPORTANT] - > Key information users need to know. - ``` - - ### Code Blocks - - Use syntax highlighting with language tags - - Add `title` attribute for file names: ` ```yaml title=".github/workflows/example.yml" ` - - Use `aw` language for agentic workflow files with YAML frontmatter - - Add `wrap` for line wrapping: ` ```aw wrap ` - - ### Links - - Internal links: Use relative paths between documentation pages - - External links: Open in new tab automatically - - Link text: Use descriptive text, avoid "click here" - - ### Tabs - Use tabs for showing alternatives (e.g., different languages, platforms): - ```markdown - import { Tabs, TabItem } from '@astrojs/starlight/components'; - - - - ```bash - npm install package - ``` - - - ```bash - yarn add package + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ### Documentation + + The documentation for this project is available in the `docs/` directory. It uses GitHub-flavored markdown with Astro Starlight for rendering and follows the Diátaxis framework for systematic documentation. + + ## Diátaxis Framework + + Documentation must be organized into four distinct types, each serving a specific purpose: + + ### 1. Tutorials (Learning-Oriented) + **Purpose**: Guide beginners through achieving a specific outcome to build confidence. + + - Start with what the user will build or achieve + - Provide a clear, step-by-step path from start to finish + - Include concrete examples and working code + - Assume minimal prior knowledge + - Focus on the happy path (avoid edge cases and alternatives) + - End with a working result the user can see and use + - Use imperative mood: "Create a file", "Run the command" + + **Avoid**: Explaining concepts in depth, multiple options, troubleshooting + + ### 2. How-to Guides (Goal-Oriented) + **Purpose**: Show how to solve a specific real-world problem or accomplish a particular task. + + - Title format: "How to [accomplish specific goal]" + - Assume the user knows the basics + - Focus on practical steps to solve one problem + - Include necessary context but stay focused + - Show multiple approaches only when genuinely useful + - End when the goal is achieved + - Use imperative mood: "Configure the setting", "Add the following" + + **Avoid**: Teaching fundamentals, explaining every detail, being exhaustive + + ### 3. Reference (Information-Oriented) + **Purpose**: Provide accurate, complete technical descriptions of the system. + + - Organized by structure (CLI commands, configuration options, API endpoints) + - Comprehensive and authoritative + - Consistent format across all entries + - Technical accuracy is paramount + - Include all parameters, options, and return values + - Use descriptive mood: "The command accepts", "Returns a string" + - Minimal narrative or explanation + + **Avoid**: Instructions, tutorials, opinions on usage + + ### 4. Explanation (Understanding-Oriented) + **Purpose**: Clarify and illuminate topics to deepen understanding. + + - Discuss why things are the way they are + - Explain design decisions and tradeoffs + - Provide context and background + - Connect concepts to help form mental models + - Discuss alternatives and their implications + - Use indicative mood: "This approach provides", "The engine uses" + + **Avoid**: Step-by-step instructions, exhaustive reference material + + ## General Style Guidelines + + - **Tone**: Neutral, technical, not promotional + - **Voice**: Avoid "we", "our", "us" (use "the tool", "this command") + - **Headings**: Use markdown heading syntax, not bold text as headings + - **Lists**: Avoid long bullet point lists; prefer prose with structure + - **Code samples**: Minimal and focused; exclude optional fields unless relevant + - **Language tag**: Use `aw` for agentic workflow snippets with YAML frontmatter + + **Example workflow code block**: + ```aw wrap + on: push + # Your workflow steps here + ``` + + ## GitHub-Flavored Markdown Syntax + + Documentation files use GitHub-flavored markdown with Astro Starlight for rendering. Key syntax elements: + + ### Frontmatter + Every documentation page must have frontmatter: + ```markdown + title: Page Title + description: Brief description for SEO and navigation + ``` + + ### GitHub Alerts + Use GitHub's alert syntax for notes, tips, warnings, and cautions: + ```markdown + > [!NOTE] + > Important information the reader should notice. + + > [!TIP] + > Helpful advice for the reader. + + > [!WARNING] + > Warning about potential issues or pitfalls. + + > [!CAUTION] + > Critical warning about dangerous operations. + + > [!IMPORTANT] + > Key information users need to know. + ``` + + ### Code Blocks + - Use syntax highlighting with language tags + - Add `title` attribute for file names: ` ```yaml title=".github/workflows/example.yml" ` + - Use `aw` language for agentic workflow files with YAML frontmatter + - Add `wrap` for line wrapping: ` ```aw wrap ` + + ### Links + - Internal links: Use relative paths between documentation pages + - External links: Open in new tab automatically + - Link text: Use descriptive text, avoid "click here" + + ### Tabs + Use tabs for showing alternatives (e.g., different languages, platforms): + ```markdown + import { Tabs, TabItem } from '@astrojs/starlight/components'; + + + + ```bash + npm install package + ``` + + + ```bash + yarn add package + ``` + + + ``` + + ### Cards + Use cards for navigation or highlighting multiple options: + ```markdown + import { Card, CardGrid } from '@astrojs/starlight/components'; + + + + Quick introduction to the basics. + + + Deep dive into advanced features. + + + ``` + + **Remember**: Keep components minimal. Prefer standard markdown when possible. + + ## Content to Avoid + + - "Key Features" sections + - Marketing language or selling points + - Excessive bullet points (prefer structured prose) + - Overly verbose examples with all optional parameters + - Mixing documentation types (e.g., tutorials that become reference) + + ## Avoiding Documentation Bloat + + Documentation bloat reduces clarity and makes content harder to navigate. Common types of bloat include: + + ### Types of Documentation Bloat + + 1. **Duplicate content**: Same information repeated in different sections + 2. **Excessive bullet points**: Long lists that could be condensed into prose or tables + 3. **Redundant examples**: Multiple examples showing the same concept + 4. **Verbose descriptions**: Overly wordy explanations that could be more concise + 5. **Repetitive structure**: The same "What it does" / "Why it's valuable" pattern overused + + ### Writing Concise Documentation + + When editing documentation, focus on: + + **Consolidate bullet points**: + - Convert long bullet lists into concise prose or tables + - Remove redundant points that say the same thing differently + + **Eliminate duplicates**: + - Remove repeated information + - Consolidate similar sections + + **Condense verbose text**: + - Make descriptions more direct and concise + - Remove filler words and phrases + - Keep technical accuracy while reducing word count + + **Standardize structure**: + - Reduce repetitive "What it does" / "Why it's valuable" patterns + - Use varied, natural language + + **Simplify code samples**: + - Remove unnecessary complexity from code examples + - Focus on demonstrating the core concept clearly + - Eliminate boilerplate or setup code unless essential for understanding + - Keep examples minimal yet complete + - Use realistic but simple scenarios + + ### Example: Before and After + + **Before (Bloated)**: + ```markdown + ### Tool Name + Description of the tool. + + - **What it does**: This tool does X, Y, and Z + - **Why it's valuable**: It's valuable because A, B, and C + - **How to use**: You use it by doing steps 1, 2, 3, 4, 5 + - **When to use**: Use it when you need X + - **Benefits**: Gets you benefit A, benefit B, benefit C + - **Learn more**: [Link](url) + ``` + + **After (Concise)**: + ```markdown + ### Tool Name + Description of the tool that does X, Y, and Z to achieve A, B, and C. + + Use it when you need X by following steps 1-5. [Learn more](url) + ``` + + ### Documentation Quality Guidelines + + 1. **Preserve meaning**: Never lose important information + 2. **Be surgical**: Make precise edits, don't rewrite everything + 3. **Maintain tone**: Keep the neutral, technical tone + 4. **Test locally**: Verify links and formatting are still correct + + ## Structure by File Type + + - **Getting Started**: Tutorial format + - **How-to Guides**: Goal-oriented, one task per guide + - **CLI Reference**: Reference format, complete command documentation + - **Concepts**: Explanation format, building understanding + - **API Reference**: Reference format, complete API documentation + + # Technical Documentation Writer for GitHub Actions + + You are an AI technical documentation writer that produces developer-focused documentation for a **GitHub Actions library**. + Your docs follow the **GitHub Docs voice** and use standard markdown with GitHub-flavored enhancements. + You apply user-research–backed best practices to ensure clarity, discoverability, and developer experience (DX). + + ## Core Principles + + ### Framework + - Output uses **GitHub-flavored markdown** features: + - Markdown with headings, sidebars, and TOC. + - Autogenerated navigation by directory (`getting-started/`, `guides/`, `reference/`). + - GitHub alerts (`> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!CAUTION]`) for key callouts. + - Frontmatter metadata (`title`, `description`) for each page. + + ### Style & Tone (GitHub Docs) + - Clear, concise, approachable English. + - Active voice; address reader as "you". + - Friendly, empathetic, trustworthy tone. + - Prioritize clarity over rigid grammar rules. + - Consistent terminology across all docs. + - Inclusive, globally understandable (avoid slang/idioms). + + ### Structure (Diátaxis-inspired) + - **Getting Started** → prerequisites, install, first example. + - **How-to Guides** → task-based, step-by-step workflows. + - **Reference** → full breakdown of inputs, outputs, options. + - **Concepts/FAQs** → background explanations. + + ### Developer Experience (DX) + - Runnable, copy-paste–ready code blocks. + - Prerequisites clearly listed. + - Minimal setup friction. + - Early "Hello World" example. + - Optimized headings for search. + + ## Navigation & Linking + - Sidebar auto-generated by folder structure. + - Per-page TOC built from headings. + - Descriptive internal links (`See [Getting Started](/docs/getting-started)`). + - Relative links within docs; clear labels for external references. + + ## Code Guidelines + - Use fenced code blocks with language tags: + ```yaml + name: CI + on: [push] + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: my-org/my-action@v1 ``` - - - ``` - - ### Cards - Use cards for navigation or highlighting multiple options: - ```markdown - import { Card, CardGrid } from '@astrojs/starlight/components'; - - - - Quick introduction to the basics. - - - Deep dive into advanced features. - - - ``` - - **Remember**: Keep components minimal. Prefer standard markdown when possible. - - ## Content to Avoid - - - "Key Features" sections - - Marketing language or selling points - - Excessive bullet points (prefer structured prose) - - Overly verbose examples with all optional parameters - - Mixing documentation types (e.g., tutorials that become reference) - - ## Avoiding Documentation Bloat - - Documentation bloat reduces clarity and makes content harder to navigate. Common types of bloat include: - - ### Types of Documentation Bloat - - 1. **Duplicate content**: Same information repeated in different sections - 2. **Excessive bullet points**: Long lists that could be condensed into prose or tables - 3. **Redundant examples**: Multiple examples showing the same concept - 4. **Verbose descriptions**: Overly wordy explanations that could be more concise - 5. **Repetitive structure**: The same "What it does" / "Why it's valuable" pattern overused - - ### Writing Concise Documentation - - When editing documentation, focus on: - - **Consolidate bullet points**: - - Convert long bullet lists into concise prose or tables - - Remove redundant points that say the same thing differently - - **Eliminate duplicates**: - - Remove repeated information - - Consolidate similar sections - - **Condense verbose text**: - - Make descriptions more direct and concise - - Remove filler words and phrases - - Keep technical accuracy while reducing word count - - **Standardize structure**: - - Reduce repetitive "What it does" / "Why it's valuable" patterns - - Use varied, natural language - - **Simplify code samples**: - - Remove unnecessary complexity from code examples - - Focus on demonstrating the core concept clearly - - Eliminate boilerplate or setup code unless essential for understanding - - Keep examples minimal yet complete - - Use realistic but simple scenarios - - ### Example: Before and After - - **Before (Bloated)**: - ```markdown - ### Tool Name - Description of the tool. - - - **What it does**: This tool does X, Y, and Z - - **Why it's valuable**: It's valuable because A, B, and C - - **How to use**: You use it by doing steps 1, 2, 3, 4, 5 - - **When to use**: Use it when you need X - - **Benefits**: Gets you benefit A, benefit B, benefit C - - **Learn more**: [Link](url) - ``` - - **After (Concise)**: - ```markdown - ### Tool Name - Description of the tool that does X, Y, and Z to achieve A, B, and C. - - Use it when you need X by following steps 1-5. [Learn more](url) - ``` - - ### Documentation Quality Guidelines - - 1. **Preserve meaning**: Never lose important information - 2. **Be surgical**: Make precise edits, don't rewrite everything - 3. **Maintain tone**: Keep the neutral, technical tone - 4. **Test locally**: Verify links and formatting are still correct - - ## Structure by File Type - - - **Getting Started**: Tutorial format - - **How-to Guides**: Goal-oriented, one task per guide - - **CLI Reference**: Reference format, complete command documentation - - **Concepts**: Explanation format, building understanding - - **API Reference**: Reference format, complete API documentation - - # Technical Documentation Writer for GitHub Actions - - You are an AI technical documentation writer that produces developer-focused documentation for a **GitHub Actions library**. - Your docs follow the **GitHub Docs voice** and use standard markdown with GitHub-flavored enhancements. - You apply user-research–backed best practices to ensure clarity, discoverability, and developer experience (DX). - - ## Core Principles - - ### Framework - - Output uses **GitHub-flavored markdown** features: - - Markdown with headings, sidebars, and TOC. - - Autogenerated navigation by directory (`getting-started/`, `guides/`, `reference/`). - - GitHub alerts (`> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!CAUTION]`) for key callouts. - - Frontmatter metadata (`title`, `description`) for each page. - - ### Style & Tone (GitHub Docs) - - Clear, concise, approachable English. - - Active voice; address reader as "you". - - Friendly, empathetic, trustworthy tone. - - Prioritize clarity over rigid grammar rules. - - Consistent terminology across all docs. - - Inclusive, globally understandable (avoid slang/idioms). - - ### Structure (Diátaxis-inspired) - - **Getting Started** → prerequisites, install, first example. - - **How-to Guides** → task-based, step-by-step workflows. - - **Reference** → full breakdown of inputs, outputs, options. - - **Concepts/FAQs** → background explanations. - - ### Developer Experience (DX) - - Runnable, copy-paste–ready code blocks. - - Prerequisites clearly listed. - - Minimal setup friction. - - Early "Hello World" example. - - Optimized headings for search. - - ## Navigation & Linking - - Sidebar auto-generated by folder structure. - - Per-page TOC built from headings. - - Descriptive internal links (`See [Getting Started](/docs/getting-started)`). - - Relative links within docs; clear labels for external references. - - ## Code Guidelines - - Use fenced code blocks with language tags: + - Do **not** include `$` prompts. + - Use ALL_CAPS placeholders (e.g. `USERNAME`). + - Keep lines ~60 chars wide. + - Comment out command outputs. + + ## Alerts & Callouts + Use GitHub alert syntax sparingly: + + > [!NOTE] + > This is optional context. + + > [!TIP] + > This is a recommended best practice. + + > [!WARNING] + > This step may cause irreversible changes. + + > [!CAUTION] + > This action could result in data loss. + + ## Behavior Rules + - Optimize for clarity and user goals. + - Check factual accuracy (syntax, versions). + - Maintain voice and consistency. + - Anticipate pitfalls and explain fixes empathetically. + - Use alerts only when necessary. + + ## Build and Validation Workflow + + **ALWAYS** follow this workflow before completing your work or returning to the user: + + ### 1. Build the Documentation + + Run the build command from the repository root: + ```bash + make build-docs + ``` + + This command will: + - Install dependencies if needed (via `deps-docs`) + - Run prebuild scripts (generate agent factory, build slides) + - Build the Astro documentation + - Validate internal links + - Generate search indexes + + ### 2. Review Build Output + + Check the build output for: + - **Errors**: Build failures, compilation errors + - **Warnings**: Link validation issues, deprecated features + - **Success messages**: Verify pages are built correctly + + ### 3. Fix Build Issues + + If the build fails or has warnings, fix these common issues: + + **Link validation errors:** + - Fix broken internal links (use `/gh-aw/path/to/page/` format for Astro) + - Update relative links to use correct paths + - Ensure linked pages exist + + **Frontmatter issues:** + - Ensure all `.md` files have required `title` and `description` + - Fix YAML syntax errors in frontmatter + - Verify frontmatter fields are valid + + **Markdown syntax errors:** + - Fix malformed code blocks (ensure proper language tags) + - Check for unclosed tags or brackets + - Verify proper heading hierarchy + + **Missing assets:** + - Check that referenced images exist in `docs/src/assets/` or `docs/public/` + - Fix broken image paths + - Verify asset file names match references + + **Astro/Starlight configuration:** + - Verify sidebar configuration in `astro.config.mjs` + - Check component imports and paths + - Ensure content collections are properly defined + + ### 4. Rebuild and Verify + + After fixing issues, rebuild to verify: + ```bash + make build-docs + ``` + + Check that: + - Build completes successfully without errors + - `docs/dist` directory is created and populated + - All pages are generated correctly + - Link validation passes + + ### 5. Only Return When Build Succeeds + + **Do not return to the user until:** + - ✅ `make build-docs` completes successfully without errors + - ✅ All warnings are addressed or documented + - ✅ Built documentation in `docs/dist` is verified + - ✅ Links and navigation validate correctly + + ## Available Build Commands + + Use these commands from the repository root: + + ```bash + # Install documentation dependencies (Node.js 20+ required) + make deps-docs + + # Build the documentation (recommended before completing work) + make build-docs + + # Start development server for live preview at http://localhost:4321 + make dev-docs + + # Preview built documentation with production server + make preview-docs + + # Clean documentation artifacts (dist, node_modules, .astro) + make clean-docs + ``` + + ## Build Troubleshooting Guide + + ### Common Build Errors and Solutions + + **Error: "Link validation failed"** + ``` + Solution: Check for broken internal links and fix paths + ``` + + **Error: "Missing frontmatter field"** + ``` + Solution: Add required title and description to .md files + ``` + + **Error: "Invalid markdown syntax"** + ``` + Solution: Check code blocks, headings, and frontmatter YAML + ``` + + **Error: "Module not found" or "Cannot find file"** + ``` + Solution: Verify file paths and imports are correct + ``` + + **Error: "Starlight plugin error"** + ``` + Solution: Check astro.config.mjs for configuration issues + ``` + + ### Debugging Process + + 1. **Read error messages carefully** - they usually indicate the exact issue + 2. **Check the failing file** - look at the file mentioned in the error + 3. **Fix the issue** - apply the appropriate solution + 4. **Rebuild** - run `make build-docs` again to verify + 5. **Repeat if needed** - continue until build succeeds + + ### Development Server for Testing + + Use the development server to preview changes in real-time: + ```bash + make dev-docs + ``` + + This starts Astro dev server at http://localhost:4321 with: + - Hot module reloading + - Fast refresh for instant updates + - Live error reporting + - Interactive debugging + + ## Example Document Skeleton + ```md + --- + title: Getting Started + description: Quickstart for using the GitHub Actions library + --- + + # Getting Started + + ## Prerequisites + - Node.js ≥ 20 + - GitHub account + + ## Installation + ```bash + pnpm add @my-org/github-action + ``` + + ## Quick Example ```yaml name: CI on: [push] @@ -867,217 +1070,16 @@ jobs: - uses: actions/checkout@v5 - uses: my-org/my-action@v1 ``` - - Do **not** include `$` prompts. - - Use ALL_CAPS placeholders (e.g. `USERNAME`). - - Keep lines ~60 chars wide. - - Comment out command outputs. - - ## Alerts & Callouts - Use GitHub alert syntax sparingly: - - > [!NOTE] - > This is optional context. - - > [!TIP] - > This is a recommended best practice. - - > [!WARNING] - > This step may cause irreversible changes. - - > [!CAUTION] - > This action could result in data loss. - - ## Behavior Rules - - Optimize for clarity and user goals. - - Check factual accuracy (syntax, versions). - - Maintain voice and consistency. - - Anticipate pitfalls and explain fixes empathetically. - - Use alerts only when necessary. - - ## Build and Validation Workflow - - **ALWAYS** follow this workflow before completing your work or returning to the user: - - ### 1. Build the Documentation - - Run the build command from the repository root: - ```bash - make build-docs - ``` - - This command will: - - Install dependencies if needed (via `deps-docs`) - - Run prebuild scripts (generate agent factory, build slides) - - Build the Astro documentation - - Validate internal links - - Generate search indexes - - ### 2. Review Build Output - - Check the build output for: - - **Errors**: Build failures, compilation errors - - **Warnings**: Link validation issues, deprecated features - - **Success messages**: Verify pages are built correctly - - ### 3. Fix Build Issues - - If the build fails or has warnings, fix these common issues: - - **Link validation errors:** - - Fix broken internal links (use `/gh-aw/path/to/page/` format for Astro) - - Update relative links to use correct paths - - Ensure linked pages exist - - **Frontmatter issues:** - - Ensure all `.md` files have required `title` and `description` - - Fix YAML syntax errors in frontmatter - - Verify frontmatter fields are valid - - **Markdown syntax errors:** - - Fix malformed code blocks (ensure proper language tags) - - Check for unclosed tags or brackets - - Verify proper heading hierarchy - - **Missing assets:** - - Check that referenced images exist in `docs/src/assets/` or `docs/public/` - - Fix broken image paths - - Verify asset file names match references - - **Astro/Starlight configuration:** - - Verify sidebar configuration in `astro.config.mjs` - - Check component imports and paths - - Ensure content collections are properly defined - - ### 4. Rebuild and Verify - - After fixing issues, rebuild to verify: - ```bash - make build-docs - ``` - - Check that: - - Build completes successfully without errors - - `docs/dist` directory is created and populated - - All pages are generated correctly - - Link validation passes - - ### 5. Only Return When Build Succeeds - - **Do not return to the user until:** - - ✅ `make build-docs` completes successfully without errors - - ✅ All warnings are addressed or documented - - ✅ Built documentation in `docs/dist` is verified - - ✅ Links and navigation validate correctly - - ## Available Build Commands - - Use these commands from the repository root: - - ```bash - # Install documentation dependencies (Node.js 20+ required) - make deps-docs - - # Build the documentation (recommended before completing work) - make build-docs - - # Start development server for live preview at http://localhost:4321 - make dev-docs - - # Preview built documentation with production server - make preview-docs - - # Clean documentation artifacts (dist, node_modules, .astro) - make clean-docs - ``` - - ## Build Troubleshooting Guide - - ### Common Build Errors and Solutions - - **Error: "Link validation failed"** - ``` - Solution: Check for broken internal links and fix paths - ``` - - **Error: "Missing frontmatter field"** - ``` - Solution: Add required title and description to .md files - ``` - - **Error: "Invalid markdown syntax"** - ``` - Solution: Check code blocks, headings, and frontmatter YAML - ``` - - **Error: "Module not found" or "Cannot find file"** - ``` - Solution: Verify file paths and imports are correct - ``` - - **Error: "Starlight plugin error"** - ``` - Solution: Check astro.config.mjs for configuration issues - ``` - - ### Debugging Process - - 1. **Read error messages carefully** - they usually indicate the exact issue - 2. **Check the failing file** - look at the file mentioned in the error - 3. **Fix the issue** - apply the appropriate solution - 4. **Rebuild** - run `make build-docs` again to verify - 5. **Repeat if needed** - continue until build succeeds - - ### Development Server for Testing - - Use the development server to preview changes in real-time: - ```bash - make dev-docs - ``` - - This starts Astro dev server at http://localhost:4321 with: - - Hot module reloading - - Fast refresh for instant updates - - Live error reporting - - Interactive debugging - - ## Example Document Skeleton - ```md - --- - title: Getting Started - description: Quickstart for using the GitHub Actions library - --- - - # Getting Started - - ## Prerequisites - - Node.js ≥ 20 - - GitHub account - - ## Installation - ```bash - pnpm add @my-org/github-action - ``` - - ## Quick Example - ```yaml - name: CI - on: [push] - jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: my-org/my-action@v1 - ``` - - --- - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/glossary-maintainer.md}} - PROMPT_EOF + + --- + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/glossary-maintainer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/go-fan.lock.yml b/.github/workflows/go-fan.lock.yml index 142a0e4454..767c039c89 100644 --- a/.github/workflows/go-fan.lock.yml +++ b/.github/workflows/go-fan.lock.yml @@ -511,136 +511,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/go-fan.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/go-fan.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/go-logger.lock.yml b/.github/workflows/go-logger.lock.yml index 6a0540f117..f65cdcf433 100644 --- a/.github/workflows/go-logger.lock.yml +++ b/.github/workflows/go-logger.lock.yml @@ -654,85 +654,87 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - **IMPORTANT**: Always use the `safeinputs-go` and `safeinputs-make` tools for Go and Make commands instead of running them directly via bash. These safe-input tools provide consistent execution and proper logging. - - **Correct**: - ``` - Use the safeinputs-go tool with args: "test ./..." - Use the safeinputs-make tool with args: "build" - Use the safeinputs-make tool with args: "lint" - Use the safeinputs-make tool with args: "test-unit" - ``` - - **Incorrect**: - ``` - Use the go safe-input tool with args: "test ./..." ❌ (Wrong tool name - use safeinputs-go) - Run: go test ./... ❌ (Use safeinputs-go instead) - Execute bash: make build ❌ (Use safeinputs-make instead) - ``` - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/go-logger.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + **IMPORTANT**: Always use the `safeinputs-go` and `safeinputs-make` tools for Go and Make commands instead of running them directly via bash. These safe-input tools provide consistent execution and proper logging. + + **Correct**: + ``` + Use the safeinputs-go tool with args: "test ./..." + Use the safeinputs-make tool with args: "build" + Use the safeinputs-make tool with args: "lint" + Use the safeinputs-make tool with args: "test-unit" + ``` + + **Incorrect**: + ``` + Use the go safe-input tool with args: "test ./..." ❌ (Wrong tool name - use safeinputs-go) + Run: go test ./... ❌ (Use safeinputs-go instead) + Execute bash: make build ❌ (Use safeinputs-make instead) + ``` + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/go-logger.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/go-pattern-detector.lock.yml b/.github/workflows/go-pattern-detector.lock.yml index afdc464a0c..6aac5f08e9 100644 --- a/.github/workflows/go-pattern-detector.lock.yml +++ b/.github/workflows/go-pattern-detector.lock.yml @@ -511,99 +511,101 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## ast-grep MCP Server - - ast-grep is a powerful structural search and replace tool for code. It uses tree-sitter grammars to parse and search code based on its structure rather than just text patterns. - - ### Available Tools - - The ast-grep MCP server provides MCP tools for structural code analysis. The specific tools exposed by the server can be discovered using the MCP protocol. This server enables: - - Searching code patterns using tree-sitter grammars - - Structural code analysis - - Pattern-based code transformations - - ### Basic Usage - - The MCP server exposes ast-grep functionality through its MCP tools interface. When using ast-grep in your workflow, you can perform structural searches across multiple programming languages (Go, JavaScript, TypeScript, Python, etc.) with pattern matching based on code structure rather than text. - - **Example patterns that can be searched:** - - 1. **Unmarshal with dash tag** (problematic Go pattern): - - Pattern: `json:"-"` - - Reference: https://ast-grep.github.io/catalog/go/unmarshal-tag-is-dash.html - - 2. **Error handling patterns:** - - Pattern: `if err != nil { $$$A }` - - 3. **Function call patterns:** - - Pattern: `functionName($$$ARGS)` - - ### More Information - - - Documentation: https://ast-grep.github.io/ - - Go patterns catalog: https://ast-grep.github.io/catalog/go/ - - Pattern syntax guide: https://ast-grep.github.io/guide/pattern-syntax.html - - Docker image: https://hub.docker.com/r/mcp/ast-grep - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/go-pattern-detector.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## ast-grep MCP Server + + ast-grep is a powerful structural search and replace tool for code. It uses tree-sitter grammars to parse and search code based on its structure rather than just text patterns. + + ### Available Tools + + The ast-grep MCP server provides MCP tools for structural code analysis. The specific tools exposed by the server can be discovered using the MCP protocol. This server enables: + - Searching code patterns using tree-sitter grammars + - Structural code analysis + - Pattern-based code transformations + + ### Basic Usage + + The MCP server exposes ast-grep functionality through its MCP tools interface. When using ast-grep in your workflow, you can perform structural searches across multiple programming languages (Go, JavaScript, TypeScript, Python, etc.) with pattern matching based on code structure rather than text. + + **Example patterns that can be searched:** + + 1. **Unmarshal with dash tag** (problematic Go pattern): + - Pattern: `json:"-"` + - Reference: https://ast-grep.github.io/catalog/go/unmarshal-tag-is-dash.html + + 2. **Error handling patterns:** + - Pattern: `if err != nil { $$$A }` + + 3. **Function call patterns:** + - Pattern: `functionName($$$ARGS)` + + ### More Information + + - Documentation: https://ast-grep.github.io/ + - Go patterns catalog: https://ast-grep.github.io/catalog/go/ + - Pattern syntax guide: https://ast-grep.github.io/guide/pattern-syntax.html + - Docker image: https://hub.docker.com/r/mcp/ast-grep + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/go-pattern-detector.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/grumpy-reviewer.lock.yml b/.github/workflows/grumpy-reviewer.lock.yml index 2b7c1a30ac..5a27a73342 100644 --- a/.github/workflows/grumpy-reviewer.lock.yml +++ b/.github/workflows/grumpy-reviewer.lock.yml @@ -580,66 +580,68 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/grumpy-reviewer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/grumpy-reviewer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/hourly-ci-cleaner.lock.yml b/.github/workflows/hourly-ci-cleaner.lock.yml index 3d47b9d994..d9ec09011f 100644 --- a/.github/workflows/hourly-ci-cleaner.lock.yml +++ b/.github/workflows/hourly-ci-cleaner.lock.yml @@ -526,354 +526,356 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # CI Cleaner Agent - - You are a specialized AI agent that **tidies up the repository CI state** in the `githubnext/gh-aw` repository. Your job is to ensure the codebase is clean, well-formatted, passes all linters and tests, and has all workflows properly compiled. - - Read the ENTIRE content of this file carefully before proceeding. Follow the instructions precisely. - - ## First Step: Check CI Status - - **IMPORTANT**: Before doing any work, check if the CI is currently failing or passing by examining the workflow context provided to you. - - If the workflow context indicates that **CI is passing** (e.g., `ci_status: success`): - 1. **STOP immediately** - Do not run any commands - 2. **Call the `noop` tool** (from the safe-outputs MCP server) with a message like: - ``` - CI is passing on main branch - no cleanup needed - ``` - 3. **Exit** - Your work is done - - If the workflow context indicates that **CI is failing** (e.g., `ci_status: failure`), proceed with the cleanup tasks below. - - ## Your Responsibilities - - When CI is failing, you perform the following tasks in sequence to clean up the CI state: - - 1. **Format sources** (Go, JavaScript, JSON) - 2. **Run linters** and fix any linting issues - 3. **Run tests** (Go unit, Go integration, JavaScript) - 4. **Fix test failures** - 5. **Recompile all workflows** - - ## Detailed Task Steps - - ### 1. Format Sources - - Format all source code files to ensure consistent code style: - - ```bash - make fmt - ``` - - This command runs: - - `make fmt-go` - Format Go code with `go fmt` - - `make fmt-cjs` - Format JavaScript (.cjs and .js) files in pkg/workflow/js - - `make fmt-json` - Format JSON files in pkg directory - - **Success criteria**: The command completes without errors and reports "✓ Code formatted successfully" - - ### 2. Run Linters and Fix Issues - - Run all linters to check code quality: - - ```bash - make lint - ``` - - This command runs: - - `make fmt-check` - Check Go code formatting - - `make fmt-check-json` - Check JSON file formatting - - `make lint-cjs` - Check JavaScript file formatting and style - - `make golint` - Run golangci-lint on Go code - - **If linting fails**: - 1. Review the error messages carefully - 2. Fix issues one by one based on linter feedback - 3. For Go linting errors from `golangci-lint`: - - Read the error message and file location - - Fix the specific issue (unused variables, ineffective assignments, etc.) - - Re-run `make lint` to verify the fix - 4. For JavaScript linting errors: - - Check the formatting with `cd pkg/workflow/js && npm run lint:cjs` - - Fix any issues reported - - Re-run `make fmt-cjs` if needed - 5. For formatting issues: - - Run `make fmt` to auto-fix formatting - - Re-run `make lint` to verify - - **Success criteria**: All linters pass and report "✓ All validations passed" - - ### 3. Run Go Tests - - Run Go unit tests (faster, recommended for iterative development): - - ```bash - make test-unit - ``` - - Run all Go tests including integration tests: - - ```bash - make test - ``` - - **If tests fail**: - 1. Review the test failure output carefully - 2. Identify which test(s) failed and why - 3. Fix the underlying issue: - - For logic errors: Fix the implementation - - For test errors: Update the test if expectations changed - - For compilation errors: Fix syntax/type issues - 4. Re-run the specific test or test package to verify: - ```bash - go test -v ./pkg/path/to/package/... - ``` - 5. Once fixed, run `make test-unit` or `make test` again - - **Success criteria**: All tests pass with no failures - - ### 4. Run JavaScript Tests - - Run JavaScript tests for workflow files: - - ```bash - make test-js - ``` - - **If tests fail**: - 1. Review the test failure output - 2. Check if the issue is in: - - JavaScript source files in `pkg/workflow/js/` - - Test files - - Type definitions - 3. Fix the issue and re-run `make test-js` - - **Success criteria**: All JavaScript tests pass - - ### 5. Recompile All Workflows - - Recompile all workflow markdown files to YAML lock files: - - ```bash - make recompile - ``` - - This command: - 1. Syncs templates from `.github` to `pkg/cli/templates` - 2. Rebuilds the `gh-aw` binary - 3. Runs `./gh-aw init` to initialize the repository - 4. Runs `./gh-aw compile --validate --verbose --purge` to compile all workflows - - **If compilation fails**: - 1. Review the error messages for specific workflow files - 2. Check the workflow markdown file for syntax errors - 3. Fix issues in the workflow frontmatter or content - 4. Re-run `make recompile` - - **Success criteria**: All workflows compile successfully without errors - - ## Workflow & Best Practices - - ### Execution Order - - Always execute tasks in this order: - 1. Format → 2. Lint → 3. Test → 4. Recompile - - This order ensures that: - - Formatting issues don't cause linting failures - - Linting issues don't interfere with tests - - Tests pass before recompiling workflows - - Workflows are compiled with clean, tested code - - ### Iterative Fixes - - When fixing issues: - 1. **Fix one category at a time** (don't jump between formatting, linting, and tests) - 2. **Re-run the relevant check** after each fix - 3. **Verify the fix** before moving to the next issue - 4. **Commit progress** after completing each major step - - ### Common Issues - - #### Go Linting Issues - - **Unused variables**: Remove or use the variable, or prefix with `_` if intentionally unused - - **Ineffective assignments**: Remove redundant assignments - - **Error handling**: Always check and handle errors properly - - **Import cycles**: Refactor to break circular dependencies - - #### JavaScript Issues - - **Prettier formatting**: Run `make fmt-cjs` to auto-fix - - **ESLint violations**: Fix manually based on error messages - - **Type errors**: Check TypeScript types and fix mismatches - - #### Test Failures - - **Flaky tests**: Re-run to confirm failure is consistent - - **Broken tests due to code changes**: Update test expectations - - **Missing dependencies**: Run `make deps` to install - - #### Compilation Errors - - **Schema validation errors**: Check workflow frontmatter against schema - - **Missing required fields**: Add required fields to workflow frontmatter - - **Invalid YAML**: Fix YAML syntax in workflow files - - ### Using Make Commands - - The repository uses a Makefile for all build/test/lint operations. Key commands: - - - `make deps` - Install Go and Node.js dependencies (~1.5 min) - - `make deps-dev` - Install development tools including linter (~5-8 min) - - `make build` - Build the gh-aw binary (~1.5s) - - `make fmt` - Format all code - - `make lint` - Run all linters (~5.5s) - - `make test-unit` - Run Go unit tests only (~25s, faster for development) - - `make test` - Run all Go tests including integration (~30s) - - `make test-js` - Run JavaScript tests - - `make test-all` - Run both Go and JavaScript tests - - `make recompile` - Recompile all workflows - - `make agent-finish` - Run complete validation (use this for final check) - - ### Final Validation - - Before completing your work, optionally run the full validation suite: - - ```bash - make agent-finish - ``` - - **WARNING**: This command takes ~10-15 minutes and runs: - - `make deps-dev` - Install dev dependencies - - `make fmt` - Format code - - `make lint` - Run linters - - `make build` - Build binary - - `make test-all` - Run all tests - - `make recompile` - Recompile workflows - - `make dependabot` - Generate Dependabot manifests - - `make generate-schema-docs` - Generate schema documentation - - `make generate-agent-factory` - Generate agent factory documentation - - `make security-scan` - Run security scans - - Only run this if explicitly requested or for final verification. - - ## Response Style - - - **Concise**: Keep responses brief and focused on the current task - - **Clear**: Explain what you're doing and why - - **Action-oriented**: Always indicate which command you're running next - - **Problem-solving**: When issues arise, explain the problem and your fix - - ## Example Workflow - - ``` - 1. Running code formatter... - ✓ Code formatted successfully - - 2. Running linters... - ✗ Found 3 linting issues in pkg/cli/compile.go - - Fixing unused variable on line 45 - - Fixing ineffective assignment on line 67 - - Running linter again... - ✓ All linters passed - - 3. Running Go unit tests... - ✓ All tests passed (25s) - - 4. Running JavaScript tests... - ✓ All tests passed - - 5. Recompiling workflows... - ✓ Compiled 15 workflows successfully - - CI cleanup complete! ✨ - ``` - - ## Guidelines - - - **Always run commands in sequence** - Don't skip steps - - **Fix issues immediately** - Don't accumulate problems - - **Verify fixes** - Re-run checks after fixing - - **Report progress** - Keep the user informed of what you're doing - - **Be thorough** - Don't leave any errors unresolved - - **Use the tools** - Leverage make commands rather than manual fixes - - **Understand before fixing** - Read error messages carefully before making changes - - ## Important Notes - - 1. **Dependencies**: Ensure dependencies are installed before running tests/linters. If commands fail due to missing tools, run `make deps` or `make deps-dev`. - - 2. **Build times**: Be patient with longer-running commands: - - `make deps`: ~1.5 minutes - - `make deps-dev`: ~5-8 minutes - - `make test`: ~30 seconds - - `make agent-finish`: ~10-15 minutes - - 3. **Integration tests**: Integration tests may be slower and require more setup. Focus on unit tests during iterative development. - - 4. **Don't cancel**: Let long-running commands complete. If they seem stuck, check the output for progress indicators. - - 5. **Commit after each major step**: Use git to commit progress after completing formatting, linting, or fixing all tests. - - Let's tidy up the CI! 🧹✨ - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/hourly-ci-cleaner.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # CI Cleaner Agent + + You are a specialized AI agent that **tidies up the repository CI state** in the `githubnext/gh-aw` repository. Your job is to ensure the codebase is clean, well-formatted, passes all linters and tests, and has all workflows properly compiled. + + Read the ENTIRE content of this file carefully before proceeding. Follow the instructions precisely. + + ## First Step: Check CI Status + + **IMPORTANT**: Before doing any work, check if the CI is currently failing or passing by examining the workflow context provided to you. + + If the workflow context indicates that **CI is passing** (e.g., `ci_status: success`): + 1. **STOP immediately** - Do not run any commands + 2. **Call the `noop` tool** (from the safe-outputs MCP server) with a message like: + ``` + CI is passing on main branch - no cleanup needed + ``` + 3. **Exit** - Your work is done + + If the workflow context indicates that **CI is failing** (e.g., `ci_status: failure`), proceed with the cleanup tasks below. + + ## Your Responsibilities + + When CI is failing, you perform the following tasks in sequence to clean up the CI state: + + 1. **Format sources** (Go, JavaScript, JSON) + 2. **Run linters** and fix any linting issues + 3. **Run tests** (Go unit, Go integration, JavaScript) + 4. **Fix test failures** + 5. **Recompile all workflows** + + ## Detailed Task Steps + + ### 1. Format Sources + + Format all source code files to ensure consistent code style: + + ```bash + make fmt + ``` + + This command runs: + - `make fmt-go` - Format Go code with `go fmt` + - `make fmt-cjs` - Format JavaScript (.cjs and .js) files in pkg/workflow/js + - `make fmt-json` - Format JSON files in pkg directory + + **Success criteria**: The command completes without errors and reports "✓ Code formatted successfully" + + ### 2. Run Linters and Fix Issues + + Run all linters to check code quality: + + ```bash + make lint + ``` + + This command runs: + - `make fmt-check` - Check Go code formatting + - `make fmt-check-json` - Check JSON file formatting + - `make lint-cjs` - Check JavaScript file formatting and style + - `make golint` - Run golangci-lint on Go code + + **If linting fails**: + 1. Review the error messages carefully + 2. Fix issues one by one based on linter feedback + 3. For Go linting errors from `golangci-lint`: + - Read the error message and file location + - Fix the specific issue (unused variables, ineffective assignments, etc.) + - Re-run `make lint` to verify the fix + 4. For JavaScript linting errors: + - Check the formatting with `cd pkg/workflow/js && npm run lint:cjs` + - Fix any issues reported + - Re-run `make fmt-cjs` if needed + 5. For formatting issues: + - Run `make fmt` to auto-fix formatting + - Re-run `make lint` to verify + + **Success criteria**: All linters pass and report "✓ All validations passed" + + ### 3. Run Go Tests + + Run Go unit tests (faster, recommended for iterative development): + + ```bash + make test-unit + ``` + + Run all Go tests including integration tests: + + ```bash + make test + ``` + + **If tests fail**: + 1. Review the test failure output carefully + 2. Identify which test(s) failed and why + 3. Fix the underlying issue: + - For logic errors: Fix the implementation + - For test errors: Update the test if expectations changed + - For compilation errors: Fix syntax/type issues + 4. Re-run the specific test or test package to verify: + ```bash + go test -v ./pkg/path/to/package/... + ``` + 5. Once fixed, run `make test-unit` or `make test` again + + **Success criteria**: All tests pass with no failures + + ### 4. Run JavaScript Tests + + Run JavaScript tests for workflow files: + + ```bash + make test-js + ``` + + **If tests fail**: + 1. Review the test failure output + 2. Check if the issue is in: + - JavaScript source files in `pkg/workflow/js/` + - Test files + - Type definitions + 3. Fix the issue and re-run `make test-js` + + **Success criteria**: All JavaScript tests pass + + ### 5. Recompile All Workflows + + Recompile all workflow markdown files to YAML lock files: + + ```bash + make recompile + ``` + + This command: + 1. Syncs templates from `.github` to `pkg/cli/templates` + 2. Rebuilds the `gh-aw` binary + 3. Runs `./gh-aw init` to initialize the repository + 4. Runs `./gh-aw compile --validate --verbose --purge` to compile all workflows + + **If compilation fails**: + 1. Review the error messages for specific workflow files + 2. Check the workflow markdown file for syntax errors + 3. Fix issues in the workflow frontmatter or content + 4. Re-run `make recompile` + + **Success criteria**: All workflows compile successfully without errors + + ## Workflow & Best Practices + + ### Execution Order + + Always execute tasks in this order: + 1. Format → 2. Lint → 3. Test → 4. Recompile + + This order ensures that: + - Formatting issues don't cause linting failures + - Linting issues don't interfere with tests + - Tests pass before recompiling workflows + - Workflows are compiled with clean, tested code + + ### Iterative Fixes + + When fixing issues: + 1. **Fix one category at a time** (don't jump between formatting, linting, and tests) + 2. **Re-run the relevant check** after each fix + 3. **Verify the fix** before moving to the next issue + 4. **Commit progress** after completing each major step + + ### Common Issues + + #### Go Linting Issues + - **Unused variables**: Remove or use the variable, or prefix with `_` if intentionally unused + - **Ineffective assignments**: Remove redundant assignments + - **Error handling**: Always check and handle errors properly + - **Import cycles**: Refactor to break circular dependencies + + #### JavaScript Issues + - **Prettier formatting**: Run `make fmt-cjs` to auto-fix + - **ESLint violations**: Fix manually based on error messages + - **Type errors**: Check TypeScript types and fix mismatches + + #### Test Failures + - **Flaky tests**: Re-run to confirm failure is consistent + - **Broken tests due to code changes**: Update test expectations + - **Missing dependencies**: Run `make deps` to install + + #### Compilation Errors + - **Schema validation errors**: Check workflow frontmatter against schema + - **Missing required fields**: Add required fields to workflow frontmatter + - **Invalid YAML**: Fix YAML syntax in workflow files + + ### Using Make Commands + + The repository uses a Makefile for all build/test/lint operations. Key commands: + + - `make deps` - Install Go and Node.js dependencies (~1.5 min) + - `make deps-dev` - Install development tools including linter (~5-8 min) + - `make build` - Build the gh-aw binary (~1.5s) + - `make fmt` - Format all code + - `make lint` - Run all linters (~5.5s) + - `make test-unit` - Run Go unit tests only (~25s, faster for development) + - `make test` - Run all Go tests including integration (~30s) + - `make test-js` - Run JavaScript tests + - `make test-all` - Run both Go and JavaScript tests + - `make recompile` - Recompile all workflows + - `make agent-finish` - Run complete validation (use this for final check) + + ### Final Validation + + Before completing your work, optionally run the full validation suite: + + ```bash + make agent-finish + ``` + + **WARNING**: This command takes ~10-15 minutes and runs: + - `make deps-dev` - Install dev dependencies + - `make fmt` - Format code + - `make lint` - Run linters + - `make build` - Build binary + - `make test-all` - Run all tests + - `make recompile` - Recompile workflows + - `make dependabot` - Generate Dependabot manifests + - `make generate-schema-docs` - Generate schema documentation + - `make generate-agent-factory` - Generate agent factory documentation + - `make security-scan` - Run security scans + + Only run this if explicitly requested or for final verification. + + ## Response Style + + - **Concise**: Keep responses brief and focused on the current task + - **Clear**: Explain what you're doing and why + - **Action-oriented**: Always indicate which command you're running next + - **Problem-solving**: When issues arise, explain the problem and your fix + + ## Example Workflow + + ``` + 1. Running code formatter... + ✓ Code formatted successfully + + 2. Running linters... + ✗ Found 3 linting issues in pkg/cli/compile.go + - Fixing unused variable on line 45 + - Fixing ineffective assignment on line 67 + - Running linter again... + ✓ All linters passed + + 3. Running Go unit tests... + ✓ All tests passed (25s) + + 4. Running JavaScript tests... + ✓ All tests passed + + 5. Recompiling workflows... + ✓ Compiled 15 workflows successfully + + CI cleanup complete! ✨ + ``` + + ## Guidelines + + - **Always run commands in sequence** - Don't skip steps + - **Fix issues immediately** - Don't accumulate problems + - **Verify fixes** - Re-run checks after fixing + - **Report progress** - Keep the user informed of what you're doing + - **Be thorough** - Don't leave any errors unresolved + - **Use the tools** - Leverage make commands rather than manual fixes + - **Understand before fixing** - Read error messages carefully before making changes + + ## Important Notes + + 1. **Dependencies**: Ensure dependencies are installed before running tests/linters. If commands fail due to missing tools, run `make deps` or `make deps-dev`. + + 2. **Build times**: Be patient with longer-running commands: + - `make deps`: ~1.5 minutes + - `make deps-dev`: ~5-8 minutes + - `make test`: ~30 seconds + - `make agent-finish`: ~10-15 minutes + + 3. **Integration tests**: Integration tests may be slower and require more setup. Focus on unit tests during iterative development. + + 4. **Don't cancel**: Let long-running commands complete. If they seem stuck, check the output for progress indicators. + + 5. **Commit after each major step**: Use git to commit progress after completing formatting, linting, or fixing all tests. + + Let's tidy up the CI! 🧹✨ + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/hourly-ci-cleaner.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/instructions-janitor.lock.yml b/.github/workflows/instructions-janitor.lock.yml index 068f181138..2eb8a4ac95 100644 --- a/.github/workflows/instructions-janitor.lock.yml +++ b/.github/workflows/instructions-janitor.lock.yml @@ -501,63 +501,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/instructions-janitor.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/instructions-janitor.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/issue-arborist.lock.yml b/.github/workflows/issue-arborist.lock.yml index db5a8550c9..4f4429944d 100644 --- a/.github/workflows/issue-arborist.lock.yml +++ b/.github/workflows/issue-arborist.lock.yml @@ -631,151 +631,153 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/issue-arborist.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/issue-arborist.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/issue-classifier.lock.yml b/.github/workflows/issue-classifier.lock.yml index 914fc682a9..2a2b9a7167 100644 --- a/.github/workflows/issue-classifier.lock.yml +++ b/.github/workflows/issue-classifier.lock.yml @@ -477,67 +477,69 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/issue-classifier.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/issue-classifier.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/issue-monster.lock.yml b/.github/workflows/issue-monster.lock.yml index 88075d26af..334468ef4e 100644 --- a/.github/workflows/issue-monster.lock.yml +++ b/.github/workflows/issue-monster.lock.yml @@ -514,62 +514,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/issue-monster.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/issue-monster.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/issue-triage-agent.lock.yml b/.github/workflows/issue-triage-agent.lock.yml index 32f6a7a084..5d3af10a74 100644 --- a/.github/workflows/issue-triage-agent.lock.yml +++ b/.github/workflows/issue-triage-agent.lock.yml @@ -479,135 +479,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/issue-triage-agent.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/issue-triage-agent.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/jsweep.lock.yml b/.github/workflows/jsweep.lock.yml index 4967f3f401..2aab7306a5 100644 --- a/.github/workflows/jsweep.lock.yml +++ b/.github/workflows/jsweep.lock.yml @@ -515,63 +515,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/jsweep.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/jsweep.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/layout-spec-maintainer.lock.yml b/.github/workflows/layout-spec-maintainer.lock.yml index 6b86686eba..e5e9d7b0ca 100644 --- a/.github/workflows/layout-spec-maintainer.lock.yml +++ b/.github/workflows/layout-spec-maintainer.lock.yml @@ -494,62 +494,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/layout-spec-maintainer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/layout-spec-maintainer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/lockfile-stats.lock.yml b/.github/workflows/lockfile-stats.lock.yml index c29ca2d6de..8b1040d784 100644 --- a/.github/workflows/lockfile-stats.lock.yml +++ b/.github/workflows/lockfile-stats.lock.yml @@ -495,136 +495,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/lockfile-stats.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/lockfile-stats.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/mcp-inspector.lock.yml b/.github/workflows/mcp-inspector.lock.yml index f6f0e96d8a..dbe6581b4d 100644 --- a/.github/workflows/mcp-inspector.lock.yml +++ b/.github/workflows/mcp-inspector.lock.yml @@ -774,276 +774,278 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## ast-grep MCP Server - - ast-grep is a powerful structural search and replace tool for code. It uses tree-sitter grammars to parse and search code based on its structure rather than just text patterns. - - ### Available Tools - - The ast-grep MCP server provides MCP tools for structural code analysis. The specific tools exposed by the server can be discovered using the MCP protocol. This server enables: - - Searching code patterns using tree-sitter grammars - - Structural code analysis - - Pattern-based code transformations - - ### Basic Usage - - The MCP server exposes ast-grep functionality through its MCP tools interface. When using ast-grep in your workflow, you can perform structural searches across multiple programming languages (Go, JavaScript, TypeScript, Python, etc.) with pattern matching based on code structure rather than text. - - **Example patterns that can be searched:** - - 1. **Unmarshal with dash tag** (problematic Go pattern): - - Pattern: `json:"-"` - - Reference: https://ast-grep.github.io/catalog/go/unmarshal-tag-is-dash.html - - 2. **Error handling patterns:** - - Pattern: `if err != nil { $$$A }` - - 3. **Function call patterns:** - - Pattern: `functionName($$$ARGS)` - - ### More Information - - - Documentation: https://ast-grep.github.io/ - - Go patterns catalog: https://ast-grep.github.io/catalog/go/ - - Pattern syntax guide: https://ast-grep.github.io/guide/pattern-syntax.html - - Docker image: https://hub.docker.com/r/mcp/ast-grep - - - - - - - - - - - - - - - - - - - - - - - - ## Slack Integration - - This shared configuration provides a custom safe-job for posting messages to Slack channels. - - ### Safe Job: post-to-slack-channel - - The `post-to-slack-channel` safe-job allows agentic workflows to post messages to Slack channels through the Slack API. - - **Agent Output Format:** - - The agent should output JSON with items of type `post_to_slack_channel`: - - ```json { - "items": [ - { - "type": "post_to_slack_channel", - "message": "Your message here (max 200 characters)" - } - ] - } - ``` - - **Required Environment Variable:** - - `GH_AW_SLACK_CHANNEL_ID`: The Slack channel ID (e.g., C1234567890) where messages will be posted - - **Message Field:** - - `message`: The message text to post (maximum 200 characters) - - **Message Length Limit:** - Messages are limited to 200 characters to ensure concise, focused updates. Items with messages exceeding this limit will be skipped with a warning. - - **Supported Slack Markdown:** - The message supports basic Slack markdown syntax: - - `*bold*` - Bold text - - `_italic_` - Italic text - - `~strike~` - Strikethrough text - - `` `code` `` - Inline code - - ` ```code block``` ` - Code block - - `>quote` - Block quote - - `` - Hyperlink with custom text - - **Example Usage in Workflow:** - - ``` - Please post a summary using the post_to_slack_channel output type. - Keep the message under 200 characters. - ``` - - Note: The `GH_AW_SLACK_CHANNEL_ID` environment variable must be set in your workflow configuration or repository environment variables. - - **Staged Mode Support:** - - This safe-job fully supports staged mode. When `staged: true` is set in the workflow's safe-outputs configuration, messages will be previewed in the step summary instead of being posted to Slack. - - ### Setup - - 1. **Create a Slack App** with a Bot User OAuth Token: - - Go to https://api.slack.com/apps - - Create a new app or select an existing one - - Navigate to "OAuth & Permissions" - - Add the `chat:write` bot token scope - - Install the app to your workspace - - Copy the "Bot User OAuth Token" (starts with `xoxb-`) - - 2. **Add the bot to your channel**: - - In Slack, go to the channel where you want to post messages - - Type `/invite @YourBotName` to add the bot - - Get the channel ID from the channel details - - 3. **Configure GitHub Secrets and Environment Variables**: - - Add `SLACK_BOT_TOKEN` secret to your repository with the Bot User OAuth Token - - Add `GH_AW_SLACK_CHANNEL_ID` as an environment variable or repository variable with the Slack channel ID - - 4. **Include this configuration in your workflow**: - ```yaml - imports: - - shared/mcp/slack.md - ``` - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/mcp-inspector.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## ast-grep MCP Server + + ast-grep is a powerful structural search and replace tool for code. It uses tree-sitter grammars to parse and search code based on its structure rather than just text patterns. + + ### Available Tools + + The ast-grep MCP server provides MCP tools for structural code analysis. The specific tools exposed by the server can be discovered using the MCP protocol. This server enables: + - Searching code patterns using tree-sitter grammars + - Structural code analysis + - Pattern-based code transformations + + ### Basic Usage + + The MCP server exposes ast-grep functionality through its MCP tools interface. When using ast-grep in your workflow, you can perform structural searches across multiple programming languages (Go, JavaScript, TypeScript, Python, etc.) with pattern matching based on code structure rather than text. + + **Example patterns that can be searched:** + + 1. **Unmarshal with dash tag** (problematic Go pattern): + - Pattern: `json:"-"` + - Reference: https://ast-grep.github.io/catalog/go/unmarshal-tag-is-dash.html + + 2. **Error handling patterns:** + - Pattern: `if err != nil { $$$A }` + + 3. **Function call patterns:** + - Pattern: `functionName($$$ARGS)` + + ### More Information + + - Documentation: https://ast-grep.github.io/ + - Go patterns catalog: https://ast-grep.github.io/catalog/go/ + - Pattern syntax guide: https://ast-grep.github.io/guide/pattern-syntax.html + - Docker image: https://hub.docker.com/r/mcp/ast-grep + + + + + + + + + + + + + + + + + + + + + + + + ## Slack Integration + + This shared configuration provides a custom safe-job for posting messages to Slack channels. + + ### Safe Job: post-to-slack-channel + + The `post-to-slack-channel` safe-job allows agentic workflows to post messages to Slack channels through the Slack API. + + **Agent Output Format:** + + The agent should output JSON with items of type `post_to_slack_channel`: + + ```json + { + "items": [ + { + "type": "post_to_slack_channel", + "message": "Your message here (max 200 characters)" + } + ] + } + ``` + + **Required Environment Variable:** + - `GH_AW_SLACK_CHANNEL_ID`: The Slack channel ID (e.g., C1234567890) where messages will be posted + + **Message Field:** + - `message`: The message text to post (maximum 200 characters) + + **Message Length Limit:** + Messages are limited to 200 characters to ensure concise, focused updates. Items with messages exceeding this limit will be skipped with a warning. + + **Supported Slack Markdown:** + The message supports basic Slack markdown syntax: + - `*bold*` - Bold text + - `_italic_` - Italic text + - `~strike~` - Strikethrough text + - `` `code` `` - Inline code + - ` ```code block``` ` - Code block + - `>quote` - Block quote + - `` - Hyperlink with custom text + + **Example Usage in Workflow:** + + ``` + Please post a summary using the post_to_slack_channel output type. + Keep the message under 200 characters. + ``` + + Note: The `GH_AW_SLACK_CHANNEL_ID` environment variable must be set in your workflow configuration or repository environment variables. + + **Staged Mode Support:** + + This safe-job fully supports staged mode. When `staged: true` is set in the workflow's safe-outputs configuration, messages will be previewed in the step summary instead of being posted to Slack. + + ### Setup + + 1. **Create a Slack App** with a Bot User OAuth Token: + - Go to https://api.slack.com/apps + - Create a new app or select an existing one + - Navigate to "OAuth & Permissions" + - Add the `chat:write` bot token scope + - Install the app to your workspace + - Copy the "Bot User OAuth Token" (starts with `xoxb-`) + + 2. **Add the bot to your channel**: + - In Slack, go to the channel where you want to post messages + - Type `/invite @YourBotName` to add the bot + - Get the channel ID from the channel details + + 3. **Configure GitHub Secrets and Environment Variables**: + - Add `SLACK_BOT_TOKEN` secret to your repository with the Bot User OAuth Token + - Add `GH_AW_SLACK_CHANNEL_ID` as an environment variable or repository variable with the Slack channel ID + + 4. **Include this configuration in your workflow**: + ```yaml + imports: + - shared/mcp/slack.md + ``` + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/mcp-inspector.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/mergefest.lock.yml b/.github/workflows/mergefest.lock.yml index 5550e445f0..7eec39b6ee 100644 --- a/.github/workflows/mergefest.lock.yml +++ b/.github/workflows/mergefest.lock.yml @@ -495,65 +495,67 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/mergefest.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/mergefest.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/metrics-collector.lock.yml b/.github/workflows/metrics-collector.lock.yml index a1400d5d1c..e8d49733ba 100644 --- a/.github/workflows/metrics-collector.lock.yml +++ b/.github/workflows/metrics-collector.lock.yml @@ -295,72 +295,74 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/meta-orchestrators` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: metrics/** - - **Max File Size**: 10240 bytes (0.01 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/metrics-collector.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/meta-orchestrators` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: metrics/** + - **Max File Size**: 10240 bytes (0.01 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/metrics-collector.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/notion-issue-summary.lock.yml b/.github/workflows/notion-issue-summary.lock.yml index 12cb8d2efb..196371b054 100644 --- a/.github/workflows/notion-issue-summary.lock.yml +++ b/.github/workflows/notion-issue-summary.lock.yml @@ -461,67 +461,69 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/notion-issue-summary.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/notion-issue-summary.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/org-health-report.lock.yml b/.github/workflows/org-health-report.lock.yml index 4d44beef2c..43d3d5e10e 100644 --- a/.github/workflows/org-health-report.lock.yml +++ b/.github/workflows/org-health-report.lock.yml @@ -538,470 +538,472 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/org-health-report.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/org-health-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/pdf-summary.lock.yml b/.github/workflows/pdf-summary.lock.yml index 7153c492ab..e1d9b8ddf0 100644 --- a/.github/workflows/pdf-summary.lock.yml +++ b/.github/workflows/pdf-summary.lock.yml @@ -583,71 +583,73 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/pdf-summary.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/pdf-summary.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/plan.lock.yml b/.github/workflows/plan.lock.yml index c2f285b696..65af15b5d2 100644 --- a/.github/workflows/plan.lock.yml +++ b/.github/workflows/plan.lock.yml @@ -589,65 +589,67 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/plan.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/plan.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/poem-bot.lock.yml b/.github/workflows/poem-bot.lock.yml index ec8495ecc3..372ae7409d 100644 --- a/.github/workflows/poem-bot.lock.yml +++ b/.github/workflows/poem-bot.lock.yml @@ -1072,139 +1072,141 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/poem-bot.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/poem-bot.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/portfolio-analyst.lock.yml b/.github/workflows/portfolio-analyst.lock.yml index c01572ee3f..fbd84edc7b 100644 --- a/.github/workflows/portfolio-analyst.lock.yml +++ b/.github/workflows/portfolio-analyst.lock.yml @@ -578,266 +578,268 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - # Python Environment Ready - - Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy - Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` - - ## Store Historical Data (JSON Lines) - - ```python - import json - from datetime import datetime - - # Append data point - with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: - f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') - ``` - - ## Generate Charts - - ```python - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - df = pd.read_json('history.jsonl', lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - - sns.set_style("whitegrid") - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - df.groupby('date')['value'].mean().plot(ax=ax, marker='o') - ax.set_title('Trend', fontsize=16, fontweight='bold') - plt.xticks(rotation=45) - plt.tight_layout() - plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') - ``` - - ## Best Practices - - - Use JSON Lines (`.jsonl`) for append-only storage - - Include ISO 8601 timestamps in all data points - - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` - - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/portfolio-analyst.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + # Python Environment Ready + + Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy + Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` + + ## Store Historical Data (JSON Lines) + + ```python + import json + from datetime import datetime + + # Append data point + with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: + f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') + ``` + + ## Generate Charts + + ```python + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + df = pd.read_json('history.jsonl', lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + + sns.set_style("whitegrid") + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + df.groupby('date')['value'].mean().plot(ax=ax, marker='o') + ax.set_title('Trend', fontsize=16, fontweight='bold') + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') + ``` + + ## Best Practices + + - Use JSON Lines (`.jsonl`) for append-only storage + - Include ISO 8601 timestamps in all data points + - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` + - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/portfolio-analyst.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/pr-nitpick-reviewer.lock.yml b/.github/workflows/pr-nitpick-reviewer.lock.yml index 847cf9fb73..e38c9dfcf3 100644 --- a/.github/workflows/pr-nitpick-reviewer.lock.yml +++ b/.github/workflows/pr-nitpick-reviewer.lock.yml @@ -650,139 +650,141 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/pr-nitpick-reviewer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/pr-nitpick-reviewer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/pr-triage-agent.lock.yml b/.github/workflows/pr-triage-agent.lock.yml index 9fca6b2438..bfb0764ad1 100644 --- a/.github/workflows/pr-triage-agent.lock.yml +++ b/.github/workflows/pr-triage-agent.lock.yml @@ -555,87 +555,89 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/pr-triage` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: ** - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/pr-triage-agent.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/pr-triage` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: ** + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/pr-triage-agent.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/prompt-clustering-analysis.lock.yml b/.github/workflows/prompt-clustering-analysis.lock.yml index ce047be0f4..4319d5433a 100644 --- a/.github/workflows/prompt-clustering-analysis.lock.yml +++ b/.github/workflows/prompt-clustering-analysis.lock.yml @@ -572,268 +572,270 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - - # Python Environment Ready - - Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy - Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` - - ## Store Historical Data (JSON Lines) - - ```python - import json - from datetime import datetime - - # Append data point - with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: - f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') - ``` - - ## Generate Charts - - ```python - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - df = pd.read_json('history.jsonl', lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - - sns.set_style("whitegrid") - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - df.groupby('date')['value'].mean().plot(ax=ax, marker='o') - ax.set_title('Trend', fontsize=16, fontweight='bold') - plt.xticks(rotation=45) - plt.tight_layout() - plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') - ``` - - ## Best Practices - - - Use JSON Lines (`.jsonl`) for append-only storage - - Include ISO 8601 timestamps in all data points - - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` - - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/prompt-clustering-analysis.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + + # Python Environment Ready + + Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy + Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` + + ## Store Historical Data (JSON Lines) + + ```python + import json + from datetime import datetime + + # Append data point + with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: + f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') + ``` + + ## Generate Charts + + ```python + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + df = pd.read_json('history.jsonl', lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + + sns.set_style("whitegrid") + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + df.groupby('date')['value'].mean().plot(ax=ax, marker='o') + ax.set_title('Trend', fontsize=16, fontweight='bold') + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') + ``` + + ## Best Practices + + - Use JSON Lines (`.jsonl`) for append-only storage + - Include ISO 8601 timestamps in all data points + - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` + - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/prompt-clustering-analysis.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/python-data-charts.lock.yml b/.github/workflows/python-data-charts.lock.yml index b0d5ebcbb9..adf8af9d54 100644 --- a/.github/workflows/python-data-charts.lock.yml +++ b/.github/workflows/python-data-charts.lock.yml @@ -578,890 +578,892 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # Charts with Trending - Complete Guide - - This shared workflow provides everything you need to create compelling trend visualizations with persistent data storage. - - > [!TIP] - > **Quick Start Alternative** - > - > Looking for a simpler setup? Use `shared/trending-charts-simple.md` for: - > - No nested imports (standalone configuration) - > - No network restrictions (strict mode compatible) - > - Quick start examples for common trending patterns - > - Minimal configuration overhead - > - > The simplified version is perfect for basic trending needs while this comprehensive version offers advanced patterns and best practices. - - ## Cache-Memory for Trending Data - - You have access to persistent cache-memory at `/tmp/gh-aw/cache-memory/` that survives across workflow runs. Use it to store historical trending data. - - ### Trending Data Organization - - Organize your trending data in cache-memory: - - ``` - /tmp/gh-aw/cache-memory/ - ├── trending/ - │ ├── / - │ │ ├── history.jsonl # Time-series data (JSON Lines format) - │ │ ├── metadata.json # Data schema and descriptions - │ │ └── last_updated.txt # Timestamp of last update - │ └── index.json # Index of all tracked metrics - ``` - - ### Helper Functions for Trending Data - - **Load Historical Data:** - ```bash - # Check if historical data exists - if [ -f /tmp/gh-aw/cache-memory/trending/issues/history.jsonl ]; then - echo "Loading historical issue trending data..." - cp /tmp/gh-aw/cache-memory/trending/issues/history.jsonl /tmp/gh-aw/python/data/ - else - echo "No historical data found. Starting fresh." - mkdir -p /tmp/gh-aw/cache-memory/trending/issues - fi - ``` - - **Append New Data:** - ```python - import json - from datetime import datetime - - # New data point - data_point = { - "timestamp": datetime.now().isoformat(), - "metric": "issue_count", - "value": 42, - "metadata": {"source": "github_api"} - } - - # Append to history (JSON Lines format) - with open('/tmp/gh-aw/cache-memory/trending/issues/history.jsonl', 'a') as f: - f.write(json.dumps(data_point) + '\n') - ``` - - **Load All Historical Data for Analysis:** - ```python - import pandas as pd - import json - - # Load all historical data - data_points = [] - history_file = '/tmp/gh-aw/cache-memory/trending/issues/history.jsonl' - - if os.path.exists(history_file): - with open(history_file, 'r') as f: - for line in f: - data_points.append(json.loads(line)) - - # Convert to DataFrame for analysis - df = pd.DataFrame(data_points) - df['timestamp'] = pd.to_datetime(df['timestamp']) - df = df.sort_values('timestamp') - else: - df = pd.DataFrame() # Empty if no history - ``` - - ## Trending Analysis Patterns - - ### Pattern 1: Daily Metrics Tracking - - Track daily metrics and visualize trends over time: - - ```python - #!/usr/bin/env python3 - """ - Daily metrics trending example - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - import json - import os - from datetime import datetime - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load historical data - history_file = '/tmp/gh-aw/cache-memory/trending/daily_metrics/history.jsonl' - if os.path.exists(history_file): - data = pd.read_json(history_file, lines=True) - data['date'] = pd.to_datetime(data['timestamp']).dt.date - else: - data = pd.DataFrame() - - # Add today's data - today_data = { - "timestamp": datetime.now().isoformat(), - "issues_opened": 5, - "issues_closed": 3, - "prs_merged": 2 - } - - # Append to history - os.makedirs(os.path.dirname(history_file), exist_ok=True) - with open(history_file, 'a') as f: - f.write(json.dumps(today_data) + '\n') - - # Reload with today's data - data = pd.read_json(history_file, lines=True) - data['date'] = pd.to_datetime(data['timestamp']).dt.date - daily_stats = data.groupby('date').sum() - - # Create trend chart - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - daily_stats.plot(ax=ax, marker='o', linewidth=2) - ax.set_title('Daily Metrics Trends', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Count', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - plt.tight_layout() - - plt.savefig('/tmp/gh-aw/python/charts/daily_metrics_trend.png', - dpi=300, bbox_inches='tight', facecolor='white') - - print(f"Chart saved. Total data points: {len(data)}") - ``` - - ### Pattern 2: Moving Averages and Smoothing - - ```python - # Calculate 7-day moving average - df['rolling_avg'] = df['value'].rolling(window=7, min_periods=1).mean() - - # Plot with trend line - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(df['date'], df['value'], label='Actual', alpha=0.5, marker='o') - ax.plot(df['date'], df['rolling_avg'], label='7-day Average', linewidth=2.5) - ax.fill_between(df['date'], df['value'], df['rolling_avg'], alpha=0.2) - ``` - - ### Pattern 3: Comparative Trends - - ```python - # Compare multiple metrics over time - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - for metric in ['metric_a', 'metric_b', 'metric_c']: - metric_data = df[df['metric'] == metric] - ax.plot(metric_data['timestamp'], metric_data['value'], - marker='o', label=metric, linewidth=2) - - ax.set_title('Comparative Metrics Trends', fontsize=16, fontweight='bold') - ax.legend(loc='best', fontsize=12) - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ## Best Practices for Cache-Memory Trending - - ### 1. Use JSON Lines Format - - JSON Lines (`.jsonl`) is ideal for append-only trending data: - - One JSON object per line - - Easy to append new data - - Efficient for time-series data - - Simple to load with pandas: `pd.read_json(file, lines=True)` - - ### 2. Include Metadata - - Store metadata alongside data: - ```json { - "metric_name": "issue_resolution_time", - "unit": "hours", - "description": "Average time to close issues", - "started_tracking": "2024-01-01", - "updated": "2024-03-15" - } - ``` - - ### 3. Maintain Index - - Keep an index of all tracked metrics: - ```json - { - "metrics": [ - "issue_count", - "pr_count", - "commit_count", - "test_coverage" - ], - "last_updated": "2024-03-15T10:30:00Z" - } - ``` - - ### 4. Data Retention Strategy - - Implement retention policies to prevent unbounded growth: - ```python - # Keep only last 90 days - cutoff_date = datetime.now() - timedelta(days=90) - df = df[df['timestamp'] >= cutoff_date] - - # Save pruned data - df.to_json('/tmp/gh-aw/cache-memory/trending/history.jsonl', - orient='records', lines=True) - ``` - - ## Complete Trending Workflow Example - - ```python - #!/usr/bin/env python3 - """ - Complete trending analysis workflow - Collects data, updates history, generates trend charts - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - import json - import os - from datetime import datetime, timedelta - - # Configuration - CACHE_DIR = '/tmp/gh-aw/cache-memory/trending' - METRIC_NAME = 'github_activity' - HISTORY_FILE = f'{CACHE_DIR}/{METRIC_NAME}/history.jsonl' - CHARTS_DIR = '/tmp/gh-aw/python/charts' - - # Ensure directories exist - os.makedirs(f'{CACHE_DIR}/{METRIC_NAME}', exist_ok=True) - os.makedirs(CHARTS_DIR, exist_ok=True) - - # Collect today's data (example) - today_data = { - "timestamp": datetime.now().isoformat(), - "issues_opened": 8, - "prs_merged": 12, - "commits": 45, - "contributors": 6 - } - - # Append to history - with open(HISTORY_FILE, 'a') as f: - f.write(json.dumps(today_data) + '\n') - - # Load all historical data - df = pd.read_json(HISTORY_FILE, lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - df = df.sort_values('timestamp') - - # Aggregate by date - daily_stats = df.groupby('date').sum() - - # Generate trend chart - sns.set_style("whitegrid") - sns.set_palette("husl") - - fig, axes = plt.subplots(2, 2, figsize=(16, 12), dpi=300) - fig.suptitle('GitHub Activity Trends', fontsize=18, fontweight='bold') - - # Chart 1: Issues Opened - axes[0, 0].plot(daily_stats.index, daily_stats['issues_opened'], - marker='o', linewidth=2, color='#FF6B6B') - axes[0, 0].set_title('Issues Opened', fontsize=14) - axes[0, 0].grid(True, alpha=0.3) - - # Chart 2: PRs Merged - axes[0, 1].plot(daily_stats.index, daily_stats['prs_merged'], - marker='s', linewidth=2, color='#4ECDC4') - axes[0, 1].set_title('PRs Merged', fontsize=14) - axes[0, 1].grid(True, alpha=0.3) - - # Chart 3: Commits - axes[1, 0].plot(daily_stats.index, daily_stats['commits'], - marker='^', linewidth=2, color='#45B7D1') - axes[1, 0].set_title('Commits', fontsize=14) - axes[1, 0].grid(True, alpha=0.3) - - # Chart 4: Contributors - axes[1, 1].plot(daily_stats.index, daily_stats['contributors'], - marker='D', linewidth=2, color='#FFA07A') - axes[1, 1].set_title('Active Contributors', fontsize=14) - axes[1, 1].grid(True, alpha=0.3) - - plt.tight_layout() - plt.savefig(f'{CHARTS_DIR}/activity_trends.png', - dpi=300, bbox_inches='tight', facecolor='white') - - print(f"✅ Trend chart generated with {len(df)} data points") - print(f"📊 Chart saved to: {CHARTS_DIR}/activity_trends.png") - print(f"💾 Historical data: {HISTORY_FILE}") - ``` - - ## Integration with Asset Upload and Discussions - - After generating charts, use the safe-outputs tools to share them: - - ```markdown - ## Example Discussion with Trending Charts - - Upload each chart using the `upload asset` tool, then create a discussion: - - **Title**: "📈 Weekly Trending Analysis - [Date]" - - **Content**: - # 📈 Trending Analysis Report - - Generated on: {date} - - ## Activity Trends - - ![Activity Trends](URL_FROM_UPLOAD_ASSET) - - Analysis shows: - - Issues opened: Up 15% from last week - - PR velocity: Stable at 12 PRs/day - - Commit activity: Peak on Tuesdays and Wednesdays - - Active contributors: Growing trend (+20% this month) - - ## Data Summary - - - **Total data points**: {count} - - **Date range**: {start} to {end} - - **Tracking period**: {days} days - - --- - - *Generated using Charts with Trending shared workflow* - *Historical data stored in cache-memory for continuous tracking* - ``` - - ## Tips for Success - - 1. **Consistency**: Use same metric names across runs - 2. **Timestamps**: Always include ISO 8601 timestamps - 3. **Validation**: Check data quality before appending - 4. **Backup**: Keep metadata for data recovery - 5. **Documentation**: Comment your data schemas - 6. **Testing**: Validate charts before uploading - 7. **Cleanup**: Implement retention policies - 8. **Indexing**: Maintain metric index for discovery - - ## Common Use Cases - - ### Repository Activity Trends - ```python - # Track: commits, PRs, issues, contributors - # Frequency: Daily - # Retention: 90 days - ``` - - ### Performance Metrics Trends - ```python - # Track: build time, test coverage, bundle size - # Frequency: Per commit/PR - # Retention: 180 days - ``` - - ### Quality Metrics Trends - ```python - # Track: code complexity, test failures, security alerts - # Frequency: Weekly - # Retention: 1 year - ``` - - ### Workflow Efficiency Trends - ```python - # Track: workflow duration, token usage, success rate - # Frequency: Per run - # Retention: 30 days - ``` - - --- - - Remember: The power of trending comes from consistent data collection over time. Use cache-memory to build a rich historical dataset that reveals insights and patterns! - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - # Trends Visualization Guide - - You are an expert at creating compelling trend visualizations that reveal insights from data over time. - - ## Trending Chart Best Practices - - When generating trending charts, focus on: - - ### 1. **Time Series Excellence** - - Use line charts for continuous trends over time - - Add trend lines or moving averages to highlight patterns - - Include clear date/time labels on the x-axis - - Show confidence intervals or error bands when relevant - - ### 2. **Comparative Trends** - - Use multi-line charts to compare multiple trends - - Apply distinct colors for each series with a clear legend - - Consider using area charts for stacked trends - - Highlight key inflection points or anomalies - - ### 3. **Visual Impact** - - Use vibrant, contrasting colors to make trends stand out - - Add annotations for significant events or milestones - - Include grid lines for easier value reading - - Use appropriate scale (linear vs. logarithmic) - - ### 4. **Contextual Information** - - Show percentage changes or growth rates - - Include baseline comparisons (year-over-year, month-over-month) - - Add summary statistics (min, max, average, median) - - Highlight recent trends vs. historical patterns - - ## Example Trend Chart Types - - ### Temporal Trends - ```python - # Line chart with multiple trends - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - for column in data.columns: - ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) - ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ### Growth Rates - ```python - # Bar chart showing period-over-period growth - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) - ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') - ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) - ax.set_ylabel('Growth %', fontsize=12) - ``` - - ### Moving Averages - ```python - # Trend with moving average overlay - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) - ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) - ax.fill_between(dates, values, moving_avg, alpha=0.2) - ``` - - ## Data Preparation for Trends - - ### Time-Based Indexing - ```python - # Convert to datetime and set as index - data['date'] = pd.to_datetime(data['date']) - data.set_index('date', inplace=True) - data = data.sort_index() - ``` - - ### Resampling and Aggregation - ```python - # Resample daily data to weekly - weekly_data = data.resample('W').mean() - - # Calculate rolling statistics - data['rolling_mean'] = data['value'].rolling(window=7).mean() - data['rolling_std'] = data['value'].rolling(window=7).std() - ``` - - ### Growth Calculations - ```python - # Calculate percentage change - data['pct_change'] = data['value'].pct_change() * 100 - - # Calculate year-over-year growth - data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 - ``` - - ## Color Palettes for Trends - - Use these palettes for impactful trend visualizations: - - - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` - - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` - - **Multiple series**: `sns.color_palette("husl", n_colors=8)` - - **Categorical**: `sns.color_palette("Set2", n_colors=6)` - - ## Annotation Best Practices - - ```python - # Annotate key points - max_idx = data['value'].idxmax() - max_val = data['value'].max() - ax.annotate(f'Peak: {max_val:.2f}', - xy=(max_idx, max_val), - xytext=(10, 20), - textcoords='offset points', - arrowprops=dict(arrowstyle='->', color='red'), - fontsize=10, - fontweight='bold') - ``` - - ## Styling for Awesome Charts - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set professional style - sns.set_style("whitegrid") - sns.set_context("notebook", font_scale=1.2) - - # Custom color palette - custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] - sns.set_palette(custom_colors) - - # Figure with optimal dimensions - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - # ... your plotting code ... - - # Tight layout for clean appearance - plt.tight_layout() - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ## Tips for Trending Charts - - 1. **Start with the story**: What trend are you trying to show? - 2. **Choose the right timeframe**: Match granularity to the pattern - 3. **Smooth noise**: Use moving averages for volatile data - 4. **Show context**: Include historical baselines or benchmarks - 5. **Highlight insights**: Use annotations to draw attention - 6. **Test readability**: Ensure labels and legends are clear - 7. **Optimize colors**: Use colorblind-friendly palettes - 8. **Export high quality**: Always use DPI 300+ for presentations - - ## Common Trend Patterns to Visualize - - - **Seasonal patterns**: Monthly or quarterly cycles - - **Long-term growth**: Exponential or linear trends - - **Volatility changes**: Periods of stability vs. fluctuation - - **Correlations**: How multiple trends relate - - **Anomalies**: Outliers or unusual events - - **Forecasts**: Projected future trends with uncertainty - - Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/python-data-charts.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # Charts with Trending - Complete Guide + + This shared workflow provides everything you need to create compelling trend visualizations with persistent data storage. + + > [!TIP] + > **Quick Start Alternative** + > + > Looking for a simpler setup? Use `shared/trending-charts-simple.md` for: + > - No nested imports (standalone configuration) + > - No network restrictions (strict mode compatible) + > - Quick start examples for common trending patterns + > - Minimal configuration overhead + > + > The simplified version is perfect for basic trending needs while this comprehensive version offers advanced patterns and best practices. + + ## Cache-Memory for Trending Data + + You have access to persistent cache-memory at `/tmp/gh-aw/cache-memory/` that survives across workflow runs. Use it to store historical trending data. + + ### Trending Data Organization + + Organize your trending data in cache-memory: + + ``` + /tmp/gh-aw/cache-memory/ + ├── trending/ + │ ├── / + │ │ ├── history.jsonl # Time-series data (JSON Lines format) + │ │ ├── metadata.json # Data schema and descriptions + │ │ └── last_updated.txt # Timestamp of last update + │ └── index.json # Index of all tracked metrics + ``` + + ### Helper Functions for Trending Data + + **Load Historical Data:** + ```bash + # Check if historical data exists + if [ -f /tmp/gh-aw/cache-memory/trending/issues/history.jsonl ]; then + echo "Loading historical issue trending data..." + cp /tmp/gh-aw/cache-memory/trending/issues/history.jsonl /tmp/gh-aw/python/data/ + else + echo "No historical data found. Starting fresh." + mkdir -p /tmp/gh-aw/cache-memory/trending/issues + fi + ``` + + **Append New Data:** + ```python + import json + from datetime import datetime + + # New data point + data_point = { + "timestamp": datetime.now().isoformat(), + "metric": "issue_count", + "value": 42, + "metadata": {"source": "github_api"} + } + + # Append to history (JSON Lines format) + with open('/tmp/gh-aw/cache-memory/trending/issues/history.jsonl', 'a') as f: + f.write(json.dumps(data_point) + '\n') + ``` + + **Load All Historical Data for Analysis:** + ```python + import pandas as pd + import json + + # Load all historical data + data_points = [] + history_file = '/tmp/gh-aw/cache-memory/trending/issues/history.jsonl' + + if os.path.exists(history_file): + with open(history_file, 'r') as f: + for line in f: + data_points.append(json.loads(line)) + + # Convert to DataFrame for analysis + df = pd.DataFrame(data_points) + df['timestamp'] = pd.to_datetime(df['timestamp']) + df = df.sort_values('timestamp') + else: + df = pd.DataFrame() # Empty if no history + ``` + + ## Trending Analysis Patterns + + ### Pattern 1: Daily Metrics Tracking + + Track daily metrics and visualize trends over time: + + ```python + #!/usr/bin/env python3 + """ + Daily metrics trending example + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + import json + import os + from datetime import datetime + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load historical data + history_file = '/tmp/gh-aw/cache-memory/trending/daily_metrics/history.jsonl' + if os.path.exists(history_file): + data = pd.read_json(history_file, lines=True) + data['date'] = pd.to_datetime(data['timestamp']).dt.date + else: + data = pd.DataFrame() + + # Add today's data + today_data = { + "timestamp": datetime.now().isoformat(), + "issues_opened": 5, + "issues_closed": 3, + "prs_merged": 2 + } + + # Append to history + os.makedirs(os.path.dirname(history_file), exist_ok=True) + with open(history_file, 'a') as f: + f.write(json.dumps(today_data) + '\n') + + # Reload with today's data + data = pd.read_json(history_file, lines=True) + data['date'] = pd.to_datetime(data['timestamp']).dt.date + daily_stats = data.groupby('date').sum() + + # Create trend chart + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + daily_stats.plot(ax=ax, marker='o', linewidth=2) + ax.set_title('Daily Metrics Trends', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Count', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + plt.tight_layout() + + plt.savefig('/tmp/gh-aw/python/charts/daily_metrics_trend.png', + dpi=300, bbox_inches='tight', facecolor='white') + + print(f"Chart saved. Total data points: {len(data)}") + ``` + + ### Pattern 2: Moving Averages and Smoothing + + ```python + # Calculate 7-day moving average + df['rolling_avg'] = df['value'].rolling(window=7, min_periods=1).mean() + + # Plot with trend line + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(df['date'], df['value'], label='Actual', alpha=0.5, marker='o') + ax.plot(df['date'], df['rolling_avg'], label='7-day Average', linewidth=2.5) + ax.fill_between(df['date'], df['value'], df['rolling_avg'], alpha=0.2) + ``` + + ### Pattern 3: Comparative Trends + + ```python + # Compare multiple metrics over time + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + for metric in ['metric_a', 'metric_b', 'metric_c']: + metric_data = df[df['metric'] == metric] + ax.plot(metric_data['timestamp'], metric_data['value'], + marker='o', label=metric, linewidth=2) + + ax.set_title('Comparative Metrics Trends', fontsize=16, fontweight='bold') + ax.legend(loc='best', fontsize=12) + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ## Best Practices for Cache-Memory Trending + + ### 1. Use JSON Lines Format + + JSON Lines (`.jsonl`) is ideal for append-only trending data: + - One JSON object per line + - Easy to append new data + - Efficient for time-series data + - Simple to load with pandas: `pd.read_json(file, lines=True)` + + ### 2. Include Metadata + + Store metadata alongside data: + ```json + { + "metric_name": "issue_resolution_time", + "unit": "hours", + "description": "Average time to close issues", + "started_tracking": "2024-01-01", + "updated": "2024-03-15" + } + ``` + + ### 3. Maintain Index + + Keep an index of all tracked metrics: + ```json + { + "metrics": [ + "issue_count", + "pr_count", + "commit_count", + "test_coverage" + ], + "last_updated": "2024-03-15T10:30:00Z" + } + ``` + + ### 4. Data Retention Strategy + + Implement retention policies to prevent unbounded growth: + ```python + # Keep only last 90 days + cutoff_date = datetime.now() - timedelta(days=90) + df = df[df['timestamp'] >= cutoff_date] + + # Save pruned data + df.to_json('/tmp/gh-aw/cache-memory/trending/history.jsonl', + orient='records', lines=True) + ``` + + ## Complete Trending Workflow Example + + ```python + #!/usr/bin/env python3 + """ + Complete trending analysis workflow + Collects data, updates history, generates trend charts + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + import json + import os + from datetime import datetime, timedelta + + # Configuration + CACHE_DIR = '/tmp/gh-aw/cache-memory/trending' + METRIC_NAME = 'github_activity' + HISTORY_FILE = f'{CACHE_DIR}/{METRIC_NAME}/history.jsonl' + CHARTS_DIR = '/tmp/gh-aw/python/charts' + + # Ensure directories exist + os.makedirs(f'{CACHE_DIR}/{METRIC_NAME}', exist_ok=True) + os.makedirs(CHARTS_DIR, exist_ok=True) + + # Collect today's data (example) + today_data = { + "timestamp": datetime.now().isoformat(), + "issues_opened": 8, + "prs_merged": 12, + "commits": 45, + "contributors": 6 + } + + # Append to history + with open(HISTORY_FILE, 'a') as f: + f.write(json.dumps(today_data) + '\n') + + # Load all historical data + df = pd.read_json(HISTORY_FILE, lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + df = df.sort_values('timestamp') + + # Aggregate by date + daily_stats = df.groupby('date').sum() + + # Generate trend chart + sns.set_style("whitegrid") + sns.set_palette("husl") + + fig, axes = plt.subplots(2, 2, figsize=(16, 12), dpi=300) + fig.suptitle('GitHub Activity Trends', fontsize=18, fontweight='bold') + + # Chart 1: Issues Opened + axes[0, 0].plot(daily_stats.index, daily_stats['issues_opened'], + marker='o', linewidth=2, color='#FF6B6B') + axes[0, 0].set_title('Issues Opened', fontsize=14) + axes[0, 0].grid(True, alpha=0.3) + + # Chart 2: PRs Merged + axes[0, 1].plot(daily_stats.index, daily_stats['prs_merged'], + marker='s', linewidth=2, color='#4ECDC4') + axes[0, 1].set_title('PRs Merged', fontsize=14) + axes[0, 1].grid(True, alpha=0.3) + + # Chart 3: Commits + axes[1, 0].plot(daily_stats.index, daily_stats['commits'], + marker='^', linewidth=2, color='#45B7D1') + axes[1, 0].set_title('Commits', fontsize=14) + axes[1, 0].grid(True, alpha=0.3) + + # Chart 4: Contributors + axes[1, 1].plot(daily_stats.index, daily_stats['contributors'], + marker='D', linewidth=2, color='#FFA07A') + axes[1, 1].set_title('Active Contributors', fontsize=14) + axes[1, 1].grid(True, alpha=0.3) + + plt.tight_layout() + plt.savefig(f'{CHARTS_DIR}/activity_trends.png', + dpi=300, bbox_inches='tight', facecolor='white') + + print(f"✅ Trend chart generated with {len(df)} data points") + print(f"📊 Chart saved to: {CHARTS_DIR}/activity_trends.png") + print(f"💾 Historical data: {HISTORY_FILE}") + ``` + + ## Integration with Asset Upload and Discussions + + After generating charts, use the safe-outputs tools to share them: + + ```markdown + ## Example Discussion with Trending Charts + + Upload each chart using the `upload asset` tool, then create a discussion: + + **Title**: "📈 Weekly Trending Analysis - [Date]" + + **Content**: + # 📈 Trending Analysis Report + + Generated on: {date} + + ## Activity Trends + + ![Activity Trends](URL_FROM_UPLOAD_ASSET) + + Analysis shows: + - Issues opened: Up 15% from last week + - PR velocity: Stable at 12 PRs/day + - Commit activity: Peak on Tuesdays and Wednesdays + - Active contributors: Growing trend (+20% this month) + + ## Data Summary + + - **Total data points**: {count} + - **Date range**: {start} to {end} + - **Tracking period**: {days} days + + --- + + *Generated using Charts with Trending shared workflow* + *Historical data stored in cache-memory for continuous tracking* + ``` + + ## Tips for Success + + 1. **Consistency**: Use same metric names across runs + 2. **Timestamps**: Always include ISO 8601 timestamps + 3. **Validation**: Check data quality before appending + 4. **Backup**: Keep metadata for data recovery + 5. **Documentation**: Comment your data schemas + 6. **Testing**: Validate charts before uploading + 7. **Cleanup**: Implement retention policies + 8. **Indexing**: Maintain metric index for discovery + + ## Common Use Cases + + ### Repository Activity Trends + ```python + # Track: commits, PRs, issues, contributors + # Frequency: Daily + # Retention: 90 days + ``` + + ### Performance Metrics Trends + ```python + # Track: build time, test coverage, bundle size + # Frequency: Per commit/PR + # Retention: 180 days + ``` + + ### Quality Metrics Trends + ```python + # Track: code complexity, test failures, security alerts + # Frequency: Weekly + # Retention: 1 year + ``` + + ### Workflow Efficiency Trends + ```python + # Track: workflow duration, token usage, success rate + # Frequency: Per run + # Retention: 30 days + ``` + + --- + + Remember: The power of trending comes from consistent data collection over time. Use cache-memory to build a rich historical dataset that reveals insights and patterns! + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + PROMPT_EOF + cat << 'PROMPT_EOF' + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + # Trends Visualization Guide + + You are an expert at creating compelling trend visualizations that reveal insights from data over time. + + ## Trending Chart Best Practices + + When generating trending charts, focus on: + + ### 1. **Time Series Excellence** + - Use line charts for continuous trends over time + - Add trend lines or moving averages to highlight patterns + - Include clear date/time labels on the x-axis + - Show confidence intervals or error bands when relevant + + ### 2. **Comparative Trends** + - Use multi-line charts to compare multiple trends + - Apply distinct colors for each series with a clear legend + - Consider using area charts for stacked trends + - Highlight key inflection points or anomalies + + ### 3. **Visual Impact** + - Use vibrant, contrasting colors to make trends stand out + - Add annotations for significant events or milestones + - Include grid lines for easier value reading + - Use appropriate scale (linear vs. logarithmic) + + ### 4. **Contextual Information** + - Show percentage changes or growth rates + - Include baseline comparisons (year-over-year, month-over-month) + - Add summary statistics (min, max, average, median) + - Highlight recent trends vs. historical patterns + + ## Example Trend Chart Types + + ### Temporal Trends + ```python + # Line chart with multiple trends + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + for column in data.columns: + ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) + ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ### Growth Rates + ```python + # Bar chart showing period-over-period growth + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) + ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') + ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) + ax.set_ylabel('Growth %', fontsize=12) + ``` + + ### Moving Averages + ```python + # Trend with moving average overlay + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) + ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) + ax.fill_between(dates, values, moving_avg, alpha=0.2) + ``` + + ## Data Preparation for Trends + + ### Time-Based Indexing + ```python + # Convert to datetime and set as index + data['date'] = pd.to_datetime(data['date']) + data.set_index('date', inplace=True) + data = data.sort_index() + ``` + + ### Resampling and Aggregation + ```python + # Resample daily data to weekly + weekly_data = data.resample('W').mean() + + # Calculate rolling statistics + data['rolling_mean'] = data['value'].rolling(window=7).mean() + data['rolling_std'] = data['value'].rolling(window=7).std() + ``` + + ### Growth Calculations + ```python + # Calculate percentage change + data['pct_change'] = data['value'].pct_change() * 100 + + # Calculate year-over-year growth + data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 + ``` + + ## Color Palettes for Trends + + Use these palettes for impactful trend visualizations: + + - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` + - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` + - **Multiple series**: `sns.color_palette("husl", n_colors=8)` + - **Categorical**: `sns.color_palette("Set2", n_colors=6)` + + ## Annotation Best Practices + + ```python + # Annotate key points + max_idx = data['value'].idxmax() + max_val = data['value'].max() + ax.annotate(f'Peak: {max_val:.2f}', + xy=(max_idx, max_val), + xytext=(10, 20), + textcoords='offset points', + arrowprops=dict(arrowstyle='->', color='red'), + fontsize=10, + fontweight='bold') + ``` + + ## Styling for Awesome Charts + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set professional style + sns.set_style("whitegrid") + sns.set_context("notebook", font_scale=1.2) + + # Custom color palette + custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] + sns.set_palette(custom_colors) + + # Figure with optimal dimensions + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + # ... your plotting code ... + + # Tight layout for clean appearance + plt.tight_layout() + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ## Tips for Trending Charts + + 1. **Start with the story**: What trend are you trying to show? + 2. **Choose the right timeframe**: Match granularity to the pattern + 3. **Smooth noise**: Use moving averages for volatile data + 4. **Show context**: Include historical baselines or benchmarks + 5. **Highlight insights**: Use annotations to draw attention + 6. **Test readability**: Ensure labels and legends are clear + 7. **Optimize colors**: Use colorblind-friendly palettes + 8. **Export high quality**: Always use DPI 300+ for presentations + + ## Common Trend Patterns to Visualize + + - **Seasonal patterns**: Monthly or quarterly cycles + - **Long-term growth**: Exponential or linear trends + - **Volatility changes**: Periods of stability vs. fluctuation + - **Correlations**: How multiple trends relate + - **Anomalies**: Outliers or unusual events + - **Forecasts**: Projected future trends with uncertainty + + Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/python-data-charts.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/q.lock.yml b/.github/workflows/q.lock.yml index 55a9af4ea9..09884abdb2 100644 --- a/.github/workflows/q.lock.yml +++ b/.github/workflows/q.lock.yml @@ -628,71 +628,73 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/q.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/q.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index d2eab81c58..53409f6703 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -500,62 +500,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/release.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/release.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/repo-audit-analyzer.lock.yml b/.github/workflows/repo-audit-analyzer.lock.yml index f6b9570be7..9932617b0e 100644 --- a/.github/workflows/repo-audit-analyzer.lock.yml +++ b/.github/workflows/repo-audit-analyzer.lock.yml @@ -497,156 +497,158 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Cache Folders Available - - You have access to persistent cache folders where you can read and write files to create memories and store information: - - - **repo-audits**: `/tmp/gh-aw/cache-memory-repo-audits/` - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Persistence**: Files in these folders persist across workflow runs via GitHub Actions cache - - **Last Write Wins**: If multiple processes write to the same file, the last write will be preserved - - **File Share**: Use these as simple file shares - organize files as you see fit - - Examples of what you can store: - - `/tmp/gh-aw/cache-memory-repo-audits/notes.txt` - general notes and observations - - `/tmp/gh-aw/cache-memory-repo-audits/preferences.json` - user preferences and settings - - `/tmp/gh-aw/cache-memory-repo-audits/state/` - organized state files in subdirectories - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/repo-audit-analyzer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Cache Folders Available + + You have access to persistent cache folders where you can read and write files to create memories and store information: + + - **repo-audits**: `/tmp/gh-aw/cache-memory-repo-audits/` + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Persistence**: Files in these folders persist across workflow runs via GitHub Actions cache + - **Last Write Wins**: If multiple processes write to the same file, the last write will be preserved + - **File Share**: Use these as simple file shares - organize files as you see fit + + Examples of what you can store: + - `/tmp/gh-aw/cache-memory-repo-audits/notes.txt` - general notes and observations + - `/tmp/gh-aw/cache-memory-repo-audits/preferences.json` - user preferences and settings + - `/tmp/gh-aw/cache-memory-repo-audits/state/` - organized state files in subdirectories + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/repo-audit-analyzer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/repo-tree-map.lock.yml b/.github/workflows/repo-tree-map.lock.yml index 733386e081..7cf8cc4e8a 100644 --- a/.github/workflows/repo-tree-map.lock.yml +++ b/.github/workflows/repo-tree-map.lock.yml @@ -480,135 +480,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/repo-tree-map.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/repo-tree-map.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/repository-quality-improver.lock.yml b/.github/workflows/repository-quality-improver.lock.yml index fe08a35d86..8334981e96 100644 --- a/.github/workflows/repository-quality-improver.lock.yml +++ b/.github/workflows/repository-quality-improver.lock.yml @@ -501,156 +501,158 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Cache Folders Available - - You have access to persistent cache folders where you can read and write files to create memories and store information: - - - **focus-areas**: `/tmp/gh-aw/cache-memory-focus-areas/` - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Persistence**: Files in these folders persist across workflow runs via GitHub Actions cache - - **Last Write Wins**: If multiple processes write to the same file, the last write will be preserved - - **File Share**: Use these as simple file shares - organize files as you see fit - - Examples of what you can store: - - `/tmp/gh-aw/cache-memory-focus-areas/notes.txt` - general notes and observations - - `/tmp/gh-aw/cache-memory-focus-areas/preferences.json` - user preferences and settings - - `/tmp/gh-aw/cache-memory-focus-areas/state/` - organized state files in subdirectories - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/repository-quality-improver.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Cache Folders Available + + You have access to persistent cache folders where you can read and write files to create memories and store information: + + - **focus-areas**: `/tmp/gh-aw/cache-memory-focus-areas/` + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Persistence**: Files in these folders persist across workflow runs via GitHub Actions cache + - **Last Write Wins**: If multiple processes write to the same file, the last write will be preserved + - **File Share**: Use these as simple file shares - organize files as you see fit + + Examples of what you can store: + - `/tmp/gh-aw/cache-memory-focus-areas/notes.txt` - general notes and observations + - `/tmp/gh-aw/cache-memory-focus-areas/preferences.json` - user preferences and settings + - `/tmp/gh-aw/cache-memory-focus-areas/state/` - organized state files in subdirectories + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/repository-quality-improver.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/research.lock.yml b/.github/workflows/research.lock.yml index 96a78f6f6e..2e94a0d0a5 100644 --- a/.github/workflows/research.lock.yml +++ b/.github/workflows/research.lock.yml @@ -497,137 +497,139 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/research.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/research.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/safe-output-health.lock.yml b/.github/workflows/safe-output-health.lock.yml index b1eed47c6e..70948f4dc1 100644 --- a/.github/workflows/safe-output-health.lock.yml +++ b/.github/workflows/safe-output-health.lock.yml @@ -524,224 +524,226 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/safe-output-health.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/safe-output-health.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/schema-consistency-checker.lock.yml b/.github/workflows/schema-consistency-checker.lock.yml index 37b286ef8e..da75ab29f8 100644 --- a/.github/workflows/schema-consistency-checker.lock.yml +++ b/.github/workflows/schema-consistency-checker.lock.yml @@ -499,136 +499,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/schema-consistency-checker.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/schema-consistency-checker.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/scout.lock.yml b/.github/workflows/scout.lock.yml index 391c831c79..3cf8ecec66 100644 --- a/.github/workflows/scout.lock.yml +++ b/.github/workflows/scout.lock.yml @@ -579,235 +579,237 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - - - - - - - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/scout.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + + + + + + + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/scout.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/secret-scanning-triage.lock.yml b/.github/workflows/secret-scanning-triage.lock.yml index fa6b905673..ff745b5448 100644 --- a/.github/workflows/secret-scanning-triage.lock.yml +++ b/.github/workflows/secret-scanning-triage.lock.yml @@ -617,158 +617,160 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Locations Available - - You have access to persistent repo memory folders where you can read and write files that are stored in git branches: - - - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Git Branch Storage**: Each memory is stored in its own git branch - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/history/` - organized history files - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/secret-scanning-triage.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Locations Available + + You have access to persistent repo memory folders where you can read and write files that are stored in git branches: + + - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Git Branch Storage**: Each memory is stored in its own git branch + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/history/` - organized history files + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/secret-scanning-triage.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/security-alert-burndown.lock.yml b/.github/workflows/security-alert-burndown.lock.yml index aa9252e7d1..3724838255 100644 --- a/.github/workflows/security-alert-burndown.lock.yml +++ b/.github/workflows/security-alert-burndown.lock.yml @@ -670,62 +670,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/security-alert-burndown.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/security-alert-burndown.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/security-compliance.lock.yml b/.github/workflows/security-compliance.lock.yml index ecc332fdd6..2d79c9aa2d 100644 --- a/.github/workflows/security-compliance.lock.yml +++ b/.github/workflows/security-compliance.lock.yml @@ -512,87 +512,89 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/campaigns` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: memory/campaigns/security-compliance-*/** - - **Max File Size**: 10240 bytes (0.01 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/security-compliance.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/campaigns` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: memory/campaigns/security-compliance-*/** + - **Max File Size**: 10240 bytes (0.01 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/security-compliance.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/security-fix-pr.lock.yml b/.github/workflows/security-fix-pr.lock.yml index 8fe067d9ef..3b0e99414f 100644 --- a/.github/workflows/security-fix-pr.lock.yml +++ b/.github/workflows/security-fix-pr.lock.yml @@ -515,85 +515,87 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Locations Available - - You have access to persistent repo memory folders where you can read and write files that are stored in git branches: - - - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) - - - **Read/Write Access**: You can freely read from and write to any files in these folders - - **Git Branch Storage**: Each memory is stored in its own git branch - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/history/` - organized history files - - Feel free to create, read, update, and organize files in these folders as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/security-fix-pr.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Locations Available + + You have access to persistent repo memory folders where you can read and write files that are stored in git branches: + + - **campaigns**: `/tmp/gh-aw/repo-memory/campaigns/` (branch: `memory/campaigns`) + + - **Read/Write Access**: You can freely read from and write to any files in these folders + - **Git Branch Storage**: Each memory is stored in its own git branch + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/history/` - organized history files + + Feel free to create, read, update, and organize files in these folders as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/security-fix-pr.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/security-guard.lock.yml b/.github/workflows/security-guard.lock.yml index d1f26ec43d..8bc5a456ff 100644 --- a/.github/workflows/security-guard.lock.yml +++ b/.github/workflows/security-guard.lock.yml @@ -463,62 +463,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/security-guard.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/security-guard.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/security-review.lock.yml b/.github/workflows/security-review.lock.yml index 3f3c3c0ee0..8dc5bd8a46 100644 --- a/.github/workflows/security-review.lock.yml +++ b/.github/workflows/security-review.lock.yml @@ -619,66 +619,68 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/security-review.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/security-review.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/semantic-function-refactor.lock.yml b/.github/workflows/semantic-function-refactor.lock.yml index 586745d71c..2c9888fc5c 100644 --- a/.github/workflows/semantic-function-refactor.lock.yml +++ b/.github/workflows/semantic-function-refactor.lock.yml @@ -543,135 +543,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/semantic-function-refactor.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/semantic-function-refactor.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/sergo.lock.yml b/.github/workflows/sergo.lock.yml index 8dd7fca362..0b086fc6ab 100644 --- a/.github/workflows/sergo.lock.yml +++ b/.github/workflows/sergo.lock.yml @@ -512,136 +512,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/sergo.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/sergo.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/slide-deck-maintainer.lock.yml b/.github/workflows/slide-deck-maintainer.lock.yml index 16c6451ef0..f766b49c6a 100644 --- a/.github/workflows/slide-deck-maintainer.lock.yml +++ b/.github/workflows/slide-deck-maintainer.lock.yml @@ -522,64 +522,66 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/slide-deck-maintainer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/slide-deck-maintainer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/smoke-claude.lock.yml b/.github/workflows/smoke-claude.lock.yml index 907af27a5a..f5e2862f89 100644 --- a/.github/workflows/smoke-claude.lock.yml +++ b/.github/workflows/smoke-claude.lock.yml @@ -1241,290 +1241,292 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## MCP Response Size Limits - - MCP tool responses have a **25,000 token limit**. When GitHub API responses exceed this limit, workflows must retry with pagination parameters, wasting turns and tokens. - - ### Common Scenarios - - **Problem**: Fetching large result sets without pagination - - `list_pull_requests` with many PRs (75,897 tokens in one case) - - `pull_request_read` with large diff/comments (31,675 tokens observed) - - `search_issues`, `search_code` with many results - - **Solution**: Use proactive pagination to stay under token limits - - ### Pagination Best Practices - - #### 1. Use `perPage` Parameter - - Limit results per request to prevent oversized responses: - - ```bash - # Good: Fetch PRs in small batches - list_pull_requests --perPage 10 - - # Good: Get issue with limited comments - issue_read --method get_comments --perPage 20 - - # Bad: Default pagination may return too much data - list_pull_requests # May exceed 25k tokens - ``` - - #### 2. Common `perPage` Values - - - **10-20**: For detailed items (PRs with diffs, issues with comments) - - **50-100**: For simpler list operations (commits, branches, labels) - - **1-5**: For exploratory queries or schema discovery - - #### 3. Handle Pagination Loops - - When you need all results: - - ```bash - # Step 1: Fetch first page - result=$(list_pull_requests --perPage 20 --page 1) - - # Step 2: Check if more pages exist - # Most list operations return metadata about total count or next page - - # Step 3: Fetch subsequent pages if needed - result=$(list_pull_requests --perPage 20 --page 2) - ``` - - ### Tool-Specific Guidance - - #### Pull Requests - - ```bash - # Fetch recent PRs in small batches - list_pull_requests --state all --perPage 10 --sort updated --direction desc - - # Get PR details without full diff/comments - pull_request_read --method get --pullNumber 123 - - # Get PR files separately if needed - pull_request_read --method get_files --pullNumber 123 --perPage 30 - ``` - - #### Issues - - ```bash - # List issues with pagination - list_issues --perPage 20 --page 1 - - # Get issue comments in batches - issue_read --method get_comments --issue_number 123 --perPage 20 - ``` - - #### Code Search - - ```bash - # Search with limited results - search_code --query "function language:go" --perPage 10 - ``` - - ### Error Messages to Watch For - - If you see these errors, add pagination: - - - `MCP tool "list_pull_requests" response (75897 tokens) exceeds maximum allowed tokens (25000)` - - `MCP tool "pull_request_read" response (31675 tokens) exceeds maximum allowed tokens (25000)` - - `Response too large for tool [tool_name]` - - ### Performance Tips - - 1. **Start small**: Use `perPage: 10` initially, increase if needed - 2. **Fetch incrementally**: Get overview first, then details for specific items - 3. **Avoid wildcards**: Don't fetch all data when you need specific items - 4. **Use filters**: Combine `perPage` with state/label/date filters to reduce results - - ### Example Workflow Pattern - - ```markdown - # Analyze Recent Pull Requests - - 1. Fetch 10 most recent PRs (stay under token limit) - 2. For each PR, get summary without full diff - 3. If detailed analysis needed, fetch files for specific PR separately - 4. Process results incrementally rather than loading everything at once - ``` - - This proactive approach eliminates retry loops and reduces token consumption. - - **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. - - **Correct**: - ``` - Use the safeinputs-gh tool with args: "pr list --limit 5" - Use the safeinputs-gh tool with args: "issue view 123" - ``` - - **Incorrect**: - ``` - Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) - Run: gh pr list --limit 5 ❌ (No authentication in bash) - Execute bash: gh issue view 123 ❌ (No authentication in bash) - ``` - - - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - **IMPORTANT**: Always use the `safeinputs-go` and `safeinputs-make` tools for Go and Make commands instead of running them directly via bash. These safe-input tools provide consistent execution and proper logging. - - **Correct**: - ``` - Use the safeinputs-go tool with args: "test ./..." - Use the safeinputs-make tool with args: "build" - Use the safeinputs-make tool with args: "lint" - Use the safeinputs-make tool with args: "test-unit" - ``` - - **Incorrect**: - ``` - Use the go safe-input tool with args: "test ./..." ❌ (Wrong tool name - use safeinputs-go) - Run: go test ./... ❌ (Use safeinputs-go instead) - Execute bash: make build ❌ (Use safeinputs-make instead) - ``` - - - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/smoke-claude.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## MCP Response Size Limits + + MCP tool responses have a **25,000 token limit**. When GitHub API responses exceed this limit, workflows must retry with pagination parameters, wasting turns and tokens. + + ### Common Scenarios + + **Problem**: Fetching large result sets without pagination + - `list_pull_requests` with many PRs (75,897 tokens in one case) + - `pull_request_read` with large diff/comments (31,675 tokens observed) + - `search_issues`, `search_code` with many results + + **Solution**: Use proactive pagination to stay under token limits + + ### Pagination Best Practices + + #### 1. Use `perPage` Parameter + + Limit results per request to prevent oversized responses: + + ```bash + # Good: Fetch PRs in small batches + list_pull_requests --perPage 10 + + # Good: Get issue with limited comments + issue_read --method get_comments --perPage 20 + + # Bad: Default pagination may return too much data + list_pull_requests # May exceed 25k tokens + ``` + + #### 2. Common `perPage` Values + + - **10-20**: For detailed items (PRs with diffs, issues with comments) + - **50-100**: For simpler list operations (commits, branches, labels) + - **1-5**: For exploratory queries or schema discovery + + #### 3. Handle Pagination Loops + + When you need all results: + + ```bash + # Step 1: Fetch first page + result=$(list_pull_requests --perPage 20 --page 1) + + # Step 2: Check if more pages exist + # Most list operations return metadata about total count or next page + + # Step 3: Fetch subsequent pages if needed + result=$(list_pull_requests --perPage 20 --page 2) + ``` + + ### Tool-Specific Guidance + + #### Pull Requests + + ```bash + # Fetch recent PRs in small batches + list_pull_requests --state all --perPage 10 --sort updated --direction desc + + # Get PR details without full diff/comments + pull_request_read --method get --pullNumber 123 + + # Get PR files separately if needed + pull_request_read --method get_files --pullNumber 123 --perPage 30 + ``` + + #### Issues + + ```bash + # List issues with pagination + list_issues --perPage 20 --page 1 + + # Get issue comments in batches + issue_read --method get_comments --issue_number 123 --perPage 20 + ``` + + #### Code Search + + ```bash + # Search with limited results + search_code --query "function language:go" --perPage 10 + ``` + + ### Error Messages to Watch For + + If you see these errors, add pagination: + + - `MCP tool "list_pull_requests" response (75897 tokens) exceeds maximum allowed tokens (25000)` + - `MCP tool "pull_request_read" response (31675 tokens) exceeds maximum allowed tokens (25000)` + - `Response too large for tool [tool_name]` + + ### Performance Tips + + 1. **Start small**: Use `perPage: 10` initially, increase if needed + 2. **Fetch incrementally**: Get overview first, then details for specific items + 3. **Avoid wildcards**: Don't fetch all data when you need specific items + 4. **Use filters**: Combine `perPage` with state/label/date filters to reduce results + + ### Example Workflow Pattern + + ```markdown + # Analyze Recent Pull Requests + + 1. Fetch 10 most recent PRs (stay under token limit) + 2. For each PR, get summary without full diff + 3. If detailed analysis needed, fetch files for specific PR separately + 4. Process results incrementally rather than loading everything at once + ``` + + This proactive approach eliminates retry loops and reduces token consumption. + + **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. + + **Correct**: + ``` + Use the safeinputs-gh tool with args: "pr list --limit 5" + Use the safeinputs-gh tool with args: "issue view 123" + ``` + + **Incorrect**: + ``` + Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) + Run: gh pr list --limit 5 ❌ (No authentication in bash) + Execute bash: gh issue view 123 ❌ (No authentication in bash) + ``` + + + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + **IMPORTANT**: Always use the `safeinputs-go` and `safeinputs-make` tools for Go and Make commands instead of running them directly via bash. These safe-input tools provide consistent execution and proper logging. + + **Correct**: + ``` + Use the safeinputs-go tool with args: "test ./..." + Use the safeinputs-make tool with args: "build" + Use the safeinputs-make tool with args: "lint" + Use the safeinputs-make tool with args: "test-unit" + ``` + + **Incorrect**: + ``` + Use the go safe-input tool with args: "test ./..." ❌ (Wrong tool name - use safeinputs-go) + Run: go test ./... ❌ (Use safeinputs-go instead) + Execute bash: make build ❌ (Use safeinputs-make instead) + ``` + + + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/smoke-claude.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/smoke-codex.lock.yml b/.github/workflows/smoke-codex.lock.yml index 572cb09a10..241a3c5705 100644 --- a/.github/workflows/smoke-codex.lock.yml +++ b/.github/workflows/smoke-codex.lock.yml @@ -1283,158 +1283,160 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. - - **Correct**: - ``` - Use the safeinputs-gh tool with args: "pr list --limit 5" - Use the safeinputs-gh tool with args: "issue view 123" - ``` - - **Incorrect**: - ``` - Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) - Run: gh pr list --limit 5 ❌ (No authentication in bash) - Execute bash: gh issue view 123 ❌ (No authentication in bash) - ``` - - - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/smoke-codex.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. + + **Correct**: + ``` + Use the safeinputs-gh tool with args: "pr list --limit 5" + Use the safeinputs-gh tool with args: "issue view 123" + ``` + + **Incorrect**: + ``` + Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) + Run: gh pr list --limit 5 ❌ (No authentication in bash) + Execute bash: gh issue view 123 ❌ (No authentication in bash) + ``` + + + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/smoke-codex.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/smoke-copilot.lock.yml b/.github/workflows/smoke-copilot.lock.yml index b2c7c49518..6f3faaa898 100644 --- a/.github/workflows/smoke-copilot.lock.yml +++ b/.github/workflows/smoke-copilot.lock.yml @@ -1228,156 +1228,158 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. - - **Correct**: - ``` - Use the safeinputs-gh tool with args: "pr list --limit 5" - Use the safeinputs-gh tool with args: "issue view 123" - ``` - - **Incorrect**: - ``` - Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) - Run: gh pr list --limit 5 ❌ (No authentication in bash) - Execute bash: gh issue view 123 ❌ (No authentication in bash) - ``` - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/smoke-copilot.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. + + **Correct**: + ``` + Use the safeinputs-gh tool with args: "pr list --limit 5" + Use the safeinputs-gh tool with args: "issue view 123" + ``` + + **Incorrect**: + ``` + Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) + Run: gh pr list --limit 5 ❌ (No authentication in bash) + Execute bash: gh issue view 123 ❌ (No authentication in bash) + ``` + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/smoke-copilot.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/smoke-opencode.lock.yml b/.github/workflows/smoke-opencode.lock.yml index a2d4eb3ed9..2c05ae6761 100644 --- a/.github/workflows/smoke-opencode.lock.yml +++ b/.github/workflows/smoke-opencode.lock.yml @@ -1100,86 +1100,88 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. - - **Correct**: - ``` - Use the safeinputs-gh tool with args: "pr list --limit 5" - Use the safeinputs-gh tool with args: "issue view 123" - ``` - - **Incorrect**: - ``` - Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) - Run: gh pr list --limit 5 ❌ (No authentication in bash) - Execute bash: gh issue view 123 ❌ (No authentication in bash) - ``` - - - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/smoke-opencode.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. + + **Correct**: + ``` + Use the safeinputs-gh tool with args: "pr list --limit 5" + Use the safeinputs-gh tool with args: "issue view 123" + ``` + + **Incorrect**: + ``` + Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) + Run: gh pr list --limit 5 ❌ (No authentication in bash) + Execute bash: gh issue view 123 ❌ (No authentication in bash) + ``` + + + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/smoke-opencode.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/smoke-project.lock.yml b/.github/workflows/smoke-project.lock.yml index be4cb677d4..e5553c85c5 100644 --- a/.github/workflows/smoke-project.lock.yml +++ b/.github/workflows/smoke-project.lock.yml @@ -991,152 +991,154 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. - - **Correct**: - ``` - Use the safeinputs-gh tool with args: "pr list --limit 5" - Use the safeinputs-gh tool with args: "issue view 123" - ``` - - **Incorrect**: - ``` - Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) - Run: gh pr list --limit 5 ❌ (No authentication in bash) - Execute bash: gh issue view 123 ❌ (No authentication in bash) - ``` - - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/smoke-project.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + **IMPORTANT**: Always use the `safeinputs-gh` tool for GitHub CLI commands instead of running `gh` directly via bash. The `safeinputs-gh` tool has proper authentication configured with `GITHUB_TOKEN`, while bash commands do not have GitHub CLI authentication by default. + + **Correct**: + ``` + Use the safeinputs-gh tool with args: "pr list --limit 5" + Use the safeinputs-gh tool with args: "issue view 123" + ``` + + **Incorrect**: + ``` + Use the gh safe-input tool with args: "pr list --limit 5" ❌ (Wrong tool name - use safeinputs-gh) + Run: gh pr list --limit 5 ❌ (No authentication in bash) + Execute bash: gh issue view 123 ❌ (No authentication in bash) + ``` + + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/smoke-project.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/smoke-test-tools.lock.yml b/.github/workflows/smoke-test-tools.lock.yml index 399d7c29e0..0426826498 100644 --- a/.github/workflows/smoke-test-tools.lock.yml +++ b/.github/workflows/smoke-test-tools.lock.yml @@ -489,62 +489,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/smoke-test-tools.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/smoke-test-tools.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/stale-repo-identifier.lock.yml b/.github/workflows/stale-repo-identifier.lock.yml index e0997281cc..08ae46c2f6 100644 --- a/.github/workflows/stale-repo-identifier.lock.yml +++ b/.github/workflows/stale-repo-identifier.lock.yml @@ -601,442 +601,444 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - ## jqschema - JSON Schema Discovery - - A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. - - ### Purpose - - Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: - - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - - Exploring API responses with large payloads - - Understanding the structure of unfamiliar data without verbose output - - Planning queries before fetching full data - - ### Usage - - ```bash - # Analyze a file - cat data.json | /tmp/gh-aw/jqschema.sh - - # Analyze command output - echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh - - # Analyze GitHub search results - gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh - ``` - - ### How It Works - - The script transforms JSON data by: - 1. Replacing object values with their type names ("string", "number", "boolean", "null") - 2. Reducing arrays to their first element's structure (or empty array if empty) - 3. Recursively processing nested structures - 4. Outputting compact (minified) JSON - - ### Example - - **Input:** - ```json { - "total_count": 1000, - "items": [ - {"login": "user1", "id": 123, "verified": true}, - {"login": "user2", "id": 456, "verified": false} - ] - } - ``` - - **Output:** - ```json - {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} - ``` - - ### Best Practices - - **Use this script when:** - - You need to understand the structure of tool outputs before requesting full data - - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) - - Exploring unfamiliar APIs or data structures - - Planning data extraction strategies - - **Example workflow for GitHub search tools:** - ```bash - # Step 1: Get schema with minimal data (fetch just 1 result) - # This helps understand the structure before requesting large datasets - echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh - - # Output shows the schema: - # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} - - # Step 2: Review schema to understand available fields - - # Step 3: Request full data with confidence about structure - # Now you know what fields are available and can query efficiently - ``` - - **Using with GitHub MCP tools:** - When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: - ```bash - # Save a minimal search result to a file - gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json - - # Generate schema to understand structure - cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh - - # Now you know which fields exist and can use them in your analysis - ``` - - # Python Environment Ready - - Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy - Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` - - ## Store Historical Data (JSON Lines) - - ```python - import json - from datetime import datetime - - # Append data point - with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: - f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') - ``` - - ## Generate Charts - - ```python - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - df = pd.read_json('history.jsonl', lines=True) - df['date'] = pd.to_datetime(df['timestamp']).dt.date - - sns.set_style("whitegrid") - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - df.groupby('date')['value'].mean().plot(ax=ax, marker='o') - ax.set_title('Trend', fontsize=16, fontweight='bold') - plt.xticks(rotation=45) - plt.tight_layout() - plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') - ``` - - ## Best Practices - - - Use JSON Lines (`.jsonl`) for append-only storage - - Include ISO 8601 timestamps in all data points - - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` - - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/stale-repo-identifier.md}} - PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + ## jqschema - JSON Schema Discovery + + A utility script is available at `/tmp/gh-aw/jqschema.sh` to help you discover the structure of complex JSON responses. + + ### Purpose + + Generate a compact structural schema (keys + types) from JSON input. This is particularly useful when: + - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) + - Exploring API responses with large payloads + - Understanding the structure of unfamiliar data without verbose output + - Planning queries before fetching full data + + ### Usage + + ```bash + # Analyze a file + cat data.json | /tmp/gh-aw/jqschema.sh + + # Analyze command output + echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | /tmp/gh-aw/jqschema.sh + + # Analyze GitHub search results + gh api search/repositories?q=language:go | /tmp/gh-aw/jqschema.sh + ``` + + ### How It Works + + The script transforms JSON data by: + 1. Replacing object values with their type names ("string", "number", "boolean", "null") + 2. Reducing arrays to their first element's structure (or empty array if empty) + 3. Recursively processing nested structures + 4. Outputting compact (minified) JSON + + ### Example + + **Input:** + ```json + { + "total_count": 1000, + "items": [ + {"login": "user1", "id": 123, "verified": true}, + {"login": "user2", "id": 456, "verified": false} + ] + } + ``` + + **Output:** + ```json + {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} + ``` + + ### Best Practices + + **Use this script when:** + - You need to understand the structure of tool outputs before requesting full data + - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first) + - Exploring unfamiliar APIs or data structures + - Planning data extraction strategies + + **Example workflow for GitHub search tools:** + ```bash + # Step 1: Get schema with minimal data (fetch just 1 result) + # This helps understand the structure before requesting large datasets + echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | /tmp/gh-aw/jqschema.sh + + # Output shows the schema: + # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"} + + # Step 2: Review schema to understand available fields + + # Step 3: Request full data with confidence about structure + # Now you know what fields are available and can query efficiently + ``` + + **Using with GitHub MCP tools:** + When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields: + ```bash + # Save a minimal search result to a file + gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json + + # Generate schema to understand structure + cat /tmp/sample.json | /tmp/gh-aw/jqschema.sh + + # Now you know which fields exist and can use them in your analysis + ``` + + # Python Environment Ready + + Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy + Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/` + + ## Store Historical Data (JSON Lines) + + ```python + import json + from datetime import datetime + + # Append data point + with open('/tmp/gh-aw/cache-memory/trending//history.jsonl', 'a') as f: + f.write(json.dumps({"timestamp": datetime.now().isoformat(), "value": 42}) + '\n') + ``` + + ## Generate Charts + + ```python + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + df = pd.read_json('history.jsonl', lines=True) + df['date'] = pd.to_datetime(df['timestamp']).dt.date + + sns.set_style("whitegrid") + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + df.groupby('date')['value'].mean().plot(ax=ax, marker='o') + ax.set_title('Trend', fontsize=16, fontweight='bold') + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig('/tmp/gh-aw/python/charts/trend.png', dpi=300, bbox_inches='tight') + ``` + + ## Best Practices + + - Use JSON Lines (`.jsonl`) for append-only storage + - Include ISO 8601 timestamps in all data points + - Implement 90-day retention: `df[df['timestamp'] >= cutoff_date]` + - Charts: 300 DPI, 12x7 inches, clear labels, seaborn style + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/stale-repo-identifier.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/static-analysis-report.lock.yml b/.github/workflows/static-analysis-report.lock.yml index 0b0312054e..e3273899b3 100644 --- a/.github/workflows/static-analysis-report.lock.yml +++ b/.github/workflows/static-analysis-report.lock.yml @@ -523,138 +523,140 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/static-analysis-report.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + + + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/static-analysis-report.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/step-name-alignment.lock.yml b/.github/workflows/step-name-alignment.lock.yml index 1ce92c0004..d5f1e6c23a 100644 --- a/.github/workflows/step-name-alignment.lock.yml +++ b/.github/workflows/step-name-alignment.lock.yml @@ -512,63 +512,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/step-name-alignment.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/step-name-alignment.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/sub-issue-closer.lock.yml b/.github/workflows/sub-issue-closer.lock.yml index 4a849483a3..a9a361aab3 100644 --- a/.github/workflows/sub-issue-closer.lock.yml +++ b/.github/workflows/sub-issue-closer.lock.yml @@ -548,62 +548,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/sub-issue-closer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/sub-issue-closer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/super-linter.lock.yml b/.github/workflows/super-linter.lock.yml index 381522e205..b2c067bdb3 100644 --- a/.github/workflows/super-linter.lock.yml +++ b/.github/workflows/super-linter.lock.yml @@ -520,136 +520,138 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/super-linter.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/super-linter.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/technical-doc-writer.lock.yml b/.github/workflows/technical-doc-writer.lock.yml index ec0d559839..f2848917a6 100644 --- a/.github/workflows/technical-doc-writer.lock.yml +++ b/.github/workflows/technical-doc-writer.lock.yml @@ -596,342 +596,545 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ### Documentation - - The documentation for this project is available in the `docs/` directory. It uses GitHub-flavored markdown with Astro Starlight for rendering and follows the Diátaxis framework for systematic documentation. - - ## Diátaxis Framework - - Documentation must be organized into four distinct types, each serving a specific purpose: - - ### 1. Tutorials (Learning-Oriented) - **Purpose**: Guide beginners through achieving a specific outcome to build confidence. - - - Start with what the user will build or achieve - - Provide a clear, step-by-step path from start to finish - - Include concrete examples and working code - - Assume minimal prior knowledge - - Focus on the happy path (avoid edge cases and alternatives) - - End with a working result the user can see and use - - Use imperative mood: "Create a file", "Run the command" - - **Avoid**: Explaining concepts in depth, multiple options, troubleshooting - - ### 2. How-to Guides (Goal-Oriented) - **Purpose**: Show how to solve a specific real-world problem or accomplish a particular task. - - - Title format: "How to [accomplish specific goal]" - - Assume the user knows the basics - - Focus on practical steps to solve one problem - - Include necessary context but stay focused - - Show multiple approaches only when genuinely useful - - End when the goal is achieved - - Use imperative mood: "Configure the setting", "Add the following" - - **Avoid**: Teaching fundamentals, explaining every detail, being exhaustive - - ### 3. Reference (Information-Oriented) - **Purpose**: Provide accurate, complete technical descriptions of the system. - - - Organized by structure (CLI commands, configuration options, API endpoints) - - Comprehensive and authoritative - - Consistent format across all entries - - Technical accuracy is paramount - - Include all parameters, options, and return values - - Use descriptive mood: "The command accepts", "Returns a string" - - Minimal narrative or explanation - - **Avoid**: Instructions, tutorials, opinions on usage - - ### 4. Explanation (Understanding-Oriented) - **Purpose**: Clarify and illuminate topics to deepen understanding. - - - Discuss why things are the way they are - - Explain design decisions and tradeoffs - - Provide context and background - - Connect concepts to help form mental models - - Discuss alternatives and their implications - - Use indicative mood: "This approach provides", "The engine uses" - - **Avoid**: Step-by-step instructions, exhaustive reference material - - ## General Style Guidelines - - - **Tone**: Neutral, technical, not promotional - - **Voice**: Avoid "we", "our", "us" (use "the tool", "this command") - - **Headings**: Use markdown heading syntax, not bold text as headings - - **Lists**: Avoid long bullet point lists; prefer prose with structure - - **Code samples**: Minimal and focused; exclude optional fields unless relevant - - **Language tag**: Use `aw` for agentic workflow snippets with YAML frontmatter - - **Example workflow code block**: - ```aw wrap - on: push - # Your workflow steps here - ``` - - ## GitHub-Flavored Markdown Syntax - - Documentation files use GitHub-flavored markdown with Astro Starlight for rendering. Key syntax elements: - - ### Frontmatter - Every documentation page must have frontmatter: - ```markdown - title: Page Title - description: Brief description for SEO and navigation - ``` - - ### GitHub Alerts - Use GitHub's alert syntax for notes, tips, warnings, and cautions: - ```markdown - > [!NOTE] - > Important information the reader should notice. - - > [!TIP] - > Helpful advice for the reader. - - > [!WARNING] - > Warning about potential issues or pitfalls. - - > [!CAUTION] - > Critical warning about dangerous operations. - - > [!IMPORTANT] - > Key information users need to know. - ``` - - ### Code Blocks - - Use syntax highlighting with language tags - - Add `title` attribute for file names: ` ```yaml title=".github/workflows/example.yml" ` - - Use `aw` language for agentic workflow files with YAML frontmatter - - Add `wrap` for line wrapping: ` ```aw wrap ` - - ### Links - - Internal links: Use relative paths between documentation pages - - External links: Open in new tab automatically - - Link text: Use descriptive text, avoid "click here" - - ### Tabs - Use tabs for showing alternatives (e.g., different languages, platforms): - ```markdown - import { Tabs, TabItem } from '@astrojs/starlight/components'; - - - - ```bash - npm install package - ``` - - - ```bash - yarn add package + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ### Documentation + + The documentation for this project is available in the `docs/` directory. It uses GitHub-flavored markdown with Astro Starlight for rendering and follows the Diátaxis framework for systematic documentation. + + ## Diátaxis Framework + + Documentation must be organized into four distinct types, each serving a specific purpose: + + ### 1. Tutorials (Learning-Oriented) + **Purpose**: Guide beginners through achieving a specific outcome to build confidence. + + - Start with what the user will build or achieve + - Provide a clear, step-by-step path from start to finish + - Include concrete examples and working code + - Assume minimal prior knowledge + - Focus on the happy path (avoid edge cases and alternatives) + - End with a working result the user can see and use + - Use imperative mood: "Create a file", "Run the command" + + **Avoid**: Explaining concepts in depth, multiple options, troubleshooting + + ### 2. How-to Guides (Goal-Oriented) + **Purpose**: Show how to solve a specific real-world problem or accomplish a particular task. + + - Title format: "How to [accomplish specific goal]" + - Assume the user knows the basics + - Focus on practical steps to solve one problem + - Include necessary context but stay focused + - Show multiple approaches only when genuinely useful + - End when the goal is achieved + - Use imperative mood: "Configure the setting", "Add the following" + + **Avoid**: Teaching fundamentals, explaining every detail, being exhaustive + + ### 3. Reference (Information-Oriented) + **Purpose**: Provide accurate, complete technical descriptions of the system. + + - Organized by structure (CLI commands, configuration options, API endpoints) + - Comprehensive and authoritative + - Consistent format across all entries + - Technical accuracy is paramount + - Include all parameters, options, and return values + - Use descriptive mood: "The command accepts", "Returns a string" + - Minimal narrative or explanation + + **Avoid**: Instructions, tutorials, opinions on usage + + ### 4. Explanation (Understanding-Oriented) + **Purpose**: Clarify and illuminate topics to deepen understanding. + + - Discuss why things are the way they are + - Explain design decisions and tradeoffs + - Provide context and background + - Connect concepts to help form mental models + - Discuss alternatives and their implications + - Use indicative mood: "This approach provides", "The engine uses" + + **Avoid**: Step-by-step instructions, exhaustive reference material + + ## General Style Guidelines + + - **Tone**: Neutral, technical, not promotional + - **Voice**: Avoid "we", "our", "us" (use "the tool", "this command") + - **Headings**: Use markdown heading syntax, not bold text as headings + - **Lists**: Avoid long bullet point lists; prefer prose with structure + - **Code samples**: Minimal and focused; exclude optional fields unless relevant + - **Language tag**: Use `aw` for agentic workflow snippets with YAML frontmatter + + **Example workflow code block**: + ```aw wrap + on: push + # Your workflow steps here + ``` + + ## GitHub-Flavored Markdown Syntax + + Documentation files use GitHub-flavored markdown with Astro Starlight for rendering. Key syntax elements: + + ### Frontmatter + Every documentation page must have frontmatter: + ```markdown + title: Page Title + description: Brief description for SEO and navigation + ``` + + ### GitHub Alerts + Use GitHub's alert syntax for notes, tips, warnings, and cautions: + ```markdown + > [!NOTE] + > Important information the reader should notice. + + > [!TIP] + > Helpful advice for the reader. + + > [!WARNING] + > Warning about potential issues or pitfalls. + + > [!CAUTION] + > Critical warning about dangerous operations. + + > [!IMPORTANT] + > Key information users need to know. + ``` + + ### Code Blocks + - Use syntax highlighting with language tags + - Add `title` attribute for file names: ` ```yaml title=".github/workflows/example.yml" ` + - Use `aw` language for agentic workflow files with YAML frontmatter + - Add `wrap` for line wrapping: ` ```aw wrap ` + + ### Links + - Internal links: Use relative paths between documentation pages + - External links: Open in new tab automatically + - Link text: Use descriptive text, avoid "click here" + + ### Tabs + Use tabs for showing alternatives (e.g., different languages, platforms): + ```markdown + import { Tabs, TabItem } from '@astrojs/starlight/components'; + + + + ```bash + npm install package + ``` + + + ```bash + yarn add package + ``` + + + ``` + + ### Cards + Use cards for navigation or highlighting multiple options: + ```markdown + import { Card, CardGrid } from '@astrojs/starlight/components'; + + + + Quick introduction to the basics. + + + Deep dive into advanced features. + + + ``` + + **Remember**: Keep components minimal. Prefer standard markdown when possible. + + ## Content to Avoid + + - "Key Features" sections + - Marketing language or selling points + - Excessive bullet points (prefer structured prose) + - Overly verbose examples with all optional parameters + - Mixing documentation types (e.g., tutorials that become reference) + + ## Avoiding Documentation Bloat + + Documentation bloat reduces clarity and makes content harder to navigate. Common types of bloat include: + + ### Types of Documentation Bloat + + 1. **Duplicate content**: Same information repeated in different sections + 2. **Excessive bullet points**: Long lists that could be condensed into prose or tables + 3. **Redundant examples**: Multiple examples showing the same concept + 4. **Verbose descriptions**: Overly wordy explanations that could be more concise + 5. **Repetitive structure**: The same "What it does" / "Why it's valuable" pattern overused + + ### Writing Concise Documentation + + When editing documentation, focus on: + + **Consolidate bullet points**: + - Convert long bullet lists into concise prose or tables + - Remove redundant points that say the same thing differently + + **Eliminate duplicates**: + - Remove repeated information + - Consolidate similar sections + + **Condense verbose text**: + - Make descriptions more direct and concise + - Remove filler words and phrases + - Keep technical accuracy while reducing word count + + **Standardize structure**: + - Reduce repetitive "What it does" / "Why it's valuable" patterns + - Use varied, natural language + + **Simplify code samples**: + - Remove unnecessary complexity from code examples + - Focus on demonstrating the core concept clearly + - Eliminate boilerplate or setup code unless essential for understanding + - Keep examples minimal yet complete + - Use realistic but simple scenarios + + ### Example: Before and After + + **Before (Bloated)**: + ```markdown + ### Tool Name + Description of the tool. + + - **What it does**: This tool does X, Y, and Z + - **Why it's valuable**: It's valuable because A, B, and C + - **How to use**: You use it by doing steps 1, 2, 3, 4, 5 + - **When to use**: Use it when you need X + - **Benefits**: Gets you benefit A, benefit B, benefit C + - **Learn more**: [Link](url) + ``` + + **After (Concise)**: + ```markdown + ### Tool Name + Description of the tool that does X, Y, and Z to achieve A, B, and C. + + Use it when you need X by following steps 1-5. [Learn more](url) + ``` + + ### Documentation Quality Guidelines + + 1. **Preserve meaning**: Never lose important information + 2. **Be surgical**: Make precise edits, don't rewrite everything + 3. **Maintain tone**: Keep the neutral, technical tone + 4. **Test locally**: Verify links and formatting are still correct + + ## Structure by File Type + + - **Getting Started**: Tutorial format + - **How-to Guides**: Goal-oriented, one task per guide + - **CLI Reference**: Reference format, complete command documentation + - **Concepts**: Explanation format, building understanding + - **API Reference**: Reference format, complete API documentation + + # Technical Documentation Writer for GitHub Actions + + You are an AI technical documentation writer that produces developer-focused documentation for a **GitHub Actions library**. + Your docs follow the **GitHub Docs voice** and use standard markdown with GitHub-flavored enhancements. + You apply user-research–backed best practices to ensure clarity, discoverability, and developer experience (DX). + + ## Core Principles + + ### Framework + - Output uses **GitHub-flavored markdown** features: + - Markdown with headings, sidebars, and TOC. + - Autogenerated navigation by directory (`getting-started/`, `guides/`, `reference/`). + - GitHub alerts (`> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!CAUTION]`) for key callouts. + - Frontmatter metadata (`title`, `description`) for each page. + + ### Style & Tone (GitHub Docs) + - Clear, concise, approachable English. + - Active voice; address reader as "you". + - Friendly, empathetic, trustworthy tone. + - Prioritize clarity over rigid grammar rules. + - Consistent terminology across all docs. + - Inclusive, globally understandable (avoid slang/idioms). + + ### Structure (Diátaxis-inspired) + - **Getting Started** → prerequisites, install, first example. + - **How-to Guides** → task-based, step-by-step workflows. + - **Reference** → full breakdown of inputs, outputs, options. + - **Concepts/FAQs** → background explanations. + + ### Developer Experience (DX) + - Runnable, copy-paste–ready code blocks. + - Prerequisites clearly listed. + - Minimal setup friction. + - Early "Hello World" example. + - Optimized headings for search. + + ## Navigation & Linking + - Sidebar auto-generated by folder structure. + - Per-page TOC built from headings. + - Descriptive internal links (`See [Getting Started](/docs/getting-started)`). + - Relative links within docs; clear labels for external references. + + ## Code Guidelines + - Use fenced code blocks with language tags: + ```yaml + name: CI + on: [push] + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: my-org/my-action@v1 ``` - - - ``` - - ### Cards - Use cards for navigation or highlighting multiple options: - ```markdown - import { Card, CardGrid } from '@astrojs/starlight/components'; - - - - Quick introduction to the basics. - - - Deep dive into advanced features. - - - ``` - - **Remember**: Keep components minimal. Prefer standard markdown when possible. - - ## Content to Avoid - - - "Key Features" sections - - Marketing language or selling points - - Excessive bullet points (prefer structured prose) - - Overly verbose examples with all optional parameters - - Mixing documentation types (e.g., tutorials that become reference) - - ## Avoiding Documentation Bloat - - Documentation bloat reduces clarity and makes content harder to navigate. Common types of bloat include: - - ### Types of Documentation Bloat - - 1. **Duplicate content**: Same information repeated in different sections - 2. **Excessive bullet points**: Long lists that could be condensed into prose or tables - 3. **Redundant examples**: Multiple examples showing the same concept - 4. **Verbose descriptions**: Overly wordy explanations that could be more concise - 5. **Repetitive structure**: The same "What it does" / "Why it's valuable" pattern overused - - ### Writing Concise Documentation - - When editing documentation, focus on: - - **Consolidate bullet points**: - - Convert long bullet lists into concise prose or tables - - Remove redundant points that say the same thing differently - - **Eliminate duplicates**: - - Remove repeated information - - Consolidate similar sections - - **Condense verbose text**: - - Make descriptions more direct and concise - - Remove filler words and phrases - - Keep technical accuracy while reducing word count - - **Standardize structure**: - - Reduce repetitive "What it does" / "Why it's valuable" patterns - - Use varied, natural language - - **Simplify code samples**: - - Remove unnecessary complexity from code examples - - Focus on demonstrating the core concept clearly - - Eliminate boilerplate or setup code unless essential for understanding - - Keep examples minimal yet complete - - Use realistic but simple scenarios - - ### Example: Before and After - - **Before (Bloated)**: - ```markdown - ### Tool Name - Description of the tool. - - - **What it does**: This tool does X, Y, and Z - - **Why it's valuable**: It's valuable because A, B, and C - - **How to use**: You use it by doing steps 1, 2, 3, 4, 5 - - **When to use**: Use it when you need X - - **Benefits**: Gets you benefit A, benefit B, benefit C - - **Learn more**: [Link](url) - ``` - - **After (Concise)**: - ```markdown - ### Tool Name - Description of the tool that does X, Y, and Z to achieve A, B, and C. - - Use it when you need X by following steps 1-5. [Learn more](url) - ``` - - ### Documentation Quality Guidelines - - 1. **Preserve meaning**: Never lose important information - 2. **Be surgical**: Make precise edits, don't rewrite everything - 3. **Maintain tone**: Keep the neutral, technical tone - 4. **Test locally**: Verify links and formatting are still correct - - ## Structure by File Type - - - **Getting Started**: Tutorial format - - **How-to Guides**: Goal-oriented, one task per guide - - **CLI Reference**: Reference format, complete command documentation - - **Concepts**: Explanation format, building understanding - - **API Reference**: Reference format, complete API documentation - - # Technical Documentation Writer for GitHub Actions - - You are an AI technical documentation writer that produces developer-focused documentation for a **GitHub Actions library**. - Your docs follow the **GitHub Docs voice** and use standard markdown with GitHub-flavored enhancements. - You apply user-research–backed best practices to ensure clarity, discoverability, and developer experience (DX). - - ## Core Principles - - ### Framework - - Output uses **GitHub-flavored markdown** features: - - Markdown with headings, sidebars, and TOC. - - Autogenerated navigation by directory (`getting-started/`, `guides/`, `reference/`). - - GitHub alerts (`> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!CAUTION]`) for key callouts. - - Frontmatter metadata (`title`, `description`) for each page. - - ### Style & Tone (GitHub Docs) - - Clear, concise, approachable English. - - Active voice; address reader as "you". - - Friendly, empathetic, trustworthy tone. - - Prioritize clarity over rigid grammar rules. - - Consistent terminology across all docs. - - Inclusive, globally understandable (avoid slang/idioms). - - ### Structure (Diátaxis-inspired) - - **Getting Started** → prerequisites, install, first example. - - **How-to Guides** → task-based, step-by-step workflows. - - **Reference** → full breakdown of inputs, outputs, options. - - **Concepts/FAQs** → background explanations. - - ### Developer Experience (DX) - - Runnable, copy-paste–ready code blocks. - - Prerequisites clearly listed. - - Minimal setup friction. - - Early "Hello World" example. - - Optimized headings for search. - - ## Navigation & Linking - - Sidebar auto-generated by folder structure. - - Per-page TOC built from headings. - - Descriptive internal links (`See [Getting Started](/docs/getting-started)`). - - Relative links within docs; clear labels for external references. - - ## Code Guidelines - - Use fenced code blocks with language tags: + - Do **not** include `$` prompts. + - Use ALL_CAPS placeholders (e.g. `USERNAME`). + - Keep lines ~60 chars wide. + - Comment out command outputs. + + ## Alerts & Callouts + Use GitHub alert syntax sparingly: + + > [!NOTE] + > This is optional context. + + > [!TIP] + > This is a recommended best practice. + + > [!WARNING] + > This step may cause irreversible changes. + + > [!CAUTION] + > This action could result in data loss. + + ## Behavior Rules + - Optimize for clarity and user goals. + - Check factual accuracy (syntax, versions). + - Maintain voice and consistency. + - Anticipate pitfalls and explain fixes empathetically. + - Use alerts only when necessary. + + ## Build and Validation Workflow + + **ALWAYS** follow this workflow before completing your work or returning to the user: + + ### 1. Build the Documentation + + Run the build command from the repository root: + ```bash + make build-docs + ``` + + This command will: + - Install dependencies if needed (via `deps-docs`) + - Run prebuild scripts (generate agent factory, build slides) + - Build the Astro documentation + - Validate internal links + - Generate search indexes + + ### 2. Review Build Output + + Check the build output for: + - **Errors**: Build failures, compilation errors + - **Warnings**: Link validation issues, deprecated features + - **Success messages**: Verify pages are built correctly + + ### 3. Fix Build Issues + + If the build fails or has warnings, fix these common issues: + + **Link validation errors:** + - Fix broken internal links (use `/gh-aw/path/to/page/` format for Astro) + - Update relative links to use correct paths + - Ensure linked pages exist + + **Frontmatter issues:** + - Ensure all `.md` files have required `title` and `description` + - Fix YAML syntax errors in frontmatter + - Verify frontmatter fields are valid + + **Markdown syntax errors:** + - Fix malformed code blocks (ensure proper language tags) + - Check for unclosed tags or brackets + - Verify proper heading hierarchy + + **Missing assets:** + - Check that referenced images exist in `docs/src/assets/` or `docs/public/` + - Fix broken image paths + - Verify asset file names match references + + **Astro/Starlight configuration:** + - Verify sidebar configuration in `astro.config.mjs` + - Check component imports and paths + - Ensure content collections are properly defined + + ### 4. Rebuild and Verify + + After fixing issues, rebuild to verify: + ```bash + make build-docs + ``` + + Check that: + - Build completes successfully without errors + - `docs/dist` directory is created and populated + - All pages are generated correctly + - Link validation passes + + ### 5. Only Return When Build Succeeds + + **Do not return to the user until:** + - ✅ `make build-docs` completes successfully without errors + - ✅ All warnings are addressed or documented + - ✅ Built documentation in `docs/dist` is verified + - ✅ Links and navigation validate correctly + + ## Available Build Commands + + Use these commands from the repository root: + + ```bash + # Install documentation dependencies (Node.js 20+ required) + make deps-docs + + # Build the documentation (recommended before completing work) + make build-docs + + # Start development server for live preview at http://localhost:4321 + make dev-docs + + # Preview built documentation with production server + make preview-docs + + # Clean documentation artifacts (dist, node_modules, .astro) + make clean-docs + ``` + + ## Build Troubleshooting Guide + + ### Common Build Errors and Solutions + + **Error: "Link validation failed"** + ``` + Solution: Check for broken internal links and fix paths + ``` + + **Error: "Missing frontmatter field"** + ``` + Solution: Add required title and description to .md files + ``` + + **Error: "Invalid markdown syntax"** + ``` + Solution: Check code blocks, headings, and frontmatter YAML + ``` + + **Error: "Module not found" or "Cannot find file"** + ``` + Solution: Verify file paths and imports are correct + ``` + + **Error: "Starlight plugin error"** + ``` + Solution: Check astro.config.mjs for configuration issues + ``` + + ### Debugging Process + + 1. **Read error messages carefully** - they usually indicate the exact issue + 2. **Check the failing file** - look at the file mentioned in the error + 3. **Fix the issue** - apply the appropriate solution + 4. **Rebuild** - run `make build-docs` again to verify + 5. **Repeat if needed** - continue until build succeeds + + ### Development Server for Testing + + Use the development server to preview changes in real-time: + ```bash + make dev-docs + ``` + + This starts Astro dev server at http://localhost:4321 with: + - Hot module reloading + - Fast refresh for instant updates + - Live error reporting + - Interactive debugging + + ## Example Document Skeleton + ```md + --- + title: Getting Started + description: Quickstart for using the GitHub Actions library + --- + + # Getting Started + + ## Prerequisites + - Node.js ≥ 20 + - GitHub account + + ## Installation + ```bash + pnpm add @my-org/github-action + ``` + + ## Quick Example ```yaml name: CI on: [push] @@ -942,217 +1145,16 @@ jobs: - uses: actions/checkout@v5 - uses: my-org/my-action@v1 ``` - - Do **not** include `$` prompts. - - Use ALL_CAPS placeholders (e.g. `USERNAME`). - - Keep lines ~60 chars wide. - - Comment out command outputs. - - ## Alerts & Callouts - Use GitHub alert syntax sparingly: - - > [!NOTE] - > This is optional context. - - > [!TIP] - > This is a recommended best practice. - - > [!WARNING] - > This step may cause irreversible changes. - - > [!CAUTION] - > This action could result in data loss. - - ## Behavior Rules - - Optimize for clarity and user goals. - - Check factual accuracy (syntax, versions). - - Maintain voice and consistency. - - Anticipate pitfalls and explain fixes empathetically. - - Use alerts only when necessary. - - ## Build and Validation Workflow - - **ALWAYS** follow this workflow before completing your work or returning to the user: - - ### 1. Build the Documentation - - Run the build command from the repository root: - ```bash - make build-docs - ``` - - This command will: - - Install dependencies if needed (via `deps-docs`) - - Run prebuild scripts (generate agent factory, build slides) - - Build the Astro documentation - - Validate internal links - - Generate search indexes - - ### 2. Review Build Output - - Check the build output for: - - **Errors**: Build failures, compilation errors - - **Warnings**: Link validation issues, deprecated features - - **Success messages**: Verify pages are built correctly - - ### 3. Fix Build Issues - - If the build fails or has warnings, fix these common issues: - - **Link validation errors:** - - Fix broken internal links (use `/gh-aw/path/to/page/` format for Astro) - - Update relative links to use correct paths - - Ensure linked pages exist - - **Frontmatter issues:** - - Ensure all `.md` files have required `title` and `description` - - Fix YAML syntax errors in frontmatter - - Verify frontmatter fields are valid - - **Markdown syntax errors:** - - Fix malformed code blocks (ensure proper language tags) - - Check for unclosed tags or brackets - - Verify proper heading hierarchy - - **Missing assets:** - - Check that referenced images exist in `docs/src/assets/` or `docs/public/` - - Fix broken image paths - - Verify asset file names match references - - **Astro/Starlight configuration:** - - Verify sidebar configuration in `astro.config.mjs` - - Check component imports and paths - - Ensure content collections are properly defined - - ### 4. Rebuild and Verify - - After fixing issues, rebuild to verify: - ```bash - make build-docs - ``` - - Check that: - - Build completes successfully without errors - - `docs/dist` directory is created and populated - - All pages are generated correctly - - Link validation passes - - ### 5. Only Return When Build Succeeds - - **Do not return to the user until:** - - ✅ `make build-docs` completes successfully without errors - - ✅ All warnings are addressed or documented - - ✅ Built documentation in `docs/dist` is verified - - ✅ Links and navigation validate correctly - - ## Available Build Commands - - Use these commands from the repository root: - - ```bash - # Install documentation dependencies (Node.js 20+ required) - make deps-docs - - # Build the documentation (recommended before completing work) - make build-docs - - # Start development server for live preview at http://localhost:4321 - make dev-docs - - # Preview built documentation with production server - make preview-docs - - # Clean documentation artifacts (dist, node_modules, .astro) - make clean-docs - ``` - - ## Build Troubleshooting Guide - - ### Common Build Errors and Solutions - - **Error: "Link validation failed"** - ``` - Solution: Check for broken internal links and fix paths - ``` - - **Error: "Missing frontmatter field"** - ``` - Solution: Add required title and description to .md files - ``` - - **Error: "Invalid markdown syntax"** - ``` - Solution: Check code blocks, headings, and frontmatter YAML - ``` - - **Error: "Module not found" or "Cannot find file"** - ``` - Solution: Verify file paths and imports are correct - ``` - - **Error: "Starlight plugin error"** - ``` - Solution: Check astro.config.mjs for configuration issues - ``` - - ### Debugging Process - - 1. **Read error messages carefully** - they usually indicate the exact issue - 2. **Check the failing file** - look at the file mentioned in the error - 3. **Fix the issue** - apply the appropriate solution - 4. **Rebuild** - run `make build-docs` again to verify - 5. **Repeat if needed** - continue until build succeeds - - ### Development Server for Testing - - Use the development server to preview changes in real-time: - ```bash - make dev-docs - ``` - - This starts Astro dev server at http://localhost:4321 with: - - Hot module reloading - - Fast refresh for instant updates - - Live error reporting - - Interactive debugging - - ## Example Document Skeleton - ```md - --- - title: Getting Started - description: Quickstart for using the GitHub Actions library - --- - - # Getting Started - - ## Prerequisites - - Node.js ≥ 20 - - GitHub account - - ## Installation - ```bash - pnpm add @my-org/github-action - ``` - - ## Quick Example - ```yaml - name: CI - on: [push] - jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: my-org/my-action@v1 - ``` - - --- - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/technical-doc-writer.md}} - PROMPT_EOF + + --- + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/technical-doc-writer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/terminal-stylist.lock.yml b/.github/workflows/terminal-stylist.lock.yml index a93d24c867..5471bfe79d 100644 --- a/.github/workflows/terminal-stylist.lock.yml +++ b/.github/workflows/terminal-stylist.lock.yml @@ -482,62 +482,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/terminal-stylist.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/terminal-stylist.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/test-create-pr-error-handling.lock.yml b/.github/workflows/test-create-pr-error-handling.lock.yml index 4ab5624809..a015f3d0c1 100644 --- a/.github/workflows/test-create-pr-error-handling.lock.yml +++ b/.github/workflows/test-create-pr-error-handling.lock.yml @@ -498,63 +498,65 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/test-create-pr-error-handling.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/test-create-pr-error-handling.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/test-dispatcher.lock.yml b/.github/workflows/test-dispatcher.lock.yml index d33e5bc6b2..35229efdf9 100644 --- a/.github/workflows/test-dispatcher.lock.yml +++ b/.github/workflows/test-dispatcher.lock.yml @@ -433,62 +433,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/test-dispatcher.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/test-dispatcher.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/test-project-url-default.lock.yml b/.github/workflows/test-project-url-default.lock.yml index 9960104114..73eac41403 100644 --- a/.github/workflows/test-project-url-default.lock.yml +++ b/.github/workflows/test-project-url-default.lock.yml @@ -676,62 +676,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/test-project-url-default.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/test-project-url-default.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/test-yaml-import.lock.yml b/.github/workflows/test-yaml-import.lock.yml index a1f80f80ed..7241d9325d 100644 --- a/.github/workflows/test-yaml-import.lock.yml +++ b/.github/workflows/test-yaml-import.lock.yml @@ -247,50 +247,52 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/test-yaml-import.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/test-yaml-import.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/tidy.lock.yml b/.github/workflows/tidy.lock.yml index 594294abb6..766ef62077 100644 --- a/.github/workflows/tidy.lock.yml +++ b/.github/workflows/tidy.lock.yml @@ -580,65 +580,67 @@ jobs: GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then - cat "/opt/gh-aw/prompts/pr_context_prompt.md" >> "$GH_AW_PROMPT" - fi - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/tidy.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "/opt/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/tidy.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/typist.lock.yml b/.github/workflows/typist.lock.yml index 5feab904a3..5be6b7be4b 100644 --- a/.github/workflows/typist.lock.yml +++ b/.github/workflows/typist.lock.yml @@ -499,135 +499,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/typist.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/typist.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/ubuntu-image-analyzer.lock.yml b/.github/workflows/ubuntu-image-analyzer.lock.yml index 3f13bdf34d..fb96e72db9 100644 --- a/.github/workflows/ubuntu-image-analyzer.lock.yml +++ b/.github/workflows/ubuntu-image-analyzer.lock.yml @@ -490,62 +490,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/ubuntu-image-analyzer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/ubuntu-image-analyzer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/unbloat-docs.lock.yml b/.github/workflows/unbloat-docs.lock.yml index ea08107dfc..77d4eb954f 100644 --- a/.github/workflows/unbloat-docs.lock.yml +++ b/.github/workflows/unbloat-docs.lock.yml @@ -629,199 +629,201 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/playwright_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - ## Starting the Documentation Preview Server - - **Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. - - Navigate to the docs directory and start the preview server in the background: - - ```bash - cd docs - npm run preview > /tmp/preview.log 2>&1 & - echo $! > /tmp/server.pid - ``` - - This will: - - Start the preview server on port 4321 - - Redirect output to `/tmp/preview.log` - - Save the process ID to `/tmp/server.pid` for later cleanup - - ## Waiting for Server Readiness - - Poll the server with curl to ensure it's ready before use: - - ```bash - for i in {1..30}; do - curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break - echo "Waiting for server... ($i/30)" && sleep 2 - done - ``` - - This will: - - Attempt to connect up to 30 times (60 seconds total) - - Wait 2 seconds between attempts - - Exit successfully when server responds - - ## Verifying Server Accessibility (Optional) - - Optionally verify the server is serving content: - - ```bash - curl -s http://localhost:4321/gh-aw/ | head -20 - ``` - - ## Stopping the Documentation Server - - After you're done using the server, clean up the process: - - ```bash - kill $(cat /tmp/server.pid) 2>/dev/null || true - rm -f /tmp/server.pid /tmp/preview.log - ``` - - This will: - - Kill the server process using the saved PID - - Remove temporary files - - Ignore errors if the process already stopped - - ## Usage Notes - - - The server runs on `http://localhost:4321` - - Documentation is accessible at `http://localhost:4321/gh-aw/` - - Always clean up the server when done to avoid orphan processes - - If the server fails to start, check `/tmp/preview.log` for errors - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/unbloat-docs.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/playwright_prompt.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + ## Starting the Documentation Preview Server + + **Context**: The documentation has been pre-built using `npm run build`. Use the preview server to serve the static build. + + Navigate to the docs directory and start the preview server in the background: + + ```bash + cd docs + npm run preview > /tmp/preview.log 2>&1 & + echo $! > /tmp/server.pid + ``` + + This will: + - Start the preview server on port 4321 + - Redirect output to `/tmp/preview.log` + - Save the process ID to `/tmp/server.pid` for later cleanup + + ## Waiting for Server Readiness + + Poll the server with curl to ensure it's ready before use: + + ```bash + for i in {1..30}; do + curl -s http://localhost:4321 > /dev/null && echo "Server ready!" && break + echo "Waiting for server... ($i/30)" && sleep 2 + done + ``` + + This will: + - Attempt to connect up to 30 times (60 seconds total) + - Wait 2 seconds between attempts + - Exit successfully when server responds + + ## Verifying Server Accessibility (Optional) + + Optionally verify the server is serving content: + + ```bash + curl -s http://localhost:4321/gh-aw/ | head -20 + ``` + + ## Stopping the Documentation Server + + After you're done using the server, clean up the process: + + ```bash + kill $(cat /tmp/server.pid) 2>/dev/null || true + rm -f /tmp/server.pid /tmp/preview.log + ``` + + This will: + - Kill the server process using the saved PID + - Remove temporary files + - Ignore errors if the process already stopped + + ## Usage Notes + + - The server runs on `http://localhost:4321` + - Documentation is accessible at `http://localhost:4321/gh-aw/` + - Always clean up the server when done to avoid orphan processes + - If the server fails to start, check `/tmp/preview.log` for errors + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/unbloat-docs.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/video-analyzer.lock.yml b/.github/workflows/video-analyzer.lock.yml index 56e66ad9eb..c0d66474b6 100644 --- a/.github/workflows/video-analyzer.lock.yml +++ b/.github/workflows/video-analyzer.lock.yml @@ -511,194 +511,196 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - # FFmpeg Usage Guide - - FFmpeg and ffprobe have been installed and are available in your PATH. A temporary folder `/tmp/gh-aw/ffmpeg` is available for caching intermediate results. - - **Note**: FFmpeg operations can take several minutes for large video files. Bash commands have a 5-minute timeout. For longer operations, break them into smaller steps or increase workflow timeout-minutes. - - ## Common FFmpeg Operations - - ### Extract Audio from Video - - ```bash - # Extract audio as MP3 with high quality - ffmpeg -i input.mp4 -vn -acodec libmp3lame -ab 192k output.mp3 - - # Extract audio for transcription (optimized for speech-to-text) - # Uses Opus codec with mono channel and low bitrate for optimal transcription - ffmpeg -i input.mp4 -vn -acodec libopus -ac 1 -ab 12k -application voip -map_metadata -1 -f ogg output.ogg - ``` - - **Key flags:** - - `-vn`: No video output - - `-acodec`: Audio codec (libmp3lame, pcm_s16le, aac, libopus) - - `-ab`: Audio bitrate (128k, 192k, 256k, 320k, or 12k for transcription) - - `-ac`: Audio channels (1 for mono, 2 for stereo) - - `-application voip`: Optimize Opus for voice (for transcription) - - `-map_metadata -1`: Remove metadata - - **For transcription:** - - Use `libopus` codec with OGG format - - Mono channel (`-ac 1`) is sufficient for speech - - Low bitrate (12k) keeps file size small - - `-application voip` optimizes for voice - - ### Extract Video Frames - - ```bash - # Extract all keyframes (I-frames) - ffmpeg -i input.mp4 -vf "select='eq(pict_type,I)'" -fps_mode vfr -frame_pts 1 keyframe_%06d.jpg - - # Extract frames at specific interval (e.g., 1 frame per second) - ffmpeg -i input.mp4 -vf "fps=1" frame_%06d.jpg - - # Extract single frame at specific timestamp - ffmpeg -i input.mp4 -ss 00:00:05 -frames:v 1 frame.jpg - ``` - - **Key flags:** - - `-vf`: Video filter - - `-fps_mode vfr`: Variable frame rate (for keyframes) - - `-frame_pts 1`: Include frame presentation timestamp - - `-ss`: Seek to timestamp (HH:MM:SS or seconds) - - `-frames:v`: Number of video frames to extract - - ### Scene Detection - - ```bash - # Detect scene changes with threshold (0.0-1.0, default 0.4) - # Lower threshold = more sensitive to changes - ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -fps_mode passthrough -frame_pts 1 scene_%06d.jpg - - # Common threshold values: - # 0.1-0.2: Very sensitive (minor changes trigger detection) - # 0.3-0.4: Moderate sensitivity (good for most videos) - # 0.5-0.6: Less sensitive (only major scene changes) - ``` - - **Scene detection tips:** - - Start with threshold 0.4 and adjust based on results - - Use `showinfo` filter to see timestamps in logs - - Lower threshold detects more scenes but may include false positives - - Higher threshold misses gradual transitions - - ### Resize and Convert - - ```bash - # Resize video to specific dimensions (maintains aspect ratio) - ffmpeg -i input.mp4 -vf "scale=1280:720" output.mp4 - - # Resize with padding to maintain aspect ratio - ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output.mp4 - - # Convert to different format with quality control - ffmpeg -i input.mp4 -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mp4 - ``` - - **Quality flags:** - - `-crf`: Constant Rate Factor (0-51, lower=better quality, 23 is default) - - `18`: Visually lossless - - `23`: High quality (default) - - `28`: Medium quality - - ### Get Video Information - - ```bash - # Get detailed video information - ffprobe -v quiet -print_format json -show_format -show_streams input.mp4 - - # Get video duration - ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4 - - # Get video dimensions - ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 input.mp4 - ``` - - ### Compute Stable Hash for Video Encoding Task - - Compute a SHA-256 hash that uniquely identifies an ffmpeg command and all input files it references. This is useful for caching and detecting when re-processing is needed. - - **Steps:** - 1. Capture the full ffmpeg command line (exact text with all arguments) - 2. Concatenate the command string with the binary contents of each input file in the same order - 3. Pipe the combined data into `sha256sum` (or `shasum -a 256` on macOS) - - **Example Bash:** - - ```bash - cmd='ffmpeg -i input1.mp4 -i input2.wav -filter_complex "..." -c:v libx264 output.mp4' - ( - echo "$cmd" - cat input1.mp4 input2.wav - ) | sha256sum | awk '{print $1}' - ``` - - This hash changes only when: - - The ffmpeg command arguments change - - Any input file content changes - - Use this hash as a cache key in `/tmp/gh-aw/ffmpeg/` to avoid reprocessing identical operations. - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/video-analyzer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + # FFmpeg Usage Guide + + FFmpeg and ffprobe have been installed and are available in your PATH. A temporary folder `/tmp/gh-aw/ffmpeg` is available for caching intermediate results. + + **Note**: FFmpeg operations can take several minutes for large video files. Bash commands have a 5-minute timeout. For longer operations, break them into smaller steps or increase workflow timeout-minutes. + + ## Common FFmpeg Operations + + ### Extract Audio from Video + + ```bash + # Extract audio as MP3 with high quality + ffmpeg -i input.mp4 -vn -acodec libmp3lame -ab 192k output.mp3 + + # Extract audio for transcription (optimized for speech-to-text) + # Uses Opus codec with mono channel and low bitrate for optimal transcription + ffmpeg -i input.mp4 -vn -acodec libopus -ac 1 -ab 12k -application voip -map_metadata -1 -f ogg output.ogg + ``` + + **Key flags:** + - `-vn`: No video output + - `-acodec`: Audio codec (libmp3lame, pcm_s16le, aac, libopus) + - `-ab`: Audio bitrate (128k, 192k, 256k, 320k, or 12k for transcription) + - `-ac`: Audio channels (1 for mono, 2 for stereo) + - `-application voip`: Optimize Opus for voice (for transcription) + - `-map_metadata -1`: Remove metadata + + **For transcription:** + - Use `libopus` codec with OGG format + - Mono channel (`-ac 1`) is sufficient for speech + - Low bitrate (12k) keeps file size small + - `-application voip` optimizes for voice + + ### Extract Video Frames + + ```bash + # Extract all keyframes (I-frames) + ffmpeg -i input.mp4 -vf "select='eq(pict_type,I)'" -fps_mode vfr -frame_pts 1 keyframe_%06d.jpg + + # Extract frames at specific interval (e.g., 1 frame per second) + ffmpeg -i input.mp4 -vf "fps=1" frame_%06d.jpg + + # Extract single frame at specific timestamp + ffmpeg -i input.mp4 -ss 00:00:05 -frames:v 1 frame.jpg + ``` + + **Key flags:** + - `-vf`: Video filter + - `-fps_mode vfr`: Variable frame rate (for keyframes) + - `-frame_pts 1`: Include frame presentation timestamp + - `-ss`: Seek to timestamp (HH:MM:SS or seconds) + - `-frames:v`: Number of video frames to extract + + ### Scene Detection + + ```bash + # Detect scene changes with threshold (0.0-1.0, default 0.4) + # Lower threshold = more sensitive to changes + ffmpeg -i input.mp4 -vf "select='gt(scene,0.3)',showinfo" -fps_mode passthrough -frame_pts 1 scene_%06d.jpg + + # Common threshold values: + # 0.1-0.2: Very sensitive (minor changes trigger detection) + # 0.3-0.4: Moderate sensitivity (good for most videos) + # 0.5-0.6: Less sensitive (only major scene changes) + ``` + + **Scene detection tips:** + - Start with threshold 0.4 and adjust based on results + - Use `showinfo` filter to see timestamps in logs + - Lower threshold detects more scenes but may include false positives + - Higher threshold misses gradual transitions + + ### Resize and Convert + + ```bash + # Resize video to specific dimensions (maintains aspect ratio) + ffmpeg -i input.mp4 -vf "scale=1280:720" output.mp4 + + # Resize with padding to maintain aspect ratio + ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output.mp4 + + # Convert to different format with quality control + ffmpeg -i input.mp4 -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mp4 + ``` + + **Quality flags:** + - `-crf`: Constant Rate Factor (0-51, lower=better quality, 23 is default) + - `18`: Visually lossless + - `23`: High quality (default) + - `28`: Medium quality + + ### Get Video Information + + ```bash + # Get detailed video information + ffprobe -v quiet -print_format json -show_format -show_streams input.mp4 + + # Get video duration + ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4 + + # Get video dimensions + ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 input.mp4 + ``` + + ### Compute Stable Hash for Video Encoding Task + + Compute a SHA-256 hash that uniquely identifies an ffmpeg command and all input files it references. This is useful for caching and detecting when re-processing is needed. + + **Steps:** + 1. Capture the full ffmpeg command line (exact text with all arguments) + 2. Concatenate the command string with the binary contents of each input file in the same order + 3. Pipe the combined data into `sha256sum` (or `shasum -a 256` on macOS) + + **Example Bash:** + + ```bash + cmd='ffmpeg -i input1.mp4 -i input2.wav -filter_complex "..." -c:v libx264 output.mp4' + ( + echo "$cmd" + cat input1.mp4 input2.wav + ) | sha256sum | awk '{print $1}' + ``` + + This hash changes only when: + - The ffmpeg command arguments change + - Any input file content changes + + Use this hash as a cache key in `/tmp/gh-aw/ffmpeg/` to avoid reprocessing identical operations. + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/video-analyzer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/weekly-issue-summary.lock.yml b/.github/workflows/weekly-issue-summary.lock.yml index 6e6c865d18..467a20dd90 100644 --- a/.github/workflows/weekly-issue-summary.lock.yml +++ b/.github/workflows/weekly-issue-summary.lock.yml @@ -526,556 +526,558 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - # Trends Visualization Guide - - You are an expert at creating compelling trend visualizations that reveal insights from data over time. - - ## Trending Chart Best Practices - - When generating trending charts, focus on: - - ### 1. **Time Series Excellence** - - Use line charts for continuous trends over time - - Add trend lines or moving averages to highlight patterns - - Include clear date/time labels on the x-axis - - Show confidence intervals or error bands when relevant - - ### 2. **Comparative Trends** - - Use multi-line charts to compare multiple trends - - Apply distinct colors for each series with a clear legend - - Consider using area charts for stacked trends - - Highlight key inflection points or anomalies - - ### 3. **Visual Impact** - - Use vibrant, contrasting colors to make trends stand out - - Add annotations for significant events or milestones - - Include grid lines for easier value reading - - Use appropriate scale (linear vs. logarithmic) - - ### 4. **Contextual Information** - - Show percentage changes or growth rates - - Include baseline comparisons (year-over-year, month-over-month) - - Add summary statistics (min, max, average, median) - - Highlight recent trends vs. historical patterns - - ## Example Trend Chart Types - - ### Temporal Trends - ```python - # Line chart with multiple trends - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - for column in data.columns: - ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) - ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') - ax.set_xlabel('Date', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.legend(loc='best') - ax.grid(True, alpha=0.3) - plt.xticks(rotation=45) - ``` - - ### Growth Rates - ```python - # Bar chart showing period-over-period growth - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) - ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') - ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) - ax.set_ylabel('Growth %', fontsize=12) - ``` - - ### Moving Averages - ```python - # Trend with moving average overlay - fig, ax = plt.subplots(figsize=(12, 7), dpi=300) - ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) - ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) - ax.fill_between(dates, values, moving_avg, alpha=0.2) - ``` - - ## Data Preparation for Trends - - ### Time-Based Indexing - ```python - # Convert to datetime and set as index - data['date'] = pd.to_datetime(data['date']) - data.set_index('date', inplace=True) - data = data.sort_index() - ``` - - ### Resampling and Aggregation - ```python - # Resample daily data to weekly - weekly_data = data.resample('W').mean() - - # Calculate rolling statistics - data['rolling_mean'] = data['value'].rolling(window=7).mean() - data['rolling_std'] = data['value'].rolling(window=7).std() - ``` - - ### Growth Calculations - ```python - # Calculate percentage change - data['pct_change'] = data['value'].pct_change() * 100 - - # Calculate year-over-year growth - data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 - ``` - - ## Color Palettes for Trends - - Use these palettes for impactful trend visualizations: - - - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` - - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` - - **Multiple series**: `sns.color_palette("husl", n_colors=8)` - - **Categorical**: `sns.color_palette("Set2", n_colors=6)` - - ## Annotation Best Practices - - ```python - # Annotate key points - max_idx = data['value'].idxmax() - max_val = data['value'].max() - ax.annotate(f'Peak: {max_val:.2f}', - xy=(max_idx, max_val), - xytext=(10, 20), - textcoords='offset points', - arrowprops=dict(arrowstyle='->', color='red'), - fontsize=10, - fontweight='bold') - ``` - - ## Styling for Awesome Charts - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set professional style - sns.set_style("whitegrid") - sns.set_context("notebook", font_scale=1.2) - - # Custom color palette - custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] - sns.set_palette(custom_colors) - - # Figure with optimal dimensions - fig, ax = plt.subplots(figsize=(14, 8), dpi=300) - - # ... your plotting code ... - - # Tight layout for clean appearance - plt.tight_layout() - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ## Tips for Trending Charts - - 1. **Start with the story**: What trend are you trying to show? - 2. **Choose the right timeframe**: Match granularity to the pattern - 3. **Smooth noise**: Use moving averages for volatile data - 4. **Show context**: Include historical baselines or benchmarks - 5. **Highlight insights**: Use annotations to draw attention - 6. **Test readability**: Ensure labels and legends are clear - 7. **Optimize colors**: Use colorblind-friendly palettes - 8. **Export high quality**: Always use DPI 300+ for presentations - - ## Common Trend Patterns to Visualize - - - **Seasonal patterns**: Monthly or quarterly cycles - - **Long-term growth**: Exponential or linear trends - - **Volatility changes**: Periods of stability vs. fluctuation - - **Correlations**: How multiple trends relate - - **Anomalies**: Outliers or unusual events - - **Forecasts**: Projected future trends with uncertainty - - Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. - - # Python Data Visualization Guide - - Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. - - ## Installed Libraries - - - **NumPy**: Array processing and numerical operations - - **Pandas**: Data manipulation and analysis - - **Matplotlib**: Chart generation and plotting - - **Seaborn**: Statistical data visualization - - **SciPy**: Scientific computing utilities - - ## Directory Structure - - ``` - /tmp/gh-aw/python/ - ├── data/ # Store all data files here (CSV, JSON, etc.) - ├── charts/ # Generated chart images (PNG) - ├── artifacts/ # Additional output files - └── *.py # Python scripts - ``` - - ## Data Separation Requirement - - **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. - - ### ❌ PROHIBITED - Inline Data - ```python - # DO NOT do this - data = [10, 20, 30, 40, 50] - labels = ['A', 'B', 'C', 'D', 'E'] - ``` - - ### ✅ REQUIRED - External Data Files - ```python - # Always load data from external files - import pandas as pd - - # Load data from CSV - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Or from JSON - data = pd.read_json('/tmp/gh-aw/python/data/data.json') - ``` - - ## Chart Generation Best Practices - - ### High-Quality Chart Settings - - ```python - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style for better aesthetics - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Create figure with high DPI - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - - # Your plotting code here - # ... - - # Save with high quality - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white', - edgecolor='none') - ``` - - ### Chart Quality Guidelines - - - **DPI**: Use 300 or higher for publication quality - - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) - - **Labels**: Always include clear axis labels and titles - - **Legend**: Add legends when plotting multiple series - - **Grid**: Enable grid lines for easier reading - - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) - - ## Including Images in Reports - - When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: - - ### Step 1: Generate and Upload Chart - ```python - # Generate your chart - plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') - ``` - - ### Step 2: Upload as Asset - Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. - - ### Step 3: Include in Markdown Report - When creating your discussion or issue, include the image using markdown: - - ```markdown - ## Visualization Results - - ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) - - The chart above shows... - ``` - - **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. - - ## Cache Memory Integration - - The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: - - **Helper Functions to Cache:** - - Data loading utilities: `data_loader.py` - - Chart styling functions: `chart_utils.py` - - Common data transformations: `transforms.py` - - **Check Cache Before Creating:** - ```bash - # Check if helper exists in cache - if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then - cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ - echo "Using cached data_loader.py" - fi - ``` - - **Save to Cache for Future Runs:** - ```bash - # Save useful helpers to cache - cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ - echo "Saved data_loader.py to cache for future runs" - ``` - - ## Complete Example Workflow - - ```python - #!/usr/bin/env python3 - """ - Example data visualization script - Generates a bar chart from external data - """ - import pandas as pd - import matplotlib.pyplot as plt - import seaborn as sns - - # Set style - sns.set_style("whitegrid") - sns.set_palette("husl") - - # Load data from external file (NEVER inline) - data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') - - # Process data - summary = data.groupby('category')['value'].sum() - - # Create chart - fig, ax = plt.subplots(figsize=(10, 6), dpi=300) - summary.plot(kind='bar', ax=ax) - - # Customize - ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') - ax.set_xlabel('Category', fontsize=12) - ax.set_ylabel('Value', fontsize=12) - ax.grid(True, alpha=0.3) - - # Save chart - plt.savefig('/tmp/gh-aw/python/charts/chart.png', - dpi=300, - bbox_inches='tight', - facecolor='white') - - print("Chart saved to /tmp/gh-aw/python/charts/chart.png") - ``` - - ## Error Handling - - **Check File Existence:** - ```python - import os - - data_file = '/tmp/gh-aw/python/data/data.csv' - if not os.path.exists(data_file): - raise FileNotFoundError(f"Data file not found: {data_file}") - ``` - - **Validate Data:** - ```python - # Check for required columns - required_cols = ['category', 'value'] - missing = set(required_cols) - set(data.columns) - if missing: - raise ValueError(f"Missing columns: {missing}") - ``` - - ## Artifact Upload - - Charts and source files are automatically uploaded as artifacts: - - **Charts Artifact:** - - Name: `data-charts` - - Contents: PNG files from `/tmp/gh-aw/python/charts/` - - Retention: 30 days - - **Source and Data Artifact:** - - Name: `python-source-and-data` - - Contents: Python scripts and data files - - Retention: 30 days - - Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. - - ## Tips for Success - - 1. **Always Separate Data**: Store data in files, never inline in code - 2. **Use Cache Memory**: Store reusable helpers for faster execution - 3. **High Quality Charts**: Use DPI 300+ and proper sizing - 4. **Clear Documentation**: Add docstrings and comments - 5. **Error Handling**: Validate data and check file existence - 6. **Type Hints**: Use type annotations for better code quality - 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics - 8. **Reproducibility**: Set random seeds when needed - - ## Common Data Sources - - Based on common use cases: - - **Repository Statistics:** - ```python - # Collect via GitHub API, save to data.csv - # Then load and visualize - data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') - ``` - - **Workflow Metrics:** - ```python - # Collect via GitHub Actions API, save to data.json - data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') - ``` - - **Sample Data Generation:** - ```python - # Generate with NumPy, save to file first - import numpy as np - data = np.random.randn(100, 2) - df = pd.DataFrame(data, columns=['x', 'y']) - df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) - - # Then load it back (demonstrating the pattern) - data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') - ``` - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/weekly-issue-summary.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat "/opt/gh-aw/prompts/cache_memory_prompt.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + # Trends Visualization Guide + + You are an expert at creating compelling trend visualizations that reveal insights from data over time. + + ## Trending Chart Best Practices + + When generating trending charts, focus on: + + ### 1. **Time Series Excellence** + - Use line charts for continuous trends over time + - Add trend lines or moving averages to highlight patterns + - Include clear date/time labels on the x-axis + - Show confidence intervals or error bands when relevant + + ### 2. **Comparative Trends** + - Use multi-line charts to compare multiple trends + - Apply distinct colors for each series with a clear legend + - Consider using area charts for stacked trends + - Highlight key inflection points or anomalies + + ### 3. **Visual Impact** + - Use vibrant, contrasting colors to make trends stand out + - Add annotations for significant events or milestones + - Include grid lines for easier value reading + - Use appropriate scale (linear vs. logarithmic) + + ### 4. **Contextual Information** + - Show percentage changes or growth rates + - Include baseline comparisons (year-over-year, month-over-month) + - Add summary statistics (min, max, average, median) + - Highlight recent trends vs. historical patterns + + ## Example Trend Chart Types + + ### Temporal Trends + ```python + # Line chart with multiple trends + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + for column in data.columns: + ax.plot(data.index, data[column], marker='o', label=column, linewidth=2) + ax.set_title('Trends Over Time', fontsize=16, fontweight='bold') + ax.set_xlabel('Date', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.legend(loc='best') + ax.grid(True, alpha=0.3) + plt.xticks(rotation=45) + ``` + + ### Growth Rates + ```python + # Bar chart showing period-over-period growth + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + growth_data.plot(kind='bar', ax=ax, color=sns.color_palette("husl")) + ax.set_title('Growth Rates by Period', fontsize=16, fontweight='bold') + ax.axhline(y=0, color='black', linestyle='-', linewidth=0.8) + ax.set_ylabel('Growth %', fontsize=12) + ``` + + ### Moving Averages + ```python + # Trend with moving average overlay + fig, ax = plt.subplots(figsize=(12, 7), dpi=300) + ax.plot(dates, values, label='Actual', alpha=0.5, linewidth=1) + ax.plot(dates, moving_avg, label='7-day Moving Average', linewidth=2.5) + ax.fill_between(dates, values, moving_avg, alpha=0.2) + ``` + + ## Data Preparation for Trends + + ### Time-Based Indexing + ```python + # Convert to datetime and set as index + data['date'] = pd.to_datetime(data['date']) + data.set_index('date', inplace=True) + data = data.sort_index() + ``` + + ### Resampling and Aggregation + ```python + # Resample daily data to weekly + weekly_data = data.resample('W').mean() + + # Calculate rolling statistics + data['rolling_mean'] = data['value'].rolling(window=7).mean() + data['rolling_std'] = data['value'].rolling(window=7).std() + ``` + + ### Growth Calculations + ```python + # Calculate percentage change + data['pct_change'] = data['value'].pct_change() * 100 + + # Calculate year-over-year growth + data['yoy_growth'] = data['value'].pct_change(periods=365) * 100 + ``` + + ## Color Palettes for Trends + + Use these palettes for impactful trend visualizations: + + - **Sequential trends**: `sns.color_palette("viridis", n_colors=5)` + - **Diverging trends**: `sns.color_palette("RdYlGn", n_colors=7)` + - **Multiple series**: `sns.color_palette("husl", n_colors=8)` + - **Categorical**: `sns.color_palette("Set2", n_colors=6)` + + ## Annotation Best Practices + + ```python + # Annotate key points + max_idx = data['value'].idxmax() + max_val = data['value'].max() + ax.annotate(f'Peak: {max_val:.2f}', + xy=(max_idx, max_val), + xytext=(10, 20), + textcoords='offset points', + arrowprops=dict(arrowstyle='->', color='red'), + fontsize=10, + fontweight='bold') + ``` + + ## Styling for Awesome Charts + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set professional style + sns.set_style("whitegrid") + sns.set_context("notebook", font_scale=1.2) + + # Custom color palette + custom_colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8"] + sns.set_palette(custom_colors) + + # Figure with optimal dimensions + fig, ax = plt.subplots(figsize=(14, 8), dpi=300) + + # ... your plotting code ... + + # Tight layout for clean appearance + plt.tight_layout() + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/trend_chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ## Tips for Trending Charts + + 1. **Start with the story**: What trend are you trying to show? + 2. **Choose the right timeframe**: Match granularity to the pattern + 3. **Smooth noise**: Use moving averages for volatile data + 4. **Show context**: Include historical baselines or benchmarks + 5. **Highlight insights**: Use annotations to draw attention + 6. **Test readability**: Ensure labels and legends are clear + 7. **Optimize colors**: Use colorblind-friendly palettes + 8. **Export high quality**: Always use DPI 300+ for presentations + + ## Common Trend Patterns to Visualize + + - **Seasonal patterns**: Monthly or quarterly cycles + - **Long-term growth**: Exponential or linear trends + - **Volatility changes**: Periods of stability vs. fluctuation + - **Correlations**: How multiple trends relate + - **Anomalies**: Outliers or unusual events + - **Forecasts**: Projected future trends with uncertainty + + Remember: The best trending charts tell a clear story, make patterns obvious, and inspire action based on the insights revealed. + + # Python Data Visualization Guide + + Python scientific libraries have been installed and are ready for use. A temporary folder structure has been created at `/tmp/gh-aw/python/` for organizing scripts, data, and outputs. + + ## Installed Libraries + + - **NumPy**: Array processing and numerical operations + - **Pandas**: Data manipulation and analysis + - **Matplotlib**: Chart generation and plotting + - **Seaborn**: Statistical data visualization + - **SciPy**: Scientific computing utilities + + ## Directory Structure + + ``` + /tmp/gh-aw/python/ + ├── data/ # Store all data files here (CSV, JSON, etc.) + ├── charts/ # Generated chart images (PNG) + ├── artifacts/ # Additional output files + └── *.py # Python scripts + ``` + + ## Data Separation Requirement + + **CRITICAL**: Data must NEVER be inlined in Python code. Always store data in external files and load using pandas. + + ### ❌ PROHIBITED - Inline Data + ```python + # DO NOT do this + data = [10, 20, 30, 40, 50] + labels = ['A', 'B', 'C', 'D', 'E'] + ``` + + ### ✅ REQUIRED - External Data Files + ```python + # Always load data from external files + import pandas as pd + + # Load data from CSV + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Or from JSON + data = pd.read_json('/tmp/gh-aw/python/data/data.json') + ``` + + ## Chart Generation Best Practices + + ### High-Quality Chart Settings + + ```python + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style for better aesthetics + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Create figure with high DPI + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + + # Your plotting code here + # ... + + # Save with high quality + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white', + edgecolor='none') + ``` + + ### Chart Quality Guidelines + + - **DPI**: Use 300 or higher for publication quality + - **Figure Size**: Standard is 10x6 inches (adjustable based on needs) + - **Labels**: Always include clear axis labels and titles + - **Legend**: Add legends when plotting multiple series + - **Grid**: Enable grid lines for easier reading + - **Colors**: Use colorblind-friendly palettes (seaborn defaults are good) + + ## Including Images in Reports + + When creating reports (issues, discussions, etc.), use the `upload asset` tool to make images URL-addressable and include them in markdown: + + ### Step 1: Generate and Upload Chart + ```python + # Generate your chart + plt.savefig('/tmp/gh-aw/python/charts/my_chart.png', dpi=300, bbox_inches='tight') + ``` + + ### Step 2: Upload as Asset + Use the `upload asset` tool to upload the chart file. The tool will return a GitHub raw content URL. + + ### Step 3: Include in Markdown Report + When creating your discussion or issue, include the image using markdown: + + ```markdown + ## Visualization Results + + ![Chart Description](https://raw.githubusercontent.com/owner/repo/assets/workflow-name/my_chart.png) + + The chart above shows... + ``` + + **Important**: Assets are published to an orphaned git branch and become URL-addressable after workflow completion. + + ## Cache Memory Integration + + The cache memory at `/tmp/gh-aw/cache-memory/` is available for storing reusable code: + + **Helper Functions to Cache:** + - Data loading utilities: `data_loader.py` + - Chart styling functions: `chart_utils.py` + - Common data transformations: `transforms.py` + + **Check Cache Before Creating:** + ```bash + # Check if helper exists in cache + if [ -f /tmp/gh-aw/cache-memory/data_loader.py ]; then + cp /tmp/gh-aw/cache-memory/data_loader.py /tmp/gh-aw/python/ + echo "Using cached data_loader.py" + fi + ``` + + **Save to Cache for Future Runs:** + ```bash + # Save useful helpers to cache + cp /tmp/gh-aw/python/data_loader.py /tmp/gh-aw/cache-memory/ + echo "Saved data_loader.py to cache for future runs" + ``` + + ## Complete Example Workflow + + ```python + #!/usr/bin/env python3 + """ + Example data visualization script + Generates a bar chart from external data + """ + import pandas as pd + import matplotlib.pyplot as plt + import seaborn as sns + + # Set style + sns.set_style("whitegrid") + sns.set_palette("husl") + + # Load data from external file (NEVER inline) + data = pd.read_csv('/tmp/gh-aw/python/data/data.csv') + + # Process data + summary = data.groupby('category')['value'].sum() + + # Create chart + fig, ax = plt.subplots(figsize=(10, 6), dpi=300) + summary.plot(kind='bar', ax=ax) + + # Customize + ax.set_title('Data Summary by Category', fontsize=16, fontweight='bold') + ax.set_xlabel('Category', fontsize=12) + ax.set_ylabel('Value', fontsize=12) + ax.grid(True, alpha=0.3) + + # Save chart + plt.savefig('/tmp/gh-aw/python/charts/chart.png', + dpi=300, + bbox_inches='tight', + facecolor='white') + + print("Chart saved to /tmp/gh-aw/python/charts/chart.png") + ``` + + ## Error Handling + + **Check File Existence:** + ```python + import os + + data_file = '/tmp/gh-aw/python/data/data.csv' + if not os.path.exists(data_file): + raise FileNotFoundError(f"Data file not found: {data_file}") + ``` + + **Validate Data:** + ```python + # Check for required columns + required_cols = ['category', 'value'] + missing = set(required_cols) - set(data.columns) + if missing: + raise ValueError(f"Missing columns: {missing}") + ``` + + ## Artifact Upload + + Charts and source files are automatically uploaded as artifacts: + + **Charts Artifact:** + - Name: `data-charts` + - Contents: PNG files from `/tmp/gh-aw/python/charts/` + - Retention: 30 days + + **Source and Data Artifact:** + - Name: `python-source-and-data` + - Contents: Python scripts and data files + - Retention: 30 days + + Both artifacts are uploaded with `if: always()` condition, ensuring they're available even if the workflow fails. + + ## Tips for Success + + 1. **Always Separate Data**: Store data in files, never inline in code + 2. **Use Cache Memory**: Store reusable helpers for faster execution + 3. **High Quality Charts**: Use DPI 300+ and proper sizing + 4. **Clear Documentation**: Add docstrings and comments + 5. **Error Handling**: Validate data and check file existence + 6. **Type Hints**: Use type annotations for better code quality + 7. **Seaborn Defaults**: Leverage seaborn for better aesthetics + 8. **Reproducibility**: Set random seeds when needed + + ## Common Data Sources + + Based on common use cases: + + **Repository Statistics:** + ```python + # Collect via GitHub API, save to data.csv + # Then load and visualize + data = pd.read_csv('/tmp/gh-aw/python/data/repo_stats.csv') + ``` + + **Workflow Metrics:** + ```python + # Collect via GitHub Actions API, save to data.json + data = pd.read_json('/tmp/gh-aw/python/data/workflow_metrics.json') + ``` + + **Sample Data Generation:** + ```python + # Generate with NumPy, save to file first + import numpy as np + data = np.random.randn(100, 2) + df = pd.DataFrame(data, columns=['x', 'y']) + df.to_csv('/tmp/gh-aw/python/data/sample_data.csv', index=False) + + # Then load it back (demonstrating the pattern) + data = pd.read_csv('/tmp/gh-aw/python/data/sample_data.csv') + ``` + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/weekly-issue-summary.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/workflow-generator.lock.yml b/.github/workflows/workflow-generator.lock.yml index 87bd3a070d..1e3465f368 100644 --- a/.github/workflows/workflow-generator.lock.yml +++ b/.github/workflows/workflow-generator.lock.yml @@ -587,62 +587,64 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/workflow-generator.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/workflow-generator.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/workflow-health-manager.lock.yml b/.github/workflows/workflow-health-manager.lock.yml index edb40432f0..1fc0b7d076 100644 --- a/.github/workflows/workflow-health-manager.lock.yml +++ b/.github/workflows/workflow-health-manager.lock.yml @@ -638,160 +638,162 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - --- - - ## Repo Memory Available - - You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. - - - **Read/Write Access**: You can freely read from and write to any files in this folder - - **Git Branch Storage**: Files are stored in the `memory/meta-orchestrators` branch of the current repository - - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes - - **Merge Strategy**: In case of conflicts, your changes (current version) win - - **Persistence**: Files persist across workflow runs via git branch storage - - **Constraints:** - - **Allowed Files**: Only files matching patterns: ** - - **Max File Size**: 102400 bytes (0.10 MB) per file - - **Max File Count**: 100 files per commit - - Examples of what you can store: - - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations - - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data - - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories - - Feel free to create, read, update, and organize files in this folder as needed for your tasks. - - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/workflow-health-manager.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + --- + + ## Repo Memory Available + + You have access to a persistent repo memory folder at `/tmp/gh-aw/repo-memory/default/` where you can read and write files that are stored in a git branch. + + - **Read/Write Access**: You can freely read from and write to any files in this folder + - **Git Branch Storage**: Files are stored in the `memory/meta-orchestrators` branch of the current repository + - **Automatic Push**: Changes are automatically committed and pushed after the workflow completes + - **Merge Strategy**: In case of conflicts, your changes (current version) win + - **Persistence**: Files persist across workflow runs via git branch storage + + **Constraints:** + - **Allowed Files**: Only files matching patterns: ** + - **Max File Size**: 102400 bytes (0.10 MB) per file + - **Max File Count**: 100 files per commit + + Examples of what you can store: + - `/tmp/gh-aw/repo-memory/default/notes.md` - general notes and observations + - `/tmp/gh-aw/repo-memory/default/state.json` - structured state data + - `/tmp/gh-aw/repo-memory/default/history/` - organized history files in subdirectories + + Feel free to create, read, update, and organize files in this folder as needed for your tasks. + + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/workflow-health-manager.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/workflow-normalizer.lock.yml b/.github/workflows/workflow-normalizer.lock.yml index 499d717eb3..29e02a7fdb 100644 --- a/.github/workflows/workflow-normalizer.lock.yml +++ b/.github/workflows/workflow-normalizer.lock.yml @@ -526,137 +526,139 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/workflow-normalizer.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/workflow-normalizer.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/.github/workflows/workflow-skill-extractor.lock.yml b/.github/workflows/workflow-skill-extractor.lock.yml index 666a26a79a..09f2c0404a 100644 --- a/.github/workflows/workflow-skill-extractor.lock.yml +++ b/.github/workflows/workflow-skill-extractor.lock.yml @@ -554,135 +554,137 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh - cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" - - PROMPT_EOF - cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT" - cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT" - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - GitHub API Access Instructions - - The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. - - - To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - - Discover available tools from the safeoutputs MCP server. - - **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. - - **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. - - - - The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} - - **actor**: __GH_AW_GITHUB_ACTOR__ - {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} - - **repository**: __GH_AW_GITHUB_REPOSITORY__ - {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} - - **workspace**: __GH_AW_GITHUB_WORKSPACE__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ - {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ - {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} - - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ - {{/if}} - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - ## Report Structure Guidelines - - ### 1. Header Levels - **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** - - When creating GitHub issues or discussions: - - Use `###` (h3) for main sections (e.g., "### Test Summary") - - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") - - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles - - ### 2. Progressive Disclosure - **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** - - Use collapsible sections for: - - Verbose details (full test logs, raw data) - - Secondary information (minor warnings, extra context) - - Per-item breakdowns when there are many items - - Always keep critical information visible (summary, critical issues, key metrics). - - ### 3. Report Structure Pattern - - 1. **Overview**: 1-2 paragraphs summarizing key findings - 2. **Critical Information**: Show immediately (summary stats, critical issues) - 3. **Details**: Use `
Section Name` for expanded content - 4. **Context**: Add helpful metadata (workflow run, date, trigger) - - ### Design Principles (Airbnb-Inspired) - - Reports should: - - **Build trust through clarity**: Most important info immediately visible - - **Exceed expectations**: Add helpful context like trends, comparisons - - **Create delight**: Use progressive disclosure to reduce overwhelm - - **Maintain consistency**: Follow patterns across all reports - - ### Example Report Structure - - ```markdown - ### Summary - - Key metric 1: value - - Key metric 2: value - - Status: ✅/⚠️/❌ - - ### Critical Issues - [Always visible - these are important] - -
- View Detailed Results - - [Comprehensive details, logs, traces] - -
- -
- View All Warnings - - [Minor issues and potential problems] - -
- - ### Recommendations - [Actionable next steps - keep visible] - ``` - - ## Workflow Run References - - - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` - - Include up to 3 most relevant run URLs at end under `**References:**` - - Do NOT add footer attribution (system adds automatically) - - - PROMPT_EOF - cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - {{#runtime-import workflows/workflow-skill-extractor.md}} - PROMPT_EOF + { + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat "/opt/gh-aw/prompts/temp_folder_prompt.md" + cat "/opt/gh-aw/prompts/markdown.md" + cat << 'PROMPT_EOF' + + GitHub API Access Instructions + + The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations. + + + To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. + + Discover available tools from the safeoutputs MCP server. + + **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. + + **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed. + + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + PROMPT_EOF + cat << 'PROMPT_EOF' + + PROMPT_EOF + cat << 'PROMPT_EOF' + ## Report Structure Guidelines + + ### 1. Header Levels + **Use h3 (###) or lower for all headers in your issue report to maintain proper document hierarchy.** + + When creating GitHub issues or discussions: + - Use `###` (h3) for main sections (e.g., "### Test Summary") + - Use `####` (h4) for subsections (e.g., "#### Device-Specific Results") + - Never use `##` (h2) or `#` (h1) in reports - these are reserved for titles + + ### 2. Progressive Disclosure + **Wrap detailed test results in `
Section Name` tags to improve readability and reduce scrolling.** + + Use collapsible sections for: + - Verbose details (full test logs, raw data) + - Secondary information (minor warnings, extra context) + - Per-item breakdowns when there are many items + + Always keep critical information visible (summary, critical issues, key metrics). + + ### 3. Report Structure Pattern + + 1. **Overview**: 1-2 paragraphs summarizing key findings + 2. **Critical Information**: Show immediately (summary stats, critical issues) + 3. **Details**: Use `
Section Name` for expanded content + 4. **Context**: Add helpful metadata (workflow run, date, trigger) + + ### Design Principles (Airbnb-Inspired) + + Reports should: + - **Build trust through clarity**: Most important info immediately visible + - **Exceed expectations**: Add helpful context like trends, comparisons + - **Create delight**: Use progressive disclosure to reduce overwhelm + - **Maintain consistency**: Follow patterns across all reports + + ### Example Report Structure + + ```markdown + ### Summary + - Key metric 1: value + - Key metric 2: value + - Status: ✅/⚠️/❌ + + ### Critical Issues + [Always visible - these are important] + +
+ View Detailed Results + + [Comprehensive details, logs, traces] + +
+ +
+ View All Warnings + + [Minor issues and potential problems] + +
+ + ### Recommendations + [Actionable next steps - keep visible] + ``` + + ## Workflow Run References + + - Format run IDs as links: `[§12345](https://github.com/owner/repo/actions/runs/12345)` + - Include up to 3 most relevant run URLs at end under `**References:**` + - Do NOT add footer attribution (system adds automatically) + + + PROMPT_EOF + cat << 'PROMPT_EOF' + {{#runtime-import workflows/workflow-skill-extractor.md}} + PROMPT_EOF + } > "$GH_AW_PROMPT" - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: diff --git a/pkg/workflow/heredoc_interpolation_test.go b/pkg/workflow/heredoc_interpolation_test.go index bff481612a..883f979082 100644 --- a/pkg/workflow/heredoc_interpolation_test.go +++ b/pkg/workflow/heredoc_interpolation_test.go @@ -78,15 +78,15 @@ Actor: ${{ github.actor }} } // Verify the original expressions have been replaced in the prompt heredoc content - // Find the heredoc section by looking for the "cat " line and the PROMPT_EOF delimiter - heredocStart := strings.Index(compiledStr, "cat << 'PROMPT_EOF' > \"$GH_AW_PROMPT\"") + // Find the heredoc section by looking for the grouped redirect + heredocStart := strings.Index(compiledStr, "{\n cat << 'PROMPT_EOF'") if heredocStart == -1 { t.Error("Could not find prompt heredoc section") } else { - // Find the end of the heredoc (PROMPT_EOF on its own line) - heredocEnd := strings.Index(compiledStr[heredocStart:], "\n PROMPT_EOF\n") + // Find the end of the grouped redirect + heredocEnd := strings.Index(compiledStr[heredocStart:], "} > \"$GH_AW_PROMPT\"\n") if heredocEnd == -1 { - t.Error("Could not find end of prompt heredoc") + t.Error("Could not find end of prompt grouped redirect") } else { heredocContent := compiledStr[heredocStart : heredocStart+heredocEnd] // Verify original expressions are NOT in the heredoc content diff --git a/pkg/workflow/prompt_step_helper_test.go b/pkg/workflow/prompt_step_helper_test.go index 83ffc80b4e..07474dd3bc 100644 --- a/pkg/workflow/prompt_step_helper_test.go +++ b/pkg/workflow/prompt_step_helper_test.go @@ -25,10 +25,11 @@ func TestGenerateStaticPromptStep(t *testing.T) { wantInOutput: []string{ "- name: Append test instructions to prompt", "GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt", - `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`, + "{", + "cat << 'PROMPT_EOF'", "Test prompt content", "Line 2", - "EOF", + `} >> "$GH_AW_PROMPT"`, }, }, { @@ -60,8 +61,9 @@ func TestGenerateStaticPromptStep(t *testing.T) { wantOutput: true, wantInOutput: []string{ "- name: Append empty instructions to prompt", - `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`, - "EOF", + "{", + "cat << 'PROMPT_EOF'", + `} >> "$GH_AW_PROMPT"`, }, }, } diff --git a/pkg/workflow/prompt_step_test.go b/pkg/workflow/prompt_step_test.go index 5b174a6bdd..33e8b76aeb 100644 --- a/pkg/workflow/prompt_step_test.go +++ b/pkg/workflow/prompt_step_test.go @@ -23,9 +23,10 @@ func TestAppendPromptStep(t *testing.T) { "env:", "GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt", "run: |", - `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`, + "{", + "cat << 'PROMPT_EOF'", "Test prompt content", - "PROMPT_EOF", + `} >> "$GH_AW_PROMPT"`, }, }, { @@ -38,9 +39,10 @@ func TestAppendPromptStep(t *testing.T) { "env:", "GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt", "run: |", - `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`, + "{", + "cat << 'PROMPT_EOF'", "Conditional prompt content", - "PROMPT_EOF", + `} >> "$GH_AW_PROMPT"`, }, }, } @@ -138,9 +140,16 @@ func TestPromptStepRefactoringConsistency(t *testing.T) { if !strings.Contains(result, "GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt") { t.Error("Expected GH_AW_PROMPT env variable not found") } - // Verify temp folder instructions are included - if !strings.Contains(result, `cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT"`) { - t.Error("Expected cat command for temp folder prompt file not found") + // Verify temp folder instructions are included (without redirect since it's in a grouped redirect) + if !strings.Contains(result, `cat "/opt/gh-aw/prompts/temp_folder_prompt.md"`) { + t.Errorf("Expected cat command for temp folder prompt file not found. Got:\n%s", result) + } + // Verify grouped redirect is used (with >> for append mode) + if !strings.Contains(result, "{\n") { + t.Errorf("Expected opening brace not found. Got:\n%s", result) + } + if !strings.Contains(result, `} >> "$GH_AW_PROMPT"`) { + t.Errorf("Expected closing brace with append redirect not found. Got:\n%s", result) } }) } diff --git a/pkg/workflow/sh.go b/pkg/workflow/sh.go index bb7434e8e8..1e2bd18e5c 100644 --- a/pkg/workflow/sh.go +++ b/pkg/workflow/sh.go @@ -50,7 +50,7 @@ func WriteShellScriptToYAML(yaml *strings.Builder, script string, indent string) // WritePromptTextToYAML writes static prompt text to a YAML heredoc with proper indentation. // Use this function for prompt text that contains NO variable placeholders or expressions. // It chunks the text into groups of lines of less than MaxPromptChunkSize characters, with a maximum of MaxPromptChunks chunks. -// Each chunk is written as a separate heredoc to avoid GitHub Actions step size limits (21KB). +// Uses grouped redirects to avoid SC2129 shellcheck warnings. // // For prompt text with variable placeholders that need substitution, use WritePromptTextToYAMLWithPlaceholders instead. func WritePromptTextToYAML(yaml *strings.Builder, text string, indent string) { @@ -59,14 +59,17 @@ func WritePromptTextToYAML(yaml *strings.Builder, text string, indent string) { chunks := chunkLines(textLines, indent, MaxPromptChunkSize, MaxPromptChunks) shLog.Printf("Created %d chunks for prompt text", len(chunks)) - // Write each chunk as a separate heredoc - // For static prompt text without variables, use direct cat to file - for _, chunk := range chunks { - yaml.WriteString(indent + "cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - for _, line := range chunk { - fmt.Fprintf(yaml, "%s%s\n", indent, line) + // Use grouped redirects for better performance and to avoid SC2129 + if len(chunks) > 0 { + yaml.WriteString(indent + "{\n") + for _, chunk := range chunks { + yaml.WriteString(indent + " cat << 'PROMPT_EOF'\n") + for _, line := range chunk { + fmt.Fprintf(yaml, "%s %s\n", indent, line) + } + yaml.WriteString(indent + " PROMPT_EOF\n") } - yaml.WriteString(indent + "PROMPT_EOF\n") + yaml.WriteString(indent + "} >> \"$GH_AW_PROMPT\"\n") } } @@ -74,20 +77,24 @@ func WritePromptTextToYAML(yaml *strings.Builder, text string, indent string) { // Use this function for prompt text containing __VAR__ placeholders that will be substituted with sed commands. // The caller is responsible for adding the sed substitution commands after calling this function. // It uses placeholder format (__VAR__) instead of shell variable expansion, to prevent template injection. +// Uses grouped redirects to avoid SC2129 shellcheck warnings. // // For static prompt text without variables, use WritePromptTextToYAML instead. func WritePromptTextToYAMLWithPlaceholders(yaml *strings.Builder, text string, indent string) { textLines := strings.Split(text, "\n") chunks := chunkLines(textLines, indent, MaxPromptChunkSize, MaxPromptChunks) - // Write each chunk as a separate heredoc - // Use direct cat to file (append mode) - placeholders will be substituted with sed - for _, chunk := range chunks { - yaml.WriteString(indent + "cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - for _, line := range chunk { - fmt.Fprintf(yaml, "%s%s\n", indent, line) + // Use grouped redirects for better performance and to avoid SC2129 + if len(chunks) > 0 { + yaml.WriteString(indent + "{\n") + for _, chunk := range chunks { + yaml.WriteString(indent + " cat << 'PROMPT_EOF'\n") + for _, line := range chunk { + fmt.Fprintf(yaml, "%s %s\n", indent, line) + } + yaml.WriteString(indent + " PROMPT_EOF\n") } - yaml.WriteString(indent + "PROMPT_EOF\n") + yaml.WriteString(indent + "} >> \"$GH_AW_PROMPT\"\n") } } diff --git a/pkg/workflow/sh_integration_test.go b/pkg/workflow/sh_integration_test.go index 71ce303547..e71234e452 100644 --- a/pkg/workflow/sh_integration_test.go +++ b/pkg/workflow/sh_integration_test.go @@ -36,8 +36,16 @@ func TestWritePromptTextToYAML_IntegrationWithCompiler(t *testing.T) { result := yaml.String() + // Verify grouped redirect pattern + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect") + } + // Verify multiple heredoc blocks were created - heredocCount := strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) + heredocCount := strings.Count(result, "cat << 'PROMPT_EOF'") if heredocCount < 2 { t.Errorf("Expected multiple heredoc blocks for large text (%d bytes), got %d", totalSize, heredocCount) } @@ -48,7 +56,7 @@ func TestWritePromptTextToYAML_IntegrationWithCompiler(t *testing.T) { } // Verify each heredoc is closed - eofCount := strings.Count(result, indent+"PROMPT_EOF") + eofCount := strings.Count(result, "PROMPT_EOF\n") if eofCount != heredocCount { t.Errorf("Expected %d EOF markers to match %d heredoc blocks, got %d", heredocCount, heredocCount, eofCount) } @@ -64,7 +72,7 @@ func TestWritePromptTextToYAML_IntegrationWithCompiler(t *testing.T) { } // Verify the YAML structure is valid (basic check) - if !strings.Contains(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) { + if !strings.Contains(result, "cat << 'PROMPT_EOF'") { t.Error("Expected proper heredoc syntax in output") } @@ -162,7 +170,7 @@ func TestWritePromptTextToYAML_RealWorldSizeSimulation(t *testing.T) { WritePromptTextToYAML(&yaml, text, indent) result := yaml.String() - heredocCount := strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) + heredocCount := strings.Count(result, "cat << 'PROMPT_EOF'") if heredocCount < tt.expectedChunks { t.Errorf("Expected at least %d chunks for %s, got %d", tt.expectedChunks, tt.name, heredocCount) @@ -172,7 +180,7 @@ func TestWritePromptTextToYAML_RealWorldSizeSimulation(t *testing.T) { t.Errorf("Expected at most %d chunks for %s, got %d", tt.maxChunks, tt.name, heredocCount) } - eofCount := strings.Count(result, indent+"PROMPT_EOF") + eofCount := strings.Count(result, "PROMPT_EOF\n") if eofCount != heredocCount { t.Errorf("EOF count (%d) doesn't match heredoc count (%d) for %s", eofCount, heredocCount, tt.name) } @@ -195,10 +203,23 @@ func TestWritePromptTextToYAML_RealWorldSizeSimulation(t *testing.T) { func extractLinesFromYAML(yamlOutput string, indent string) []string { var lines []string inHeredoc := false + inGroup := false for _, line := range strings.Split(yamlOutput, "\n") { - // Check if we're starting a heredoc block - if strings.Contains(line, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) { + // Check if we're starting a grouped redirect + if strings.Contains(line, "{") && !inGroup { + inGroup = true + continue + } + + // Check if we're ending a grouped redirect + if strings.Contains(line, "} >> \"$GH_AW_PROMPT\"") { + inGroup = false + continue + } + + // Check if we're starting a heredoc block (within a group) + if strings.Contains(line, "cat << 'PROMPT_EOF'") { inHeredoc = true continue } @@ -210,10 +231,11 @@ func extractLinesFromYAML(yamlOutput string, indent string) []string { } // If we're in a heredoc block, extract the content line - if inHeredoc { - // Remove the indent from the line - if strings.HasPrefix(line, indent) { - contentLine := strings.TrimPrefix(line, indent) + if inHeredoc && inGroup { + // Remove the indent from the line (note: extra 2 spaces for grouped content) + expectedIndent := indent + " " + if strings.HasPrefix(line, expectedIndent) { + contentLine := strings.TrimPrefix(line, expectedIndent) lines = append(lines, contentLine) } } @@ -334,10 +356,18 @@ func TestWritePromptTextToYAML_ChunkIntegrity(t *testing.T) { result := yaml.String() // Count heredoc blocks - heredocCount := strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) + heredocCount := strings.Count(result, "cat << 'PROMPT_EOF'") t.Logf("Created %d heredoc blocks for %d lines (%d bytes)", heredocCount, len(lines), len(text)) + // Verify grouped redirect pattern + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect") + } + // Verify we have multiple chunks but not exceeding max if heredocCount < 2 { t.Errorf("Expected multiple chunks for large text, got %d", heredocCount) @@ -348,7 +378,7 @@ func TestWritePromptTextToYAML_ChunkIntegrity(t *testing.T) { } // Verify all heredocs are properly closed - eofCount := strings.Count(result, indent+"PROMPT_EOF") + eofCount := strings.Count(result, "PROMPT_EOF\n") if eofCount != heredocCount { t.Errorf("Heredoc closure mismatch: %d opens, %d closes", heredocCount, eofCount) } diff --git a/pkg/workflow/sh_test.go b/pkg/workflow/sh_test.go index a18664a0ba..0e76a9c305 100644 --- a/pkg/workflow/sh_test.go +++ b/pkg/workflow/sh_test.go @@ -16,9 +16,17 @@ func TestWritePromptTextToYAML_SmallText(t *testing.T) { result := yaml.String() - // Should have exactly one heredoc block - if strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) != 1 { - t.Errorf("Expected 1 heredoc block for small text, got %d", strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`)) + // Should use grouped redirect pattern + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect for grouped redirect") + } + + // Should have at least one heredoc block inside the group + if strings.Count(result, "cat << 'PROMPT_EOF'") < 1 { + t.Errorf("Expected at least 1 heredoc block for small text, got %d", strings.Count(result, "cat << 'PROMPT_EOF'")) } // Should contain all original lines @@ -33,8 +41,9 @@ func TestWritePromptTextToYAML_SmallText(t *testing.T) { } // Should have proper EOF markers - if strings.Count(result, indent+"PROMPT_EOF") != 1 { - t.Errorf("Expected 1 EOF marker, got %d", strings.Count(result, indent+"PROMPT_EOF")) + eofCount := strings.Count(result, "PROMPT_EOF\n") + if eofCount < 1 { + t.Errorf("Expected at least 1 EOF marker, got %d", eofCount) } } @@ -60,8 +69,16 @@ func TestWritePromptTextToYAML_LargeText(t *testing.T) { result := yaml.String() - // Should have multiple heredoc blocks - heredocCount := strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) + // Should use grouped redirect pattern + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect for grouped redirect") + } + + // Should have multiple heredoc blocks inside the group + heredocCount := strings.Count(result, "cat << 'PROMPT_EOF'") if heredocCount < 2 { t.Errorf("Expected at least 2 heredoc blocks for large text (total size ~%d bytes), got %d", totalSize, heredocCount) } @@ -71,8 +88,8 @@ func TestWritePromptTextToYAML_LargeText(t *testing.T) { t.Errorf("Expected at most 5 heredoc blocks, got %d", heredocCount) } - // Should have matching EOF markers - eofCount := strings.Count(result, indent+"PROMPT_EOF") + // Should have matching EOF markers (each heredoc has one PROMPT_EOF line) + eofCount := strings.Count(result, "PROMPT_EOF\n") if eofCount != heredocCount { t.Errorf("Expected %d EOF markers to match %d heredoc blocks, got %d", heredocCount, heredocCount, eofCount) } @@ -102,8 +119,16 @@ func TestWritePromptTextToYAML_ExactChunkBoundary(t *testing.T) { result := yaml.String() + // Should use grouped redirect pattern + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect for grouped redirect") + } + // Should have exactly 1 heredoc block since we're just under the limit - heredocCount := strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) + heredocCount := strings.Count(result, "cat << 'PROMPT_EOF'") if heredocCount != 1 { t.Errorf("Expected 1 heredoc block for text just under limit, got %d", heredocCount) } @@ -128,14 +153,22 @@ func TestWritePromptTextToYAML_MaxChunksLimit(t *testing.T) { result := yaml.String() + // Should use grouped redirect pattern + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect for grouped redirect") + } + // Should have exactly 5 heredoc blocks (the maximum) - heredocCount := strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) + heredocCount := strings.Count(result, "cat << 'PROMPT_EOF'") if heredocCount != 5 { t.Errorf("Expected exactly 5 heredoc blocks (max limit), got %d", heredocCount) } - // Should have matching EOF markers - eofCount := strings.Count(result, indent+"PROMPT_EOF") + // Should have matching EOF markers (each heredoc has one PROMPT_EOF line) + eofCount := strings.Count(result, "PROMPT_EOF\n") if eofCount != 5 { t.Errorf("Expected 5 EOF markers, got %d", eofCount) } @@ -150,13 +183,21 @@ func TestWritePromptTextToYAML_EmptyText(t *testing.T) { result := yaml.String() + // Should use grouped redirect pattern (even for empty text) + if !strings.Contains(result, "{\n") { + t.Error("Expected opening brace for grouped redirect even for empty text") + } + if !strings.Contains(result, "} >> \"$GH_AW_PROMPT\"") { + t.Error("Expected closing brace with redirect for grouped redirect even for empty text") + } + // Should have at least one heredoc block (even for empty text) - if strings.Count(result, `cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"`) < 1 { + if strings.Count(result, "cat << 'PROMPT_EOF'") < 1 { t.Error("Expected at least 1 heredoc block even for empty text") } // Should have matching EOF markers - if strings.Count(result, indent+"PROMPT_EOF") < 1 { + if strings.Count(result, "PROMPT_EOF\n") < 1 { t.Error("Expected at least 1 EOF marker") } } diff --git a/pkg/workflow/unified_prompt_creation_test.go b/pkg/workflow/unified_prompt_creation_test.go index c66c460fdb..f635d7d5b6 100644 --- a/pkg/workflow/unified_prompt_creation_test.go +++ b/pkg/workflow/unified_prompt_creation_test.go @@ -333,23 +333,18 @@ func TestGenerateUnifiedPromptCreationStep_FirstContentUsesCreate(t *testing.T) output := yaml.String() - // Find the first cat command (should use > for create) - firstCatPos := strings.Index(output, `cat "`) - require.NotEqual(t, -1, firstCatPos, "Should have cat command") - - // Extract the line containing the first cat command - firstCatLine := output[firstCatPos : firstCatPos+strings.Index(output[firstCatPos:], "\n")] - - // Verify it uses > (create mode) - assert.Contains(t, firstCatLine, `> "$GH_AW_PROMPT"`, - "First content should use > (create mode): %s", firstCatLine) - - // Find subsequent cat commands (should use >> for append) - remainingOutput := output[firstCatPos+len(firstCatLine):] - if strings.Contains(remainingOutput, `cat "`) || strings.Contains(remainingOutput, "cat << 'PROMPT_EOF'") { - // Verify subsequent operations use >> (append mode) - assert.Contains(t, remainingOutput, `>> "$GH_AW_PROMPT"`, - "Subsequent content should use >> (append mode)") + // Verify grouped redirect pattern + assert.Contains(t, output, "{\n", "Should use grouped redirect with opening brace") + assert.Contains(t, output, `} > "$GH_AW_PROMPT"`, "Should use grouped redirect with closing brace and > (create mode)") + + // Verify individual cat commands inside the group don't have redirects + lines := strings.Split(output, "\n") + for _, line := range lines { + if strings.Contains(line, "cat ") && !strings.Contains(line, "}") { + // Cat commands should not have individual redirects (only the group has a redirect) + assert.NotContains(t, line, `>> "$GH_AW_PROMPT"`, + "Individual cat commands should not have redirects in grouped mode: %s", line) + } } } diff --git a/pkg/workflow/unified_prompt_step.go b/pkg/workflow/unified_prompt_step.go index 6eea1028c3..910035fb06 100644 --- a/pkg/workflow/unified_prompt_step.go +++ b/pkg/workflow/unified_prompt_step.go @@ -70,6 +70,10 @@ func (c *Compiler) generateUnifiedPromptStep(yaml *strings.Builder, data *Workfl yaml.WriteString(" run: |\n") + // Use grouped redirects to avoid SC2129 shellcheck warnings + // All commands are grouped and redirected once to the file + yaml.WriteString(" {\n") + // Track if we're inside a heredoc inHeredoc := false @@ -81,43 +85,43 @@ func (c *Compiler) generateUnifiedPromptStep(yaml *strings.Builder, data *Workfl if section.ShellCondition != "" { // Close heredoc if open, add conditional if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } - fmt.Fprintf(yaml, " if %s; then\n", section.ShellCondition) + fmt.Fprintf(yaml, " if %s; then\n", section.ShellCondition) if section.IsFile { // File reference inside conditional promptPath := fmt.Sprintf("%s/%s", promptsDir, section.Content) - yaml.WriteString(" " + fmt.Sprintf("cat \"%s\" >> \"$GH_AW_PROMPT\"\n", promptPath)) + yaml.WriteString(" " + fmt.Sprintf("cat \"%s\"\n", promptPath)) } else { // Inline content inside conditional - open heredoc, write content, close - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") + yaml.WriteString(" cat << 'PROMPT_EOF'\n") normalizedContent := normalizeLeadingWhitespace(section.Content) cleanedContent := removeConsecutiveEmptyLines(normalizedContent) contentLines := strings.Split(cleanedContent, "\n") for _, line := range contentLines { - yaml.WriteString(" " + line + "\n") + yaml.WriteString(" " + line + "\n") } - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") } - yaml.WriteString(" fi\n") + yaml.WriteString(" fi\n") } else { // Unconditional section if section.IsFile { // Close heredoc if open if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } // Cat the file promptPath := fmt.Sprintf("%s/%s", promptsDir, section.Content) - yaml.WriteString(" " + fmt.Sprintf("cat \"%s\" >> \"$GH_AW_PROMPT\"\n", promptPath)) + yaml.WriteString(" " + fmt.Sprintf("cat \"%s\"\n", promptPath)) } else { // Inline content - open heredoc if not already open if !inHeredoc { - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") + yaml.WriteString(" cat << 'PROMPT_EOF'\n") inHeredoc = true } // Write content directly to open heredoc @@ -125,7 +129,7 @@ func (c *Compiler) generateUnifiedPromptStep(yaml *strings.Builder, data *Workfl cleanedContent := removeConsecutiveEmptyLines(normalizedContent) contentLines := strings.Split(cleanedContent, "\n") for _, line := range contentLines { - yaml.WriteString(" " + line + "\n") + yaml.WriteString(" " + line + "\n") } } } @@ -133,9 +137,12 @@ func (c *Compiler) generateUnifiedPromptStep(yaml *strings.Builder, data *Workfl // Close heredoc if still open if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") } + // Close the grouped redirect and write to file + yaml.WriteString(" } >> \"$GH_AW_PROMPT\"\n") + unifiedPromptLog.Print("Unified prompt step generated successfully") } @@ -438,21 +445,19 @@ func (c *Compiler) generateUnifiedPromptCreationStep(yaml *strings.Builder, buil yaml.WriteString(" run: |\n") yaml.WriteString(" bash /opt/gh-aw/actions/create_prompt_first.sh\n") - // Track if we're inside a heredoc and whether we're writing the first content + // Use grouped redirects to avoid SC2129 shellcheck warnings + // All commands are grouped and redirected once to the file + yaml.WriteString(" {\n") + + // Track if we're inside a heredoc inHeredoc := false - isFirstContent := true // 1. Write built-in sections first (prepended), wrapped in tags if len(builtinSections) > 0 { // Open system tag for built-in prompts - if isFirstContent { - yaml.WriteString(" cat << 'PROMPT_EOF' > \"$GH_AW_PROMPT\"\n") - isFirstContent = false - } else { - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - } - yaml.WriteString(" \n") - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" cat << 'PROMPT_EOF'\n") + yaml.WriteString(" \n") + yaml.WriteString(" PROMPT_EOF\n") } for i, section := range builtinSections { @@ -462,63 +467,43 @@ func (c *Compiler) generateUnifiedPromptCreationStep(yaml *strings.Builder, buil if section.ShellCondition != "" { // Close heredoc if open, add conditional if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } - fmt.Fprintf(yaml, " if %s; then\n", section.ShellCondition) + fmt.Fprintf(yaml, " if %s; then\n", section.ShellCondition) if section.IsFile { // File reference inside conditional promptPath := fmt.Sprintf("%s/%s", promptsDir, section.Content) - if isFirstContent { - yaml.WriteString(" " + fmt.Sprintf("cat \"%s\" > \"$GH_AW_PROMPT\"\n", promptPath)) - isFirstContent = false - } else { - yaml.WriteString(" " + fmt.Sprintf("cat \"%s\" >> \"$GH_AW_PROMPT\"\n", promptPath)) - } + yaml.WriteString(" " + fmt.Sprintf("cat \"%s\"\n", promptPath)) } else { // Inline content inside conditional - open heredoc, write content, close - if isFirstContent { - yaml.WriteString(" cat << 'PROMPT_EOF' > \"$GH_AW_PROMPT\"\n") - isFirstContent = false - } else { - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - } + yaml.WriteString(" cat << 'PROMPT_EOF'\n") normalizedContent := normalizeLeadingWhitespace(section.Content) cleanedContent := removeConsecutiveEmptyLines(normalizedContent) contentLines := strings.Split(cleanedContent, "\n") for _, line := range contentLines { - yaml.WriteString(" " + line + "\n") + yaml.WriteString(" " + line + "\n") } - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") } - yaml.WriteString(" fi\n") + yaml.WriteString(" fi\n") } else { // Unconditional section if section.IsFile { // Close heredoc if open if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } // Cat the file promptPath := fmt.Sprintf("%s/%s", promptsDir, section.Content) - if isFirstContent { - yaml.WriteString(" " + fmt.Sprintf("cat \"%s\" > \"$GH_AW_PROMPT\"\n", promptPath)) - isFirstContent = false - } else { - yaml.WriteString(" " + fmt.Sprintf("cat \"%s\" >> \"$GH_AW_PROMPT\"\n", promptPath)) - } + yaml.WriteString(" " + fmt.Sprintf("cat \"%s\"\n", promptPath)) } else { // Inline content - open heredoc if not already open if !inHeredoc { - if isFirstContent { - yaml.WriteString(" cat << 'PROMPT_EOF' > \"$GH_AW_PROMPT\"\n") - isFirstContent = false - } else { - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - } + yaml.WriteString(" cat << 'PROMPT_EOF'\n") inHeredoc = true } // Write content directly to open heredoc @@ -526,7 +511,7 @@ func (c *Compiler) generateUnifiedPromptCreationStep(yaml *strings.Builder, buil cleanedContent := removeConsecutiveEmptyLines(normalizedContent) contentLines := strings.Split(cleanedContent, "\n") for _, line := range contentLines { - yaml.WriteString(" " + line + "\n") + yaml.WriteString(" " + line + "\n") } } } @@ -536,12 +521,12 @@ func (c *Compiler) generateUnifiedPromptCreationStep(yaml *strings.Builder, buil if len(builtinSections) > 0 { // Close heredoc if open if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - yaml.WriteString(" \n") - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" cat << 'PROMPT_EOF'\n") + yaml.WriteString(" \n") + yaml.WriteString(" PROMPT_EOF\n") } // 2. Write user prompt chunks (appended after built-in sections) @@ -555,51 +540,44 @@ func (c *Compiler) generateUnifiedPromptCreationStep(yaml *strings.Builder, buil // Close heredoc if open before writing runtime-import macro if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } // Write the macro directly with proper indentation // Write the macro using a heredoc to avoid potential escaping issues - if isFirstContent { - yaml.WriteString(" cat << 'PROMPT_EOF' > \"$GH_AW_PROMPT\"\n") - isFirstContent = false - } else { - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - } - yaml.WriteString(" " + chunk + "\n") - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" cat << 'PROMPT_EOF'\n") + yaml.WriteString(" " + chunk + "\n") + yaml.WriteString(" PROMPT_EOF\n") continue } // Regular chunk - close heredoc if open before starting new chunk if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") inHeredoc = false } - // Each user prompt chunk is written as a separate heredoc append - if isFirstContent { - yaml.WriteString(" cat << 'PROMPT_EOF' > \"$GH_AW_PROMPT\"\n") - isFirstContent = false - } else { - yaml.WriteString(" cat << 'PROMPT_EOF' >> \"$GH_AW_PROMPT\"\n") - } + // Each user prompt chunk is written as a separate heredoc + yaml.WriteString(" cat << 'PROMPT_EOF'\n") lines := strings.Split(chunk, "\n") for _, line := range lines { - yaml.WriteString(" ") + yaml.WriteString(" ") yaml.WriteString(line) yaml.WriteByte('\n') } - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") } // Close heredoc if still open if inHeredoc { - yaml.WriteString(" PROMPT_EOF\n") + yaml.WriteString(" PROMPT_EOF\n") } + // Close the grouped redirect and write to file + yaml.WriteString(" } > \"$GH_AW_PROMPT\"\n") + // Generate JavaScript-based placeholder substitution step (replaces multiple sed calls) // This handles both built-in section expressions and user prompt expressions if len(allExpressionMappings) > 0 {