• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
TechTrendFeed
  • Home
  • Tech News
  • Cybersecurity
  • Software
  • Gaming
  • Machine Learning
  • Smart Home & IoT
No Result
View All Result
  • Home
  • Tech News
  • Cybersecurity
  • Software
  • Gaming
  • Machine Learning
  • Smart Home & IoT
No Result
View All Result
TechTrendFeed
No Result
View All Result

Constructing Customized Tooling with LLMs

Admin by Admin
May 16, 2025
Home Software
Share on FacebookShare on Twitter


Instruments that deal with diagrams as code, similar to PlantUML, are invaluable for speaking
complicated system habits. Their text-based format simplifies versioning, automation, and
evolving architectural diagrams alongside code. In my work explaining distributed
methods, PlantUML’s sequence diagrams are significantly helpful for capturing interactions
exactly.

Nevertheless, I usually wished for an extension to stroll by means of these diagrams step-by-step,
revealing interactions sequentially fairly than displaying the whole complicated stream at
as soon as—like a slideshow for execution paths. This need displays a standard developer
state of affairs: wanting personalised extensions or inner instruments for their very own wants.

But, extending established instruments like PlantUML usually includes vital preliminary
setup—parsing hooks, construct scripts, viewer code, packaging—sufficient “plumbing” to
deter speedy prototyping. The preliminary funding required to start can suppress good
concepts.

That is the place Massive Language Fashions (LLMs) show helpful. They’ll deal with boilerplate
duties, liberating builders to give attention to design and core logic. This text particulars how I
used an LLM to construct PlantUMLSteps, a small extension including step-wise
playback to PlantUML sequence diagrams. The objective is not simply the software itself, however
illustrating the method how syntax design, parsing, SVG era, construct automation,
and an HTML viewer had been iteratively developed by means of a dialog with an LLM,
turning tedious duties into manageable steps.

Diagram as code – A PlantUML primer

Earlier than diving into the event course of, let’s briefly introduce PlantUML
for individuals who may be unfamiliar. PlantUML is an open-source software that enables
you to create UML diagrams from a easy text-based description language. It
helps
numerous diagram varieties together with sequence, class, exercise, part, and state
diagrams.

The facility of PlantUML lies in its capability to model management diagrams
as plain textual content, combine with documentation methods, and automate diagram
era inside growth pipelines. That is significantly precious for
technical documentation that should evolve alongside code.

This is a easy instance of a sequence diagram in PlantUML syntax:

@startuml

conceal footbox

actor Person
participant System
participant Database

Person -> System: Login Request
System --> Person: Login Type

Person -> System: Submit Credentials
System -> Database: Confirm Credentials
Database --> System: Validation Consequence
System --> Person: Authentication Consequence

Person -> System: Request Dashboard
System -> Database: Fetch Person Information
Database --> System: Person Information
System --> Person: Dashboard View
@enduml 

When processed by PlantUML, this textual content generates a visible sequence diagram displaying the
interplay between parts.

The code-like nature of PlantUML makes
it simple to be taught and use, particularly for builders who’re already comfy
with text-based instruments.

This simplicity is what makes PlantUML an ideal candidate for extension. With the
proper tooling, we will improve its capabilities whereas sustaining its text-based
workflow.

Our objective for this venture is to create a software which might divide the
sequence diagram into steps and generate a step-by-step view of the diagram.
So for the above diagram, we should always be capable of view login, authentication and
dashboard
steps one after the other.

Step 2: Constructing the Parser Logic (and Debugging)

“Now we have to parse the plantuml information and separate out step. Every time we
encounter a step marker, we create a step object and maintain including the following strains
to it till we encounter one other step marker or finish of file. In case we
encounter one other step counter, we create new step object, it ought to have all
the consists of, actors and individuals from the earlier step. It must also
have all of the content material of the earlier step, until the step metadata has
‘newPage’ attribute. If there are not any step markers encountered, which is the case
the place we’ve information with out steps, it ought to create a default step. Create a
StepParser to parse given puml information and create checklist of steps.”

Claude generated the preliminary code for a StepParser class and a Step mannequin class to
deal with parsing PlantUML information with step markers. The preliminary implementation had some
logical points:

  • Incorrect dealing with of step content material inheritance when newPage attribute was false
  • Improper dealing with of declarations (actors, individuals) showing earlier than the
    first step marker
  • Points with making a default step for information with out markers

The Cursor editor was working in Agent mode, so after working assessments and figuring out
these points by means of the failure messages, Claude offered a corrected model that
correctly dealt with:

  • Content material collected earlier than step one marker
  • Inheritance of content material from the instantly previous step
  • World monitoring of declarations throughout steps
  • Correct creation of a default step for information with out markers

