You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b5f43a5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: plugins/AI-Agent-Claude/README.md
+47-3Lines changed: 47 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,8 @@ cd plugins/AI-Agent-Claude
32
32
33
33
## Configuration
34
34
35
-
Everything is configured in **AI Core → Agent settings**, on the pane this plugin
36
-
contributes: API key, model, and one **Test Connection & List Models** button.
35
+
Everything is configured in **Preferences → Configuration → Agent**, on the pane
36
+
this plugin contributes: API key, model, and one **Test Connection & List Models** button.
37
37
Nothing outside this plugin handles the key. Listing models and testing the key
38
38
are the same `GET /v1/models`, so they are one control, and the model is a
39
39
single editable dropdown: type any id, or pick one the key can use.
@@ -121,6 +121,48 @@ register with. Order does not matter: this plugin re-registers when it sees
121
121
ai-core activate. Copy `build/plugin/ai-agent-claude.cgp` to the device, install
122
122
via CodeOnTheGo's Plugin Manager, then restart the IDE.
123
123
124
+
## System prompt config
125
+
126
+
The prompt Claude asks ai-core to send lives in `src/main/assets/prompts/`, one YAML
127
+
file per concern, apart from the code that sends it. Changing the tone, adding a
128
+
rule or translating the prompt is an edit to those files alone. ai-core appends its
129
+
own IDE CONTEXT block after the rendered prompt.
130
+
131
+
The files are loaded, validated and cached once, when the plugin is activated.
132
+
`getSystemPrompt` renders `layout.yml` from that cache for each request, since the
133
+
tool list, the protocol and the example path vary per run; it never waits. Until the
134
+
config has loaded, or if it cannot render, it returns null and ai-core sends its own
135
+
default prompt.
136
+
137
+
| File | Keys | What it is |
138
+
|---|---|---|
139
+
|`agent.yml`|`schema_version`, `identity`, `include`| The entry point: the version (`1`; another is refused rather than misread), who the agent is, and the files below. |
140
+
|`scope.yml`|`scope`| What the agent will answer: anything, with the project's tools only when the request is about the open project. |
141
+
|`rules.yml`|`rules`| Priority groups, highest first; each has a `heading` (`CRITICAL`, `IMPORTANT`, `MANDATORY`, `OPTIONAL`) and its `items`. **Adding a rule is adding an item.**|
142
+
|`workflow.yml`|`behavior`, `workflow`| How to go about building or changing something; the workflow's `steps` are numbered when rendered. |
143
+
|`tools.yml`|`tools`, `tool_call_format`| What introduces the tool list, and how to call a tool: `native` under the function-calling API, `text` (with its examples) when calls travel in the reply. Exactly one is sent. |
144
+
|`layout.yml`|`layout.system_prompt`| Where each text goes. |
145
+
146
+
Loading and checking follow ai-core's rules (see ai-core's README): a key belongs to
147
+
one file, only `agent.yml` includes, and a missing, unknown, misspelled or duplicate
148
+
key, an empty list or an unquoted number is refused naming the file and path, e.g.
149
+
`rules.yml: rules[1].items is empty`. Texts are named by their YAML path in upper
150
+
case (`scope.heading` is `SCOPE_HEADING`); each rule group has `HEADING` and `ITEMS`,
151
+
each item and step has `TEXT`, each step has `NUMBER`, and each example has `PURPOSE`
152
+
and `CALL`. The request's values are `TOOLS` (each with `NAME`, `DESCRIPTION`,
153
+
inserted verbatim), `TOOL_CALL_SYNTAX` (null under native calling),
154
+
`NATIVE_TOOL_CALLS`, `EXAMPLE_FILE_PATH` and `EXAMPLE_FILE_STEM`.
155
+
156
+
Rendering is strict: an unknown name throws, naming the text it was in. Activation
157
+
renders the prompt for requests that open and close every section and logs any
158
+
failure, and `ClaudeSystemPromptTest` fails on one in the shipped files. A new key
159
+
needs `ClaudePromptConfig` and its parser; a new name needs `ClaudePromptVariables`.
160
+
161
+
The engine and the YAML plumbing (`PromptTemplateEngine`, `PromptConfigLoader`,
162
+
`PromptConfigStore`, `PromptConfigObject`, ...) are the IDE's, in `plugin-api.jar`'s
163
+
`com.itsaky.androidide.plugins.ai.prompt`, shared with ai-core and the other backends.
164
+
Only `ClaudePromptConfig`, its mapping in `ClaudePromptConfigParser`, and `sharedPromptConfig` are this plugin's own.
165
+
124
166
## Key classes
125
167
126
168
-`plugin/ClaudePlugin.kt` — entry point; registers the backend with ai-core
@@ -134,7 +176,9 @@ via CodeOnTheGo's Plugin Manager, then restart the IDE.
0 commit comments