devtu-github

GitHub workflow for ToolUniverse - push code safely by moving temp files, activating pre-commit hooks, running tests, and cleaning staged files. Use when pushing to GitHub, fixing CI failures, or cleaning up before commits.

By mims-harvard · 357 installs

npx skills add mims-harvard/tooluniverse --skill devtu-github

Source repository · Upstream listing

DevTU GitHub Workflow Safely push ToolUniverse code to GitHub by enforcing pre push cleanup, pre commit hooks, and test validation. Instructions When the user wants to push code, fix CI, or prepare a commit, follow this workflow: Phase 1: Pre Push Cleanup 1. Move temp files out of root session docs and ad hoc test scripts must NOT be pushed: 2. Verify nothing unwanted is staged : Red flags these should NEVER be staged: SUMMARY.md , REPORT.md , SESSION .md in root test .py in root (these are ad hoc scripts, not real tests) .env or credential files temp docs and tests/ contents Phase 2: Activate Pre Commit Hooks 3. Ensure pre commit is installed and active : This enables automatic checks on every git commit : ruff check fix Python linting with auto fix ruff format Code formatting YAML/TOML validation Trailing whitespace removal End of file fixes 4. Verify hooks are active : Phase 3: Run Tests 5. Run the full test suite locally : 6. If tests fail , diagnose using the error patterns below and fix before proceeding. Phase 4: Commit and Push 7. Stage only specific files (never use git add . or git add A ): 8. Commit (pre commit hooks run automatically): 9. Rebase onto latest main BEFORE pushing (CRITICAL — prevents PR conflicts): If rebase conflicts arise, resolve them (keep our newer changes), then: 10. Push (force with lease after a rebase): After pushing, verify the PR is conflict free: Files That Must NEVER Be Pushed Temp Session Documents (Root Level .md) These are session notes created during development. Move to temp docs and tests/ before committing: Pattern Example SUMMARY.md API DISCOVERY SESSION SUMMARY.md REPORT.md SKILL TESTING REPORT.md , TOOLUNIVERSE BUG REPORT.md SESSION .md SESSION 2026 02 13.md IMPLEMENTATION .md IMPLEMENTATION COMPLETE.md BUG ANALYSIS .md BUG ANALYSIS DETAILED.md FIX .md FIX SUMMARY.md , CORRECT FIX.md AGENT .md AGENT DESIGN UPDATES.md Exception : README.md , CHANGELOG.md , LICENSE.md are real docs and MUST stay. Root Level Test Scripts Ad hoc test scripts like test .py in root are NOT part of the test suite ( tests/ directory is). Move them to temp docs and tests/ : File Purpose test clear tools.py One off tool cleanup test test finemapping tools.py Ad hoc tool validation test metabolomics tools.py Ad hoc tool validation test original bug.py Bug reproduction test pathway tools.py Ad hoc tool validation test protein interaction skill.py Skill test test reload fix.py Bug reproduction test round10 tools.py Ad hoc tool validation Other Excluded Files .env Environment variables with secrets temp docs and tests/ Already in .gitignore .claude/ Claude Code configuration pycache / , .pyc Python bytecode .DS Store macOS metadata Common Test Failure Patterns Pattern 1: KeyError: 'role' Symptom : KeyError: 'role' when accessing message dicts Fix : Add return message=True to tu.run() and use .get() : Pattern 2: Mock Not Subscriptable Symptom : TypeError: 'Mock' object is not subscriptable Fix : Use real dicts for all tool dict and add get tool instance : Pattern 3: Linting Errors (F841, E731) Fix F841 (unused variable): Use prefix or = func() Fix E731 (lambda assignment): Replace with def Pattern 4: Temp Files Tracked by Git Symptom : git status shows temp files as modified/staged Fix : Pre Commit Hook Configuration The project uses .pre commit config.yaml : Scope: Only files matching ^(ToolUniverse/)?src/tooluniverse/ Quick Reference Task Command Activate hooks pre commit install Run all tests pytest tests/ x tb=short q Run specific test pytest tests/path/test.py::Class::method xvs Check staged files git status short Unstage a file git restore staged <file Remove from tracking git rm cached <file Move temp files See Phase 1 commands Run hooks manually pre commit run all files Pre Push Checklist Before every push, verify: [ ] Temp markdown files moved from root to temp docs and tests/ [ ] Root level test .py scripts moved to temp docs and tests/ [ ] Pre commit hooks installed ( pre commit install ) [ ] All tests pass locally ( pytest tests/ x ) [ ] No linting errors [ ] Only relevant files staged (no .env , no temp files) [ ] Commit message is clear and descriptive [ ] Correct branch selected Git Commit Guidelines Never include AI attribution in commits Never commit session documentation markdown files Use git add <specific files instead of git add . Write clean, professional commit messages One logical change per commit