Nitrokit Nitrokit - Ship faster with AI - No more heavy lifting, build Angular apps at NITROSPEED!

Documentation

AI assistant

Documentation on the AI assistant

Screenshot 2024-10-29 at 21.00.22.png Nitrokit is smart:

  • It knows about your codebase
  • It knows which types of projects there are
  • It knows which elements those projects can contain and expose
  • It comes with an AI assistant that you can ask to code and refactor for you

How is this possible?

Because of the very consistent scalable architecture Nitrokits knows where everything lives in your codebase. This way it knows where to read code but also where to write generated code to! A match made in heaven❤️

What does it generate for me?

Basically you can ask it anything.

  • "Generate a data service in the project influencer-feat-channel with the name foo"
  • "Change the scope of the project code-assistant-feat-shell to influencer"
  • "Remove the project influencer-feat-channel"
  • "Move the element in the project code-assistant-feat-shell that has the filename get-elements-by-project.util.ts to the project shared-util-nx"

But it get's further than that:

  • "In the code-assistant-feat-shell project, for the shell-entry.smart-component.ts perform the following task: generate-datatest-ids"
  • "In the code-assistant-feat-shell project, generate a util with the name sort-dates that sorts dates ascending or descending based on a function param"

Now this gets really crazy. It can even generate this for you

"In the influencer-feat-channel project, generate a form with the name user with the following implementation: There should be a first name, last name, age and description. The description should live in a general form group, that also contains a VAT number. The VAT number should be validated in a way that only valid VAT numbers can be entered, the age should not be higher than 18 and the first name is required. When the first name is not filled in, we should disable the last name. When the first name is Brecht, the description should contain the text hiyaa!"

How to use the agent

In the keys.json you have to add your own openai and antrophic keys to use the api. Then run the following two commands:

npx nx run code-assistant:serve

and

npx nx run code-assistant-electron:serve

Which models does Nitrokit use

Nitrokit is smart about the pricing to, so it uses a combination of the GPT mini 4o model for simple things and the GPT 4o for more complex things.

Can I create my own prompts?

YES!! And that's exactly what you should do The code is filled with examples and best practices for prompt engineering, copy-paste a generator like the utilGenerator and start expanding this awesome AI-agent. Just kidding! I made it easier for your. You can generate a generator.

Adding a new ai generator

Nitrokit uses NX generators that act as AI agents. These generators live in libs/code-assistant/util-automation/src/lib/generators. I have created an ai generator generator that you can use to set up a new generator quickly. After all, you are going to want to manage your own custom prompts.

To create a new AI generator run the following command:

npx nx g @nitrokit/code-assistant-util-automation:ai-generator-generator --message="I want you to generate me an ai generator that refactors a piece of code in the way that it extracts all the pure functions and exports them in the same file so they can be tested"
npx nx run @nitrokit/code-assistant-util-automation:refactor-pure-functions --filename="dashboard.smart-component.ts" --project="influencer-feat-dashboard"

Just open the ai agent

What features does the Coding assistant have?

Glad you asked! Here is an overview:

  • Visualizes the scopes, the types of projects and which elements each project holds
  • It can search for all the elements in the codebase
  • You can chat to it so it updates stuff in your codebase
  • Shows the usage of tokens
  • Shows the executed prompts and the results
  • Autocompletion to help you quickly with refactoring and generating in your workspace
  • AI tasks on specific elements
  • Generate a complete app with complete CRUD features with AI
  • Shows a chat history between you and the different models
  • The code is generated in a dry-run, so you can review the code and than apply it to the file system
  • Diff tool between code that is updated by the AI assistant
  • Code generation with actual implementation written to the correct directory incl unittests
  • Supports Light/dark mode
  • Nitrokit prevents you from generating stuff in the wrong directory, EG, you can't generate a ui-component in a data-access lib

Nitrokit is growing every day, and we are focusing on AI BIG TIME!, future versions can include:

  • Talking to your codebase
  • Let an agent find and fix bugs for your
  • etc...

Current Tasks

  • Move file
  • Delete file
  • Create project
  • Change scope of project
  • Change type of project
  • Change name of project
  • Delete project
  • Generate supabase Angular application

Current AI tasks

  • Create Ui component
  • Update implementation of Ui component
  • Create smart component
  • Update implementation of smart component
  • Create pipe
  • Update implementation of pipe
  • Create directive
  • Update implementation of directive
  • Create Service
  • Update implementation of Service
  • Create util
  • Update implementation of util
  • Improve code
  • Generate data-testids
  • Generate unittests
  • Generate documentation
  • Fix code based on failing unittests
  • Generate complete AI generator with custom prompt that you can maintain
  • Generate complete working AI feature incl search and supabase interaction

Have questions?

Still have questions? Talk to support.