Skip to content

Commit cb460be

Browse files
committed
2 parents a2f2c6e + 54a5779 commit cb460be

3 files changed

Lines changed: 237 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ These workflows analyze the repository, code, and activity to produce reports, i
7272
- [📝 Agentic Wiki Writer](docs/agentic-wiki-writer.md) - Automatically generate and maintain GitHub wiki pages from source code
7373
- [🔧 Agentic Wiki Coder](docs/agentic-wiki-coder.md) - Implement code changes described in GitHub wiki edits
7474
- [📖 Glossary Maintainer](docs/glossary-maintainer.md) - Automatically maintain project glossary based on codebase changes
75+
- [🎙️ Dictation Prompt Generator](docs/dictation-prompt.md) - Generate and maintain a project-specific `DICTATION.md` file with speech-to-text vocabulary and error-correction guidance
7576
- [🔗 Link Checker](docs/link-checker.md) - Daily automated link checker that finds and fixes broken links in documentation
7677
- [🗜️ Documentation Unbloat](docs/unbloat-docs.md) - Automatically simplify documentation by reducing verbosity while maintaining clarity
7778
- [✨ Code Simplifier](docs/code-simplifier.md) - Automatically simplify recently modified code for improved clarity and maintainability

docs/dictation-prompt.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# 🎙️ Dictation Prompt Generator
2+
3+
> For an overview of all available workflows, see the [main README](../README.md).
4+
5+
**Generate and maintain a project-specific dictation instruction file for speech-to-text workflows**
6+
7+
The [Dictation Prompt Generator workflow](../workflows/dictation-prompt.md?plain=1) runs weekly on Sundays. It scans your documentation for technical vocabulary, builds an NLP word-frequency histogram, and creates or updates `DICTATION.md` — a concise dictation instruction file that teaches your speech-to-text engine your project's terminology.
8+
9+
Pairs naturally with [dictationmd](https://github.com/pelikhan/dictationmd), a tool that reads `DICTATION.md` and configures speech recognition profiles accordingly.
10+
11+
## Installation
12+
13+
```bash
14+
# Install the 'gh aw' extension
15+
gh extension install github/gh-aw
16+
17+
# Add the workflow to your repository
18+
gh aw add-wizard githubnext/agentics/dictation-prompt
19+
```
20+
21+
This walks you through adding the workflow to your repository.
22+
23+
## How It Works
24+
25+
```mermaid
26+
graph LR
27+
A[Run NLP Histogram Step] --> B[Scan Documentation]
28+
B --> C[Extract 256 Terms]
29+
C --> D[Build DICTATION.md]
30+
D --> E[Create PR]
31+
```
32+
33+
1. **Setup step**: A shell script scans common documentation locations (`docs/`, `documentation/`, `wiki/`, `pages/`, `content/`, `site/`, and root-level markdown files) and prints a word-frequency histogram of backtick-quoted tokens and technical identifiers.
34+
2. **Agent**: Uses the histogram output and targeted semantic searches to extract the 256 most relevant project-specific terms, then creates or updates `DICTATION.md` with:
35+
- A 256-term project glossary (alphabetically sorted)
36+
- Speech-to-text error correction guidance (ambiguous terms, spacing, hyphenation)
37+
- Text "agentification" rules: removing filler words and improving clarity
38+
39+
## Usage
40+
41+
The workflow runs every Sunday around 06:00 UTC. You can also trigger it manually.
42+
43+
### Configuration
44+
45+
This workflow works out of the box. You can customize the glossary size, documentation paths, and PR settings in the workflow file.
46+
47+
After editing run `gh aw compile` to update the workflow and commit all changes to the default branch.
48+
49+
### Commands
50+
51+
You can start a run immediately:
52+
53+
```bash
54+
gh aw run dictation-prompt
55+
```
56+
57+
### Triggering CI on Pull Requests
58+
59+
To automatically trigger CI checks on PRs created by this workflow, configure an additional repository secret `GH_AW_CI_TRIGGER_TOKEN`. See the [triggering CI documentation](https://github.github.com/gh-aw/reference/triggering-ci/) for setup instructions.
60+
61+
## Learn More
62+
63+
- [dictationmd](https://github.com/pelikhan/dictationmd) — companion tool that reads `DICTATION.md` and configures speech recognition profiles

workflows/dictation-prompt.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
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

Comments
 (0)