RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cline rules/adsumnetworks/Adsum-IoT-Coder

Cline rules

.clinerules/project-memory.md
Cline rules

Quality

71/100

Scores the file, not the repository.

Length

949 words

9 headings · 0 code blocks

Repository

25

— · pushed 13 days ago

Last changed

3 days ago

First indexed 3 days ago.
adsumnetworks/Adsum-IoT-Coder/.clinerules/project-memory.mdRawGitHub
1# SoC AI Debugger - Deep Project Memory & Architecture Guide
2 
3This document is the **Ultimate Reference Guide** for any AI Coding Agent working on the SoC AI Debugger (formerly Cline/nRF AI Debugger). It is designed to prevent you from needing to grep or re-analyze the entire codebase to understand the command execution pipeline, UI data flow, or Nordic SDK integration logic.
4 
5---
6 
7## 1. Core Architecture & Component Map
8 
9The extension is split into three main areas: Core Extension (Backend), Webview UI (Frontend React), and Hosts (VS Code specific implementations).
10 
11### 1.1 Backend Core (`src/core/`)
12- `src/core/task/Task.ts`: The absolute brain of the execution loop. It handles the `while (!this.abort)` loop, parses API chunks, and manages tool execution.
13- `src/core/prompts/system-prompt/`: Contains all system prompts and tool schemas.
14 - `tools/nrf_device_tool.ts`: The strictly enforced schema for Zephyr/Nordic SDK operations. (Renamed from `trigger_nordic_action.ts`).
15 - `tools/execute_command.ts`: The generic bash tool. **CRITICAL:** The prompt here explicitly forbids its use for Nordic SDK tasks.
16- `src/core/controller/index.ts`: The `Controller` class manages state persistence (GlobalState, SecretStorage), the `McpHub`, and communication with the Webview.
17 
18### 1.2 Terminal Integration & Routing (The Most Complex Subsystem)
19The extension executes commands in different types of terminals based on the user's settings and the task at hand. This is handled in `src/integrations/terminal/`.
20 
21- **`CommandExecutor.ts`**: The routing hub for all `execute_command` and `nrf_device_tool` calls.
22 - **Execution Modes:** `terminalExecutionMode` can be `integrated` (visible to user) or `backgroundExec` (hidden standalone).
23 - **The "Named Terminal" Override:** In `backgroundExec` mode, standard commands run in hidden shells via `StandaloneTerminalManager`. However, if a tool specifically requests a *named* terminal (e.g., "nRF Connect"), `CommandExecutor` lazily instantiates a `VscodeTerminalManager` to force the command into the visible VS Code environment where the Zephyr SDK variables are injected.
24- **`src/hosts/vscode/terminal/VscodeTerminalManager.ts`**: Implements `ITerminalManager` for VS Code. It interacts with the VS Code API to find or create visible terminals.
25- **`src/hosts/vscode/terminal/VscodeTerminalRegistry.ts`**: Manages the lifecycle of terminals created by the extension.
26 - *Quirk:* The `createTerminal` method currently hardcodes the terminal name `name: "Cline"` or `"IoT AI Debugger"` internally. Do not refactor internal legacy names aggressively as it breaks tracking.
27- **`TriggerNordicActionHandler.ts`** (`src/core/task/tools/handlers/`): The handler that parses `nrf_device_tool` parameters. It specifically asks `CommandExecutor` to run commands in the "nRF Connect" terminal to guarantee SDK paths (`ZEPHYR_BASE`, `PATH`) are available.
28 
29### 1.3 Webview UI (`webview-ui/`)
30- Built with React and Vite.
31- **State Management:** `webview-ui/src/context/ExtensionStateContext.tsx` handles real-time synchronization with the backend `Controller` via VS Code message passing.
32- **Key Components:**
33 - `ChatView.tsx` / `ChatRow.tsx`: Render the conversational UI.
34 - `CommandOutputRow.tsx`: Renders real-time terminal streaming output.
35- **Branding:** Recently overhauled to "IoT AI Debugger". Logos (`NrfLogo.tsx`, `icon.png`) and UI text reflect this new branding.
36 
37---
38 
39## 2. The Data Flow: How a Nordic Command is Executed
40 
41To understand how to fix bugs in the execution pipeline, you must understand this flow:
42 
431. **Agent Output:** The AI generates a `tool_use` block for `nrf_device_tool` with `action="execute"` and `command="west build"`.
442. **Task Processing:** `Task.ts` intercepts this and routes it to `TriggerNordicActionHandler.executeInNrfTerminal()`.
453. **Execution Request:** The handler calls `commandExecutor.execute("west build", timeout, "nRF Connect")`. Note the specific passing of the terminal name `"nRF Connect"`.
464. **Routing (`CommandExecutor.ts`):**
47 - `CommandExecutor` checks the requested terminal name.
48 - Even if the user is in `backgroundExec` mode, because `"nRF Connect"` is explicitly requested, it bypasses the `StandaloneTerminalManager` and uses `VscodeTerminalManager`.
495. **Terminal Acquisition (`VscodeTerminalManager.ts`):**
50 - It iterates over `vscode.window.terminals` looking for one whose name includes "nRF Connect".
51 - If found, it uses it (this terminal has `ZEPHYR_BASE` injected by the official Nordic extension).
52 - If NOT found, it asks `TerminalRegistry` to create one, which may unfortunately default to the internal branding name, leading to execution in a generic environment (this is a known edge case).
536. **Streaming:** Output is streamed back via VS Code event listeners and piped into `Task.ts` to be read by the AI.
54 
55---
56 
57## 3. Persistent Agent Knowledge Base (`iot-knowledge/`)
58 
59**Do not confuse this directory with agent development memory.**
60- `iot-knowledge/` contains the strict markdown rules that the *active AI agent inside the VS Code extension* uses to learn how to debug nRF devices.
61- It contains `rules/nrf-terminal.md`, `platforms/`, etc.
62- In v0.0.6, we stripped hardcoded prompt strings out of the UI TypeScript files and moved them into this directory so the AI can dynamically load them based on the active workspace.
63 
64---
65 
66## 4. Known Quirks, Traps, and Limitations
67 
681. **Model Compliance Failures (The "Free Model" Bug):**
69 - Smaller models (like GLM 4.5 Air) have weak attention spans. They frequently ignore the negative constraints in `execute_command.ts` ("DO NOT use execute_command for SDK tasks") and fail to route Zephyr commands to `nrf_device_tool`.
70 - When modifying prompts to fix this, do not write long explanatory paragraphs. Use short, aggressive negative constraints at the very top of the tool schema.
712. **The "Shell Integration Unavailable" Warning:**
72 - NCS Terminals natively lack VS Code shell integration. `CommandExecutor.ts` handles this by suppressing the shell integration warning flag when a Nordic command is run. If you modify `CommandExecutor`, do not accidentally re-enable this warning for named terminals.
733. **Legacy Branding Variables:**
74 - You will see variables like `ClineDefaultTool`, `ClineIgnoreController`, and `clineMessages`. **Do not rename these.** The branding transition to "SoC AI Debugger" / "IoT AI Debugger" applies strictly to user-facing strings (UI text, Output Channel, `package.json` displayName). Refactoring internal variable names breaks backward compatibility with saved user states.
75 
76---
77 
78## 5. Development Workflow
79 
801. **Testing UI:** `cd webview-ui && npm run dev`
812. **Testing Extension:** Run the "Run Extension" launch configuration in VS Code (F5).
823. **Nordic Specific Tests:** We have isolated tests for the Nordic handlers. Run `npm run test:nordic`.
834. **Building VSIX:** `npm install` followed by `npx vsce package`. (Note: `*.vsix` is strictly ignored in `.gitignore`).
84 
85---
86*End of Project Memory. You are now fully contextualized.*
87 

