Skip to content

Commit 1761033

Browse files
Copilotpelikhan
andauthored
Optimize qmd-docs workflows: explicitly instruct models to use qmd-query for doc search (#20987)
* Initial plan * Optimize qmd-docs workflows with explicit qmd-query usage instructions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 0a5055a commit 1761033

8 files changed

Lines changed: 57 additions & 6 deletions

File tree

.github/workflows/daily-doc-healer.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ For each issue that was NOT addressed by DDUw:
9797

9898
1. Use `list_commits` and `get_commit` to review commits from the past 7 days.
9999
2. Determine whether any code change is directly related to the issue's subject matter (feature, flag, behavior described in the issue).
100-
3. Read the referenced documentation files to verify the gap exists today:
100+
3. **Use `qmd-query` to find relevant documentation files** for the feature or concept described in the issue — this is faster than using `find` and surfaces the most semantically relevant pages:
101+
- e.g., `qmd-query("permissions workflow configuration")` or `qmd-query("safe-outputs create-pull-request")`
102+
- Read the returned file paths to verify the documentation gap exists today
103+
4. Read the identified documentation files to verify the gap exists today:
101104

102105
```bash
103106
find docs/src/content/docs -name '*.md' -o -name '*.mdx'

.github/workflows/daily-doc-updater.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,17 @@ Pay special attention to:
125125

126126
Review the documentation in the `docs/src/content/docs/` directory:
127127

128+
**First, use `qmd-query` to search for existing documentation** related to each identified change — this is faster and more accurate than browsing files manually:
129+
- For each new feature or change, run a targeted query: e.g., `qmd-query("engine configuration options")` or `qmd-query("permissions frontmatter field")`
130+
- Read the returned file paths to check if documentation already exists
131+
- Only resort to `find` for exhaustive listing when you need a complete inventory
132+
128133
- Check if new features are already documented
129134
- Identify which documentation files need updates
130135
- Determine the appropriate documentation type (tutorial, how-to, reference, explanation)
131136
- Find the best location for new content
132137

133-
Use bash commands to explore documentation structure:
138+
Use bash commands to explore documentation structure when needed:
134139

135140
```bash
136141
find docs/src/content/docs -name '*.md' -o -name '*.mdx'

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ If there's a previous run's data, load it to understand historical context:
103103

104104
### 1. Identify All Markdown Files
105105

106+
Use `qmd-query` to discover relevant documentation and spec files before listing files with bash:
107+
108+
```bash
109+
# Use qmd-query first to find semantically relevant files
110+
# Example: qmd-query("developer instructions code organization")
111+
# Example: qmd-query("project architecture patterns")
112+
# Then read the returned file paths to get full content
113+
```
114+
106115
Find all `.md` files in the `scratchpad/` directory:
107116

108117
```bash

.github/workflows/dictation-prompt.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ Create a concise dictation instruction file at `skills/dictation/SKILL.md` that:
5656

5757
### 1. Scan Documentation for Project-Specific Glossary
5858

59-
Scan documentation files in `docs/src/content/docs/` to extract approximately 1000 project-specific technical terms (950-1050 acceptable).
59+
Use `qmd-query` to efficiently discover documentation covering different areas of the project, then read the returned files to extract vocabulary. This is more targeted than scanning all files with `find`:
6060

61-
**Focus areas:**
61+
- `qmd-query("workflow configuration frontmatter engine permissions")` — core workflow concepts
62+
- `qmd-query("safe-outputs create-pull-request tools MCP server")` — tools and integrations
63+
- `qmd-query("compilation CLI commands audit logs")` — CLI and developer tools
64+
- `qmd-query("network sandbox runtime activation triggers")` — advanced features
65+
66+
Read each returned file path for its content, then also scan any remaining documentation files in `docs/src/content/docs/` to ensure broad coverage.
67+
68+
**Focus areas for extraction:**
6269
- Configuration: safe-outputs, permissions, tools, cache-memory, toolset, frontmatter
6370
- Engines: copilot, claude, codex, custom
6471
- Bot mentions: @copilot (for GitHub issue assignment)

.github/workflows/glossary-maintainer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ Read the current glossary:
132132
cat docs/src/content/docs/reference/glossary.md
133133
```
134134

135+
**For each candidate term, use `qmd-query` to find documentation that describes it** — this provides authoritative context for writing accurate definitions and reveals whether any documentation page already explains the term:
136+
- e.g., `qmd-query("safe-outputs create-pull-request")` to find pages describing that feature
137+
- e.g., `qmd-query("engine configuration copilot")` to find all documentation on engines
138+
- Read the returned file paths for full context before writing definitions
139+
135140
**Check for:**
136141
- Terms that are missing from the glossary
137142
- Terms that need updated definitions

.github/workflows/shared/mcp/qmd-docs.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,16 @@ mcp-scripts:
4949

5050
<qmd>
5151
Use `qmd-query` to find relevant documentation files with a natural language request — it queries a local vector database of project docs, agents, and workflow files. Read the returned file paths to get full content.
52+
53+
**Always use `qmd-query` first** when you need to find, verify, or search documentation:
54+
- **Before using `find` or `bash` to list files** — use `qmd-query` to discover the most relevant docs for a topic
55+
- **Before writing new content** — search first to check whether documentation already exists
56+
- **When identifying relevant files** — use it to narrow down which documentation pages cover a feature or concept
57+
- **When understanding a term or concept** — query to find authoritative documentation describing it
58+
59+
**Usage tips:**
60+
- Use descriptive, natural language queries: e.g., `"how to configure MCP servers"` or `"safe-outputs create-pull-request options"` or `"permissions frontmatter field"`
61+
- Lower `min_score` (e.g., `0.3`) to get broader results; raise it (e.g., `0.6`) to get only the most closely matching files
62+
- Always read the returned file paths to get the full content — `qmd-query` returns paths only, not content
63+
- Combine multiple targeted queries rather than one broad query for better coverage
5264
</qmd>

.github/workflows/technical-doc-writer.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ When reviewing documentation for the specified topic in the **docs/** folder:
108108

109109
1. **Analyze the topic** provided in the workflow input: "${{ github.event.inputs.topic }}"
110110

111-
2. **Review relevant documentation files** in the docs/ folder related to the topic
111+
2. **Find relevant documentation files** using `qmd-query` before browsing files manually:
112+
- Query with the topic: e.g., `qmd-query("${{ github.event.inputs.topic }}")`
113+
- Run additional targeted queries if needed (e.g., `qmd-query("${{ github.event.inputs.topic }} examples")`)
114+
- Read each returned file path to get the full content
115+
- Then review those files in the docs/ folder
112116

113117
3. **Make improvements** to the documentation as needed:
114118
- Fix clarity and conciseness issues

.github/workflows/unbloat-docs.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ This will help you avoid re-cleaning files that were recently processed.
152152

153153
### 2. Find Documentation Files
154154

155-
Scan the `docs/` directory for markdown files, excluding code-generated files and blog posts:
155+
Use `qmd-query` to semantically search for documentation files that may contain bloat (verbose descriptions, repetitive patterns, excessive bullet points). This is faster and more targeted than listing all files:
156+
157+
- Query for areas known to accumulate bloat: `qmd-query("verbose documentation long examples repeated patterns")`
158+
- Query for specific topics recently added: `qmd-query("recently added feature documentation")`
159+
- Read the returned file paths to assess their content
160+
161+
Then scan the `docs/` directory for all markdown files, excluding code-generated files and blog posts:
156162
```bash
157163
find docs/src/content/docs -path 'docs/src/content/docs/blog' -prune -o -name '*.md' -type f ! -name 'frontmatter-full.md' -print
158164
```

0 commit comments

Comments
 (0)