Skip to content

Conversation

@Ranieri93
Copy link

This PR aims to tackle issue 79

It introduces a pre-execution linting step to automatically fix and validate LLM-generated code, and integrates a comprehensive set of Node.js best-practice guidelines into the main prompt to guide the model toward better output.

What's New?

  • ** Enhanced Node.js Guidelines (NODE_GUIDELINES.md) **

    • A detailed set of guidelines for writing modern, secure, and performant Node.js code has been created.
    • These guidelines are now automatically injected into the run-node-js-script prompt in server.ts, providing the LLM with clear instructions on best practices (e.g., use ESM, async/await, fetch, and secure coding patterns).
  • ** On-the-fly Code Linter (src/linterUtils.ts) **

    • Before execution, all user-submitted code is now passed through a new ESLint-based linter.
    • The linter automatically fixes common stylistic and syntax errors (e.g., converting var to const, fixing spacing)
    • If unfixable errors are found (like using an undefined variable), a clear report is returned to the user, making debugging much easier.

@Ranieri93 Ranieri93 marked this pull request as draft August 23, 2025 12:19
 - prompt now has in depth guidelines to follow second

 - introduced a linter step before executing code

 - introduced tests and meaningfull errors
@Ranieri93 Ranieri93 force-pushed the enhance_node_generated_code branch from 24213c0 to 4517f67 Compare August 23, 2025 12:22
@Ranieri93 Ranieri93 closed this Aug 23, 2025
@Ranieri93 Ranieri93 deleted the enhance_node_generated_code branch August 23, 2025 13:06
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.

1 participant