Commands it names

  • npm run test:nordic
  • npm install
  • npx vsce package

Sections

  • SoC AI Debugger - Deep Project Memory & Architecture Guide
  • 1. Core Architecture & Component Map
  • 1.1 Backend Core (`src/core/`)
  • 1.2 Terminal Integration & Routing (The Most Complex Subsystem)
  • 1.3 Webview UI (`webview-ui/`)
  • 2. The Data Flow: How a Nordic Command is Executed
  • 3. Persistent Agent Knowledge Base (`iot-knowledge/`)
  • 4. Known Quirks, Traps, and Limitations
  • 5. Development Workflow

What it covers

setuptestcode-styleuiperformanceagent-behaviour

Stack — with the evidence

typescript

(1.00)

node

(1.00)

playwright

(1.00)

biome

(1.00)

react

(0.70)

tailwind

(0.70)

vite

(0.70)

vitest

(0.70)

aws

(0.70)

javascript

(0.60)

github-actions

(0.60)

Format

Cline rules

A single file or a folder of files, all always-on. The folder form is the simplest way any format here lets you split rules into topics without also learning an activation model.

What the corpus says about it

Repository

Owner
adsumnetworks
Language
—
License
—
Archived
no

All configs in this repo

Also in adsumnetworks/Adsum-IoT-Coder

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
adsumnetworks/Adsum-IoT-Coder.clinerules/cline-overview.md · 25Cline rulestypescriptnode+9archtypesapi54/1003 days ago
adsumnetworks/Adsum-IoT-Coder.clinerules/general.md · 25Cline rulestypescriptnode+9buildtestapiagent-behaviour69/1003 days ago
adsumnetworks/Adsum-IoT-Coder.clinerules/network.md · 25Cline rulestypescriptnode+9styletesting-strategydependencies54/1003 days ago
adsumnetworks/Adsum-IoT-Coder.clinerules/protobuf-development.md · 25Cline rulestypescriptnode+9buildstylearchapi+174/1003 days ago
Diff against .clinerules/cline-overview.md Diff against .clinerules/general.md Diff against .clinerules/network.md Diff against .clinerules/protobuf-development.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5Cline rulestypescriptnode+8setupbuildtestlint-format+11100/1003 days ago
JCodesMore/ai-website-cloner-template.clinerules · 31kCline rulestypescriptnode+7buildlint-formatstylearch+397/1002 days ago
BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0Cline rulesjavascripttailwind+5buildstylearchgit+296/1003 days ago
u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1Cline rulestypescriptvite+4setuparchtypesdo-not93/100yesterday
HerringtonDarkholme/megarepo.clinerules/02-development.md · 17Cline rulesnodejavascriptsetupbuildteststyle+392/1003 days ago
blendsdk/codeops-mcp.clinerules/project.md · 0Cline rulestypescriptvitest+3buildteststylearch+791/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack