> For the complete documentation index, see [llms.txt](https://developer.kizen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode.md).

# Work with KiCode

KiCode brings agent-assisted app development to Kizen. Build fully functional custom components for your business using iterative, plain-language prompts.

{% hint style="success" %}
**Audience:** Developers, solution architects

**Purpose:** Describes how KiCode works for agent-assisted development of Kizen components
{% endhint %}

## Overview

KiCode is Kizen's built-in tool for agent-assisted app development. With this tool, you use ordinary language to describe a custom Kizen component to build. The KiCode agent writes the underlying code, including all the necessary scripts, stylesheets, and configuration files, and compiles a fully functional first version that you can use immediately. To modify the result, explain to the agent what you want to change, and it creates a new numbered version that incorporates your edits.

{% hint style="info" %}
**Note:** KiCode isn't the same as Nexus, Kizen's automated assistant. Use Nexus to help you set up your business and workflows or get answers to questions about Kizen features. Use KiCode specifically for building Kizen components.
{% endhint %}

***

## How KiCode works

KiCode runs in a chat interface in an onscreen panel (see Figure 1). Enter your instructions to the agent in the text field, and the agent replies to you in the chat.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FQXv2eyimjYkbAXlI7Dzv%2Fappdev_kaicode_chat.png?alt=media&amp;token=f2d86df3-b1bf-4777-90fb-eaa78649be22" alt="The user&#x27;s KiCode chat interface appears in a panel on the right side of the screen." width="563"><figcaption><p><strong>Figure 1:</strong> The KiCode panel.</p></figcaption></figure></div>

The agent interacts with your business through API calls. It has access to the structure of your business in Kizen—your custom objects, the custom fields in your contacts, and so on—and to the data in your business records. It can create new custom objects and fields and, with your permission, new records entirely. It can also build tools that enable team members to perform these actions manually, as long as they have access to the data.

{% hint style="info" %}
**Note:** Each KiCode chat is self-contained. It can't access or modify other KiCode chats. However, it retains its own chat history, and it can refer back to earlier sessions. Closing the interface doesn't erase the conversation.&#x20;
{% endhint %}

### About knowledge sources

The agent doesn't have Internet access, so it can't look up or verify information on public websites. It can't open URLs, follow links, or run web searches. However, it has full access to the knowledge catalogs of your Kizen business, which can include links to online sources. While the agent still can't access this content directly, it can search and reference the indexed copies that Kizen creates from these sources.

* **To manage your knowledge catalogs,** go to **Data** > **Custom Knowledge** in the global navigation.&#x20;

### About the source code

After the agent builds the component, you can inspect the source code in the Files section of the interface (see Figure 2). Select a file in the list to show its code. The code in this view is read-only.

<figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FmAmbk4Qt55BwXka7jRW2%2Fappdev_kaicode_files.png?alt=media&amp;token=edf61e57-ab0c-44c9-9c66-777d7bc2b839" alt="The user goes to the Files section to inspect the source code of one of the scripts in a block." width="563"><figcaption><p><strong>Figure 2:</strong> The Files section of the KiCode interface.</p></figcaption></figure>

***

## How to write the prompt

For best results, consider these guidelines as you draft your prompt:

* **Be as thorough as possible.** State the purpose of the component, explain exactly which custom objects and fields it uses, describe the layout and visual style, and note edge cases and how to handle them. KiCode fills in the gaps on its own to make the end result immediately usable, but the less you leave for it to decide, the closer it adheres to your original idea.
* **Iterate on the design, not the output.** If you aren't sure of the exact specifications, you can give KiCode your general idea and ask it to help you write the prompt. You get better outputs overall in a shorter time when you work out the details during the design stage instead of after KiCode builds the first version.
* **Add necessary context to your knowledge catalogs instead of the prompt.** KiCode can access the complete custom knowledge of your business, including all the internal files and links to websites that you have compiled. If the agent can find the definitions of terms or contextual information it needs among these sources, you don't need to provide the same information in the prompt.

Here is an example:

{% code overflow="wrap" expandable="true" %}

```
Please build a tool to help sales managers monitor the health of our pipeline for the current quarter.


Purpose

Help sales managers spot stalled or overdue deals during weekly pipeline reviews, and fix close dates on the spot without leaving the dashboard.


Data

Use the Deals pipeline object. Count only open deals, not won or lost ones.


What to show

(1) A row of summary numbers at the top: total open pipeline value, number of open deals, average deal size, and deals with no activity in the last 14 days.

(2) A horizontal bar chart of total value by stage, in pipeline stage order.

(3) A short table of the ten largest open deals: name, owner, stage, value and expected close date. Show overdue close dates in red.


Interaction

Clicking a deal name should open that record.

Each overdue deal should have a Push 30 Days button. This moves that deal's expected close date 30 days from today. Ask for confirmation before saving, then refresh the display.


Visual style

Clean and compact. It should fit in a half-width dashlet without horizontal scrolling. Use the standard Kizen styling.


Edge cases

If there are no open deals, show a friendly empty message instead of blank charts. If a field like Expected Close Date is missing, show a dash instead of failing. If a save fails, for example because the viewer can't edit that deal, show a clear error message.
```

{% endcode %}

***

## How to use KiCode

For step-by-step instructions on using KiCode, see the following topics:

* [Create and Edit Blocks with KiCode](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode/create-and-edit-blocks-with-kicode.md)
* [Create and Edit Business Apps with KiCode](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode/create-and-edit-business-apps-with-kicode.md)

***

## What's next

Continue to [Create and Edit Blocks with KiCode](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode/create-and-edit-blocks-with-kicode.md) to learn how to use KiCode to build content blocks on dashboards, homepages, and chart groups.

<details>

<summary>Related Topics</summary>

* [Apps](https://developer.kizen.com/docs/apps-and-integrations/plugin-development.md)
* [Work with Marketplace Apps](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/work-with-marketplace-apps.md)
* [Work with Business Apps](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/work-with-business-apps.md)
* [Develop Apps](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps.md)
* [Create and Edit Blocks with KiCode](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode/create-and-edit-blocks-with-kicode.md)
* [Create and Edit Business Apps with KiCode](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode/create-and-edit-business-apps-with-kicode.md)
* [Create App Surfaces](https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/create-app-surfaces.md)

</details>

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.kizen.com/docs/apps-and-integrations/plugin-development/develop-apps/work-with-kicode.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
