Agent skill
repo-hygiene
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/repo-hygiene
SKILL.md
Repo Hygiene
Comprehensive repository housekeeping: pre-work validation, documentation updates, writing style, and cleanup.
Pre-Work Checks
MANDATORY before adding files or making structural changes.
Before Adding Files
- Find existing examples of similar files
- State the correct location based on those examples
- Tell the user your plan and wait for confirmation
- Send updates during work
If you skip any step: BLOCKED
Finding Patterns
# For skills
ls -la .claude/skills/ | head -10
find . -name "SKILL.md" -type f | head -10
# For any file type
find . -name "*.ts" -type f | head -10
Self-Check Before File Creation
- Did I check existing patterns?
- Did I tell the user my plan?
- Did I wait for confirmation?
- Did I send updates during work?
If any answer is "no": STOP and fix it.
Documentation Updates
Automatically update project documentation after task completion.
Trigger Conditions
Invoke after:
- Completing any task
- Adding a new feature
- Fixing a bug
- Refactoring code
PLAN.md Updates
All plan updates go to root PLAN.md. This is the single source of truth.
Mark completed items:
## Current Sprint
- [x] Implement user authentication # Was [ ]
Add discovered work:
## Backlog
- [ ] (discovered) New task from implementation
Move completed items with timestamp:
## Completed
- [x] Task description (2026-01-30)
README.md Updates
Update when:
- New user-facing feature added
- API changed
- New command available
- Installation steps changed
Alphabetical Ordering
All skill lists and tables in documentation (README.md, CLAUDE.md) must be sorted alphabetically by skill name. Within categorized sections, sort alphabetically within each category.
Check after any skill addition or rename:
# Verify alphabetical order in markdown tables
grep '^\| \[' README.md # Visual check: names should be A-Z within each section
grep '^\|' CLAUDE.md # Visual check: names should be A-Z
If out of order: fix before committing.
Link Validation
Verify all markdown links resolve before committing:
# Find all markdown links and check they exist
grep -oE '\[.*?\]\(\.?/?[^)]+\)' README.md | \
sed -E 's/.*\(([^)]+)\)/\1/' | \
while read link; do
[ -e "$link" ] || echo "BROKEN: $link"
done
Check for:
- Relative links (./path/to/file.md): Must resolve from README location
- Anchor links (#section): Must match a heading in the target file
- External links: Verify with curl if critical
Run validation after any documentation update.
Pre-Merge Cleanup
When preparing to merge:
# 1. Sync CLAUDE.md with installed skills
skills claudemd sync
# 2. Scan for test artifacts and slop
skills hygiene scan
# 3. If slop found, clean it
skills hygiene clean --confirm
# 4. Update PLAN.md with completed work
# 5. Commit and push
git add -A && git commit -m "chore: pre-merge cleanup" && git push
Writing Style
Use for all markdown files: README.md, PLAN.md, documentation.
Voice
- Write like speaking to an intelligent friend
- Short sentences. Direct claims. No hedging.
- Active voice, not passive
- State claims confidently
Punctuation Rules
- Never use em dashes (—)
- Use periods and new sentences for separate thoughts
- Use commas for simple asides
- Use parentheses for clarifying information
- Use colons for lists or elaboration
Structure
- Start with the point, not background
- One idea per paragraph
- Headers should be claims, not topics
- End sections when the point is made
Quality Checklist
- No em dashes in content
- Sentences are short and direct
- Opens with the main point
- Code examples are minimal
- Tables used for structured data
Slop Cleanup
Detect and clean AI-generated slop from your project.
Quick Start
# Scan for slop
skills hygiene scan
# Preview what would be deleted
skills hygiene clean --dry-run
# Actually delete slop
skills hygiene clean --confirm
What is Slop?
| Pattern | Example | Action |
|---|---|---|
test-skill-* |
test-skill-1234567890 |
Delete |
| Timestamped | my-skill-1706625000000 |
Review |
_temp_* |
_temp_claude-svelte5-skill |
Review |
| Placeholder | "NEW content with improvements!" | Delete |
CLAUDE.md Cleanup
Check for:
- Stale references: Skills listed but not installed
- Duplicate references: Same skill listed multiple times
Run skills claudemd sync to fix.
Decision Tree
Found test-skill-*?
├─ YES → Delete (safe)
└─ NO
├─ Found _temp_* with good content?
│ └─ Rename to proper name, delete _temp_ version
├─ Found placeholder content?
│ └─ Delete or rewrite
└─ Found stale CLAUDE.md refs?
└─ Run: skills claudemd sync
Related Commands
skills validate- Check skill qualityskills claudemd sync- Sync CLAUDE.md with installed skillsskills list- Show installed skills
Rationalizations (Do Not Skip)
| Excuse | Why It's Wrong | Required Action |
|---|---|---|
| "I know where it goes" | You were wrong last time | Check existing patterns |
| "Too small to document" | Small changes accumulate | Update PLAN.md |
| "I'll remember" | Context is lost between sessions | Write it down |
| "It's obvious" | Clearly it wasn't | Confirm with user |
| "Just a bug fix" | Bugs deserve tracking | Mark complete |
Reference Files
For README writing guidelines, see:
references/readme-structure.md- Section orderingreferences/readme-badges.md- Badge patternsreferences/readme-cli-docs.md- CLI documentationreferences/readme-checklist.md- Full checklist
For prose quality and markdown rewriting support, use:
../paul-graham/SKILL.md- Direct, high-signal writing and editing workflow
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?