Validate that all non-git-ignored directories have valid .context.md files.
Steps
- •
Find all directories that are not git-ignored:
bashfind . -type d -not -path './.git/*' | while read dir; do git check-ignore -q "$dir" 2>/dev/null || echo "$dir" done
- •
For each directory found, check if
.context.mdexists - •
If
.context.mdexists, validate it has the required sections:- •
## Purpose- Describes the directory's role - •
## Functionality- Lists external features/capabilities - •
## Files- Documents files in the directory
- •
- •
Report findings:
- •List directories missing
.context.md - •List directories with incomplete context files (missing sections)
- •List directories with valid context files
- •List directories missing
- •
For directories missing context files, offer to create them:
- •Read the files in the directory
- •Analyze their purpose and functionality
- •Generate a
.context.mdwith appropriate content
Valid Context File Format
markdown
# Directory Name ## Purpose Describe the overall role of this directory and how it relates to the rest of the project. ## Functionality High-level description of functionality this directory provides externally: - Feature or capability 1 - Feature or capability 2 ## Files | File | Description | |------|-------------| | `file1.ts` | Brief description | | `file2.ts` | Brief description |
Options
- •Run without arguments to scan and report
- •When missing files are found, ask the user if they want to generate them
- •Skip directories that only contain other directories (no source files)