Skip to content

Commit 0774e4c

Browse files
authored
feat(logistics-manager-app): upgrade baseline, prompts, and docs to Genkit (#30)
1 parent 5e95335 commit 0774e4c

27 files changed

Lines changed: 340 additions & 349 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"mcpServers": {
3+
"angular-cli": {
4+
"command": "npx",
5+
"args": [
6+
"-y",
7+
"@angular/cli",
8+
"mcp"
9+
],
10+
"disabledTools": [
11+
"ai_tutor"
12+
]
13+
},
14+
"chrome-devtools": {
15+
"command": "npx",
16+
"args": [
17+
"--yes",
18+
"chrome-devtools-mcp@1.10.1"
19+
]
20+
}
21+
}
22+
}

‎logistics-manager-app/.gitignore‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
.agents
23+
.vscode
24+
25+
# Visual Studio Code
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
!.vscode/mcp.json
32+
.history/*
33+
34+
# Miscellaneous
35+
/.angular/cache
36+
.sass-cache/
37+
/connect.lock
38+
/coverage
39+
/libpeerconnection.log
40+
testem.log
41+
/typings
42+
__screenshots__/
43+
.env
44+
45+
# System files
46+
.DS_Store
47+
Thumbs.db
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"plugins": {
3+
"@tailwindcss/postcss": {}
4+
}
5+
}

‎logistics-manager-app/AGENTS.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Project Context & Agent Configuration
2+
3+
**System Directive:** For all tasks within this project workspace, you must prioritize the environment-configured Agent Skills, Antigravity Plugins, and MCP Servers listed below. Do not rely on generalized knowledge if a specialized skill or server can execute the task.
4+
5+
Verify your work using the proper tools available to you.
6+
7+
## 1. Agent Skills & Plugins
8+
Apply the following specialized profiles based on the task domain:
9+
10+
* **`angular-developer`**: Engage this skill for all frontend architecture, component creation, best practices and modern Angular.
11+
* **`developing-genkit-js`**: Engage this skill when writing, configuring, or troubleshooting Genkit AI integrations, agents (`ai.defineAgent`), flows (`ai.defineFlow`), and tools (`ai.defineTool`).
12+
* **Express v5 Compatibility Note**: Do **NOT** install or import `@genkit-ai/express` (such as `expressHandler`), because Angular 21 SSR uses Express v5 (`^5.1.0`) while `@genkit-ai/express` requires Express v4 (`^4.21.1`). Invoke Genkit agents/flows directly inside standard Express route handlers in `src/server.ts`.
13+
* **`chrome-devtools` (`chrome-devtools-plugin`)**: Installed via `/plugin install chrome-devtools-plugin` in Antigravity CLI. Engage the `chrome-devtools` skill to automate browser interactions, inspect DOM states, capture console logs, evaluate network payloads, and verify UI changes (`navigate_page`, `wait_for`, `take_snapshot`, `click`, `fill`).
14+
15+
## 2. MCP Servers
16+
Route operations through these Model Context Protocol servers to interact with the local development environment:
17+
18+
* **angular-cli MCP Server**: Invoke and use tools like the following to control the development server.
19+
* **`devserver.start`** - starts the Angular dev server
20+
* **`devserver.stop`** - stops the Angular dev server
21+
* **`devserver.wait_for_build`** - Returns the output logs of the most recent build in a running development server started by `devserver.start`
22+
* **Chrome DevTools Plugin (`chrome-devtools-plugin`)**: Installed via `/plugin install chrome-devtools-plugin`. Provides the `chrome-devtools` MCP tools and skills for browser verification and debugging.
23+
24+
## 3. Execution Boundaries
25+
* **Sequential Execution**: Follow multi-step prompts in exact sequence. Review and implement the code in `src/server.ts` first before running verification.
26+
* **Environment & Credentials**: `.env` is valid and is already loaded at the top of `src/server.ts` (overriding any stale shell variables). Do **NOT** run standalone pre-flight `node -e` scripts to test API keys, and do **NOT** invoke external cloud/auth CLI tools (`gcloud`, `aws`, etc.). Test against the running application server (use `curl` only when asked to test the backend API directly; use `chrome-devtools` browser tools—not `curl`—when verifying UI and end-to-end flows).
27+
* **MCP Tool Usage**: Do **NOT** invoke the interactive `ai_tutor` tool from the `angular-cli` MCP server.

‎logistics-manager-app/GEMINI.md‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎logistics-manager-app/README.md‎

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,78 @@
1-
# LogisticsManagerApp
1+
# Obsidian Logistics Manager — Angular + Genkit Agentic Demo
22

3-
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.1.3.
3+
An interactive fleet and service-queue management web application built with **Angular 21** (Signals, `resource`, `linkedSignal`, Angular Aria, SSR with Express) and **Genkit** (`genkit` + `@genkit-ai/google-genai` powered by `gemini-3-flash-preview`).
44

5-
## Development server
5+
This repository accompanies the live stage demo showing how to pair-program with an AI coding agent using **Agent Skills**, **MCP Servers**, and **Antigravity Plugins** (`chrome-devtools-plugin`).
66

7-
To start a local development server, run:
7+
---
88

9-
```bash
10-
ng serve
11-
```
9+
## Branches & Demo Steps
1210

13-
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
11+
You can either start on **`main`** and run each prompt in [`content/prompts/`](./content/prompts/) with your coding agent, or check out any of the completed checkpoint branches directly:
1412

15-
## Code scaffolding
13+
| Branch | Prompt | Description |
14+
| :--- | :--- | :--- |
15+
| **`main`** | — | Clean starter baseline with fleet map, inventory list, service queue, and static chat shell. |
16+
| **`step-1`** | [`content/prompts/prompt-1.md`](./content/prompts/prompt-1.md) | Initializes Genkit with `googleAI()` (`gemini-3-flash-preview`) and adds the `POST /api/chat` endpoint in `src/server.ts`. |
17+
| **`step-2`** | [`content/prompts/prompt-2.md`](./content/prompts/prompt-2.md) | Connects the client chat UI (`src/app/components/chat/chat.ts`) to `/api/chat` using the Angular `resource` API and `afterRenderEffect` auto-scrolling. |
18+
| **`step-3`** | [`content/prompts/prompt-3.md`](./content/prompts/prompt-3.md) | Defines 7 Genkit fleet & service-queue tools (`ai.defineTool`) in `src/server.ts` and synchronizes UI state using Angular `resource`, `linkedSignal`, and `.reload()`. |
1619

17-
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
20+
To jump straight to the completed application with full Genkit tool calling:
1821

1922
```bash
20-
ng generate component component-name
23+
git checkout step-3
2124
```
2225

23-
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
26+
---
27+
28+
## Getting Started
29+
30+
### 1. Install Dependencies
2431

2532
```bash
26-
ng generate --help
33+
npm install
2734
```
2835

29-
## Building
36+
### 2. Configure Environment Variables
3037

31-
To build the project run:
38+
Create a `.env` file in the project root:
3239

33-
```bash
34-
ng build
40+
```env
41+
GEMINI_API_KEY="your_gemini_api_key_here"
3542
```
3643

37-
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
44+
### 3. Install Agent Skills & Plugins (For Running the Prompts)
3845

39-
## Running unit tests
46+
If you want to run the prompts in [`content/prompts/`](./content/prompts/) with an AI coding agent from `main`:
4047

41-
To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command:
48+
1. **Install the Angular & Genkit Agent Skills**:
49+
```bash
50+
npx skills add https://github.com/angular/skills --skill angular-developer
51+
npx skills add firebase/genkit --skill developing-genkit-js
52+
```
4253

43-
```bash
44-
ng test
45-
```
54+
2. **Install the Chrome DevTools Plugin** (in Antigravity CLI):
55+
```text
56+
/plugin install chrome-devtools-plugin
57+
```
58+
59+
3. **MCP Configuration**:
60+
- Project MCP settings are included in [`.gemini/settings.json`](./.gemini/settings.json), and agent workspace guidelines are defined in [`AGENTS.md`](./AGENTS.md).
61+
62+
---
4663

47-
## Running end-to-end tests
64+
## Development Server & Building
4865

49-
For end-to-end (e2e) testing, run:
66+
To start the local development server:
5067

5168
```bash
52-
ng e2e
69+
npm start
5370
```
5471

55-
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
72+
Open `http://localhost:4200/` in your browser.
5673

57-
## Additional Resources
74+
To build the project for production:
5875

59-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
76+
```bash
77+
npm run build
78+
```

‎logistics-manager-app/codelab.md‎

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,36 @@ cd logistics-manager-app
2424
npm install
2525
```
2626

27-
### 2. Install Gemini CLI Skills
28-
Skills provide the agent with specialized knowledge. You'll add the `angular-developer`, `gemini-sdk`, and `gemini-interactions-api` skills to help with code generation and API integration.
27+
### 2. Install Agent Skills
28+
Skills provide the agent with specialized knowledge. You'll add the `angular-developer` and `developing-genkit-js` skills to help with Angular code generation and Genkit AI integration.
2929

3030
```bash
3131
# Add Angular expertise
32-
npx skills install https://github.com/angular/skills/ --skill angular-developer
32+
npx skills add https://github.com/angular/skills/ --skill angular-developer
3333

34-
# Add Gemini SDK expertise
35-
npx skills add https://github.com/google-gemini/gemini-skills --skill gemini-api-dev
36-
npx skills add https://github.com/google-gemini/gemini-skills --skill gemini-interactions-api
34+
# Add Genkit JS expertise
35+
npx skills add firebase/genkit --skill developing-genkit-js
3736
```
3837

39-
Confirm that the agent skills are installed by using the `/skills` commands in Gemini CLI. This may require restarting Gemini CLI.
38+
Confirm that the agent skills are installed by using the `/skills` commands in your CLI. This may require restarting the CLI.
4039

41-
_Note: You do not have to use the `skills` npm package, you are welcome to use whichever agent skills manager you prefer.
40+
_Note: You do not have to use the `skills` npm package, you are welcome to use whichever agent skills manager you prefer._
4241

43-
### 3. Configure MCP Servers
44-
You can use Model Context Protocol (MCP) to enable your AI tools to interact with your running application and the browser.
42+
### 3. Configure Plugins & MCP Servers
43+
You can use Model Context Protocol (MCP) and plugins to enable your AI tools to interact with your running application and the browser.
4544

4645
#### Angular MCP Server
47-
This server allows the AI tooling to understand your Angular project structure, components,services and more. Use the Angular CLI to get the configuration for the MCP server.
46+
This server allows the AI tooling to understand your Angular project structure, components, services, and control the development server (`devserver.start`, `devserver.wait_for_build`, `devserver.stop`).
4847

49-
#### Chrome DevTools MCP Server
48+
#### Chrome DevTools Plugin (`chrome-devtools-plugin`)
5049
This allows the AI to inspect the running application in your browser for debugging and UI analysis.
5150

52-
Add the following configuration to your environment, for example, `.gemini/setting.json`:
51+
In Antigravity CLI, install the plugin:
52+
```text
53+
/plugin install chrome-devtools-plugin
54+
```
55+
56+
Add the following configuration to `.gemini/settings.json`:
5357

5458
```json
5559
{
@@ -59,15 +63,17 @@ Add the following configuration to your environment, for example, `.gemini/setti
5963
"args": [
6064
"-y",
6165
"@angular/cli",
62-
"mcp",
63-
"-E",
64-
"devserver"
66+
"mcp"
67+
],
68+
"disabledTools": [
69+
"ai_tutor"
6570
]
6671
},
6772
"chrome-devtools": {
6873
"command": "npx",
6974
"args": [
70-
"chrome-devtools-mcp@latest"
75+
"--yes",
76+
"chrome-devtools-mcp@1.10.1"
7177
]
7278
}
7379
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Add Gemini support to my Angular project's backend (Node.js).
1+
# Add Genkit support to my Angular project's backend (Node.js).
22

33
Technical Stack:
4-
* Package: @google/genai (the new unified SDK)
5-
* Model: gemini-3-flash-preview
4+
* Packages: `genkit` and `@genkit-ai/google-genai`
5+
* Model: `gemini-3-flash-preview`
66

77
## Task:
88

9-
1. Review my current server entry point and suggest how to initialize the GoogleGenAI client.
9+
1. Review my current server entry point (`src/server.ts`) and suggest how to initialize Genkit.
1010

11-
2. Outline a plan for a new POST endpoint that accepts a prompt and returns a generated response using the interactions API method. Ensure the plan explains how the interaction_id will be stored or passed back to the Angular client to maintain session state.
11+
2. Implement a new POST endpoint (`/api/chat`) that accepts a `prompt` and returns a generated response (`{ text }`) using Genkit.
1212

13-
3. Verify that endpoint is working by building the app, and use `curl` to ensure that the endpoint is working.
13+
3. Verify that the endpoint is working by building the app, running the server, and using `curl` to test `/api/chat`.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Add communication from the client side app to the AI chat endpoint via the chat window in the web app.
22

33
Task:
4-
1. Review the endpoint and chat window code to understand where to integrate.
4+
1. Review the `/api/chat` endpoint and chat window code (`src/app/components/chat/chat.ts`) to understand where to integrate.
55

6-
2. Outline a plan to implement the communication between the client and the server.
7-
- Use the **`@google/genai` interactions API**. Extract the generated message from the first text object in `interaction.outputs`. Refer to the documention if you get stuck: https://ai.google.dev/gemini-api/docs/interactions.md.txt
6+
2. Outline a plan to implement the communication between the client and the server:
7+
- Use the Angular **`resource`** API for the client requests to `/api/chat`.
8+
- Send the user's `prompt` and display the user and AI messages in the chat window, automatically scrolling the messages container to the bottom when new messages arrive.
89

910
3. For verification:
10-
- build the app and confirm that the build is error free. Use the Angular MCP server tools.
11-
- you may also use the ChromeDevTools MCP server to preview the build in a browser
11+
- Build the app and confirm that the build is error free. Use the Angular MCP server tools.
12+
- Use the `chrome-devtools` skill (`chrome-devtools-plugin`) in the browser (do not use `curl`) to preview and verify the chat UI end-to-end.

0 commit comments

Comments
 (0)