Skip to content
Back to skills

Devtu Code Optimization

ASecurity

Code quality patterns and guidelines for ToolUniverse tool development. Apply when writing, fixing, or refactoring tool Python code in the ToolUniverse project. Encodes lessons from 80+ debug rounds. Use alongside devtu-fix-tool and devtu-self-evolve. Triggers: implementing tool fixes, writing new tool classes, reviewing tool code quality, checking schema correctness, looking up API-specific bug fixes.

  • 1,719 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
ai-agentspythongobashrefactoringgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add mims-harvard/ToolUniverse --skill devtu-code-optimization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Devtu Code Optimization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Devtu Code Optimization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mims-harvard-devtu-code-optimization/badge)](https://www.skillsdirectory.com/skills/mims-harvard-devtu-code-optimization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: devtu-code-optimization
description: >
  Code quality patterns and guidelines for ToolUniverse tool development.
  Apply when writing, fixing, or refactoring tool Python code in the ToolUniverse project.
  Encodes lessons from 80+ debug rounds. Use alongside devtu-fix-tool and devtu-self-evolve.
  Triggers: implementing tool fixes, writing new tool classes, reviewing tool code quality,
  checking schema correctness, looking up API-specific bug fixes.
---

# ToolUniverse Code Optimization

Always run `Skill(skill="simplify")` after writing or modifying code.

## Pre-Commit Checklist

- [ ] `return_schema` has `oneOf: [{data+metadata}, {error}]`
- [ ] Test examples use real IDs (no DUMMY/PLACEHOLDER)
- [ ] `try:` has `except:` at exact same indentation level
- [ ] No trailing commas in JSON (`python3 -c "import json; json.load(open('f.json'))"`)
- [ ] New tool class registered in `_lazy_registry_static.py` and `default_config.py`
- [ ] `ruff check src/tooluniverse/<file>.py` passes
- [ ] `python -c "from tooluniverse.<module> import <Class>"` passes
- [ ] `python -m tooluniverse.cli run <Tool> '<real_args_json>'` returns expected data
- [ ] Ran `Skill(skill="simplify")` on all modified files

## Key Fix Categories

| Category | Signal | Reference |
|---|---|---|
| Silent param ignored | API accepts but drops filter | [code-patterns.md](code-patterns.md) — Client-Side Filter |
| Wrong API field/endpoint | 0 results or 404 | [api-fixes.md](api-fixes.md) — Quick Lookup Table |
| Schema invalid | null type, missing oneOf | [code-patterns.md](code-patterns.md) — Schema Patterns |
| Undisclosed normalization | Auto-transform hidden from user | [code-patterns.md](code-patterns.md) — Normalization Disclosure |
| try/except indent | SyntaxError at runtime | [code-patterns.md](code-patterns.md) — try/except section |
| Truncation buried | Data count hidden in notes | [code-patterns.md](code-patterns.md) — Truncation |
| Hosted model API (NIM) | async 404 on poll, JSON-wrapped output, 200+inner-failure, "not found for account" | [code-patterns.md](code-patterns.md) — Hosted Model-API Tools |
| R subprocess tool | `'\.' unrecognized escape` from `Rscript -e` | [code-patterns.md](code-patterns.md) — R-subprocess Tools |

## References

- **[references/api-fixes.md](references/api-fixes.md)** — Per-API bug fixes (GtoPdb, CIViC, GTEx, ENCODE, CPIC, etc.)
- **[references/code-patterns.md](references/code-patterns.md)** — Reusable Python patterns (schema, filtering, pagination, normalization)

## Git & PR Workflow

```bash
git fetch origin && git stash && git rebase origin/main && git stash pop
git push --force-with-lease origin fix/round-XX-bugs
gh pr view <N> --json mergeable  # must be MERGEABLE before done
```

- Never push to `main` directly
- Never have multiple open fix PRs
- Commit messages: "Feature" or "Fix" — never "Bug"
- No AI attribution in commits
- Repo: `mims-harvard/ToolUniverse` — verify with `git remote -v`

Files in this skill

  • SKILL.md2.9 KB
  • references/api-fixes.md3.8 KB
  • references/code-patterns.md5.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…