跳到正文
DEV Community· mansour fall·· 2 小時前AI 評分55

AI 可以編寫程式碼,開發者仍須理解;READIT 以 UML 圖探索程式庫

AI can write the code. You still need to understand it.

AI 導讀

作者 mansour fall 發佈開源工具 READIT,結合 Agent Skill、Node.js CLI 與互動式 UML 瀏覽器,協助開發者理解程式庫。

正文

You open a pull request. You skim through the changes. The tests pass. The feature looks right. But as you are about to merge it all, that little voice in your brain asks:

What happens if payment fails after we've already reserved the stock?

Now you stop, checkout the branch locally and start following the behavior across several components: validation, inventory, payment, persistence, error handling. Keeping track of everything as you try to make sense of code you have not written yourself (who does nowadays ? :p ) can quickly become overwhelming.

This is the problem I'm exploring with READIT..

The gap between owning code and understanding it

Joining an existing project often means reconstructing a mental model from scattered clues: routes, services, tests, database calls, and conversations with whoever last touched the feature.

As more and more code is now generated by AI at wrap speed, our understanding of the inner workings of the systems we build starts falling behind just as fast.

The issue is no longer Technical Debt. We are now faced with growing Cognitive Debt

One symptom of Cognitive Debt would be our incapacity to answer questions that normally would not trip us, like "What happens between the initial request and the final response?". If you can't answer this type of question confidently, you have fallen victim to Cognitive debt.

After more than a year with almost zero code written by hand and a productivity that seems out of science fiction, I have to admit that Cognitive Debt is now taking a toll on me.

Rather than manually prompting my agents each time I land on a new project or have to review a new feature or change, I wanted a simple, fast, and interactive way of exploring/understanding a code base.

Meet READIT

READIT demo: explore the use-case map, select Place an order, and follow its sequence of messages.

READIT combines an agent Skill, a Node.js CLI and an interactive UML explorer.

It organizes a repository around two connected views:

1. What does the application let people do?

A UML use case diagram maps actors and their goals: place an order, invite a member, publish a report. You can select a goal and explore its scenarios.

2. How does the code make that happen?

A UML sequence diagram follows the interactions implementing a scenario. You can play the flow, step through individual messages, and inspect the code associated with each one.
The navigation starts with the user's intent and leads into implementation details.

Give it a Try!

With Node.js 22+ installed, add the skill from your project directory:

npx skills add MansourFall/readit --skill readit

Then invoke it in your coding agent. The composer syntax belongs to the host, not to the READIT CLI:

Then invoke it in your coding agent. The composer syntax belongs to the host, not to the READIT CLI:

Agent host Invocation
Codex $readit
A host that exposes installed skills as slash commands /readit
Any other compatible host “Use the READIT skill to map this repository for developer onboarding.”

The project is open source under the MIT license, and I'd love feedback from people working with unfamiliar repositories or reviewing agent-generated changes.

Contribute, Give it a Star !!

來源:DEV Community · dev.to