Posts

opencode plugin with skills setup - continuation of this blog https://mitzen.blogspot.com/2026/04/opencode-creating-plugin-and.html

Image
In the previous post , we learned how to setup plugin so we can call it from opencode. In this post, we are going to add a skill - bragging skills - as I find it really important arsenal to have especially in an interview.  So we only need to update our config object for opencode. Let's see an example of how to do it with skills   config : async ( config : any ) => {       config . skills = config . skills || {};       config . skills . paths = config . skills . paths || [] ;       if ( ! config . skills . paths . includes ( skillsDir )) {         config . skills . paths . push ( skillsDir ) ;       } And that's it. Once you have restart opencode, it will load my new skills.  The full code is here and the repo here: https://github.com/kepungnzai/appcoreopc-num-mastery.git import { type Plugin } from " @opencode-ai/plugin " import { tool } from " @opencode-ai/pl...

azure speech to text using azure AI foundry

Image
In this example, we will try to test out Azure speech to text by. First we need to create an Azure foundry project. Go to Azure portal then on the left, select   "Use with Foundry" and create a foundry resource.] After you created it, it will look something like this. After it is completed, click on the link to goto Azure foundry, then select Build -> Model -> Azure Speech speech to text.  And you will get some endpoints and keys that you can use. Or if you're not doing any coding, then you can just upload a file or click on "Start recording" for a demo.  The beauty of it is, you can see it working in real-time Then it can return JSON as an output. And finally you can use code to interact with it  Example of pre-generated c# code look like this. using Microsoft . CognitiveServices . Speech ; using Microsoft . CognitiveServices . Speech . Audio ; class Program {     static async Task Main ( string [] args )     {     ...

terraform import existing resources - not quite with 1.5.x with generated output

Image
Terraform import can be quite interesting thing to do. So let's start with us trying to import a storage account. So we will start off using hcl import statement to import this.  provider "azurerm" {   features {} } resource "azurerm_storage_account" "imported_storage" {   name                     = " saforimort "   resource_group_name       = " mytest-kv-rg "   location                 = " australiaeast "   account_tier             = " Standard "   account_replication_type = " LRS " } import {   to = azurerm_storage_account . imported_storage   id = " /subscriptions/your-subscription-id/resourceGroups/ mytest-kv-rg/providers/Microsoft.Storage/storageAccounts/saforimort " } As you can see here, we are trying to import to  "azurerm_storage_account" "imported_storage" . and we just ne...

opencode - creating plugin and distributing it via npm

Image
We can easily create a plugin for opencode. In this example, we are just going to write a simple output. First we need to create a nodejs project using the following code. Please refer to this code repo here for typescript setup and other codes.  https://github.com/kepungnzai/appcoreopc-num-mastery. In this code, the most important thing is it must inherit from Plugin (quite important) otherwise your agent might not be able to figur out. import { type Plugin } from " @opencode-ai/plugin " import { tool } from " @opencode-ai/plugin/tool " export const AppcoreopcNumMastery : Plugin = async () => {   const myTool = tool ( {     description : " A simple plugin. " ,     args : {       query : tool . schema . string () . describe ( " Question or topic to submit to Google AI Mode " ) ,       timeout : tool . schema . number () . min ( 5 ) . max ( 120 ) . optional () . describe ( " Timeout in seconds (...

opencode creating plugins and exposing it via opencode command line

Image
 Let's create a plugin that you can call from opencode command interface for example by typing  /custom-plugin  to get opencode to execute your plugin. To do that, we need to create a plugin and then create command that goes into opencode.json The plugin  The plugin code - you need to create a folder ".opencode/plugins/custom-tools.ts".  import { type Plugin , tool } from " @opencode-ai/plugin " export const CustomToolsPlugin : Plugin = async ( ctx ) => {   return {     tool : {       mymagictool : tool ( {         description : " This is a custom tool " ,         args : {           foo : tool . schema . string () ,         },         async execute ( args , context ) {           const { directory , worktree } = context           return ` Hello ${ ...

opencode creating tools

Image
We can easily extend opencode to support custom tools and plugins. We will cover plugin which is essentially npm packages you publish.  To create a custom tools, we create a folder called ".opencode/tools/hello.ts and in this file we have the following code.  hello.ts import { tool } from " @opencode-ai/plugin " export const sayhello = tool ( {   description : " say hello multiple times " ,   args : {       name : tool . schema . string () . describe ( " Name to greet " )   },   async execute ( args ) {     return ` Hello, ${ args . name } ! Hello again, ${ args . name } ! `   }, } )   Next, fire opencode and then you can start to use it and you will get the following output. This is just an example.

opencode setting up skills

opencode can be extended with skills. To setup, go and create opencode.json config file.  In the folder that you're trying to fun opencode, create a file called opencode.json and then place the following content in there. It will setup obra superpowers and opencode-devcontainers.  superpowers is a skills or plugin that supports your model application development. It helps with writting plans, request code review and brain storming.  devcontainers provide workspace isolations by running your code on a container and not touching the host.  To install all these superpowers above, add this to your opencode.json file. opencode.json  {   " $schema " : " https://opencode.ai/config.json " ,   " plugin " : [ " superpowers@git+https://github.com/obra/superpowers.git " , " opencode-devcontainers " ] } More info https://github.com/athal7/opencode-devcontainers https://github.com/obra/superpowers

opencode using qwen 3.6 code for free

Image
Opencode supports qwen 3.6 and you can use it for free. Here is how you can use it. Download and install opencode. curl -fsSL https://opencode.ai/install | bash Then you can fire it up in your bash terminal.  Press / (slash) and then choose your qwen 3.6 as your model. And that's it.   Give it a go, ask it to coding :- 

Google ADK - taking a look at LLMAgent, Agent, AgentTool, SubAgent, SequentialAgent and ParrallelAgent

This covers some confusion around agent in Google ADK. So what is the differences between LLMAgent, Agent, SequentialAgent and ParallelAgent?  LLMAgent is used for reasoning, understanding your intention, making decision and ability to interact with tools.  To use LlmAgent here is an example capital_agent = LlmAgent ( model = "gemini-2.5-flash" , name = "capital_agent" , description = "Answers user questions about the capital city of a given country." # instruction and tools will be added next ) Agent is an alis for LLMAgent.  SequentialAgent on the other hand are pre-defined sequential workflow to be carried out by an orchestration agent. In this case, it would be Agent / LLMAgent.  Code example of sequentialAgent can be shown here  location_strategy_pipeline = SequentialAgent (     name = " LocationStrategyPipeline " ,     description = """ Comprehensive retail location strategy analysis pipeline. "...

bicep using user defined function

User defined function can be quite handy to help us some save time. Here is an example of how we can defned user defined function (like in golang) func buildResourceName ( prefix string , env string , suffix string ) string =>   toLower ( ' ${ prefix } - ${ env } - ${ suffix } ' ) And to use it we simple call it here in our storage container examples:-  resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2023-01-01' = [ for name in containers : {   parent : blobService   name : buildResourceName ( name , 'dev' , 'aue' )   properties : {     publicAccess : 'None'     metadata : {       project : 'audit-2026'     }   } }] You can get all the bicep function here https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions Placing your function in another file  You can place all your function in a separate file and import it in.  functions....