For many years, software developers were focused on repetitive tasks like code review, complex test suites, or trying to improve code quality. All of these are necessary to keep an organized codebase and ensure high-quality software, even if the final user will never notice this. At the end of the day, your customer just needs a usable product that improves their quality of life.
Repetitive tasks stop your engineering team from adding value to the product and really focus on delivering that brand new feature that will break the internet.
Nowadays, AI is an impressive tool that is capable of helping us daily with an entire set of tasks, from video games to tackling complex work tasks.
AI in software development is making huge advancements to help us to develop and improve code-based products. There’s a lot of programming software that uses AI to improve developers' productivity, like development environments, code editors, or terminal programs.
Some examples to use your own commands could be code review to ensure high quality in your code, performance audits, security scans, API documentation, or your own third-party services patterns.
AI agent commands work like little instructions that call a specific file that works like a set of rules using your project’s context. These commands aim to centralize the team’s knowledge about your own project.
Each command follows a YAML frontmatter that works like metadata to identify the role and usage of the command.
Every AI agent software handles its own way to add commands. We will see how to create our first command using OpenCode, which is an open-source alternative to using an AI agent in our codebase.
You need to create the file “.opencode/commands/implement-tests.md” in your project directory.
Then we move to describe the info of what we want the command to do. This section includes information about when to use, rules, references, and a checklist.
A lot of tools use the auto-invoke feature, so the agent will know when it has to call this command. Please note that this command is not a “proper” way to do the task, but the way that our own team uses the test structure.
These commands are a powerful tool that allows developers to focus their time on improving the product capabilities instead of working on repetitive tasks.