docs.expand.glossary
# docs.expand.glossary
What this skill does
# docs.expand.glossary
**Version**: 0.1.0
**Status**: active
## Overview
The `docs.expand.glossary` skill automatically discovers undocumented terms from Betty manifests and documentation, then enriches `glossary.md` with auto-generated definitions. This ensures comprehensive documentation coverage and helps maintain consistency across the Betty ecosystem.
## Purpose
- Extract field names and values from `skill.yaml` and `agent.yaml` manifests
- Scan markdown documentation for capitalized terms that may need definitions
- Identify gaps in the existing glossary
- Auto-generate definitions for common technical terms
- Update `glossary.md` with new entries organized alphabetically
- Emit JSON summary of changes for auditing
## Inputs
| Name | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `glossary_path` | string | No | `docs/glossary.md` | Path to the glossary file to expand |
| `base_dir` | string | No | Project root | Base directory to scan for manifests |
| `dry_run` | boolean | No | `false` | Preview changes without writing to file |
| `include_auto_generated` | boolean | No | `true` | Include auto-generated definitions |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| `summary` | object | Summary with counts, file paths, and operation metadata |
| `new_definitions` | object | Dictionary mapping new terms to their definitions |
| `manifest_terms` | object | Categorized terms extracted from manifests |
| `skipped_terms` | array | Terms that were skipped (already documented or too common) |
## What Gets Scanned
### Manifest Files
**skill.yaml fields:**
- `status` values (active, draft, deprecated, archived)
- `runtime` values (python, javascript, bash)
- `permissions` (filesystem:read, filesystem:write, network:http)
- Input/output `type` values
- `entrypoints` parameters
**agent.yaml fields:**
- `reasoning_mode` (iterative, oneshot)
- `status` values
- `capabilities`
- Error handling strategies (on_validation_failure, etc.)
- Timeout and retry configurations
### Documentation
- Scans all `docs/*.md` files for capitalized multi-word phrases
- Identifies technical terms that may need glossary entries
- Filters out common words and overly generic terms
## How It Works
1. **Load Existing Glossary**: Parses `glossary.md` to identify already-documented terms
2. **Scan Manifests**: Recursively walks `skills/` and `agents/` directories for YAML files
3. **Extract Terms**: Collects field names, values, and configuration options from manifests
4. **Scan Docs**: Looks for capitalized terms in markdown documentation
5. **Generate Definitions**: Creates concise, accurate definitions for common technical terms
6. **Update Glossary**: Inserts new terms alphabetically into appropriate sections
7. **Report**: Returns JSON summary with all changes and statistics
## Auto-Generated Definitions
The skill includes predefined definitions for common terms:
- **Status values**: active, draft, deprecated, archived
- **Runtimes**: python, javascript, bash
- **Permissions**: filesystem:read, filesystem:write, network:http
- **Reasoning modes**: iterative, oneshot
- **Types**: string, boolean, integer, object, array
- **Configuration**: max_retries, timeout_seconds, blocking, fuzzy
- **Modes**: dry_run, strict, overwrite
For unknown terms, the skill can generate contextual definitions based on category and usage patterns.
## Usage Examples
### Basic Usage
```bash
# Expand glossary with all undocumented terms
python glossary_expand.py
# Preview changes without writing
python glossary_expand.py --dry-run
# Use custom glossary location
python glossary_expand.py --glossary-path /path/to/glossary.md
```
### Programmatic Usage
```python
from skills.docs.expand.glossary.glossary_expand import expand_glossary
# Expand glossary
result = expand_glossary(
glossary_path="docs/glossary.md",
dry_run=False,
include_auto_generated=True
)
# Check results
if result['ok']:
summary = result['details']['summary']
print(f"Added {summary['new_terms_count']} new terms")
print(f"New terms: {summary['new_terms']}")
```
### Output Format
#### Summary Mode (Default)
```
================================================================================
GLOSSARY EXPANSION SUMMARY
================================================================================
Glossary: /home/user/betty/docs/glossary.md
Existing terms: 45
New terms added: 8
Scanned: 25 skills, 2 agents
--------------------------------------------------------------------------------
NEW TERMS:
--------------------------------------------------------------------------------
### Archived
A status indicating that a component has been retired and is no longer
maintained or available.
### Dry Run
A mode that previews an operation without actually executing it or making
changes.
### Handler
The script or function that implements the core logic of a skill or operation.
...
--------------------------------------------------------------------------------
Glossary updated successfully!
================================================================================
```
#### JSON Mode
```json
{
"ok": true,
"status": "success",
"timestamp": "2025-10-23T19:54:00Z",
"details": {
"summary": {
"glossary_path": "docs/glossary.md",
"existing_terms_count": 45,
"new_terms_count": 8,
"new_terms": ["Archived", "Dry Run", "Handler", ...],
"scanned_files": {
"skills": 25,
"agents": 2
}
},
"new_definitions": {
"Archived": "A status indicating...",
"Dry Run": "A mode that previews...",
...
},
"manifest_terms": {
"status": ["active", "draft", "deprecated", "archived"],
"runtime": ["python", "bash"],
"permissions": ["filesystem:read", "filesystem:write"]
}
}
}
```
## Integration
### With CI/CD
```yaml
# .github/workflows/docs-check.yml
- name: Check glossary completeness
run: |
python skills/docs.expand.glossary/glossary_expand.py --dry-run
# Fail if new terms found
if [ $? -eq 0 ]; then
echo "Glossary is complete"
else
echo "Missing glossary terms - run skill to update"
exit 1
fi
```
### As a Hook
Can be integrated as a pre-commit hook to ensure glossary stays current:
```yaml
# .claude/hooks.yaml
- name: glossary-completeness-check
event: on_commit
command: python skills/docs.expand.glossary/glossary_expand.py --dry-run
blocking: false
```
## Skipped Terms
The skill automatically skips:
- Terms already in the glossary
- Common words (name, version, description, etc.)
- Generic types (string, boolean, file, path, etc.)
- Single-character or overly generic terms
## Limitations
- Auto-generated definitions may need manual refinement for domain-specific terms
- Complex or nuanced terms may require human review
- Alphabetical insertion may need manual adjustment for optimal organization
- Does not detect duplicate or inconsistent definitions
## Future Enhancements
- Detect and flag duplicate definitions
- Identify outdated or inconsistent glossary entries
- Generate contextual definitions using LLM analysis
- Support for multi-language glossaries
- Integration with documentation linting tools
## Dependencies
- `context.schema` - For validating manifest structure
## Tags
`documentation`, `glossary`, `automation`, `analysis`, `manifests`
## Related Skills
- `generate.docs` - Generate SKILL.md documentation from manifests
- `registry.query` - Query registries for specific terms and metadata
- `skill.define` - Define and register new skills
## See Also
- [Glossary](../../docs/glossary.md) - The Betty Framework glossary
- [Contributing](../../docs/contributing.md) - Documentation contribution guidelines
- [Developer Guide](../../docs/developer-guide.md) - Building and extending Betty
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.