gibi-bot 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.context.json +185 -0
- package/.env.example +4 -0
- package/DISTRIBUTION.md +55 -0
- package/GEMINI.md +20 -0
- package/LICENSE +21 -0
- package/README.md +192 -0
- package/assets/gibi_avatar.png +0 -0
- package/conductor/code_styleguides/general.md +23 -0
- package/conductor/code_styleguides/ts.md +52 -0
- package/conductor/product-guidelines.md +28 -0
- package/conductor/product.md +20 -0
- package/conductor/setup_state.json +1 -0
- package/conductor/tech-stack.md +15 -0
- package/conductor/tracks/slack_bot_20260107/metadata.json +8 -0
- package/conductor/tracks/slack_bot_20260107/plan.md +26 -0
- package/conductor/tracks/slack_bot_20260107/spec.md +18 -0
- package/conductor/tracks.md +8 -0
- package/conductor/workflow.md +338 -0
- package/dist/agents.js +90 -0
- package/dist/agents.test.js +65 -0
- package/dist/app.js +740 -0
- package/dist/config.js +102 -0
- package/dist/context.js +146 -0
- package/dist/context.test.js +95 -0
- package/dist/prompts.js +20 -0
- package/jest.config.js +11 -0
- package/nodemon.json +10 -0
- package/package.json +44 -0
- package/src/agents.test.ts +85 -0
- package/src/agents.ts +112 -0
- package/src/app.d.ts +2 -0
- package/src/app.d.ts.map +1 -0
- package/src/app.js +55 -0
- package/src/app.js.map +1 -0
- package/src/app.ts +809 -0
- package/src/config.ts +72 -0
- package/src/context.test.ts +75 -0
- package/src/context.ts +130 -0
- package/src/prompts.ts +17 -0
- package/test_gemini.js +23 -0
- package/test_gemini_approval.js +24 -0
- package/test_gemini_write.js +23 -0
- package/tsconfig.json +13 -0
package/.context.json
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
{
|
|
2
|
+
"C0A7J7EU39S": {
|
|
3
|
+
"id": "C0A7J7EU39S",
|
|
4
|
+
"createdAt": "2026-01-08T00:29:43.084Z",
|
|
5
|
+
"lastActiveAt": "2026-01-08T00:39:55.422Z",
|
|
6
|
+
"data": {
|
|
7
|
+
"messages": [
|
|
8
|
+
{
|
|
9
|
+
"role": "user",
|
|
10
|
+
"content": "list me all files"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"role": "assistant",
|
|
14
|
+
"content": "I will list all the files in the current directory to provide you with a comprehensive overview of the project's structure.\nI'll use a glob pattern to list all the files in the project recursively, giving you a complete picture of the codebase.\nThe project currently contains the following files:\n\n- **Root:** `.context.json`, `.env.example`, `.gitignore`, `GEMINI.md`, `LICENSE`, `nodemon.json`, `package-lock.json`, `package.json`, `README.md`, `tsconfig.json`\n- **src/:** `app.ts`, `context.ts`, `config.ts`, `app.d.ts`, `app.d.ts.map`, `app.js`, `app.js.map`\n- **conductor/:** `tracks.md`, `tech-stack.md`, `setup_state.json`, `workflow.md`, `product-guidelines.md`, `product.md`\n- **conductor/code_styleguides/:** `ts.md`, `general.md`\n- **conductor/tracks/slack_bot_20260107/:** `plan.md`, `spec.md`, `metadata.json`"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"role": "user",
|
|
18
|
+
"content": "what was your last answer? rephrase it"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"role": "assistant",
|
|
22
|
+
"content": "In my previous response, I summarized the project's file structure, highlighting key configuration files in the root, application logic in the `src/` directory, and planning documentation within `conductor/`."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"messages": [
|
|
27
|
+
{
|
|
28
|
+
"role": "user",
|
|
29
|
+
"content": "list me all files"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"role": "assistant",
|
|
33
|
+
"content": "I will list all the files in the current directory to provide you with a comprehensive overview of the project's structure.\nI'll use a glob pattern to list all the files in the project recursively, giving you a complete picture of the codebase.\nThe project currently contains the following files:\n\n- **Root:** `.context.json`, `.env.example`, `.gitignore`, `GEMINI.md`, `LICENSE`, `nodemon.json`, `package-lock.json`, `package.json`, `README.md`, `tsconfig.json`\n- **src/:** `app.ts`, `context.ts`, `config.ts`, `app.d.ts`, `app.d.ts.map`, `app.js`, `app.js.map`\n- **conductor/:** `tracks.md`, `tech-stack.md`, `setup_state.json`, `workflow.md`, `product-guidelines.md`, `product.md`\n- **conductor/code_styleguides/:** `ts.md`, `general.md`\n- **conductor/tracks/slack_bot_20260107/:** `plan.md`, `spec.md`, `metadata.json`"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"role": "user",
|
|
37
|
+
"content": "what was your last answer? rephrase it"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"role": "assistant",
|
|
41
|
+
"content": "In my previous response, I summarized the project's file structure, highlighting key configuration files in the root, application logic in the `src/` directory, and planning documentation within `conductor/`."
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"C0A7CSPQQK0": {
|
|
46
|
+
"id": "C0A7CSPQQK0",
|
|
47
|
+
"createdAt": "2026-01-08T01:14:19.522Z",
|
|
48
|
+
"lastActiveAt": "2026-01-08T01:14:29.538Z",
|
|
49
|
+
"data": {
|
|
50
|
+
"type": "channel",
|
|
51
|
+
"initiated": true,
|
|
52
|
+
"messages": [
|
|
53
|
+
{
|
|
54
|
+
"role": "user",
|
|
55
|
+
"content": "Hi"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"messages": [
|
|
60
|
+
{
|
|
61
|
+
"role": "user",
|
|
62
|
+
"content": "Hi"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"1767855898.834639": {
|
|
67
|
+
"id": "1767855898.834639",
|
|
68
|
+
"createdAt": "2026-01-08T07:11:00.856Z",
|
|
69
|
+
"lastActiveAt": "2026-01-08T07:11:12.608Z",
|
|
70
|
+
"data": {
|
|
71
|
+
"messages": [
|
|
72
|
+
{
|
|
73
|
+
"role": "assistant",
|
|
74
|
+
"content": "I'm ready. Please provide your first command."
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"messages": [
|
|
79
|
+
{
|
|
80
|
+
"role": "assistant",
|
|
81
|
+
"content": "I'm ready. Please provide your first command."
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"1767855910.979099": {
|
|
86
|
+
"id": "1767855910.979099",
|
|
87
|
+
"createdAt": "2026-01-08T07:11:12.950Z",
|
|
88
|
+
"lastActiveAt": "2026-01-08T07:11:22.936Z",
|
|
89
|
+
"data": {
|
|
90
|
+
"messages": [
|
|
91
|
+
{
|
|
92
|
+
"role": "user",
|
|
93
|
+
"content": "hello"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"role": "assistant",
|
|
97
|
+
"content": "Hello! I'm ready to assist you with the development of **Gibi**, your Slack Bolt application. I've initialized my context with your project's structure and tech stack. \n\nHow can I help you today?"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"messages": [
|
|
102
|
+
{
|
|
103
|
+
"role": "user",
|
|
104
|
+
"content": "hello"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"role": "assistant",
|
|
108
|
+
"content": "Hello! I'm ready to assist you with the development of **Gibi**, your Slack Bolt application. I've initialized my context with your project's structure and tech stack. \n\nHow can I help you today?"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"1767857503.249309": {
|
|
113
|
+
"id": "1767857503.249309",
|
|
114
|
+
"createdAt": "2026-01-08T07:31:52.821Z",
|
|
115
|
+
"lastActiveAt": "2026-01-08T07:31:52.822Z",
|
|
116
|
+
"data": {
|
|
117
|
+
"messages": [
|
|
118
|
+
{
|
|
119
|
+
"role": "user",
|
|
120
|
+
"content": "hello"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"messages": [
|
|
125
|
+
{
|
|
126
|
+
"role": "user",
|
|
127
|
+
"content": "hello"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"C0A85RFLCG0": {
|
|
132
|
+
"id": "C0A85RFLCG0",
|
|
133
|
+
"createdAt": "2026-01-08T07:48:15.386Z",
|
|
134
|
+
"lastActiveAt": "2026-01-08T07:48:25.856Z",
|
|
135
|
+
"data": {
|
|
136
|
+
"messages": [
|
|
137
|
+
{
|
|
138
|
+
"role": "user",
|
|
139
|
+
"content": "hi"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"role": "assistant",
|
|
143
|
+
"content": "Hello! I'm ready to help you with the **Gibi** project. I see we're working on a Slack Bolt application in TypeScript. How can I assist you today?"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"messages": [
|
|
148
|
+
{
|
|
149
|
+
"role": "user",
|
|
150
|
+
"content": "hi"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"role": "assistant",
|
|
154
|
+
"content": "Hello! I'm ready to help you with the **Gibi** project. I see we're working on a Slack Bolt application in TypeScript. How can I assist you today?"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"1767858677.077039": {
|
|
159
|
+
"id": "1767858677.077039",
|
|
160
|
+
"createdAt": "2026-01-08T07:51:18.831Z",
|
|
161
|
+
"lastActiveAt": "2026-01-08T07:51:36.106Z",
|
|
162
|
+
"data": {
|
|
163
|
+
"messages": [
|
|
164
|
+
{
|
|
165
|
+
"role": "user",
|
|
166
|
+
"content": "list me all files"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"role": "assistant",
|
|
170
|
+
"content": "I will list all the files in the current directory.\nI will list all the files in the project recursively.\nThe files in the project are listed below:\n\n- `.context.json`\n- `src/app.ts`\n- `src/agents.test.ts`\n- `package.json`\n- `src/context.test.ts`\n- `jest.config.js`\n- `package-lock.json`\n- `diagnose.ts`\n- `README.md`\n- `src/context.ts`\n- `test_gemini_approval.js`\n- `test_gemini_write.js`\n- `test_gemini.js`\n- `src/agents.ts`\n- `src/config.ts`\n- `.gitignore`\n- `.DS_Store`\n- `assets/gibi_avatar.png`\n- `src/prompts.ts`\n- `nodemon.json`\n- `conductor/tracks.md`\n- `conductor/tracks/slack_bot_20260107/plan.md`\n- `.env.example`\n- `conductor/code_styleguides/ts.md`\n- `tsconfig.json`\n- `src/app.d.ts`\n- `src/app.d.ts.map`\n- `src/app.js`\n- `src/app.js.map`\n- `conductor/tracks/slack_bot_20260107/spec.md`\n- `conductor/tracks/slack_bot_20260107/metadata.json`\n- `conductor/tech-stack.md`\n- `GEMINI.md`\n- `conductor/setup_state.json`\n- `conductor/workflow.md`\n- `conductor/code_styleguides/general.md`\n- `conductor/product-guidelines.md`\n- `conductor/product.md`\n- `LICENSE`"
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"messages": [
|
|
175
|
+
{
|
|
176
|
+
"role": "user",
|
|
177
|
+
"content": "list me all files"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"role": "assistant",
|
|
181
|
+
"content": "I will list all the files in the current directory.\nI will list all the files in the project recursively.\nThe files in the project are listed below:\n\n- `.context.json`\n- `src/app.ts`\n- `src/agents.test.ts`\n- `package.json`\n- `src/context.test.ts`\n- `jest.config.js`\n- `package-lock.json`\n- `diagnose.ts`\n- `README.md`\n- `src/context.ts`\n- `test_gemini_approval.js`\n- `test_gemini_write.js`\n- `test_gemini.js`\n- `src/agents.ts`\n- `src/config.ts`\n- `.gitignore`\n- `.DS_Store`\n- `assets/gibi_avatar.png`\n- `src/prompts.ts`\n- `nodemon.json`\n- `conductor/tracks.md`\n- `conductor/tracks/slack_bot_20260107/plan.md`\n- `.env.example`\n- `conductor/code_styleguides/ts.md`\n- `tsconfig.json`\n- `src/app.d.ts`\n- `src/app.d.ts.map`\n- `src/app.js`\n- `src/app.js.map`\n- `conductor/tracks/slack_bot_20260107/spec.md`\n- `conductor/tracks/slack_bot_20260107/metadata.json`\n- `conductor/tech-stack.md`\n- `GEMINI.md`\n- `conductor/setup_state.json`\n- `conductor/workflow.md`\n- `conductor/code_styleguides/general.md`\n- `conductor/product-guidelines.md`\n- `conductor/product.md`\n- `LICENSE`"
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
}
|
package/.env.example
ADDED
package/DISTRIBUTION.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Gibi Distribution & Execution Guide
|
|
2
|
+
|
|
3
|
+
This document outlines how to distribute **Gibi** as a command-line tool and how users can execute it.
|
|
4
|
+
|
|
5
|
+
## 1. Building for Distribution
|
|
6
|
+
Before distributing, the TypeScript source code must be compiled into JavaScript.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm run build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This command runs `tsc` and outputs the compiled code to the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## 2. Local Installation (For Testing/Personal Use)
|
|
15
|
+
You can install the package globally on your machine directly from the source. This is excellent for testing the CLI experience without publishing.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# In the project root directory
|
|
19
|
+
npm install -g .
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Once installed, the `gibi` command will be available globally in your terminal.
|
|
23
|
+
|
|
24
|
+
## 3. Usage as a CLI Tool
|
|
25
|
+
Once installed, you can start the bot from anywhere:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
gibi
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Environment Setup
|
|
32
|
+
Gibi requires specific environment variables (`SLACK_BOT_TOKEN`, `SLACK_APP_TOKEN`, etc.).
|
|
33
|
+
On the first run, `gibi` will check for these. If not found in the system keychain, it will verify if a `.env` file exists in the current directory or prompt you to enter them securely.
|
|
34
|
+
|
|
35
|
+
### Context
|
|
36
|
+
When running `gibi` from a specific directory, that directory becomes the initial "Current Working Directory" (CWD) for the bot's file operations (like `/cd` or reading files).
|
|
37
|
+
|
|
38
|
+
## 4. Publishing to NPM (Optional)
|
|
39
|
+
To share Gibi with others via the NPM registry:
|
|
40
|
+
|
|
41
|
+
1. **Login to NPM**:
|
|
42
|
+
```bash
|
|
43
|
+
npm login
|
|
44
|
+
```
|
|
45
|
+
2. **Publish**:
|
|
46
|
+
```bash
|
|
47
|
+
npm publish --access public
|
|
48
|
+
```
|
|
49
|
+
*(Note: Ensure `package.json` has a unique version number before publishing)*
|
|
50
|
+
|
|
51
|
+
3. **User Installation**:
|
|
52
|
+
Users can then install it via:
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g gibi
|
|
55
|
+
```
|
package/GEMINI.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Gibi Project Context
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
**Gibi** is a software project currently in its setup phase.
|
|
5
|
+
It is being built as a **TypeScript** application using the **Slack Bolt** framework.
|
|
6
|
+
|
|
7
|
+
## Architecture & Technology Stack
|
|
8
|
+
* **Language:** TypeScript
|
|
9
|
+
* **Runtime:** Node.js
|
|
10
|
+
* **Framework:** @slack/bolt
|
|
11
|
+
* **Status:** Initial Setup
|
|
12
|
+
|
|
13
|
+
## Building and Running
|
|
14
|
+
* `npm install` - Install dependencies.
|
|
15
|
+
* `npm start` - Run the application (to be configured).
|
|
16
|
+
* `npm test` - Run tests.
|
|
17
|
+
|
|
18
|
+
## Development Conventions
|
|
19
|
+
* **Version Control:** Git.
|
|
20
|
+
* **Style:** TypeScript standard (ESLint/Prettier recommended).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fa-krug
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Gibi
|
|
2
|
+
|
|
3
|
+
Gibi is a Slack bot built with TypeScript and the Slack Bolt framework.
|
|
4
|
+
|
|
5
|
+
## Setup & Configuration
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
- Node.js (v18+ recommended)
|
|
9
|
+
- A Slack Workspace
|
|
10
|
+
- **Agent CLIs** (Optional but recommended):
|
|
11
|
+
- `gemini` (Google Gemini) - *Default*
|
|
12
|
+
- `claude` (Anthropic Claude)
|
|
13
|
+
- `cursor` (Cursor AI)
|
|
14
|
+
*Ensure these CLIs are installed and available in your system's PATH.*
|
|
15
|
+
|
|
16
|
+
### 1. Create Slack App & Obtain Tokens (2026 Guide)
|
|
17
|
+
The easiest way to configure the bot is using a **Slack App Manifest**.
|
|
18
|
+
|
|
19
|
+
1. Navigate to [Slack Apps](https://api.slack.com/apps).
|
|
20
|
+
2. Click **Create New App**.
|
|
21
|
+
3. Select **From an app manifest**.
|
|
22
|
+
4. Select your target workspace.
|
|
23
|
+
5. Paste the following YAML manifest:
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
display_information:
|
|
27
|
+
name: Gibi
|
|
28
|
+
description: A helpful Slack bot
|
|
29
|
+
background_color: "#2c2d30"
|
|
30
|
+
features:
|
|
31
|
+
bot_user:
|
|
32
|
+
display_name: Gibi
|
|
33
|
+
always_online: true
|
|
34
|
+
oauth_config:
|
|
35
|
+
scopes:
|
|
36
|
+
bot:
|
|
37
|
+
- chat:write
|
|
38
|
+
- channels:history
|
|
39
|
+
- groups:history
|
|
40
|
+
- im:history
|
|
41
|
+
- app_mentions:read
|
|
42
|
+
- commands
|
|
43
|
+
slash_commands:
|
|
44
|
+
- command: /cd
|
|
45
|
+
description: Change working directory
|
|
46
|
+
usage_hint: "[path]"
|
|
47
|
+
should_escape: false
|
|
48
|
+
- command: /plan
|
|
49
|
+
description: Enter Plan Mode to generate implementation plans
|
|
50
|
+
usage_hint: "[goal]"
|
|
51
|
+
should_escape: false
|
|
52
|
+
- command: /model
|
|
53
|
+
description: Switch the AI model for the current context
|
|
54
|
+
usage_hint: "[model_name]"
|
|
55
|
+
should_escape: false
|
|
56
|
+
- command: /help
|
|
57
|
+
description: Show available commands
|
|
58
|
+
usage_hint: ""
|
|
59
|
+
should_escape: false
|
|
60
|
+
- command: /agent
|
|
61
|
+
description: Switch the backing agent
|
|
62
|
+
usage_hint: "[agent_name]"
|
|
63
|
+
should_escape: false
|
|
64
|
+
settings:
|
|
65
|
+
event_subscriptions:
|
|
66
|
+
request_url: http://localhost:3000/slack/events # Ignored for Socket Mode but required for schema
|
|
67
|
+
bot_events:
|
|
68
|
+
- message.channels
|
|
69
|
+
- message.groups
|
|
70
|
+
- message.im
|
|
71
|
+
- app_mention
|
|
72
|
+
- member_joined_channel
|
|
73
|
+
socket_mode_enabled: true
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
6. Click **Next** and then **Create**.
|
|
77
|
+
7. **Obtain Bot Token**:
|
|
78
|
+
- Go to **OAuth & Permissions**.
|
|
79
|
+
- Click **Install to Workspace**.
|
|
80
|
+
- Copy the `xoxb-...` token. This is your `SLACK_BOT_TOKEN`.
|
|
81
|
+
8. **Obtain Signing Secret**:
|
|
82
|
+
- Go to **Basic Information** > **App Credentials**.
|
|
83
|
+
- Copy the **Signing Secret**. This is your `SLACK_SIGNING_SECRET`.
|
|
84
|
+
9. **Obtain App Token**:
|
|
85
|
+
- Go to **Basic Information** > **App-Level Tokens**.
|
|
86
|
+
- Click **Generate Token and Scopes**.
|
|
87
|
+
- Name it (e.g., `socket-mode`), add the `connections:write` scope, and generate.
|
|
88
|
+
- Copy the `xapp-...` token. This is your `SLACK_APP_TOKEN`.
|
|
89
|
+
|
|
90
|
+
### 2. Run the Application
|
|
91
|
+
1. Install dependencies:
|
|
92
|
+
```bash
|
|
93
|
+
npm install
|
|
94
|
+
```
|
|
95
|
+
2. Start the app:
|
|
96
|
+
```bash
|
|
97
|
+
npm start
|
|
98
|
+
```
|
|
99
|
+
3. On the first run, the app will prompt you to enter the tokens you obtained above. It will securely save them to your system keychain so you don't need to enter them again.
|
|
100
|
+
|
|
101
|
+
### 2a. Run as CLI (Global Install)
|
|
102
|
+
Alternatively, you can install Gibi globally and run it from any directory:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm install -g .
|
|
106
|
+
gibi
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
- `npm start`: Runs the bot in development mode.
|
|
111
|
+
- `npm run dev`: Runs the bot with auto-reload (using nodemon).
|
|
112
|
+
- `npm run build`: Compiles TypeScript to JavaScript.
|
|
113
|
+
|
|
114
|
+
## Features
|
|
115
|
+
|
|
116
|
+
### 🏠 App Home Dashboard
|
|
117
|
+
Gibi now features a dedicated **Home tab** in Slack.
|
|
118
|
+
- **System Status**: View available models and agents.
|
|
119
|
+
- **Recent Activity**: See your most recent conversation contexts and their current state (Model, Agent, CWD) at a glance.
|
|
120
|
+
|
|
121
|
+
### 📂 Interactive Navigation
|
|
122
|
+
The `/cd` command and `cd [path]` messages now provide an interactive directory browser.
|
|
123
|
+
- **Buttons**: Navigate into folders by clicking buttons instead of typing paths.
|
|
124
|
+
- **Quick Up**: Use the "Up one level" button for fast traversal.
|
|
125
|
+
|
|
126
|
+
### 🛠️ Visual Configuration
|
|
127
|
+
Switching models and agents is now easier and less error-prone.
|
|
128
|
+
- **Modals**: Use `/model` or `/agent` without arguments to open a popup window with selection dropdowns.
|
|
129
|
+
|
|
130
|
+
### 🤖 Rich Agent Responses
|
|
131
|
+
Conversation with Gibi is more structured and informative.
|
|
132
|
+
- **Context Footers**: Every response shows which Agent and Model were used, along with the current working directory.
|
|
133
|
+
- **Feedback**: Use the 👍/👎 buttons on responses to provide quick feedback.
|
|
134
|
+
|
|
135
|
+
### Context Awareness & Threading
|
|
136
|
+
Gibi now uses a **Thread-First** approach to keep your channels clean and organized.
|
|
137
|
+
|
|
138
|
+
- **Start a Task**: Mention the bot in a channel to start a new context (e.g., `@Gibi let's debug this`). Gibi will reply **in a thread**.
|
|
139
|
+
- **Chat in Thread**: Once a thread is started, you can reply directly in that thread *without* mentioning `@Gibi` again. The bot will automatically listen and respond within that specific context.
|
|
140
|
+
- **Noise Reduction**: Gibi ignores general channel messages. It only responds to:
|
|
141
|
+
- Direct Mentions (`@Gibi`)
|
|
142
|
+
- Direct Messages (DMs)
|
|
143
|
+
- Messages within threads it is already participating in.
|
|
144
|
+
- **Isolation**: Each thread is a completely isolated context with its own memory, working directory (`CWD`), and configuration.
|
|
145
|
+
|
|
146
|
+
### Persistence
|
|
147
|
+
Contexts are saved to `.context.json` locally. If you restart the bot, it picks up right where it left off.
|
|
148
|
+
|
|
149
|
+
### `/cd` Command
|
|
150
|
+
Change the bot's working directory *contextually* for the current channel.
|
|
151
|
+
- **Usage**: `/cd [path]`
|
|
152
|
+
- **Examples**:
|
|
153
|
+
- `/cd src`: Move into the `src` folder.
|
|
154
|
+
- `/cd ..`: Move up one level.
|
|
155
|
+
- `/cd`: Show the current directory listing.
|
|
156
|
+
- **Note**: The directory change is persisted per channel/thread. It does not affect the global process or other channels.
|
|
157
|
+
|
|
158
|
+
### `/plan` Command
|
|
159
|
+
Enter "Plan Mode" where the bot acts as a technical architect to help you plan features.
|
|
160
|
+
- **Usage**: `/plan [goal]`
|
|
161
|
+
- **Example**: `/plan Build a new login system`
|
|
162
|
+
- **Behavior**: The bot will generate a detailed markdown plan/checklist and ask clarifying questions.
|
|
163
|
+
|
|
164
|
+
### `/model` Command
|
|
165
|
+
Switch the Gemini model used for the current conversation.
|
|
166
|
+
- **Usage**: `/model [model_name]`
|
|
167
|
+
- **Example**: `/model gemini-1.5-pro`
|
|
168
|
+
- **Note**: Persisted per channel/thread.
|
|
169
|
+
|
|
170
|
+
### `/agent` Command
|
|
171
|
+
Switch the backing AI agent used for the conversation.
|
|
172
|
+
- **Usage**: `/agent [agent_name]`
|
|
173
|
+
- **Supported Agents**: `gemini`, `claude`, `cursor`
|
|
174
|
+
- **Example**: `/agent claude`
|
|
175
|
+
- **Note**: Persisted per channel/thread. Requires the respective CLI to be installed.
|
|
176
|
+
|
|
177
|
+
### `/help` Command
|
|
178
|
+
Show a list of all available commands and their usage.
|
|
179
|
+
- **Usage**: `/help`
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
## Troubleshooting
|
|
184
|
+
|
|
185
|
+
### Events Not Firing?
|
|
186
|
+
If features like the invite greeting aren't working:
|
|
187
|
+
|
|
188
|
+
1. **Check Event Subscriptions**: Ensure the relevant events (e.g., `member_joined_channel`) are added in the Slack App settings.
|
|
189
|
+
2. **Reinstall App**: After changing permissions or events, you **MUST** reinstall the app to the workspace.
|
|
190
|
+
- Go to **Install App** in the sidebar.
|
|
191
|
+
- Click **Reinstall to Workspace**.
|
|
192
|
+
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# General Code Style Principles
|
|
2
|
+
|
|
3
|
+
This document outlines general coding principles that apply across all languages and frameworks used in this project.
|
|
4
|
+
|
|
5
|
+
## Readability
|
|
6
|
+
- Code should be easy to read and understand by humans.
|
|
7
|
+
- Avoid overly clever or obscure constructs.
|
|
8
|
+
|
|
9
|
+
## Consistency
|
|
10
|
+
- Follow existing patterns in the codebase.
|
|
11
|
+
- Maintain consistent formatting, naming, and structure.
|
|
12
|
+
|
|
13
|
+
## Simplicity
|
|
14
|
+
- Prefer simple solutions over complex ones.
|
|
15
|
+
- Break down complex problems into smaller, manageable parts.
|
|
16
|
+
|
|
17
|
+
## Maintainability
|
|
18
|
+
- Write code that is easy to modify and extend.
|
|
19
|
+
- Minimize dependencies and coupling.
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
- Document *why* something is done, not just *what*.
|
|
23
|
+
- Keep documentation up-to-date with code changes.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# TypeScript Style Guide
|
|
2
|
+
|
|
3
|
+
This document defines the coding standards and conventions for the Gibi project.
|
|
4
|
+
|
|
5
|
+
## 1. General Principles
|
|
6
|
+
* **Strict Typing:** Always enable `"strict": true` in `tsconfig.json`. Avoid `any` whenever possible; use `unknown` if the type is truly uncertain and narrow it down.
|
|
7
|
+
* **Immutability:** Prefer `const` over `let`. Never use `var`.
|
|
8
|
+
* **Functional Style:** Prefer pure functions and immutable data structures where feasible.
|
|
9
|
+
* **Clarity:** Code should be self-documenting. Use descriptive variable and function names.
|
|
10
|
+
|
|
11
|
+
## 2. Naming Conventions
|
|
12
|
+
* **Files & Directories:** Use `kebab-case` (e.g., `user-profile.ts`, `event-handlers/`).
|
|
13
|
+
* **Variables & Functions:** Use `camelCase` (e.g., `fetchUserData`, `isReady`).
|
|
14
|
+
* **Classes & Interfaces:** Use `PascalCase` (e.g., `UserProfile`, `slackClient`).
|
|
15
|
+
* **Constants:**
|
|
16
|
+
* Global/Exported constants: `UPPER_SNAKE_CASE` (e.g., `MAX_RETRY_COUNT`).
|
|
17
|
+
* Local constants: `camelCase`.
|
|
18
|
+
* **Types:** Use `PascalCase`. Suffix with `Type` if aliasing a primitive or union (e.g., `UserIdType`), but prefer interfaces for objects.
|
|
19
|
+
* **Interfaces:** Use `PascalCase`. Do **not** prefix with `I` (e.g., use `User` instead of `IUser`).
|
|
20
|
+
|
|
21
|
+
## 3. Formatting
|
|
22
|
+
* **Indentation:** 2 spaces.
|
|
23
|
+
* **Quotes:** Single quotes `'` for strings, backticks `` ` `` for template literals. Avoid double quotes `"` unless escaping is otherwise required.
|
|
24
|
+
* **Semicolons:** Always use semicolons.
|
|
25
|
+
* **Trailing Commas:** Enable trailing commas where valid (ES5+).
|
|
26
|
+
* **Braces:** "One True Brace Style" (opening brace on the same line).
|
|
27
|
+
|
|
28
|
+
## 4. TypeScript Specifics
|
|
29
|
+
* **Interfaces vs Types:** Prefer `interface` for defining public API shapes and object structures. Use `type` for unions, intersections, and primitives.
|
|
30
|
+
* **Visibility:** Explicitly define `private`, `protected`, and `public` for class members.
|
|
31
|
+
* **Async/Await:** Prefer `async`/`await` syntax over `.then()` chains for readability.
|
|
32
|
+
* **Null/Undefined:** Use optional chaining (`?.`) and nullish coalescing (`??`) operators. Avoid explicit `null` checks when possible.
|
|
33
|
+
|
|
34
|
+
## 5. Slack Bolt Patterns
|
|
35
|
+
* **Listeners:** Group related listeners in dedicated modules/directories (e.g., `src/listeners/messages/`).
|
|
36
|
+
* **Typed Context:** Use Bolt's generics to type arguments in listeners:
|
|
37
|
+
```typescript
|
|
38
|
+
app.message('ping', async ({ message, say }: { message: GenericMessageEvent; say: SayFn }) => { ... });
|
|
39
|
+
```
|
|
40
|
+
* **Error Handling:** All async listeners must catch errors or bubble them up to a global error handler.
|
|
41
|
+
|
|
42
|
+
## 6. Testing
|
|
43
|
+
* Write unit tests for logic-heavy functions.
|
|
44
|
+
* Mock external dependencies (Slack API calls) using standard mocking libraries.
|
|
45
|
+
* Test files should be named `*.test.ts` or `*.spec.ts` and reside next to the source file or in a `tests/` directory.
|
|
46
|
+
|
|
47
|
+
## 7. Imports
|
|
48
|
+
* Group imports:
|
|
49
|
+
1. Node.js built-ins.
|
|
50
|
+
2. External dependencies (node_modules).
|
|
51
|
+
3. Internal modules (relative paths).
|
|
52
|
+
* Avoid circular dependencies.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Product Guidelines: Gibi
|
|
2
|
+
|
|
3
|
+
## Persona & Tone
|
|
4
|
+
Gibi is designed to be a **Friendly & Helpful** "personal code monkey." The bot's personality should be approachable and proactive, using a conversational tone that makes complex AI interactions feel accessible.
|
|
5
|
+
|
|
6
|
+
* **Tone:** Conversational, supportive, and efficient.
|
|
7
|
+
* **Personality:** Enthusiastic about helping with code, yet reliable and professional in its execution.
|
|
8
|
+
* **Voice:** Proactive—offering tips, clear status updates, and helpful suggestions when appropriate.
|
|
9
|
+
|
|
10
|
+
## Visual Identity & Branding
|
|
11
|
+
Gibi embraces a **Character-Driven** brand identity in Slack.
|
|
12
|
+
|
|
13
|
+
* **Avatar:** A distinct and friendly monkey-themed icon.
|
|
14
|
+
* **Visual Language:** Lighthearted use of monkey-themed emojis or subtle puns where appropriate to maintain a unique and recognizable personality.
|
|
15
|
+
* **Formatting:** Leverages standard Slack UI components while maintaining a clean, developer-friendly look.
|
|
16
|
+
|
|
17
|
+
## Interaction Design
|
|
18
|
+
Interaction with Gibi should prioritize ease of use and clarity, minimizing the friction of managing AI agents.
|
|
19
|
+
|
|
20
|
+
* **Clarity First:** All messages must be easy to scan. Use clear headings, bullet points, and properly formatted code blocks.
|
|
21
|
+
* **Interactive Elements:** Heavily utilize Slack buttons, menus, and modals. The goal is to allow users to trigger agents, approve plans, and make selections with minimal typing.
|
|
22
|
+
* **Progress Updates:** Provide **Incremental Status Updates**. Long-running tasks should use message threading or frequent, concise updates (e.g., "Analyzing codebase...", "Drafting plan...") to keep the user informed of specific steps.
|
|
23
|
+
|
|
24
|
+
## Error Handling & Support
|
|
25
|
+
When things go wrong, Gibi remains helpful rather than just technical.
|
|
26
|
+
|
|
27
|
+
* **User-Friendly & Actionable:** Instead of raw stack traces, explain errors in plain English.
|
|
28
|
+
* **Next Steps:** Every error message should suggest a clear path forward or provide options for the user to retry or adjust the task.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Product Guide: Gibi
|
|
2
|
+
|
|
3
|
+
## Initial Concept
|
|
4
|
+
**Gibi** is a personal "code monkey" designed to bring the power of autonomous AI coding agents out of the terminal and into a collaborative environment, specifically Slack, without compromising the security and control of local execution. It allows users to chat with a bot to trigger and manage various AI agents that perform coding tasks.
|
|
5
|
+
|
|
6
|
+
## Target Users
|
|
7
|
+
* **Individual Developers:** Programmers seeking to automate repetitive coding tasks and leverage AI assistance for debugging and code generation.
|
|
8
|
+
* **Development Teams:** Groups looking for a shared, accessible AI assistant to facilitate code reviews, boilerplate generation, and collaborative problem-solving.
|
|
9
|
+
|
|
10
|
+
## Core Features
|
|
11
|
+
* **Slack Bot Interface:** A user-friendly chat interface that serves as the primary command center. Users can trigger agents, monitor progress, and receive results directly within Slack conversations.
|
|
12
|
+
* **Multi-Agent Support:** A flexible architecture that supports multiple specialized agents (e.g., refactoring, documentation, bug fixing). Users can select the appropriate agent for their specific task.
|
|
13
|
+
* **Local Execution:** A key differentiator is "freeing the coding agents from the terminal without throwing them into the cloud." Gibi runs agents in a controlled, local environment (or user-managed server), ensuring code privacy and avoiding full reliance on cloud-hosted SaaS execution environments.
|
|
14
|
+
|
|
15
|
+
## Primary Goals
|
|
16
|
+
* **Increase Developer Velocity:** By offloading repetitive and time-consuming tasks to AI agents, developers can focus on high-leverage architectural and creative work.
|
|
17
|
+
* **Improve Code Quality:** Utilizing specialized agents helps ensure consistent coding styles, comprehensive documentation, and proactive bug detection, leading to a more robust codebase.
|
|
18
|
+
|
|
19
|
+
## Vision
|
|
20
|
+
To democratize access to powerful local AI coding agents by providing a familiar, chat-based interface. Gibi aims to bridge the gap between CLI-based AI tools and team collaboration platforms, ensuring data stays local while making advanced automation accessible to everyone on the team.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"last_successful_step": "3.3_initial_track_generated"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Technology Stack
|
|
2
|
+
|
|
3
|
+
## Core Language & Runtime
|
|
4
|
+
- **Language:** TypeScript
|
|
5
|
+
- **Runtime:** Node.js (Latest LTS recommended)
|
|
6
|
+
|
|
7
|
+
## Frameworks & Libraries
|
|
8
|
+
- **Slack Framework:** @slack/bolt (Official Slack framework for building apps)
|
|
9
|
+
- **Configuration:** dotenv (Environment variable management)
|
|
10
|
+
|
|
11
|
+
## Development Tools
|
|
12
|
+
- **Build/Transpilation:** TypeScript (`tsc`)
|
|
13
|
+
- **Execution:** `ts-node` (for development) or `node` (production build)
|
|
14
|
+
- **Linting/Formatting:** ESLint, Prettier (Recommended)
|
|
15
|
+
- **Testing:** Jest or Mocha (To be determined)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Track Plan: Initialize Slack Bot (TypeScript)
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
Initialize the project as a TypeScript application and implement a basic "ping-pong" Slack bot using the `@slack/bolt` framework.
|
|
5
|
+
|
|
6
|
+
## Steps
|
|
7
|
+
|
|
8
|
+
### 1. Project Initialization
|
|
9
|
+
- [x] Initialize `package.json` (`npm init -y`). [3538e0d]
|
|
10
|
+
- [x] Install dependencies: `typescript`, `ts-node`, `@slack/bolt`, `dotenv`. [3538e0d]
|
|
11
|
+
- [x] Install dev dependencies: `@types/node`. [3538e0d]
|
|
12
|
+
- [x] Initialize `tsconfig.json`. [3538e0d]
|
|
13
|
+
|
|
14
|
+
### 2. Basic Configuration
|
|
15
|
+
- [x] Create `.env` file (and add to `.gitignore`). [52ef449]
|
|
16
|
+
- [x] Create `src/` directory. [52ef449]
|
|
17
|
+
|
|
18
|
+
### 3. Bot Implementation
|
|
19
|
+
- [x] Create `src/app.ts` as the main entry point. [8cefef6]
|
|
20
|
+
- [x] Initialize `App` from `@slack/bolt`. [8cefef6]
|
|
21
|
+
- [x] Implement a simple message listener for "ping" that responds with "pong". [8cefef6]
|
|
22
|
+
- [x] Add start script to `package.json`. [8cefef6]
|
|
23
|
+
|
|
24
|
+
### 4. Verification
|
|
25
|
+
- [x] Verify compilation (`tsc`). [Verified]
|
|
26
|
+
- [x] Verify execution (`npm start`). [Verified]
|