With these corrections, the parser efficiently handed all assessments.

The following step was to generate a gradle job.

We want gradle job which might course of puml information in src/diagrams and its sub
folders. For every file it ought to create a listing with the title of the file the place
it generates legitimate puml file for every step. It could actually generate that by simply including
@startuml at the beginning and @enduml on the finish of the step content material.

I will show you how to create a Gradle job to course of PlantUML information and generate
step-by-step diagrams. First, let’s create the duty in
construct.gradle:

// Course of every .puml file within the enter listing and its subdirectories
fileTree(inputDir).embrace('**/*.puml').every { pumlFile ->
    def relativePath = inputDir.toPath().relativize(pumlFile.toPath()).toString()
    def fileName = pumlFile.title.exchange('.puml', '')
    def stepOutputDir = new File(outputDir, fileName)
    
    if (!stepOutputDir.exists()) {
        stepOutputDir.mkdirs()
    }
    
    // Run the generator for this file
    javaexec {
        classpath = sourceSets.primary.runtimeClasspath
        mainClass = 'com.instance.StepDiagramGenerator'
        args = [pumlFile.absolutePath, stepOutputDir.absolutePath]
    }

Claude additionally helped producing a easy plantuml sequence diagram to check the gradle
job. The identical one which we used originally of the article.

The gradle job wanted a category PlantUMLGenerator which
can generate SVGs for every step.
Cursor within the Agent mode generated the code for the category.

It then ran the construct to confirm the duty.

Let's run a check to verify our implementation works: cd /Customers/unmeshjoshi/work/plantumlsequence && ./gradlew clear construct
                
Activity :generateStepDiagrams
Generated step diagram: /Customers/unmeshjoshi/work/plantumlsteps/construct/generated-diagrams/user-authentication/step-01-step-1-user-login.puml
Generated step diagram: /Customers/unmeshjoshi/work/plantumlsteps/construct/generated-diagrams/user-authentication/step-02-step-2-authentication.puml
Generated step diagram: /Customers/unmeshjoshi/work/plantumlsteps/construct/generated-diagrams/user-authentication/step-03-step-3-dashboard.puml
Generated step stream abstract: /Customers/unmeshjoshi/work/plantumlsteps/construct/generated-diagrams/user-authentication/abstract.puml

        BUILD SUCCESSFUL in 543ms
        3 actionable duties: 3 executed

Step 3: Producing HTML Viewer for Step Sequence

The following step was to generate a easy HTML viewer that can be utilized to view the step
sequence.

Now we have to generate a HTML viewer for the step information to be proven one after the other.
The HTML viewer can have a view space the place we present the svg picture generated for every
step with the step title within the metadata for that step. We will have subsequent and former
buttons to point out subsequent and former step picture.

I will show you how to create an HTML viewer for the step diagrams. We’ll must: Generate
SVG information from the PlantUML information Create an HTML viewer with navigation controls
Replace the Gradle job to generate each PlantUML and SVG information, together with the HTML
viewer First, let’s create a easy HTML template for the viewer:
….

The agent mode found out a number of points with the template however auto-fixed it by
working some corrective actions.

This setup allowed us to shortly generate step diagrams from a single PlantUML file,
and look at them in a step-by-step method. So the above diagram might be seen as a
sequence of following steps:

The Code is the Supply of Reality

The place to go from right here?

Whereas the prompts and the LLM assistant (on this case, interacting in an agent-like
mode, using fashions like Claude Sonnet) offered a remarkably efficient approach to
generate a working first model of PlantUMLSteps, it is essential to
acknowledge the character of this generated output.

  • Prompts aren’t Deterministic: The prompts utilized in our dialog had been
    efficient for this interplay, however they can’t be handled as the last word
    ‘supply of reality’. The identical prompts given to a unique mannequin, and even the identical
    mannequin at a later date, aren’t assured to supply the very same output due
    to the inherent variability in LLM era.
  • Code Requires Administration: The generated code is the supply of reality for
    the software’s performance. As such, it must be handled like another
    software program artifact – checked into model management, reviewed, examined, and
    maintained.
  • Evaluate for Habitability: It is important to revisit the LLM-generated code
    after the preliminary creation part. Is it ‘liveable’? That’s, is it moderately
    simple to learn, perceive, and modify by a human developer? Whereas the LLM helped
    overcome preliminary hurdles and boilerplate, making certain the long-term maintainability
    and readability of the codebase usually requires human evaluation and potential
    refactoring. The objective is code that not solely works however can be developed
    successfully over time.

Prompting in pure language (like English) to generate code works properly within the
early phases of growth—while you’re exploring concepts, scaffolding performance,
or getting aware of a brand new software or framework. However as your system begins to take
form, the boundaries of imprecise or broad prompts grow to be obvious. At this stage, what’s
wanted isn’t extra code era, however conceptual modeling—utilizing the constructs of
your programming language or expertise stack to precisely signify the area.
This stage wants deeper considering to construct abstractions, and an alignment between
code construction and area ideas—one thing solely achievable by means of considerate
design, not simply prompting. If prompt-based code era with out
evaluation known as “vibe coding,” then the extra disciplined strategy might be
known as “AI-assisted structured coding.”.

Past Code Technology: The Developer Perception in Refactoring

The following step was to refactor the code to make it extra readable and maintainable.

Initially, the parse methodology was a protracted, monolithic perform that dealt with all the things
from
detecting step markers to managing declarations and content material. The code was tough
to
perceive and keep.

The total code is obtainable in
this preliminary commit on GitHub.

The `StepParser.java` parse methodology wants refactoring. It ought to signify ideas
used within the requirement or area ideas and comply with customary clear code practices
with intentional methodology names and code that reads like a DSL.

This preliminary request was open-ended, indicating that the developer acknowledged the
want for enchancment however was on the lookout for steerage on how one can strategy it.
The LLM responded with a complete refactoring that launched a number of new
lessons and strategies:

- Launched `PlantUmlDocument` to signify the doc being parsed
- Smaller, extra targeted strategies with intention-revealing names
- Higher encapsulation of associated behaviors
- Extra expressive variable and methodology names


    /**
     * Represents a PlantUML doc being parsed, managing state throughout parsing
     */
    non-public class PlantUmlDocument {
        non-public ultimate Listing steps = new ArrayList<>();
        non-public ultimate Listing declarations = new ArrayList<>();
        non-public ultimate Listing contentBeforeFirstStep = new ArrayList<>();
        non-public Step currentStep = null;
        non-public boolean hasStepMarkers = false;
        
        public void beginNewStep(StepMetadata metadata) {
            hasStepMarkers = true;
            
            // Save the present step if it exists
            if (currentStep != null) {
                steps.add(currentStep);
            }
            
            // Create a brand new step
            currentStep = new Step(metadata.getName(), metadata.isNewPage(), metadata.getAttributes());
            
            // Add all declarations to the brand new step
            currentStep.addAllDeclarations(declarations);
            
            // If this is not a brand new web page and we've earlier steps, copy all content material from earlier steps
            if (!metadata.isNewPage() && !steps.isEmpty()) {
                carryOverPreviousStepsContent();
            }
        }
        
        non-public void carryOverPreviousStepsContent() {
            for (Step previousStep : steps) {
                for (String contentLine : previousStep.getContent()) {
                    currentStep.addContent(contentLine);
                }
            }
        }
        
        public void addDeclaration(String line) {
            declarations.add(line);
            
            if (currentStep != null) {
                currentStep.addDeclaration(line);
            } else {
                contentBeforeFirstStep.add(line);
            }
        }
        
        public void addContentLine(String line) {
            if (currentStep != null) {
                currentStep.addContent(line);
            } else if (!line.trim().isEmpty()) {
                contentBeforeFirstStep.add(line);
            }
        }
        
        public void finalizeDocument() {
            // Add the final step if it exists and hasn't been added but
            if (currentStep != null) {
                steps.add(currentStep);
            }
        }

The total code is obtainable in
this commit on GitHub.

The `contentBeforeFirstStep` in `PlantUmlDocument.java` is used just for creating
default step when there are not any step markers?
So we will presumably
do two go processing the place we first verify if there are step markers.. if there
are.. we do step-based processing. Or else we simply create a default step and add all
declarations and content material. That may take away the necessity to have `contentBeforeFirstStep`
We will additionally possibily title PlantUmlDocument as `ParsedPumlFile` which represents
the parsed puml file.

The LLM carried out this suggestion with a two-pass strategy. It additionally renamed the
PlantUmlDocument as ParsedPumlFile.
The total code is obtainable in
this commit on GitHub.

`ParsedPumlFile` might be higher represented as builder sample.
`StepBuilder` generally is a builder for `Step` objects.

This perception demonstrated the developer’s capability to acknowledge design patterns,
noting that the refactored class adopted the Builder sample.

The ultimate refactoring represents a big enchancment over the unique code:

class StepBuilder {
    non-public ultimate Listing steps = new ArrayList<>();
    non-public ultimate Listing globalDeclarations = new ArrayList<>();
    non-public Step currentStep = null;
    
    public void startNewStep(StepMetadata metadata) {
        if (currentStep != null) {
            steps.add(currentStep);
        }
        
        currentStep = new Step(metadata);
        currentStep.addAllDeclarations(globalDeclarations);
        
        if (!metadata.isNewPage() && !steps.isEmpty()) {
            // Copy content material from the earlier step
            Step previousStep = steps.get(steps.dimension() - 1);
            for (String contentLine : previousStep.getContent()) {
                currentStep.addContent(contentLine);
            }
        }
    }
    
    public void addDeclaration(String declaration) {
        globalDeclarations.add(declaration);
        
        if (currentStep != null) {
            currentStep.addDeclaration(declaration);
        }
    }
    
    public void addContent(String content material) {
        // If no step has been began but, create a default step
        if (currentStep == null) {
            StepMetadata metadata = new StepMetadata("Default Step", false, new HashMap<>());
            startNewStep(metadata);
        }
        
        currentStep.addContent(content material);
    }
    
    public Listing construct() {
        if (currentStep != null) {
            steps.add(currentStep);
        }
        
        return new ArrayList<>(steps);
    }
} 

The total code is obtainable in
this commit on GitHub.

There are extra enhancements attainable,
however I’ve included a number of to display the character of collaboration between LLMs
and builders.

Conclusion

Every a part of this extension—remark syntax, Java parsing logic, HTML viewer, and
Gradle wiring—began with a targeted LLM immediate. Some elements required some professional
developer steerage to LLM, however the important thing profit was with the ability to discover and
validate concepts with out getting slowed down in boilerplate. LLMs are significantly
useful when you’ve a design in thoughts however aren’t getting began due to
the efforts wanted for establishing the scaffolding to attempt it out. They can assist
you generate working glue code, combine libraries, and generate small
UIs—leaving you to give attention to whether or not the concept itself works.

After the preliminary working model, it was essential to have a developer to information
the LLM to enhance the code, to make it extra maintainable. It was vital
for builders to:

  • Ask insightful questions
  • Problem proposed implementations
  • Counsel various approaches
  • Apply software program design ideas

This collaboration between the developer and the LLM is essential to constructing
maintainable and scalable methods. The LLM can assist generate working code,
however the developer is the one who could make it extra readable, maintainable and
scalable.


Tags: BuildingCustomLLMsTooling
Admin

Admin

Next Post
First Take a look at 6 Remaining Fantasy Playing cards That Convey Iconic Artwork to Magic: The Gathering

First Take a look at 6 Remaining Fantasy Playing cards That Convey Iconic Artwork to Magic: The Gathering

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending.

Discover Vibrant Spring 2025 Kitchen Decor Colours and Equipment – Chefio

Discover Vibrant Spring 2025 Kitchen Decor Colours and Equipment – Chefio

May 17, 2025
Reconeyez Launches New Web site | SDM Journal

Reconeyez Launches New Web site | SDM Journal

May 15, 2025
Safety Amplified: Audio’s Affect Speaks Volumes About Preventive Safety

Safety Amplified: Audio’s Affect Speaks Volumes About Preventive Safety

May 18, 2025
Flip Your Toilet Right into a Good Oasis

Flip Your Toilet Right into a Good Oasis

May 15, 2025
Apollo joins the Works With House Assistant Program

Apollo joins the Works With House Assistant Program

May 17, 2025

TechTrendFeed

Welcome to TechTrendFeed, your go-to source for the latest news and insights from the world of technology. Our mission is to bring you the most relevant and up-to-date information on everything tech-related, from machine learning and artificial intelligence to cybersecurity, gaming, and the exciting world of smart home technology and IoT.

Categories

  • Cybersecurity
  • Gaming
  • Machine Learning
  • Smart Home & IoT
  • Software
  • Tech News

Recent News

How authorities cyber cuts will have an effect on you and your enterprise

How authorities cyber cuts will have an effect on you and your enterprise

July 9, 2025
Namal – Half 1: The Shattered Peace | by Javeria Jahangeer | Jul, 2025

Namal – Half 1: The Shattered Peace | by Javeria Jahangeer | Jul, 2025

July 9, 2025
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://techtrendfeed.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Tech News
  • Cybersecurity
  • Software
  • Gaming
  • Machine Learning
  • Smart Home & IoT

© 2025 https://techtrendfeed.com/ - All Rights Reserved