Add jqschema shared workflow for analyzing large tool outputs#1942
Conversation
|
@copilot renamed shared workflow and script to jqschema |
|
@copilot add shared workflow to github PR analyzer agentic workflows, daily news, scout, cli version checker |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added jqschema import to changeset-generator (PR analyzer), daily-news, scout, and cli-version-checker. All workflows compile successfully. (commit: ${git rev-parse --short HEAD})
Done. Renamed shared workflow to |
| @@ -0,0 +1,109 @@ | |||
| --- | |||
There was a problem hiding this comment.
@copilot add tools section
tools:
bash:
- "jq *"
- "/tmp/gh-aw/jqschema.sh"
There was a problem hiding this comment.
Added tools section with bash: ["jq *", "/tmp/gh-aw/jqschema.sh"]. Tools are automatically merged into workflows that import jqschema.
| steps: | ||
| - name: Set up jq utilities directory | ||
| run: | | ||
| mkdir -p /tmp/gh-aw/jq |
There was a problem hiding this comment.
Removed mkdir -p /tmp/gh-aw/jq line. Script now writes directly to /tmp/gh-aw/.
| - name: Set up jq utilities directory | ||
| run: | | ||
| mkdir -p /tmp/gh-aw/jq | ||
| cat > /tmp/gh-aw/jq/jqschema.sh << 'EOF' |
There was a problem hiding this comment.
@copilot use /tmp/gh-aw/ folder, no nested jq needed
There was a problem hiding this comment.
Changed to /tmp/gh-aw/jqschema.sh (removed nested jq folder). All paths updated throughout documentation and workflows.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot import jqschema in the github copilot PR analyzer agentic workflows |
|
Agentic Changeset Generator triggered by this pull request. |
Cannot add jqschema import to copilot-agent-analysis workflow - the workflow content (18KB) + jqschema docs (3.3KB) exceeds GitHub Actions' 21KB limit for WORKFLOW_MARKDOWN environment variable. The workflow would need to be shortened first.
Cannot add jqschema import to copilot-agent-analysis workflow - the workflow content (18KB) + jqschema docs (3.3KB) exceeds GitHub Actions' 21KB limit for WORKFLOW_MARKDOWN environment variable. The workflow would need to be shortened first. |
Overview
This PR adds a shared agentic workflow component that provides AI agents with a
jq-based JSON schema discovery utility. The tool helps agents discover the structure of complex JSON responses from GitHub search tools and other APIs without displaying verbose output.Motivation
When AI agents use GitHub search tools like
search_code,search_issues, orsearch_repositories, the API responses can be extremely large (thousands of results with nested objects). Agents need to understand the structure of these responses to extract relevant data, but displaying full responses is:Solution
Created a shared workflow that:
/tmp/gh-aw/jqschema.sh) that transforms JSON data into compact schemasjqrecursively to replace all values with their type names ("string", "number", "boolean", "null")jq *and the script path, automatically available in importing workflowsExample Transformation
Input (GitHub repository search response):
{ "total_count": 2500, "incomplete_results": false, "items": [ { "name": "gh-aw", "stargazers_count": 100, "topics": ["github", "agentic"], "license": {"key": "mit", "name": "MIT License"} } ] }Output (compact schema):
{"incomplete_results":"boolean","items":[{"license":{"key":"string","name":"string"},"name":"string","stargazers_count":"number","topics":["string"]}],"total_count":"number"}Usage
Workflows can import this shared component and agents will have access to the script and bash tools:
Agents can then use it to analyze tool outputs:
Benefits
Files Changed
.github/workflows/shared/jqschema.md- New shared workflow component with script, tools, and documentation.github/workflows/test-jqschema.md- Test workflow demonstrating usage.github/workflows/test-jqschema.lock.yml- Compiled test workflowWorkflows Updated
The jqschema utility has been added to the following workflows for immediate use:
.github/workflows/changeset-generator.md- GitHub PR analyzer.github/workflows/daily-news.md- Daily repository news summary.github/workflows/scout.md- Research and investigation workflow.github/workflows/cli-version-checker.md- CLI version monitoringTesting
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.