{"uid":"cap_rn8N5YH1CRHLmeHkceasB","slug":"obol-file-refactor-typescript-modernization-to-github-pr-c31d123b","name":"Obol File Refactor — TypeScript Modernization to GitHub PR","description":"Obol: File → modernized TypeScript → GitHub PR — $5 USDC","url":"https://api.obol.sh/refactor?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["path","repo"],"properties":{"path":{"type":"string","description":"Path to the file to refactor (e.g. src/lib/utils.ts)"},"repo":{"type":"string","description":"GitHub repo in owner/repo format"},"email":{"type":"string","description":"Email address to notify when PR is ready"}}},"responseSchema":{"pr":{"type":"string","description":"URL of the opened pull request"},"fork":{"type":"string","description":"URL of the forked repository"},"files":{"type":"array","description":"File paths written to the branch"},"branch":{"type":"string","description":"Branch name on the fork"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"1","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__x7V5VVKwJmJpagTqiTD0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Takes a file path in a GitHub repo, rewrites it as modernized TypeScript, and opens a pull request with the changes","exampleAgentPrompt":"Can you modernize src/lib/utils.ts in my GitHub repo myorg/my-app — refactor it to clean, modern TypeScript and open a pull request? Notify me at dev@example.com when it's ready.","exampleUseCases":[{"title":"Modernize legacy utility file","prompt":"Hey, can you take src/helpers/formatters.js in my repo acme-corp/dashboard and rewrite it as clean, modern TypeScript? Open a pull request so my team can review it before we merge."},{"title":"Upgrade old API client module","prompt":"I've got a really outdated file at src/api/client.ts in myorg/backend-service — it's using old TypeScript patterns and no generics. Can you modernize it and open a PR with the improvements?"},{"title":"Refactor shared types before release","prompt":"Before our next release, I need src/types/models.ts in acme/web-app cleaned up and converted to modern TypeScript — strict types, proper interfaces, the works. Can you open a pull request with those changes?"}],"resultDescription":"Returns a pull request URL opened on a fork of the target repo, the fork URL, the branch name, and a list of file paths written to that branch — all reflecting the modernized TypeScript version of the specified file.","failureModes":["File path not found in repo — returns error indicating missing path","Repo not accessible or invalid owner/repo format — authentication or 404 error","GitHub API rate limit or permission issues preventing fork or PR creation","Payment failure via x402 protocol — request rejected before processing","Invalid or malformed email — notification may not be sent but PR may still be created","File is not TypeScript or JavaScript — refactoring output may be unexpected"],"whenToPreferThis":"Use this endpoint when you have a specific file in a GitHub repository that needs to be modernized to current TypeScript standards and you want the result delivered as a pull request without manual editing. It is ideal for automating code quality improvements on individual files in existing repos, especially when you want a reviewable PR workflow rather than just a code suggestion.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:27:39.221Z","isFirstParty":false,"canonicalSlug":"obol-file-refactor-typescript-modernization-to-github-pr-c31d123b"}