From b35f38421964c687086d04eb4e3606c2f4183ab6 Mon Sep 17 00:00:00 2001
From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com>
Date: Tue, 15 Jul 2025 17:38:27 +0000
Subject: [PATCH 1/6] Add Kiro IDE module

Adds a new module for Kiro IDE, AWS's AI-powered IDE that helps developers
build from concept to production with spec-driven development.

Features:
- One-click button to launch Kiro IDE
- Support for opening specific folders
- Support for opening recent workspaces
- Customizable display name, slug, order, and group
- Full test coverage

Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
---
 registry/coder/modules/kiro/README.md    | 52 +++++++++++++
 registry/coder/modules/kiro/main.test.ts | 93 ++++++++++++++++++++++++
 registry/coder/modules/kiro/main.tf      | 81 +++++++++++++++++++++
 3 files changed, 226 insertions(+)
 create mode 100644 registry/coder/modules/kiro/README.md
 create mode 100644 registry/coder/modules/kiro/main.test.ts
 create mode 100644 registry/coder/modules/kiro/main.tf

diff --git a/registry/coder/modules/kiro/README.md b/registry/coder/modules/kiro/README.md
new file mode 100644
index 00000000..fa41732e
--- /dev/null
+++ b/registry/coder/modules/kiro/README.md
@@ -0,0 +1,52 @@
+---
+display_name: Kiro IDE
+description: Add a one-click button to launch Kiro IDE
+icon: ../../../../.icons/code.svg
+maintainer_github: coder
+verified: true
+tags: [ide, kiro, ai, aws]
+---
+
+# Kiro IDE
+
+Add a button to open any workspace with a single click in Kiro IDE.
+
+Kiro is an AI-powered IDE from AWS that helps developers build from concept to production with spec-driven development, featuring AI agents, hooks, and steering files.
+
+Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder).
+
+```tf
+module "kiro" {
+  count    = data.coder_workspace.me.start_count
+  source   = "registry.coder.com/coder/kiro/coder"
+  version  = "1.0.0"
+  agent_id = coder_agent.example.id
+}
+```
+
+## Examples
+
+### Open in a specific directory
+
+```tf
+module "kiro" {
+  count    = data.coder_workspace.me.start_count
+  source   = "registry.coder.com/coder/kiro/coder"
+  version  = "1.0.0"
+  agent_id = coder_agent.example.id
+  folder   = "/home/coder/project"
+}
+```
+
+### Open with custom display name and order
+
+```tf
+module "kiro" {
+  count        = data.coder_workspace.me.start_count
+  source       = "registry.coder.com/coder/kiro/coder"
+  version      = "1.0.0"
+  agent_id     = coder_agent.example.id
+  display_name = "Kiro AI IDE"
+  order        = 1
+}
+```
diff --git a/registry/coder/modules/kiro/main.test.ts b/registry/coder/modules/kiro/main.test.ts
new file mode 100644
index 00000000..89ea9cc7
--- /dev/null
+++ b/registry/coder/modules/kiro/main.test.ts
@@ -0,0 +1,93 @@
+import { describe, expect, it } from "bun:test";
+import {
+  runTerraformApply,
+  runTerraformInit,
+  testRequiredVariables,
+} from "~test";
+
+describe("kiro", async () => {
+  await runTerraformInit(import.meta.dir);
+
+  testRequiredVariables(import.meta.dir, {
+    agent_id: "foo",
+  });
+
+  it("default output", async () => {
+    const state = await runTerraformApply(import.meta.dir, {
+      agent_id: "foo",
+    });
+    expect(state.outputs.kiro_url.value).toBe(
+      "kiro://coder.coder-remote/open?owner=default&workspace=default&url=https://mydeployment.coder.com&token=$SESSION_TOKEN",
+    );
+
+    const coder_app = state.resources.find(
+      (res) => res.type === "coder_app" && res.name === "kiro",
+    );
+
+    expect(coder_app).not.toBeNull();
+    expect(coder_app?.instances.length).toBe(1);
+    expect(coder_app?.instances[0].attributes.order).toBeNull();
+  });
+
+  it("adds folder", async () => {
+    const state = await runTerraformApply(import.meta.dir, {
+      agent_id: "foo",
+      folder: "/foo/bar",
+    });
+    expect(state.outputs.kiro_url.value).toBe(
+      "kiro://coder.coder-remote/open?owner=default&workspace=default&folder=/foo/bar&url=https://mydeployment.coder.com&token=$SESSION_TOKEN",
+    );
+  });
+
+  it("adds folder and open_recent", async () => {
+    const state = await runTerraformApply(import.meta.dir, {
+      agent_id: "foo",
+      folder: "/foo/bar",
+      open_recent: "true",
+    });
+    expect(state.outputs.kiro_url.value).toBe(
+      "kiro://coder.coder-remote/open?owner=default&workspace=default&folder=/foo/bar&openRecent&url=https://mydeployment.coder.com&token=$SESSION_TOKEN",
+    );
+  });
+
+  it("custom slug and display_name", async () => {
+    const state = await runTerraformApply(import.meta.dir, {
+      agent_id: "foo",
+      slug: "kiro-ai",
+      display_name: "Kiro AI IDE",
+    });
+    
+    const coder_app = state.resources.find(
+      (res) => res.type === "coder_app" && res.name === "kiro",
+    );
+
+    expect(coder_app?.instances[0].attributes.slug).toBe("kiro-ai");
+    expect(coder_app?.instances[0].attributes.display_name).toBe("Kiro AI IDE");
+  });
+
+  it("sets order", async () => {
+    const state = await runTerraformApply(import.meta.dir, {
+      agent_id: "foo",
+      order: "5",
+    });
+    
+    const coder_app = state.resources.find(
+      (res) => res.type === "coder_app" && res.name === "kiro",
+    );
+
+    expect(coder_app?.instances[0].attributes.order).toBe(5);
+  });
+
+  it("sets group", async () => {
+    const state = await runTerraformApply(import.meta.dir, {
+      agent_id: "foo",
+      group: "AI IDEs",
+    });
+    
+    const coder_app = state.resources.find(
+      (res) => res.type === "coder_app" && res.name === "kiro",
+    );
+
+    expect(coder_app?.instances[0].attributes.group).toBe("AI IDEs");
+  });
+});
diff --git a/registry/coder/modules/kiro/main.tf b/registry/coder/modules/kiro/main.tf
new file mode 100644
index 00000000..79eb24b0
--- /dev/null
+++ b/registry/coder/modules/kiro/main.tf
@@ -0,0 +1,81 @@
+terraform {
+  required_version = ">= 1.0"
+
+  required_providers {
+    coder = {
+      source  = "coder/coder"
+      version = ">= 2.5"
+    }
+  }
+}
+
+variable "agent_id" {
+  type        = string
+  description = "The ID of a Coder agent."
+}
+
+variable "folder" {
+  type        = string
+  description = "The folder to open in Kiro IDE."
+  default     = ""
+}
+
+variable "open_recent" {
+  type        = bool
+  description = "Open the most recent workspace or folder. Falls back to the folder if there is no recent workspace or folder to open."
+  default     = false
+}
+
+variable "order" {
+  type        = number
+  description = "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order)."
+  default     = null
+}
+
+variable "group" {
+  type        = string
+  description = "The name of a group that this app belongs to."
+  default     = null
+}
+
+variable "slug" {
+  type        = string
+  description = "The slug of the app."
+  default     = "kiro"
+}
+
+variable "display_name" {
+  type        = string
+  description = "The display name of the app."
+  default     = "Kiro IDE"
+}
+
+data "coder_workspace" "me" {}
+data "coder_workspace_owner" "me" {}
+
+resource "coder_app" "kiro" {
+  agent_id     = var.agent_id
+  external     = true
+  icon         = "/icon/code.svg"
+  slug         = var.slug
+  display_name = var.display_name
+  order        = var.order
+  group        = var.group
+  url = join("", [
+    "kiro://coder.coder-remote/open",
+    "?owner=",
+    data.coder_workspace_owner.me.name,
+    "&workspace=",
+    data.coder_workspace.me.name,
+    var.folder != "" ? join("", ["&folder=", var.folder]) : "",
+    var.open_recent ? "&openRecent" : "",
+    "&url=",
+    data.coder_workspace.me.access_url,
+    "&token=$SESSION_TOKEN",
+  ])
+}
+
+output "kiro_url" {
+  value       = coder_app.kiro.url
+  description = "Kiro IDE URL."
+}

