|
| 1 | +--- |
| 2 | +name: Dictation Prompt Generator |
| 3 | +description: Generates optimized prompts for voice dictation and speech-to-text workflows |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + schedule: weekly on sunday around 6:00 |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + issues: read |
| 11 | + pull-requests: read |
| 12 | + |
| 13 | +engine: copilot |
| 14 | + |
| 15 | +network: defaults |
| 16 | + |
| 17 | +imports: |
| 18 | + - shared/reporting.md |
| 19 | + |
| 20 | +tools: |
| 21 | + edit: |
| 22 | + bash: |
| 23 | + - "*" |
| 24 | + github: |
| 25 | + toolsets: [default] |
| 26 | + |
| 27 | +safe-outputs: |
| 28 | + create-pull-request: |
| 29 | + expires: 2d |
| 30 | + title-prefix: "[docs] " |
| 31 | + labels: [documentation, automation] |
| 32 | + draft: false |
| 33 | + auto-merge: true |
| 34 | + |
| 35 | +timeout-minutes: 10 |
| 36 | + |
| 37 | +steps: |
| 38 | + - name: Compute NLP word-frequency histogram |
| 39 | + run: | |
| 40 | + python3 - <<'EOF' |
| 41 | + import re |
| 42 | + from pathlib import Path |
| 43 | + from collections import Counter |
| 44 | +
|
| 45 | + # Common documentation locations to scan |
| 46 | + doc_roots = [ |
| 47 | + "docs/src/content/docs", |
| 48 | + "docs", |
| 49 | + "documentation", |
| 50 | + "doc", |
| 51 | + "wiki", |
| 52 | + "pages", |
| 53 | + "content", |
| 54 | + "site", |
| 55 | + ] |
| 56 | +
|
| 57 | + tokens = Counter() |
| 58 | + scanned = 0 |
| 59 | +
|
| 60 | + for root in doc_roots: |
| 61 | + p = Path(root) |
| 62 | + if p.is_dir(): |
| 63 | + for md_file in p.rglob("*.md"): |
| 64 | + text = md_file.read_text(errors="replace") |
| 65 | + # Collect backtick-quoted technical tokens |
| 66 | + tokens.update(re.findall(r'`([^`\n]+)`', text)) |
| 67 | + # Also collect hyphenated/dotted/underscored identifiers |
| 68 | + tokens.update(re.findall(r'\b([\w][\w\-\.]{2,}[\w])\b', text)) |
| 69 | + scanned += 1 |
| 70 | +
|
| 71 | + # Also scan root-level markdown files (README, CONTRIBUTING, etc.) |
| 72 | + for md_file in Path(".").glob("*.md"): |
| 73 | + text = md_file.read_text(errors="replace") |
| 74 | + tokens.update(re.findall(r'`([^`\n]+)`', text)) |
| 75 | + tokens.update(re.findall(r'\b([\w][\w\-\.]{2,}[\w])\b', text)) |
| 76 | + scanned += 1 |
| 77 | +
|
| 78 | + print(f"Scanned {scanned} files. Frequency histogram — top 500 project tokens:") |
| 79 | + for tok, n in tokens.most_common(500): |
| 80 | + if len(tok) > 2: |
| 81 | + print(f" {n:5d} {tok}") |
| 82 | + EOF |
| 83 | +--- |
| 84 | + |
| 85 | +# Dictation Prompt Generator |
| 86 | + |
| 87 | +Extract technical vocabulary from documentation files and create a concise dictation instruction file for fixing speech-to-text errors and improving text clarity. |
| 88 | + |
| 89 | +## Your Mission |
| 90 | + |
| 91 | +Create a concise dictation instruction file at `DICTATION.md` that: |
| 92 | +1. Contains a glossary of exactly 256 project-specific terms extracted from documentation |
| 93 | +2. Provides instructions for fixing speech-to-text errors (ambiguous terms, spacing, hyphenation) |
| 94 | +3. Provides instructions for "agentifying" text: removing filler words (humm, you know, um, uh, like, etc.), improving clarity, and making text more professional |
| 95 | +4. Does NOT include planning guidelines or examples (keep it short and focused on error correction and text cleanup) |
| 96 | +5. Includes guidelines to NOT plan or provide examples, just focus on fixing speech-to-text errors and improving text quality. |
| 97 | + |
| 98 | +## Task Steps |
| 99 | + |
| 100 | +### 1. Review NLP Word-Frequency Histogram |
| 101 | + |
| 102 | +The setup step has already run a word-frequency histogram across all documentation files and printed the results to the log. Review that output as the **primary source** for selecting the 256 glossary terms — prefer tokens with high frequency that are project-specific (not generic English words). |
| 103 | + |
| 104 | +### 2. Scan Documentation for Project-Specific Glossary |
| 105 | + |
| 106 | +Use `search` 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`: |
| 107 | + |
| 108 | +- `search("workflow configuration frontmatter engine permissions")` — core workflow concepts |
| 109 | +- `search("safe-outputs create-pull-request tools MCP server")` — tools and integrations |
| 110 | +- `search("compilation CLI commands audit logs")` — CLI and developer tools |
| 111 | +- `search("network sandbox runtime activation triggers")` — advanced features |
| 112 | + |
| 113 | +Read each returned file path for its content, then also scan any remaining documentation files in common locations (`docs/`, `documentation/`, `doc/`, `wiki/`, `pages/`, `content/`, `site/`) to ensure broad coverage. |
| 114 | + |
| 115 | +**Focus areas for extraction:** |
| 116 | +- Configuration: safe-outputs, permissions, tools, cache-memory, toolset, frontmatter |
| 117 | +- Engines: @copilot, claude, codex, custom |
| 118 | +- Bot mentions: @copilot (for GitHub issue assignment) |
| 119 | +- Commands: compile, audit, logs, mcp, recompile |
| 120 | +- GitHub concepts: workflow_dispatch, pull_request, issues, discussions |
| 121 | +- Repository-specific: agentic workflows, gh-aw, activation, MCP servers |
| 122 | +- File formats: markdown, lockfile (.lock.yml), YAML |
| 123 | +- Tool types: edit, bash, github, playwright, web-fetch, web-search |
| 124 | +- Operations: fmt, lint, test-unit, timeout-minutes, runs-on |
| 125 | + |
| 126 | +**Exclude**: makefile, Astro, starlight (tooling-specific, not user-facing) |
| 127 | + |
| 128 | +### 3. Create the Dictation Instructions File |
| 129 | + |
| 130 | +Create `DICTATION.md` with: |
| 131 | +- Frontmatter with name and description fields |
| 132 | +- Title: Dictation Instructions |
| 133 | +- Technical Context: Brief description of gh-aw |
| 134 | +- Project Glossary: 256 terms, alphabetically sorted, one per line |
| 135 | +- Fix Speech-to-Text Errors: Common misrecognitions → correct terms |
| 136 | +- Clean Up and Improve Text: Instructions for removing filler words and improving clarity |
| 137 | +- Guidelines: General instructions as follows |
| 138 | + |
| 139 | +```markdown |
| 140 | +You do not have enough background information to plan or provide code examples. |
| 141 | +- do NOT generate code examples |
| 142 | +- do NOT plan steps |
| 143 | +- focus on fixing speech-to-text errors and improving text quality |
| 144 | +- remove filler words (humm, you know, um, uh, like, basically, actually, etc.) |
| 145 | +- improve clarity and make text more professional |
| 146 | +- maintain the user's intended meaning |
| 147 | +``` |
| 148 | + |
| 149 | +### 4. Create Pull Request |
| 150 | + |
| 151 | +Use the create-pull-request tool to submit your changes with: |
| 152 | +- Title: "[docs] Update dictation skill instructions" |
| 153 | +- Description explaining the changes made to DICTATION.md |
| 154 | + |
| 155 | +## Guidelines |
| 156 | + |
| 157 | +- Scan documentation files across common locations (`docs/`, `documentation/`, `doc/`, `wiki/`, `pages/`, `content/`, `site/`, and root-level `.md` files) |
| 158 | +- Extract 256 terms (240-270 acceptable) |
| 159 | +- Exclude tooling-specific terms (makefile, Astro, starlight) |
| 160 | +- Prioritize frequently used project-specific terms (use NLP histogram from Step 1) |
| 161 | +- Alphabetize the glossary |
| 162 | +- No descriptions in glossary (just term names) |
| 163 | +- Focus on fixing speech-to-text errors, not planning or examples |
| 164 | + |
| 165 | +## Success Criteria |
| 166 | + |
| 167 | +- ✅ File `DICTATION.md` exists |
| 168 | +- ✅ Contains proper frontmatter (name, description) |
| 169 | +- ✅ Contains 256 project-specific terms (240-270 acceptable) |
| 170 | +- ✅ Terms extracted from documentation only |
| 171 | +- ✅ Focuses on fixing speech-to-text errors |
| 172 | +- ✅ Includes instructions for removing filler words and improving text clarity |
| 173 | +- ✅ Pull request created with changes |
0 commit comments