cover

I developed KV Store Manager - Mattermost Plugin

[AI Translated]

Introduction

I regularly use Mattermost, a communication tool similar to Slack that can be self-hosted. A friend of mine manages it for me.

Through this experience, I occasionally create Mattermost plugins. Here’s one that registers RSS feeds to channels so everyone can subscribe together:

https://github.com/manybugsdev/mattermost-plugin-feed

Bot posting articles

Before developing this, I was using the following plugin. However, it had a special condition for determining article updates, which sometimes caused a massive reposting of old articles. I created my own plugin to address this issue.

Mass posting

https://mattermost.com/marketplace/rssfeed-plugin/

Now, when developing Mattermost plugins, you can use the KV Store provided internally within the application to save state. However, there was no way to check the KV Store’s state from outside the plugin, so I had to confirm it by writing to log files each time.

Therefore, I decided to create a plugin that can check the state of the KV Store used in Mattermost plugins with a single command. Since it was a simple program, I decided to develop it using the recently popular Vibe Coding method.

What is Vibe Coding?

https://www.ibm.com/think/topics/vibe-coding

It’s a development method where you give instructions in natural language without doing much coding yourself, and generative AI does the coding. Recently, generative AI has become quite smart, and you can entrust it with the entire implementation for simple things.

My preferred AI is GitHub Copilot. It has a particularly attractive pricing structure among generative AI tools. No other service offers agent mode for $10/month. Since it can integrate with GitHub Issues and operate like actual team development, I used this for Vibe Coding.

Development Flow

Development using GitHub Copilot agent starts with creating an Issue. You write the program requirements and assign Copilot as the Assignee. That’s it.

First Issue

If Copilot doesn’t appear in the Assignees, you either don’t have a Copilot Pro subscription, or repository access hasn’t been provided to Copilot. You can check here:

https://github.com/settings/copilot/coding_agent

When you create an Issue, Copilot starts working. After a few minutes, the work is completed and a pull request is created. You review the code and execution results.

Code diff display

If you like the pull request, merge it and delete the created branch. If you don’t like it, discard the pull request and branch, and start over from creating an Issue.

In this way, you can work with the same flow as team development using GitHub. It’s also good practice for using GitHub.

Tips for Giving Instructions

For giving instructions, I’m conscious of not being too detailed. If there’s too much work on our side like prompt engineering, it defeats the purpose. I think the interesting part is thinking about how to concisely share your image with the AI.

But this one I didn’t explain enough:

Issue with too little explanation

Results

I was able to create something satisfactory. You can execute /kv list to display all KV Store keys, and /kv get plugin_name:key to display the corresponding values.

https://github.com/manybugsdev/mattermost-plugin-kv

KV plugin view

I’m a solo developer, but it felt like I was developing with a team, which was fun. I was impressed that I could do program development in short periods of time, as reviews are possible even on mobile apps. There were some parts that didn’t work out as expected, but simple programs are sufficient with Vibe Coding since it corrects them at an abnormal coding speed.

However, the only stress was that reviews were troublesome. Automatic deployment makes confirmation easy, but I was uploading files manually and had to open my computer each time. It’s better to set up your environment first so you can review immediately. You could leave it to AI, but SRE-related tasks don’t seem to work out well.

Summary