brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
tidy-project-structureOrganize project files → conventional dirs, update stale READMEs, clean config drift, archive deprecated w/o changing code logic. Use → files scattered no clear org, READMEs outdated/broken examples, config files multiplied across dev/staging/prod, deprecated in root, naming conventions inconsistent.
Independent GitHub snapshot · Automated classification · Original documentation governs
Project org drifted from conventions:
Do NOT use for code refactoring | dep restructuring. Focus = file org + doc hygiene.
| Parameter | Type | Required | Description |
|---|---|---|---|
project_path | string | Yes | Absolute path to project root |
conventions | string | No | Path to style guide (e.g., docs/conventions.md) |
archive_mode | enum | No | move (default) or delete for deprecated files |
readme_update | boolean | No | Update stale READMEs (default: true) |
Cmp current structure vs conventions | language best practices.
Common conventions by lang:
JavaScript/TypeScript:
src/ # Source code
tests/ # Test files
dist/ # Build output (gitignored)
docs/ # Documentation
.github/ # CI/CD workflows
Python:
package_name/ # Package code
tests/ # Test suite
docs/ # Sphinx docs
scripts/ # Utility scripts
R:
R/ # R source
tests/testthat/ # Test suite
man/ # Documentation (generated)
vignettes/ # Long-form guides
inst/ # Installed files
data/ # Package data
Rust:
src/ # Source code
tests/ # Integration tests
benches/ # Benchmarks
examples/ # Usage examples
Got: List of files/dirs violating saved to structure_audit.txt.
If err: No conventions doc'd → use language-std defaults.
Relocate to conventional dirs.
Common moves:
tests/ → tests/docs/ → docs/src/ → delete (gitignored)config/ | .config/Per move:
# Check if file is referenced anywhere
grep -r "filename" .
# If no references or only relative path references:
mkdir -p target_directory/
git mv source/file target_directory/file
# Update any imports/requires
# (language-specific — see repair-broken-references skill)
Got: All files in conventional locations; git history preserved via git mv.
If err: Moving breaks imports → update import paths | escalate.
ID stale info in all READMEs.
Staleness indicators:
# Find all READMEs
find . -name "README.md" -o -name "readme.md"
# For each README:
# - Check last modified date
git log -1 --format="%ci" README.md
# - Check for broken links
markdown-link-check README.md
# - Verify example code still runs (sample first example)
Got: List of stale READMEs in readme_freshness.txt w/ specific issues.
If err: markdown-link-check unavail → manually review external links.
Fix broken links, update examples, add missing sections.
Std fixes:
README template:
# Project Name
Brief description (1-2 sentences).
## Installation
```bash
# Language-specific install command
```
## Usage
```language
# Basic example
```
## Documentation
Link to full docs.
## Contributing
Link to CONTRIBUTING.md or inline guidelines.
## License
LICENSE badge and link.
Got: All READMEs updated; examples verified to run.
If err: Example code can't be verified → mark w/ warning comment.
ID drift + consolidate duplicate settings.
Common config issues:
.env (.env, .env.local, .env.dev, .env.prod)# Find all config files
find . -name "*.config.*" -o -name ".env*" -o -name "*.yml" -o -name "*.yaml"
# For each config:
# - Check for duplicate keys
# - Grep for hardcoded secrets (API keys, tokens, passwords)
grep -E "(api[_-]?key|token|password|secret)" config_file
# - Compare dev vs prod settings
diff .env.dev .env.prod
Got: Config drift doc'd in config_review.txt; secrets flagged for escalation.
If err: Diff shows major divergence → escalate to devops-engineer.
Move | delete files no longer needed.
Candidates:
nginx.conf.old)file.bak, file~)Archive process:
# Create archive directory (if archive_mode=move)
mkdir -p archive/YYYY-MM-DD/
# For each deprecated file:
# 1. Verify not referenced anywhere
grep -r "filename" .
# 2. Check git history for last modification
git log -1 --format="%ci" filename
# 3. If not modified in >1 year and no references:
if [ "$archive_mode" = "move" ]; then
git mv filename archive/YYYY-MM-DD/
else
git rm filename
fi
# 4. Document in ARCHIVE_LOG.md
echo "- filename (reason, last modified: DATE)" >> ARCHIVE_LOG.md
Got: Deprecated archived; ARCHIVE_LOG.md updated.
If err: Uncertain if deprecated → leave + doc in report.
Check inconsistent file naming across project.
Common conventions:
my-file.js (JS/web)my_file.py (Python)MyComponent.tsx (React)myUtility.js (JS fns)# Find files violating conventions
# Example: Python project expecting snake_case
find . -name "*.py" | grep -v "__pycache__" | grep -E "[A-Z-]"
# For each violation, either:
# 1. Rename to match conventions
# 2. Document exception (e.g., Django settings.py convention)
Got: All files follow conventions | exceptions doc'd.
If err: Renaming breaks imports → update references | escalate.
Doc all structural changes.
# Project Structure Tidying Report
**Date**: YYYY-MM-DD
**Project**: <project_name>
## Directory Changes
- Moved X files to conventional directories
- Created Y new directories
- Archived Z deprecated files
## README Updates
- Updated W stale READMEs
- Fixed X broken links
- Verified Y code examples
## Config Cleanup
- Consolidated X duplicate settings
- Flagged Y hardcoded secrets for removal
- Documented Z config drift issues
## Files Archived
See ARCHIVE_LOG.md for full list (Z files).
## Naming Convention Fixes
- Renamed X files to match conventions
- Documented Y exceptions
## Escalations
- [Config drift requiring devops review]
- [Hardcoded secrets requiring security audit]
Got: Report saved to TIDYING_REPORT.md.
If err: (N/A — generate regardless)
Post-tidy:
git mv not mv)mv not git mv → loses history. Always git cmds for moves.