From 3ba9ec6b62b766eff8a3819a56833af68ce7b64b Mon Sep 17 00:00:00 2001
From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com>
Date: Tue, 15 Jul 2025 17:44:22 +0000
Subject: [PATCH 2/6] Add official Kiro SVG icon and update module to use it

Adds the official Kiro SVG icon to .icons/kiro.svg and updates the
Kiro module to use the proper icon instead of the generic code.svg.

The icon features Kiro's distinctive ghost-like mascot design.

Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
---
 .icons/kiro.svg                       | 1 +
 registry/coder/modules/kiro/README.md | 2 +-
 registry/coder/modules/kiro/main.tf   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 .icons/kiro.svg

diff --git a/.icons/kiro.svg b/.icons/kiro.svg
new file mode 100644
index 00000000..e132ead1
--- /dev/null
+++ b/.icons/kiro.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="24" viewBox="0 0 20 24" fill="none"><path d="M3.80081 18.5661C1.32306 24.0572 6.59904 25.434 10.4904 22.2205C11.6339 25.8242 15.926 23.1361 17.4652 20.3445C20.8578 14.1915 19.4877 7.91459 19.1361 6.61988C16.7244 -2.20972 4.67055 -2.21852 2.59581 6.6649C2.11136 8.21946 2.10284 9.98752 1.82846 11.8233C1.69011 12.749 1.59258 13.3398 1.23436 14.3135C1.02841 14.8733 0.745043 15.3704 0.299833 16.2082C-0.391594 17.5095 -0.0998802 20.021 3.46397 18.7186V18.7195L3.80081 18.5661Z" fill="white"></path><path d="M10.9614 10.4413C9.97202 10.4413 9.82422 9.25893 9.82422 8.55407C9.82422 7.91791 9.93824 7.4124 10.1542 7.09197C10.3441 6.81003 10.6158 6.66699 10.9614 6.66699C11.3071 6.66699 11.6036 6.81228 11.8128 7.09892C12.0511 7.42554 12.177 7.92861 12.177 8.55407C12.177 9.73591 11.7226 10.4413 10.9616 10.4413H10.9614Z" fill="black"></path><path d="M15.0318 10.4413C14.0423 10.4413 13.8945 9.25893 13.8945 8.55407C13.8945 7.91791 14.0086 7.4124 14.2245 7.09197C14.4144 6.81003 14.6861 6.66699 15.0318 6.66699C15.3774 6.66699 15.6739 6.81228 15.8831 7.09892C16.1214 7.42554 16.2474 7.92861 16.2474 8.55407C16.2474 9.73591 15.793 10.4413 15.0319 10.4413H15.0318Z" fill="black"></path></svg>
\ No newline at end of file
diff --git a/registry/coder/modules/kiro/README.md b/registry/coder/modules/kiro/README.md
index fa41732e..85e99e7d 100644
--- a/registry/coder/modules/kiro/README.md
+++ b/registry/coder/modules/kiro/README.md
@@ -1,7 +1,7 @@
 ---
 display_name: Kiro IDE
 description: Add a one-click button to launch Kiro IDE
