Skip to content

Issue #2302 - Implementation of Multi-language and Validation AI Skills#2

Closed
ShmRayan wants to merge 3 commits into
mainfrom
issue-2302-ai-skills
Closed

Issue #2302 - Implementation of Multi-language and Validation AI Skills#2
ShmRayan wants to merge 3 commits into
mainfrom
issue-2302-ai-skills

Conversation

@ShmRayan
Copy link
Copy Markdown

@ShmRayan ShmRayan commented Mar 3, 2026

Description

This PR implements the core AI Skills requested in issue #2302.

Key Features:

  • Multi-language support: Added Java, PHP, and Python source code generation to main.ts.
  • Validation Mode: Implemented a --type validate mode that captures detailed compiler errors (e.g., Error 1502).
  • Self-Correction Support: The script now correctly analyzes stdout/stderr to provide feedback for AI agent agentic loops.
  • Folder Management: Outputs are now organized in timestamped folders.
  • Documentation: Updated SKILL.md to reflect new capabilities.

Fixes #2302

@ElwinLiu
Copy link
Copy Markdown
Collaborator

ElwinLiu commented Mar 4, 2026

Just curious, why is the gv dependency check removed?

@ElwinLiu
Copy link
Copy Markdown
Collaborator

ElwinLiu commented Mar 4, 2026

Just curious, why is the gv dependency check removed?

Same for: --json flag

@ShmRayan
Copy link
Copy Markdown
Author

ShmRayan commented Mar 5, 2026

I have updated the code to address your feedback:
Restored --json flag support for all generation types (Java, PHP, Python) and the validation mode.
Fixed dependency checks: The Graphviz (dot) check is now conditional; it will only block the process if a visual diagram is requested, allowing source code generation to proceed without it.

Comment thread umple-diagram-generator/scripts/main.ts Outdated
Copy link
Copy Markdown
Collaborator

@ElwinLiu ElwinLiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using npm to build the project, please add node_modules to .gitignore.
Don't submit node_modules to the repo.

Comment thread umple-diagram-generator/scripts/main.ts Outdated
Comment thread umple-diagram-generator/scripts/main.ts Outdated
Comment thread umple-diagram-generator/scripts/main.ts
Comment thread umple-diagram-generator/scripts/main.ts Outdated
@ShmRayan
Copy link
Copy Markdown
Author

ShmRayan commented Mar 5, 2026

I've just updated the code based on your feedback @ElwinLiu:
Robust File Copying: Now using startsWith(baseFileName) to only copy relevant generated files.
Validation Mode: --output is now optional for the validate type.
JSON Support: Fully restored for both success and error outputs.
Git Hygiene: Added a .gitignore and removed node_modules.
Fixed Folder Naming: Naming prefix now correctly matches the diagram or generation type.

@ShmRayan ShmRayan requested a review from ElwinLiu March 5, 2026 17:09
Comment thread .gitignore
@@ -1,21 +1,4 @@
# OS files
.DS_Store
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't deleted the original entries, they're intended to be there.

Comment thread package.json
@@ -0,0 +1,5 @@
{
"devDependencies": {
"@types/node": "^25.3.0"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary. The project uses npx -y bun which handles types natively.

const sourceDir = path.dirname(inputPath);
const baseFileName = path.basename(inputPath, ".ump");
const generatedFiles = readdirSync(sourceDir).filter(f =>
f.startsWith(baseFileName) &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work. Umple generates files based on class names inside the .ump file, not the .ump filename.


if (!generation.success) {
if (args.json) {
console.log(JSON.stringify({ success: false, error: "Generation failed", output: generation.output }, null, 2));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are other output objects deleted? e.g. inputPath, diagramType

const baseFileName = path.basename(inputPath, ".ump");
const generatedFiles = readdirSync(sourceDir).filter(f =>
f.startsWith(baseFileName) &&
(f.endsWith(".java") || f.endsWith(".php") || f.endsWith(".py") || f.endsWith(".cpp"))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cpp supported in this pr?

@ElwinLiu
Copy link
Copy Markdown
Collaborator

Closing the PR as it's been 2 weeks, and the architecture has been refactored.

@ElwinLiu ElwinLiu closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants