Paper deep dive
AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI
Clemens Pohle
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 91%
Last extracted: 7/20/2026, 9:03:49 PM
Summary
The paper introduces AgenticTyper, an LLM-based agentic system designed to automate the addition of type safety to legacy JavaScript projects by converting them to TypeScript. It addresses limitations of previous automated typing research by handling type checking setup, definition generation, and behavioral correctness through iterative error correction and transpilation comparison. Evaluated on two proprietary repositories totaling 81K LOC, AgenticTyper resolved all 633 initial type errors in approximately 20 minutes, significantly reducing manual effort compared to traditional methods.
Entities (10)
Relation Signals (8)
Clemens Pohle → affiliatedwith → Darmstadt University of Applied Sciences
confidence 95% · Clemens Pohle Darmstadt University of Applied Sciences
AgenticTyper → targets → JavaScript
confidence 95% · Legacy JavaScript systems lack type safety... AgenticTyper... automate typing legacy JavaScript repositories
AgenticTyper → uses → LLM
confidence 95% · AgenticTyper, a Large Language Model (LLM)-based agentic system
Clemens Pohle → affiliatedwith → MaibornWolff GmbH
confidence 90% · MaibornWolff GmbH Darmstadt, Germany clemens.pohle@maibornwolff.de
AgenticTyper → convertsto → TypeScript
confidence 90% · automate typing legacy JavaScript repositories... establish minimal TypeScript checking
claude-sonnet-4.5 → developedby → Anthropic
confidence 90% · Anthropic 2025. Introducing Claude Sonnet 4.5.
AgenticTyper → publishedin → ICSE-Companion '26
confidence 90% · AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI. In 2026 IEEE/ACM 48th International Conference on Software Engineering (ICSE-Companion ’26)
AgenticTyper → usesmodel → claude-sonnet-4.5
confidence 85% · We implemented phase one using the Claude Agent SDK with Claude Sonnet 4.5
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Legacy JavaScript systems lack type safety, making maintenance risky. While TypeScript can help, manually adding types is expensive. Previous automated typing research focuses on type inference but rarely addresses type checking setup, definition generation, bug identification, or behavioral correctness at repository scale. We present AgenticTyper, a Large Language Model (LLM)-based agentic system that addresses these gaps through iterative error correction and behavior preservation via transpilation comparison. Evaluation on two proprietary repositories (81K LOC) shows that AgenticTyper resolves all 633 initial type errors in 20 minutes, reducing manual effort from one working day.
Tags
Links
- Source: https://arxiv.org/abs/2602.21251v1
- Canonical: https://arxiv.org/abs/2602.21251v1
Trouble viewing inline? Open PDF directly →
Full Text
19,021 characters extracted from source content.
Expand or collapse full text
AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI Clemens Pohle Darmstadt University of Applied Sciences Darmstadt, Germany clemens.pohle@stud.h-da.de MaibornWolff GmbH Darmstadt, Germany clemens.pohle@maibornwolff.de Abstract Legacy JavaScript systems lack type safety, making maintenance risky. While TypeScript can help, manually adding types is expen- sive. Previous automated typing research focuses on type inference but rarely addresses type checking setup, definition generation, bug identification, or behavioral correctness at repository scale. We present AgenticTyper, a Large Language Model (LLM)-based agentic system that addresses these gaps through iterative error correction and behavior preservation via transpilation comparison. Evaluation on two proprietary repositories (81K LOC) shows that AgenticTyper resolves all 633 initial type errors in 20 minutes, reducing manual effort from one working day. CCS Concepts • Software and its engineering→Software maintenance tools; Automatic programming;• Theory of computation→Type structures;• Computing methodologies→Intelligent agents;• General and reference→ Empirical studies. Keywords Optional Typing, Legacy Software, Agentic AI, JavaScript, Type- Script ACM Reference Format: Clemens Pohle. 2026. AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI. In 2026 IEEE/ACM 48th International Conference on Software Engineering (ICSE-Companion ’26), April 12–18, 2026, Rio de Janeiro, Brazil. ACM, New York, NY, USA, 3 pages. https://doi.org/10.1145/ 3774748.3787746 1 Problem and Motivation Business-critical legacy systems, often written in dynamically typed languages like JavaScript [6,35], accumulate significant business value but become increasingly difficult to modify and understand [5, 25]. Lack of type safety makes changes risky, potentially breaking existing functionality [12]. Optional typing systems [9] like Type- Script provide documentation [15], make dependencies explicit [22], and prevent bugs [13]. However, manually adding type safety is This work is licensed under a Creative Commons Attribution 4.0 International License. ICSE-Companion ’26, Rio de Janeiro, Brazil © 2026 Copyright held by the owner/author(s). ACM ISBN 979-8-4007-2296-7/2026/04 https://doi.org/10.1145/3774748.3787746 costly [13], often requiring years [40]. Developers must trace depen- dencies across files, design reusable type definitions, and address cascading issues as each type annotation may reveal new problems in dependent code. Therefore, we present ongoing work on Agen- ticTyper 1 [30], leveraging Large Language Model (LLM)-based coding agents to automate typing legacy JavaScript repositories without regressions. 2 Background and Related Work Automated typing research focuses on type inference using static [1, 19], dynamic [2,29], probabilistic [33,37], and hybrid methods [27, 31]. However, these approaches face key limitations [14]: static methods cannot handle dynamic features [36], dynamic methods require test suites [17], and probabilistic methods produce incorrect predictions that must be discarded [31]. Generating type defini- tions [39] and identifying [32] and fixing [26] existing type issues remain underexplored. LLMs have been applied to numerous software engineering tasks [18], including type inference [10,20,21], fixing type er- rors [11,16,28], and combined with static analysis [7,34]. However, simply prompting anLLMto add types fails at repository scale: models cannot navigate and edit multiple files, handle cascading errors, or verify behavioral preservation.LLM-based agents [38] (agentic AI [24]) address this through tool use and multi-step rea- soning and have recently been applied to program repair [8,23], but not yet to typing tasks. 3 Approach and Uniqueness Unlike prior work, AgenticTyper combines agentic AI with transpi- lation comparison for change detection, enabling repository-level typing without test suites. Additionally, it distinguishes between ac- tual bugs requiring human attention and valid patterns that cannot be typed without behavioral changes (e.g., type coercion). We propose three incremental phases (Figure 1). Phase one es- tablishes minimal TypeScript checking. Coding agents analyze and address type errors (TypeScript compiler diagnostics) in each file by adding or fixing JSDoc type annotations (e.g.,@type,@param). When errors cannot be resolved without behavioral changes, agents insert suppression comments (@ts-expect-error): bugs are marked for human review, while valid patterns receive neutral explanations, 1 Source code: https://github.com/clemens-mw/agentic-typer arXiv:2602.21251v1 [cs.SE] 21 Feb 2026 ICSE-Companion ’26, April 12–18, 2026, Rio de Janeiro, BrazilClemens Pohle Phase 1: Minimal Setup Enable TypeScript Install Missing @types Fix/Suppress Type Errors Phase 2: Full Coverage Enable noImplicitAny Add Definitions/ Annotations Address New Errors Phase 3: Strict Mode Enable Strict Mode Refactor for Type Safety Regression Testing Figure 1: Three-phase typing approach. </> Coding Agent Hook Verification ✓ Errors On File Edit Transpiled Diff Finished Remaining Errors Success Figure 2: Single-agent architecture for phase one and two. The hook preventing behavior changes is highlighted. creating a clean baseline. Phase two enablesnoImplicitAny, re- quiring explicit annotations throughout. Agents add type defini- tions and annotations, addressing newly surfaced errors as in phase one. Phase three enables strict checking, revealing issues that of- ten require refactoring (e.g., null checks). Since refactoring carries risk, this phase requires regression testing via generated tests or manual verification. In phases one and two, the behavior preservation mechanism (Figure 2) prevents regressions without tests: after each edit, a hook transpiles the modified code to JavaScript and compares it against the original transpiled output, alerting agents of any run- time changes. After an agent finishes, static verification checks for remaining errors before proceeding. Multiple agents run in parallel, and a final verification agent addresses cross-file errors introduced by earlier fixes. 4 Results and Contributions So far, we implemented phase one using the Claude Agent SDK [3] with Claude Sonnet 4.5 [4], chosen for its leading coding capabil- ities as of September 2025. We evaluated AgenticTyper on two proprietary legacy Node.js backend repositories from an industrial Table 1: Phase one results on two proprietary JavaScript repositories. Average of three runs each. Repo LOC Type Errors Necessary Suppressions Additional Suppressions Time Cost A75K570327+26 (+8.0%)16:51 min$22.85 B6K6356+0 (+0.0%)3:06 min$2.08 Total 81K633383+26 (+6.8%) 19:57 min $24.93 facility management platform (Table 1). The system is configured to run ten agents in parallel. AgenticTyper successfully establishes type checking and ad- dresses all 633 initial type errors without modifying runtime behav- ior, verified through transpilation comparison. This task previously required one full working day by an experienced TypeScript de- veloper and is now completed in 20 minutes for $25. While Agen- ticTyper handles most cross-file dependencies properly, 7% of suppressions could have been avoided with more precise root cause tracing. Examples include parameter shadowing and bugs where the agent suppressed at multiple usage sites rather than the single source. In summary, our contributions are: (1) a novel agentic approach with behavior preservation for automated typing, (2) an open- source implementation with parallel agent execution, and (3) an evaluation demonstrating practical feasibility and cost-effectiveness. 5 Future Work We will implement and evaluate phases two and three on the same repositories, plus a 300,000 LOC TypeScript repository where phase one is not necessary. Evaluation will measure type coverage (percentage of typed elements), annotation correctness through type checking and manual review, and cleanup effort in hours and changed lines. We will also investigate differentLLMs and extend to other optionally typed languages like Python. References [1]Alex Aiken and Brian Murphy. 1991. Static Type Inference in a Dynamically Typed Language. In Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Orlando, FL, USA) (POPL ’91). ACM, New York, NY, USA, 279–290. doi:10.1145/99583.99621 [2] Jong-hoon D. An, Avik Chaudhuri, Jeffrey S. Foster, and Michael Hicks. 2011. Dynamic Inference of Static Types for Ruby. ACM SIGPLAN Notices 46, 1 (Jan. 2011), 459–472. doi:10.1145/1925844.1926437 [3]Anthropic 2025. Building Agents with the Claude Agent SDK. Anthropic. Re- trieved November 6, 2025 from https://w.anthropic.com/engineering/building- agents-with-the-claude-agent-sdk [4]Anthropic 2025. Introducing Claude Sonnet 4.5. Anthropic. Retrieved November 6, 2025 from https://w.anthropic.com/news/claude-sonnet-4-5 [5]Wesley K. G. Assunção, Luciano Marchezan, Lawrence Arkoh, Alexander Egyed, and Rudolf Ramler. 2025. Contemporary Software Modernization: Strategies, Driving Forces, and Research Opportunities. ACM Transactions on Software Engineering and Methodology 34, 5, Article 142 (May 2025), 35 pages. doi:10.1145/ 3708527 [6] Olga Bedrina. 2025. The State of Developer Ecosystem 2025: Coding in the Age of AI, New Productivity Metrics, and Changing Realities. JetBrains. Retrieved Novem- ber 6, 2025 from https://blog.jetbrains.com/research/2025/10/state-of-developer- ecosystem-2025/#languages-and-tools [7] Varun Bharti, Shashwat Jha, Dhruv Kumar, and Pankaj Jalote. 2025. Automated Type Annotation in Python Using Large Language Models. arXiv:2508.00422 [cs.PL] [8]Islem Bouzenia, Premkumar Devanbu, and Michael Pradel. 2025. RepairAgent: An Autonomous, LLM-Based Agent for Program Repair. In Proceedings of the IEEE/ACM 47th International Conference on Software Engineering (Ottawa, ON, Canada) (ICSE ’25). IEEE, New York, NY, USA, 2188–2200. doi:10.1109/ICSE55347. AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AIICSE-Companion ’26, April 12–18, 2026, Rio de Janeiro, Brazil 2025.00157 [9]Gilad Bracha. 2004. Pluggable Type Systems. In OOPSLA04 Workshop on Revival of Dynamic Languages (Vancouver, BC, Canada). Retrieved November 6, 2025 from https://bracha.org/pluggableTypesPosition.pdf [10]Federico Cassano, Ming-Ho Yee, Noah Shinn, Arjun Guha, and Steven Holtzen. 2023. Type Prediction With Program Decomposition and Fill-in-the-Type Training. arXiv:2305.17145 [cs.SE] [11]Yiu Wai Chow, Luca Di Grazia, and Michael Pradel. 2024. PyTy: Repairing Static Type Errors in Python. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (Lisbon, Portugal) (ICSE ’24). ACM, New York, NY, USA, Article 87, 13 pages. doi:10.1145/3597503.3639184 [12]Michael C. Feathers and Robert C. Martin. 2004. Working Effectively with Legacy Code. Prentice Hall Professional Technical Reference, Upper Saddle River, NJ, USA. [13]Zheng Gao, Christian Bird, and Earl T. Barr. 2017. To Type or Not to Type: Quantifying Detectable Bugs in JavaScript. In Proceedings of the 39th International Conference on Software Engineering (Buenos Aires, Argentina) (ICSE ’17). IEEE, New York, NY, USA, 758–769. doi:10.1109/ICSE.2017.75 [14]Yimeng Guo, Zhifei Chen, Lin Chen, Wenjie Xu, Yanhui Li, Yuming Zhou, and Baowen Xu. 2024. Generating Python Type Annotations from Type Inference: How Far Are We? ACM Transactions on Software Engineering and Methodology 33, 5, Article 123 (June 2024), 38 pages. doi:10.1145/3652153 [15]Stefan Hanenberg, Sebastian Kleinschmager, Romain Robbes, Éric Tanter, and Andreas Stefik. 2014. An Empirical Study on the Impact of Static Typing on Software Maintainability. Empirical Software Engineering 19, 5 (Oct. 2014), 1335– 1382. doi:10.1007/s10664-013-9289-1 [16]Sichong Hao, Xianjun Shi, and Hongwei Liu. 2024. RetypeR: Integrated Retrieval- based Automatic Program Repair for Python Type Errors. In 2024 IEEE Interna- tional Conference on Software Maintenance and Evolution (Flagstaff, AZ, USA) (IC- SME ’24). IEEE, New York, NY, USA, 199–210. doi:10.1109/ICSME58944.2024.00028 [17]Joshua Hoeflich, Robert Bruce Findler, and Manuel Serrano. 2022. Highly Illogical, Kirk: Spotting Type Mismatches in the Large Despite Broken Contracts, Unsound Types, and Too Many Linters. Proceedings of the ACM on Programming Languages 6, OOPSLA2, Article 142 (Oct. 2022), 26 pages. doi:10.1145/3563305 [18]Xinyi Hou, Yanjie Zhao, Yue Liu, Zhou Yang, Kailong Wang, Li Li, Xiapu Luo, David Lo, John Grundy, and Haoyu Wang. 2024. Large Language Models for Software Engineering: A Systematic Literature Review. ACM Transactions on Software Engineering and Methodology 33, 8, Article 220 (Dec. 2024), 79 pages. doi:10.1145/3695988 [19]Simon Holm Jensen, Anders Møller, and Peter Thiemann. 2009. Type Analysis for JavaScript. In Static Analysis (Los Angeles, CA, USA) (SAS ’09). Springer, Berlin, Heidelberg, Germany, 238–255. doi:10.1007/978-3-642-03237-0_17 [20] Kevin Jesse, Premkumar T. Devanbu, and Toufique Ahmed. 2021. Learning Type Annotation: Is Big Data Enough?. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (Athens, Greece) (ESEC/FSE ’21). ACM, New York, NY, USA, 1483–1486. doi:10.1145/3468264.3473135 [21] Kevin Jesse, Premkumar T. Devanbu, and Anand Sawant. 2023. Learning to Predict User-Defined Types. IEEE Transactions on Software Engineering 49, 4 (April 2023), 1508–1522. doi:10.1109/TSE.2022.3178945 [22]Wuxia Jin, Dinghong Zhong, Yuanfang Cai, Rick Kazman, and Ting Liu. 2023. Evaluating the Impact of Possible Dependencies on Architecture-Level Maintain- ability. IEEE Transactions on Software Engineering 49, 3 (March 2023), 1064–1085. doi:10.1109/TSE.2022.3171288 [23] Pascal Joos, Islem Bouzenia, and Michael Pradel. 2025. CodeCureAgent: Automatic Classification and Repair of Static Analysis Warnings. arXiv:2509.11787 [cs.SE] [24] Sayash Kapoor, Benedikt Stroebl, Zachary S. Siegel, Nitya Nadgir, and Arvind Narayanan. 2025. AI Agents That Matter. Transactions on Machine Learn- ing Research (May 2025), 38 pages. Retrieved November 6, 2025 from https: //openreview.net/forum?id=Zy4uFzMviZ [25]Ravi Khadka, Belfrit V. Batlajery, Amir M. Saeidi, Slinger Jansen, and Jurri- aan Hage. 2014. How Do Professionals Perceive Legacy Systems and Software Modernization?. In Proceedings of the 36th International Conference on Software Engineering (Hyderabad, India) (ICSE ’14). ACM, New York, NY, USA, 36–47. doi:10.1145/2568225.2568318 [26]Wonseok Oh and Hakjoo Oh. 2022. PyTER: Effective Program Repair for Python Type Errors. In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (Singapore) (ESEC/FSE ’22). ACM, New York, NY, USA, 922–934. doi:10.1145/3540250.3549130 [27]Irene Vlassi Pandi, Earl T. Barr, Andrew D. Gordon, and Charles Sutton. 2021. Opt- Typer: Probabilistic Type Inference by Optimising Logical and Natural Constraints. arXiv:2004.00348 [cs.PL] [28]Yun Peng, Shuzheng Gao, Cuiyun Gao, Yintong Huo, and Michael Lyu. 2024. Do- main Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (Lisbon, Portugal) (ICSE ’24). ACM, New York, NY, USA, Article 4, 13 pages. doi:10.1145/3597503.3608132 [29]Juan A. Pizzorno and Emery D. Berger. 2025. RightTyper: Effective and Efficient Type Annotation for Python. arXiv:2507.16051 [cs.PL] [30]Clemens Pohle. 2025. AgenticTyper: Automated Typing of Legacy Software Projects Using Agentic AI. doi:10.5281/zenodo.17954447 [31]Michael Pradel, Georgios Gousios, Jason Liu, and Satish Chandra. 2020. Type- Writer: Neural Type Prediction with Search-Based Validation. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (Virtual Event, USA) (ESEC/FSE ’20). ACM, New York, NY, USA, 209–220. doi:10.1145/3368089.3409715 [32]Michael Pradel, Parker Schuh, and Koushik Sen. 2015. TypeDevil: Dynamic Type Inconsistency Analysis for JavaScript. In Proceedings of the 37th International Conference on Software Engineering (Florence, Italy) (ICSE ’15, Vol. 1). IEEE, New York, NY, USA, 314–324. doi:10.1109/ICSE.2015.51 [33]Veselin Raychev, Martin Vechev, and Andreas Krause. 2015. Predicting Program Properties from "Big Code". In Proceedings of the 42nd Annual ACM SIGPLAN- SIGACT Symposium on Principles of Programming Languages (Mumbai, India) (POPL ’15). ACM, New York, NY, USA, 111–124. doi:10.1145/2676726.2677009 [34]Lukas Seidel, Sedick David Baker Effendi, Xavier Pinho, Konrad Rieck, Brink van der Merwe, and Fabian Yamaguchi. 2023. Learning Type Inference for Enhanced Dataflow Analysis. In Computer Security (The Hague, The Netherlands) (ESORICS ’23). Springer, Cham, Switzerland, 184–203. doi:10.1007/978-3-031- 51482-1_10 [35]Stack Exchange 2025. 2025 Stack Overflow Developer Survey. Stack Exchange. Re- trieved November 6, 2025 from https://survey.stackoverflow.co/2025/technology# 1-programming-scripting-and-markup-languages [36] Ke Sun, Yifan Zhao, Dan Hao, and Lu Zhang. 2023. Static Type Recommendation for Python. In Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering (Rochester, MI, USA) (ASE ’22). ACM, New York, NY, USA, Article 98, 13 pages. doi:10.1145/3551349.3561150 [37] Jiayi Wei, Maruth Goyal, Greg Durrett, and Isil Dillig. 2019. LambdaNet: Proba- bilistic Type Inference using Graph Neural Networks. In Proceedings of the 7th International Conference on Learning Representations (New Orleans, LA, USA) (ICLR ’19). Curran Associates, Inc., Red Hook, NY, USA, 11 pages. Retrieved November 6, 2025 from https://openreview.net/forum?id=Hkx6hANtwH [38] Zhiheng Xi, Wenxiang Chen, Xin Guo, Wei He, Yiwen Ding, Boyang Hong, Ming Zhang, Junzhe Wang, Senjie Jin, Enyu Zhou, Rui Zheng, Xiaoran Fan, Xiao Wang, Limao Xiong, Yuhao Zhou, Weiran Wang, Changhao Jiang, Yicheng Zou, Xiangyang Liu, Zhangyue Yin, Shihan Dou, Rongxiang Weng, Wenjuan Qin, Yongyan Zheng, Xipeng Qiu, Xuanjing Huang, Qi Zhang, and Tao Gui. 2025. The Rise and Potential of Large Language Model Based Agents: A Survey. Science China Information Sciences 68, 2, Article 121101 (Jan. 2025), 44 pages. doi:10.1007/s11432-024-4222-0 [39] Ming-Ho Yee. 2024. Predicting TypeScript Type Annotations and Definitions with Machine Learning. Ph. D. Dissertation. Northeastern University. doi:10.17760/ D20653005 [40]Ming-Ho Yee and Arjun Guha. 2023. Do Machine Learning Models Produce TypeScript Types That Type Check?. In 37th European Conference on Object- Oriented Programming (Seattle, WA, USA) (ECOOP ’23). Schloss Dagstuhl, Wadern, Germany, Article 37, 28 pages. doi:10.4230/LIPIcs.ECOOP.2023.37