-icon: ../../../../.icons/code.svg
+icon: ../../../../.icons/kiro.svg
 maintainer_github: coder
 verified: true
 tags: [ide, kiro, ai, aws]
diff --git a/registry/coder/modules/kiro/main.tf b/registry/coder/modules/kiro/main.tf
index 79eb24b0..a6a49948 100644
--- a/registry/coder/modules/kiro/main.tf
+++ b/registry/coder/modules/kiro/main.tf
@@ -56,7 +56,7 @@ data "coder_workspace_owner" "me" {}
 resource "coder_app" "kiro" {
   agent_id     = var.agent_id
   external     = true
-  icon         = "/icon/code.svg"
+  icon         = "/icon/kiro.svg"
   slug         = var.slug
   display_name = var.display_name
   order        = var.order

From b028aa68a7c2ffc62639786dfde94865f62a5b19 Mon Sep 17 00:00:00 2001
From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com>
Date: Tue, 15 Jul 2025 18:04:06 +0000
Subject: [PATCH 3/6] Update README: Add kiro.dev link and improve formatting

Adds a link to https://kiro.dev in the description as requested
in the PR review.

Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
---
 registry/coder/modules/kiro/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/registry/coder/modules/kiro/README.md b/registry/coder/modules/kiro/README.md
index 85e99e7d..292017f9 100644
--- a/registry/coder/modules/kiro/README.md
+++ b/registry/coder/modules/kiro/README.md
@@ -9,7 +9,7 @@ tags: [ide, kiro, ai, aws]
 
 # Kiro IDE
 
-Add a button to open any workspace with a single click in Kiro IDE.
+Add a button to open any workspace with a single click in [Kiro IDE](https://kiro.dev).
 
 Kiro is an AI-powered IDE from AWS that helps developers build from concept to production with spec-driven development, featuring AI agents, hooks, and steering files.
 

From d0f561a5c1c8aa54fbe471b8ab86d6636aba7b83 Mon Sep 17 00:00:00 2001
From: Atif Ali <atif@coder.com>
Date: Tue, 15 Jul 2025 23:12:50 +0500
Subject: [PATCH 4/6] Apply suggestion from @matifali

---
 registry/coder/modules/kiro/README.md | 1 -
 1 file changed, 1 deletion(-)

diff --git a/registry/coder/modules/kiro/README.md b/registry/coder/modules/kiro/README.md
index 292017f9..20eb8bf1 100644
--- a/registry/coder/modules/kiro/README.md
+++ b/registry/coder/modules/kiro/README.md
@@ -2,7 +2,6 @@
 display_name: Kiro IDE
 description: Add a one-click button to launch Kiro IDE
 icon: ../../../../.icons/kiro.svg
-maintainer_github: coder
 verified: true
 tags: [ide, kiro, ai, aws]
 ---

From d386058c0a0fd6b29e52db1b2f2adcf3f67880fa Mon Sep 17 00:00:00 2001
From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com>
Date: Tue, 15 Jul 2025 19:16:48 +0000
Subject: [PATCH 5/6] Update README: Use open-remote-ssh extension instead of
 Coder Remote VS Code Extension

Updates the documentation to reference the correct extension used by Kiro
for establishing connections to Coder workspaces.

Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
---
 registry/coder/modules/kiro/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/registry/coder/modules/kiro/README.md b/registry/coder/modules/kiro/README.md
index 20eb8bf1..90b31d69 100644
--- a/registry/coder/modules/kiro/README.md
+++ b/registry/coder/modules/kiro/README.md
@@ -12,7 +12,7 @@ Add a button to open any workspace with a single click in [Kiro IDE](https://kir
 
 Kiro is an AI-powered IDE from AWS that helps developers build from concept to production with spec-driven development, featuring AI agents, hooks, and steering files.
 
-Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder).
+Uses the [open-remote-ssh extension](https://open-vsx.org/extension/jeanp413/open-remote-ssh) for establishing connections to Coder workspaces.
 
 ```tf
 module "kiro" {

From d6f6a7c3de183c49ad53f63870d4d502af8f5a14 Mon Sep 17 00:00:00 2001
From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com>
Date: Tue, 15 Jul 2025 19:20:49 +0000
Subject: [PATCH 6/6] Update README: Mention both Coder Remote VS Code
 Extension and open-remote-ssh extension

As clarified in the PR review, Kiro uses both extensions for establishing
connections to Coder workspaces.

Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
---
 registry/coder/modules/kiro/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/registry/coder/modules/kiro/README.md b/registry/coder/modules/kiro/README.md
index 90b31d69..732472cb 100644
--- a/registry/coder/modules/kiro/README.md
+++ b/registry/coder/modules/kiro/README.md
@@ -12,7 +12,7 @@ Add a button to open any workspace with a single click in [Kiro IDE](https://kir
 
 Kiro is an AI-powered IDE from AWS that helps developers build from concept to production with spec-driven development, featuring AI agents, hooks, and steering files.
 
-Uses the [open-remote-ssh extension](https://open-vsx.org/extension/jeanp413/open-remote-ssh) for establishing connections to Coder workspaces.
+Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder) and [open-remote-ssh extension](https://open-vsx.org/extension/jeanp413/open-remote-ssh) for establishing connections to Coder workspaces.
 
 ```tf
 module "kiro" {
