kyro-ai 3.3.1 → 3.3.2
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/.claude-plugin/plugin.json +1 -1
- package/WORKFLOW.yaml +1 -1
- package/dist/cli/adapters/codex.d.ts.map +1 -1
- package/dist/cli/adapters/codex.js +24 -0
- package/dist/cli/adapters/codex.js.map +1 -1
- package/dist/cli/adapters/command-skills.d.ts +3 -0
- package/dist/cli/adapters/command-skills.d.ts.map +1 -1
- package/dist/cli/adapters/command-skills.js +16 -4
- package/dist/cli/adapters/command-skills.js.map +1 -1
- package/dist/cli/adapters/detection.d.ts +5 -0
- package/dist/cli/adapters/detection.d.ts.map +1 -0
- package/dist/cli/adapters/detection.js +43 -0
- package/dist/cli/adapters/detection.js.map +1 -0
- package/dist/cli/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/adapters/opencode.js +94 -7
- package/dist/cli/adapters/opencode.js.map +1 -1
- package/dist/cli/adapters/registry-types.d.ts +31 -0
- package/dist/cli/adapters/registry-types.d.ts.map +1 -1
- package/dist/cli/adapters/registry.d.ts.map +1 -1
- package/dist/cli/adapters/registry.js +34 -3
- package/dist/cli/adapters/registry.js.map +1 -1
- package/dist/cli/adapters/standard.d.ts.map +1 -1
- package/dist/cli/adapters/standard.js +25 -0
- package/dist/cli/adapters/standard.js.map +1 -1
- package/dist/cli/app.d.ts.map +1 -1
- package/dist/cli/app.js +4 -0
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/commands/detect.d.ts +3 -0
- package/dist/cli/commands/detect.d.ts.map +1 -0
- package/dist/cli/commands/detect.js +39 -0
- package/dist/cli/commands/detect.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +26 -2
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +25 -2
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/preflight.d.ts +11 -0
- package/dist/cli/commands/preflight.d.ts.map +1 -0
- package/dist/cli/commands/preflight.js +50 -0
- package/dist/cli/commands/preflight.js.map +1 -0
- package/dist/cli/commands/tui.d.ts.map +1 -1
- package/dist/cli/commands/tui.js +19 -3
- package/dist/cli/commands/tui.js.map +1 -1
- package/dist/cli/commands/uninstall.d.ts.map +1 -1
- package/dist/cli/commands/uninstall.js +34 -7
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/dist/cli/drift.d.ts +19 -0
- package/dist/cli/drift.d.ts.map +1 -0
- package/dist/cli/drift.js +136 -0
- package/dist/cli/drift.js.map +1 -0
- package/dist/cli/fs.d.ts.map +1 -1
- package/dist/cli/fs.js +6 -70
- package/dist/cli/fs.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +12 -3
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/injectors/json-merge.d.ts +3 -0
- package/dist/cli/injectors/json-merge.d.ts.map +1 -0
- package/dist/cli/injectors/json-merge.js +136 -0
- package/dist/cli/injectors/json-merge.js.map +1 -0
- package/dist/cli/injectors/managed-block.d.ts +7 -0
- package/dist/cli/injectors/managed-block.d.ts.map +1 -0
- package/dist/cli/injectors/managed-block.js +39 -0
- package/dist/cli/injectors/managed-block.js.map +1 -0
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +20 -0
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/pipeline/operation-steps.d.ts +10 -0
- package/dist/cli/pipeline/operation-steps.d.ts.map +1 -0
- package/dist/cli/pipeline/operation-steps.js +141 -0
- package/dist/cli/pipeline/operation-steps.js.map +1 -0
- package/dist/cli/pipeline/orchestrator.d.ts +12 -0
- package/dist/cli/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/cli/pipeline/orchestrator.js +111 -0
- package/dist/cli/pipeline/orchestrator.js.map +1 -0
- package/dist/cli/pipeline/types.d.ts +40 -0
- package/dist/cli/pipeline/types.d.ts.map +1 -0
- package/dist/cli/pipeline/types.js +3 -0
- package/dist/cli/pipeline/types.js.map +1 -0
- package/dist/cli/types.d.ts +6 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/docs/HOW-TO-USE-OPENCODE.md +10 -6
- package/docs/agent-adapters.md +9 -4
- package/docs/cli.md +48 -2
- package/docs/getting-started.md +8 -0
- package/package.json +3 -2
- package/scripts/check-adapter-fixtures.mjs +595 -0
- package/docs/kyro-adapter-architecture-redesign.md +0 -987
|
@@ -1,987 +0,0 @@
|
|
|
1
|
-
# Kyro AI Adapter Architecture Redesign
|
|
2
|
-
|
|
3
|
-
> Technical baseline, target architecture, and implementation roadmap for Kyro AI's multi-agent adapter system.
|
|
4
|
-
|
|
5
|
-
Document status: **working technical source of truth for adapter redesign planning**.
|
|
6
|
-
|
|
7
|
-
Last updated: 2026-06-18.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 1. Purpose
|
|
12
|
-
|
|
13
|
-
Kyro AI is a portable, markdown-first sprint workflow harness for AI coding agents. Its current CLI already installs a managed runtime, projects command skills, validates package/workspace health, audits artifact integrity, repairs JSON summaries from Markdown evidence, and manages Kyro scopes.
|
|
14
|
-
|
|
15
|
-
The adapter layer is the weak point. Today it can project a small command-skill surface for Standard, OpenCode, and Codex, but it does not yet model agent detection, native config paths, capabilities, MCP configuration, rollback, or platform-aware installation.
|
|
16
|
-
|
|
17
|
-
This document defines the technical baseline and target architecture we will use to create implementation plans.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 2. Source Analysis Status
|
|
22
|
-
|
|
23
|
-
### Verified Against Kyro Source
|
|
24
|
-
|
|
25
|
-
The Kyro analysis in this document is verified against the local source tree:
|
|
26
|
-
|
|
27
|
-
- `src/cli/app.ts`
|
|
28
|
-
- `src/cli/options.ts`
|
|
29
|
-
- `src/cli/types.ts`
|
|
30
|
-
- `src/cli/fs.ts`
|
|
31
|
-
- `src/cli/install-plan.ts`
|
|
32
|
-
- `src/cli/state.ts`
|
|
33
|
-
- `src/cli/adapters/*`
|
|
34
|
-
- `src/cli/commands/*`
|
|
35
|
-
- `src/cli/artifacts/*`
|
|
36
|
-
- `README.md`
|
|
37
|
-
- `docs/agent-adapters.md`
|
|
38
|
-
- `docs/cli.md`
|
|
39
|
-
- `package.json`
|
|
40
|
-
|
|
41
|
-
`npm run build` passes as of this analysis.
|
|
42
|
-
|
|
43
|
-
### Verified Against Gentle AI Source
|
|
44
|
-
|
|
45
|
-
Gentle AI was verified locally at:
|
|
46
|
-
|
|
47
|
-
```text
|
|
48
|
-
/home/joisephdev/rjperaza/externals/ai-projects/gentle-ai
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The Gentle AI analysis in this document is verified against:
|
|
52
|
-
|
|
53
|
-
- `internal/agents/interface.go`
|
|
54
|
-
- `internal/agents/factory.go`
|
|
55
|
-
- `internal/agents/registry.go`
|
|
56
|
-
- `internal/agents/discovery.go`
|
|
57
|
-
- `internal/model/types.go`
|
|
58
|
-
- `internal/pipeline/*`
|
|
59
|
-
- `internal/state/state.go`
|
|
60
|
-
- `internal/system/detect.go`
|
|
61
|
-
- `internal/installcmd/resolver.go`
|
|
62
|
-
- `internal/backup/*`
|
|
63
|
-
- `internal/agents/claude/adapter.go`
|
|
64
|
-
- `internal/agents/opencode/adapter.go`
|
|
65
|
-
- `internal/agents/codex/adapter.go`
|
|
66
|
-
|
|
67
|
-
Gentle AI currently has 16 adapter implementations under `internal/agents/*/adapter.go`.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 3. Current Kyro Architecture
|
|
72
|
-
|
|
73
|
-
### Product Shape
|
|
74
|
-
|
|
75
|
-
Kyro currently ships as an npm package with two bins:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
kyro
|
|
79
|
-
kyro-ai
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Core CLI commands:
|
|
83
|
-
|
|
84
|
-
| Command | Current behavior |
|
|
85
|
-
|---------|------------------|
|
|
86
|
-
| `kyro` / `kyro tui` | Basic interactive installer menu |
|
|
87
|
-
| `kyro install` | Installs managed runtime and selected adapter projections |
|
|
88
|
-
| `kyro sync` | Refreshes installed adapters from project state, or explicit `--agent` |
|
|
89
|
-
| `kyro doctor` | Validates package versions, assets, project state, runtime, adapters |
|
|
90
|
-
| `kyro doctor --tokens` | Runs progressive-disclosure token budget checks |
|
|
91
|
-
| `kyro doctor --artifacts` | Validates scope state, indexes, summaries, markdown references |
|
|
92
|
-
| `kyro repair` | Rebuilds JSON scope summaries from Markdown evidence |
|
|
93
|
-
| `kyro scope list` | Lists known Kyro scopes |
|
|
94
|
-
| `kyro scope inspect <scope>` | Shows scope state and artifact checks |
|
|
95
|
-
| `kyro scope set-active <scope>` | Updates active scope in project state |
|
|
96
|
-
| `kyro uninstall` | Removes managed adapter blocks and clears installed adapters |
|
|
97
|
-
|
|
98
|
-
### Runtime Layout
|
|
99
|
-
|
|
100
|
-
Global runtime:
|
|
101
|
-
|
|
102
|
-
```text
|
|
103
|
-
~/.agents/
|
|
104
|
-
├── kyro/
|
|
105
|
-
│ ├── versions/{version}/
|
|
106
|
-
│ │ ├── core/
|
|
107
|
-
│ │ │ ├── agents/
|
|
108
|
-
│ │ │ ├── config.json
|
|
109
|
-
│ │ │ └── WORKFLOW.yaml
|
|
110
|
-
│ │ ├── commands/
|
|
111
|
-
│ │ ├── skills/
|
|
112
|
-
│ │ ├── KYRO.md
|
|
113
|
-
│ │ └── manifest.json
|
|
114
|
-
│ └── current -> versions/{version}
|
|
115
|
-
└── skills/
|
|
116
|
-
├── kyro-forge/SKILL.md
|
|
117
|
-
├── kyro-status/SKILL.md
|
|
118
|
-
└── kyro-wrap-up/SKILL.md
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Project state and artifacts:
|
|
122
|
-
|
|
123
|
-
```text
|
|
124
|
-
<workspace>/
|
|
125
|
-
└── .agents/
|
|
126
|
-
└── kyro/
|
|
127
|
-
├── kyro.json
|
|
128
|
-
└── scopes/{scope}/
|
|
129
|
-
├── state.json
|
|
130
|
-
├── index.json
|
|
131
|
-
├── ROADMAP.md
|
|
132
|
-
├── ROADMAP.summary.json
|
|
133
|
-
├── DEBT.summary.json
|
|
134
|
-
└── phases/
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Current State Model
|
|
138
|
-
|
|
139
|
-
`KyroProjectState`:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
interface KyroProjectState {
|
|
143
|
-
schemaVersion: 1;
|
|
144
|
-
artifactRoot: string;
|
|
145
|
-
scopes: string[];
|
|
146
|
-
activeScope: string | null;
|
|
147
|
-
runtimeVersion: string;
|
|
148
|
-
runtimePath: string;
|
|
149
|
-
installedAdapters: KyroInstalledAdapter[];
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
`KyroManifest`:
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
interface KyroManifest {
|
|
157
|
-
schemaVersion: 1;
|
|
158
|
-
packageName: string;
|
|
159
|
-
packageVersion: string;
|
|
160
|
-
installedAt: string;
|
|
161
|
-
installScope: InstallScope;
|
|
162
|
-
managedFiles: string[];
|
|
163
|
-
managedBlocks: string[];
|
|
164
|
-
adapters: KyroInstalledAdapter[];
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Important correction: `mergeProjectState()` does **not** fully clobber installed adapters. It preserves existing adapters by agent and replaces only adapters explicitly passed to the install/sync plan.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## 4. Current Adapter System
|
|
173
|
-
|
|
174
|
-
### Current Agents
|
|
175
|
-
|
|
176
|
-
| Agent | Current status | Current behavior |
|
|
177
|
-
|-------|----------------|------------------|
|
|
178
|
-
| `standard` | Implemented | Writes global Kyro command skills under `~/.agents/skills/kyro-*` |
|
|
179
|
-
| `opencode` | Implemented | Same projection as `standard`; no OpenCode-native config |
|
|
180
|
-
| `codex` | Implemented | Same command skills plus managed Kyro block in workspace `AGENTS.md` |
|
|
181
|
-
| `claude` | Planned | Stub adapter; CLI install is blocked, plugin packaging remains first-class |
|
|
182
|
-
| `cursor` | Planned | Stub adapter; CLI install is blocked |
|
|
183
|
-
|
|
184
|
-
Current implementation count: **3 implemented, 2 planned**.
|
|
185
|
-
|
|
186
|
-
### Current Adapter Contract
|
|
187
|
-
|
|
188
|
-
```typescript
|
|
189
|
-
interface AdapterDefinition {
|
|
190
|
-
agent: Agent;
|
|
191
|
-
displayName: string;
|
|
192
|
-
status: 'implemented' | 'planned';
|
|
193
|
-
buildProjection(plan: OperationPlan[]): void;
|
|
194
|
-
buildManagedFiles(): string[];
|
|
195
|
-
buildManagedBlocks(): string[];
|
|
196
|
-
buildInstalledAdapter(scope: InstallScope, installedAt: string): KyroInstalledAdapter;
|
|
197
|
-
doctor(manifest: KyroManifest | null): CheckResult;
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Current Operation Plan
|
|
202
|
-
|
|
203
|
-
```typescript
|
|
204
|
-
interface OperationPlan {
|
|
205
|
-
action: 'write' | 'copy' | 'mkdir' | 'remove' | 'upsert-block' | 'remove-block' | 'symlink';
|
|
206
|
-
path: string;
|
|
207
|
-
source?: string;
|
|
208
|
-
content?: string;
|
|
209
|
-
blockName?: string;
|
|
210
|
-
}
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
`applyPlan()` executes operations sequentially with no prepare/apply stages, no backup, no rollback, and no progress callback.
|
|
214
|
-
|
|
215
|
-
### Current Managed Block Format
|
|
216
|
-
|
|
217
|
-
Kyro's implemented markers are:
|
|
218
|
-
|
|
219
|
-
```text
|
|
220
|
-
<!-- kyro-ai:{blockName}:start -->
|
|
221
|
-
...
|
|
222
|
-
<!-- kyro-ai:{blockName}:end -->
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
The redesign must preserve this marker namespace unless a migration is explicitly planned.
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## 5. Strengths To Preserve
|
|
230
|
-
|
|
231
|
-
These are architectural assets, not accidental details:
|
|
232
|
-
|
|
233
|
-
| Strength | Why it matters |
|
|
234
|
-
|----------|----------------|
|
|
235
|
-
| Markdown-first evidence | Humans and agents can inspect durable workflow state without custom tooling |
|
|
236
|
-
| Progressive disclosure | Agents load command routers, modes, helpers, and templates only as needed |
|
|
237
|
-
| Global runtime plus project state | Runtime can be versioned globally while workspace artifacts remain local |
|
|
238
|
-
| Command-skill projection | Agents get short entrypoints instead of large copied prompts |
|
|
239
|
-
| Managed blocks | Workspace instruction files can be updated idempotently without deleting user content |
|
|
240
|
-
| Token budget audits | Prevents workflow assets from growing beyond practical agent context budgets |
|
|
241
|
-
| Artifact doctor and repair | JSON routing state can be validated and rebuilt from Markdown evidence |
|
|
242
|
-
| Scope lifecycle commands | Operators can inspect and switch active work scopes deterministically |
|
|
243
|
-
| Claude plugin packaging | Claude remains first-class even before a CLI-native Claude adapter exists |
|
|
244
|
-
|
|
245
|
-
The redesign must not weaken these properties.
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## 6. What Is Missing
|
|
250
|
-
|
|
251
|
-
### Adapter Architecture Gaps
|
|
252
|
-
|
|
253
|
-
| Gap | Current state | Required target |
|
|
254
|
-
|-----|---------------|-----------------|
|
|
255
|
-
| Capability discovery | Only `status: implemented/planned` | Query capabilities like `skills`, `system-prompt`, `mcp`, `commands`, `sub-agents` |
|
|
256
|
-
| Agent detection | User must pass `--agent`, default is `standard` | Filesystem detection by adapter config roots |
|
|
257
|
-
| Native config paths | Not modeled | Each adapter owns config dirs, prompt paths, skills paths, MCP paths |
|
|
258
|
-
| Injection strategy | Hardcoded in `buildProjection()` | Reusable injectors selected by strategy |
|
|
259
|
-
| OpenCode support | Same as Standard | OpenCode-native config support |
|
|
260
|
-
| Codex support | Workspace `AGENTS.md` only | Decide whether to keep workspace block, add `~/.codex`, or support both by scope |
|
|
261
|
-
| Claude CLI adapter | Stub only | CLI-native adapter that complements `.claude-plugin/` |
|
|
262
|
-
| Cursor adapter | Stub only | Cursor-native rules/config adapter |
|
|
263
|
-
| MCP | Not modeled | Strategy-based MCP config writers |
|
|
264
|
-
| Platform install | Not modeled | Optional install command resolution per adapter |
|
|
265
|
-
| Rollback | None | Backup and restore for modified files |
|
|
266
|
-
| Progress reporting | None | Step-level events for CLI/TUI |
|
|
267
|
-
| Adapter tests | None found | Table-driven tests for contract, paths, projections, doctor |
|
|
268
|
-
|
|
269
|
-
### Operational Gaps
|
|
270
|
-
|
|
271
|
-
| Gap | Impact |
|
|
272
|
-
|-----|--------|
|
|
273
|
-
| No backup before writing global or workspace config | Failed installs can leave partial state |
|
|
274
|
-
| State writes happen inside same flat plan as file writes | Manifest/project state can be written before later failures |
|
|
275
|
-
| `uninstall` preserves global runtime and command skills | Intentional today, but future uninstall modes must be explicit |
|
|
276
|
-
| `--scope global` is parsed but rejected | Global install semantics need a design before enabling |
|
|
277
|
-
| `doctor` has no adapter inventory mode | Hard to plan or verify adapter migration progress |
|
|
278
|
-
| No integration fixtures for install plans | Refactors can accidentally change installed outputs |
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## 7. Verified Gentle AI Architecture
|
|
283
|
-
|
|
284
|
-
Gentle AI's adapter system is a mature reference implementation. Kyro should borrow the architectural patterns, not the product model.
|
|
285
|
-
|
|
286
|
-
### Adapter Contract
|
|
287
|
-
|
|
288
|
-
Gentle AI's `agents.Adapter` contains these groups:
|
|
289
|
-
|
|
290
|
-
| Group | Methods |
|
|
291
|
-
|-------|---------|
|
|
292
|
-
| Identity | `Agent()`, `Tier()` |
|
|
293
|
-
| Detection | `Detect(ctx, homeDir)` |
|
|
294
|
-
| Installation | `SupportsAutoInstall()`, `InstallCommand(profile)` |
|
|
295
|
-
| Config paths | `GlobalConfigDir`, `SystemPromptDir`, `SystemPromptFile`, `SkillsDir`, `SettingsPath`, `MCPConfigPath` |
|
|
296
|
-
| Strategies | `SystemPromptStrategy()`, `MCPStrategy()` |
|
|
297
|
-
| Optional capabilities | output styles, slash commands, sub-agents, skills, system prompt, MCP |
|
|
298
|
-
|
|
299
|
-
This is the core design rule Kyro should copy: components call adapter methods instead of hardcoding agent-specific behavior in install/sync/doctor.
|
|
300
|
-
|
|
301
|
-
### Supported Agents
|
|
302
|
-
|
|
303
|
-
Gentle AI registers 16 adapters:
|
|
304
|
-
|
|
305
|
-
```text
|
|
306
|
-
claude-code, opencode, kilocode, gemini-cli, cursor, vscode-copilot,
|
|
307
|
-
codex, antigravity, windsurf, kimi, qwen-code, kiro-ide, openclaw,
|
|
308
|
-
pi, trae-ide, hermes
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
`NewDefaultRegistry()` creates all 16. `NewMVPRegistry()` keeps backward-compatible Claude Code + OpenCode support.
|
|
312
|
-
|
|
313
|
-
### Strategies
|
|
314
|
-
|
|
315
|
-
Gentle AI's `SystemPromptStrategy` values:
|
|
316
|
-
|
|
317
|
-
| Strategy | Purpose |
|
|
318
|
-
|----------|---------|
|
|
319
|
-
| `StrategyMarkdownSections` | Managed marker sections inside an existing file |
|
|
320
|
-
| `StrategyFileReplace` | Own/replace entire prompt file |
|
|
321
|
-
| `StrategyAppendToFile` | Append to existing file |
|
|
322
|
-
| `StrategyInstructionsFile` | Dedicated instruction file |
|
|
323
|
-
| `StrategyJinjaModules` | Kimi-style module files included by a template |
|
|
324
|
-
| `StrategySteeringFile` | Kiro steering file with always-included frontmatter |
|
|
325
|
-
|
|
326
|
-
Gentle AI's `MCPStrategy` values:
|
|
327
|
-
|
|
328
|
-
| Strategy | Purpose |
|
|
329
|
-
|----------|---------|
|
|
330
|
-
| `StrategySeparateMCPFiles` | One JSON file per MCP server |
|
|
331
|
-
| `StrategyMergeIntoSettings` | Merge MCP servers into settings JSON |
|
|
332
|
-
| `StrategyMCPConfigFile` | Dedicated `mcp.json` |
|
|
333
|
-
| `StrategyTOMLFile` | TOML config, used by Codex |
|
|
334
|
-
| `StrategyMergeIntoYAML` | YAML merge, used by Hermes |
|
|
335
|
-
|
|
336
|
-
### Discovery and Backup Roots
|
|
337
|
-
|
|
338
|
-
`DiscoverInstalled(reg, homeDir)` performs a pure filesystem check over `adapter.GlobalConfigDir(homeDir)`.
|
|
339
|
-
|
|
340
|
-
`ConfigRootsForBackup(reg, homeDir)` deduplicates discovered config roots. This is directly useful for Kyro's future rollback work: backup target selection should come from adapter paths, not from duplicated install code.
|
|
341
|
-
|
|
342
|
-
### Pipeline
|
|
343
|
-
|
|
344
|
-
Gentle AI's pipeline has:
|
|
345
|
-
|
|
346
|
-
- `StagePrepare`
|
|
347
|
-
- `StageApply`
|
|
348
|
-
- `StageRollback`
|
|
349
|
-
- `Runner`
|
|
350
|
-
- `RollbackPolicy`
|
|
351
|
-
- `ProgressFunc`
|
|
352
|
-
- `StepResult` timestamps and status
|
|
353
|
-
- reverse-order rollback of succeeded apply steps implementing `RollbackStep`
|
|
354
|
-
|
|
355
|
-
Kyro should copy this shape closely, translated to TypeScript.
|
|
356
|
-
|
|
357
|
-
### State
|
|
358
|
-
|
|
359
|
-
Gentle AI persists global state at `~/.gentle-ai/state.json`. Its state preserves:
|
|
360
|
-
|
|
361
|
-
- installed agents
|
|
362
|
-
- model assignments
|
|
363
|
-
- persona
|
|
364
|
-
- update check timestamp
|
|
365
|
-
- pending sync
|
|
366
|
-
|
|
367
|
-
`MergeAgents()` deduplicates incremental installs while preserving all other fields. Kyro's project state already preserves adapters similarly, but Kyro still lacks global state for detected agents, pending sync, or persisted global preferences.
|
|
368
|
-
|
|
369
|
-
### Platform and Install Commands
|
|
370
|
-
|
|
371
|
-
Gentle AI's `PlatformProfile` includes:
|
|
372
|
-
|
|
373
|
-
- OS
|
|
374
|
-
- Linux distro
|
|
375
|
-
- package manager
|
|
376
|
-
- npm writability
|
|
377
|
-
- Go availability
|
|
378
|
-
- supported flag
|
|
379
|
-
|
|
380
|
-
`installcmd.Resolver` centralizes install command resolution for several agents/components. It also performs preflight validation for npm-based agents. Kyro should use a similar resolver module instead of putting platform command logic inside every adapter.
|
|
381
|
-
|
|
382
|
-
### Concrete Adapter Examples
|
|
383
|
-
|
|
384
|
-
| Agent | Gentle AI paths/strategies |
|
|
385
|
-
|-------|----------------------------|
|
|
386
|
-
| Claude Code | `~/.claude`, `CLAUDE.md`, skills, commands, agents, output styles, `StrategyMarkdownSections`, `StrategySeparateMCPFiles` |
|
|
387
|
-
| OpenCode | `~/.config/opencode`, `AGENTS.md`, `opencode.json`, commands, skills, `StrategyFileReplace`, `StrategyMergeIntoSettings` |
|
|
388
|
-
| Codex | `~/.codex`, `AGENTS.md`, `config.toml`, skills, `StrategyFileReplace`, `StrategyTOMLFile` |
|
|
389
|
-
|
|
390
|
-
### Patterns To Adopt
|
|
391
|
-
|
|
392
|
-
The useful patterns are:
|
|
393
|
-
|
|
394
|
-
1. **Adapters encapsulate agent-specific knowledge**
|
|
395
|
-
- Identity
|
|
396
|
-
- Detection
|
|
397
|
-
- Config paths
|
|
398
|
-
- Injection strategies
|
|
399
|
-
- Capabilities
|
|
400
|
-
- Optional install commands
|
|
401
|
-
|
|
402
|
-
2. **Components query adapters rather than switching on agent ID**
|
|
403
|
-
- This reduces core changes when adding new agents.
|
|
404
|
-
|
|
405
|
-
3. **Strategies separate "where" from "how"**
|
|
406
|
-
- Adapter returns paths and strategy identifiers.
|
|
407
|
-
- Injectors implement marker upsert, file replace, append, JSON merge, TOML merge, etc.
|
|
408
|
-
|
|
409
|
-
4. **Install execution is staged**
|
|
410
|
-
- Prepare validates and backs up.
|
|
411
|
-
- Apply writes changes.
|
|
412
|
-
- Rollback restores on failure when needed.
|
|
413
|
-
|
|
414
|
-
5. **Discovery is filesystem-driven**
|
|
415
|
-
- Registry can detect installed agents by checking known config roots.
|
|
416
|
-
|
|
417
|
-
6. **State is persistent and mergeable**
|
|
418
|
-
- Incremental adapter installs should preserve previous selections and user choices.
|
|
419
|
-
|
|
420
|
-
### What Kyro Should Not Copy Blindly
|
|
421
|
-
|
|
422
|
-
- Do not replace Kyro's markdown-first workflow model.
|
|
423
|
-
- Do not remove project-local artifacts.
|
|
424
|
-
- Do not make auto-install a prerequisite for adapter support.
|
|
425
|
-
- Do not write into native agent home directories before backup/rollback exists.
|
|
426
|
-
- Do not move Kyro state to `~/.gentle-ai`; Kyro should keep its own `~/.agents/kyro` runtime convention unless we intentionally introduce a separate namespace.
|
|
427
|
-
- Do not copy all 16 agents as an immediate goal; Kyro should first stabilize Standard, OpenCode, Codex, Claude, and Cursor.
|
|
428
|
-
|
|
429
|
-
---
|
|
430
|
-
|
|
431
|
-
## 8. Target Adapter Architecture
|
|
432
|
-
|
|
433
|
-
### Design Principles
|
|
434
|
-
|
|
435
|
-
1. **Backward-compatible first**
|
|
436
|
-
- Existing `standard`, `opencode`, and `codex` install output must remain stable until a migration phase explicitly changes it.
|
|
437
|
-
|
|
438
|
-
2. **Adapters own agent knowledge**
|
|
439
|
-
- Core install/sync code must not need `if agent === 'codex'` logic for paths or strategies.
|
|
440
|
-
|
|
441
|
-
3. **Capabilities drive behavior**
|
|
442
|
-
- A component asks whether an adapter supports a feature before acting.
|
|
443
|
-
|
|
444
|
-
4. **Strategies perform writes**
|
|
445
|
-
- Adapters select strategies; injectors implement them.
|
|
446
|
-
|
|
447
|
-
5. **Plan before apply**
|
|
448
|
-
- Build a structured plan, print/dry-run it, then execute with rollback once global/native config writes are introduced.
|
|
449
|
-
|
|
450
|
-
6. **Native config writes require rollback**
|
|
451
|
-
- Any writes to `~/.codex`, `~/.claude`, `~/.config/opencode`, `~/.cursor`, etc. must be protected by backup.
|
|
452
|
-
|
|
453
|
-
### Target Types
|
|
454
|
-
|
|
455
|
-
```typescript
|
|
456
|
-
export type AdapterCapability =
|
|
457
|
-
| 'command-skills'
|
|
458
|
-
| 'system-prompt'
|
|
459
|
-
| 'mcp'
|
|
460
|
-
| 'slash-commands'
|
|
461
|
-
| 'sub-agents'
|
|
462
|
-
| 'output-styles'
|
|
463
|
-
| 'filesystem-detect'
|
|
464
|
-
| 'auto-install';
|
|
465
|
-
|
|
466
|
-
export type SystemPromptStrategy =
|
|
467
|
-
| 'managed-block'
|
|
468
|
-
| 'file-replace'
|
|
469
|
-
| 'append'
|
|
470
|
-
| 'instructions-file'
|
|
471
|
-
| 'none';
|
|
472
|
-
|
|
473
|
-
export type MCPStrategy =
|
|
474
|
-
| 'separate-files'
|
|
475
|
-
| 'merge-json-settings'
|
|
476
|
-
| 'mcp-json-file'
|
|
477
|
-
| 'toml-file'
|
|
478
|
-
| 'yaml-merge'
|
|
479
|
-
| 'none';
|
|
480
|
-
|
|
481
|
-
export interface DetectionContext {
|
|
482
|
-
homeDir: string;
|
|
483
|
-
envPath: string | undefined;
|
|
484
|
-
platform?: PlatformProfile;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
export interface DetectionResult {
|
|
488
|
-
agent: Agent;
|
|
489
|
-
installed: boolean;
|
|
490
|
-
binaryPath: string | null;
|
|
491
|
-
configFound: boolean;
|
|
492
|
-
configPath: string | null;
|
|
493
|
-
detail: string;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
export interface AdapterPaths {
|
|
497
|
-
globalConfigDir?: string;
|
|
498
|
-
systemPromptPath?: string;
|
|
499
|
-
skillsDir?: string;
|
|
500
|
-
commandsDir?: string;
|
|
501
|
-
settingsPath?: string;
|
|
502
|
-
mcpConfigPath?: string;
|
|
503
|
-
subAgentsDir?: string;
|
|
504
|
-
outputStylesDir?: string;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
export interface PlatformProfile {
|
|
508
|
-
os: 'darwin' | 'linux' | 'windows' | string;
|
|
509
|
-
linuxDistro?: 'ubuntu' | 'debian' | 'arch' | 'fedora' | 'unknown' | string;
|
|
510
|
-
packageManager?: 'brew' | 'apt' | 'pacman' | 'dnf' | 'winget' | 'npm' | string;
|
|
511
|
-
npmWritable: boolean;
|
|
512
|
-
supported: boolean;
|
|
513
|
-
}
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
### Target Adapter Interface
|
|
517
|
-
|
|
518
|
-
```typescript
|
|
519
|
-
export interface Adapter {
|
|
520
|
-
readonly agent: Agent;
|
|
521
|
-
readonly displayName: string;
|
|
522
|
-
readonly status: 'implemented' | 'planned' | 'experimental';
|
|
523
|
-
|
|
524
|
-
capabilities(): ReadonlySet<AdapterCapability>;
|
|
525
|
-
supports(capability: AdapterCapability): boolean;
|
|
526
|
-
|
|
527
|
-
paths(homeDir: string): AdapterPaths;
|
|
528
|
-
detect(context: DetectionContext): DetectionResult;
|
|
529
|
-
|
|
530
|
-
systemPromptStrategy(): SystemPromptStrategy;
|
|
531
|
-
mcpStrategy(): MCPStrategy;
|
|
532
|
-
|
|
533
|
-
buildInstallPlan(context: AdapterPlanContext): OperationPlan[];
|
|
534
|
-
buildUninstallPlan(context: AdapterPlanContext): OperationPlan[];
|
|
535
|
-
buildInstalledAdapter(scope: InstallScope, installedAt: string): KyroInstalledAdapter;
|
|
536
|
-
|
|
537
|
-
doctor(context: AdapterDoctorContext): CheckResult;
|
|
538
|
-
}
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
Compatibility note: this interface should be introduced alongside the current `AdapterDefinition`, then migrated adapter by adapter. Do not remove the current contract until baseline tests prove output parity.
|
|
542
|
-
|
|
543
|
-
Implementation note: Gentle AI uses many explicit `SupportsX()` methods. Kyro can use a `capabilities()` set for compactness, but implementation plans should evaluate whether explicit methods are clearer for TypeScript call sites.
|
|
544
|
-
|
|
545
|
-
### Registry
|
|
546
|
-
|
|
547
|
-
```typescript
|
|
548
|
-
export class AdapterRegistry {
|
|
549
|
-
register(adapter: Adapter): void;
|
|
550
|
-
get(agent: Agent): Adapter;
|
|
551
|
-
getAll(): Adapter[];
|
|
552
|
-
getInstallable(): Adapter[];
|
|
553
|
-
discoverInstalled(context: DetectionContext): DetectionResult[];
|
|
554
|
-
configRootsForBackup(context: DetectionContext): string[];
|
|
555
|
-
}
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
Registry requirements:
|
|
559
|
-
|
|
560
|
-
- Reject duplicate agents.
|
|
561
|
-
- Preserve stable ordering for deterministic plans.
|
|
562
|
-
- Include planned adapters in inventory.
|
|
563
|
-
- Return only implemented/experimental adapters from `getInstallable()`.
|
|
564
|
-
- Deduplicate backup roots from discovered adapter config directories.
|
|
565
|
-
|
|
566
|
-
---
|
|
567
|
-
|
|
568
|
-
## 9. Target Injection Strategies
|
|
569
|
-
|
|
570
|
-
### System Prompt Injectors
|
|
571
|
-
|
|
572
|
-
| Strategy | Behavior |
|
|
573
|
-
|----------|----------|
|
|
574
|
-
| `managed-block` | Upsert/remove `<!-- kyro-ai:{id}:start -->` blocks while preserving user content |
|
|
575
|
-
| `file-replace` | Own the whole target file; only use when Kyro is meant to control it |
|
|
576
|
-
| `append` | Append a marked section if absent; update if present |
|
|
577
|
-
| `instructions-file` | Write a dedicated instruction/rules file |
|
|
578
|
-
| `none` | Adapter does not manage system prompt |
|
|
579
|
-
|
|
580
|
-
`managed-block` must use the current `kyro-ai` marker namespace.
|
|
581
|
-
|
|
582
|
-
### MCP Injectors
|
|
583
|
-
|
|
584
|
-
| Strategy | Behavior |
|
|
585
|
-
|----------|----------|
|
|
586
|
-
| `separate-files` | One JSON file per MCP server |
|
|
587
|
-
| `merge-json-settings` | Merge into a JSON settings file without deleting unrelated keys |
|
|
588
|
-
| `mcp-json-file` | Manage one dedicated MCP JSON file |
|
|
589
|
-
| `toml-file` | Merge into TOML config |
|
|
590
|
-
| `yaml-merge` | Merge into YAML while preserving unrelated user config |
|
|
591
|
-
| `none` | Adapter does not manage MCP |
|
|
592
|
-
|
|
593
|
-
MCP should not be implemented before tests exist for JSON/TOML preservation behavior.
|
|
594
|
-
|
|
595
|
-
YAML merge is not needed for Kyro's near-term target agents, but keeping it in the enum avoids a later contract break if Hermes-like agents are added.
|
|
596
|
-
|
|
597
|
-
---
|
|
598
|
-
|
|
599
|
-
## 10. Target Pipeline
|
|
600
|
-
|
|
601
|
-
### Current Problem
|
|
602
|
-
|
|
603
|
-
`applyPlan()` writes sequentially. A failure midway can leave:
|
|
604
|
-
|
|
605
|
-
- project state updated but runtime incomplete
|
|
606
|
-
- symlink changed but files missing
|
|
607
|
-
- managed block written but manifest not matching
|
|
608
|
-
- future native config files partially modified
|
|
609
|
-
|
|
610
|
-
### Target Execution Model
|
|
611
|
-
|
|
612
|
-
```typescript
|
|
613
|
-
export type Stage = 'prepare' | 'apply' | 'rollback';
|
|
614
|
-
export type StepStatus = 'pending' | 'running' | 'succeeded' | 'failed';
|
|
615
|
-
|
|
616
|
-
export interface Step {
|
|
617
|
-
readonly id: string;
|
|
618
|
-
readonly description: string;
|
|
619
|
-
run(): Promise<void>;
|
|
620
|
-
rollback?(): Promise<void>;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
export interface StagePlan {
|
|
624
|
-
prepare: Step[];
|
|
625
|
-
apply: Step[];
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
export interface ProgressEvent {
|
|
629
|
-
stage: Stage;
|
|
630
|
-
stepId: string;
|
|
631
|
-
status: StepStatus;
|
|
632
|
-
error?: Error;
|
|
633
|
-
}
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
Pipeline requirements:
|
|
637
|
-
|
|
638
|
-
- Validate duplicate step IDs before execution.
|
|
639
|
-
- Run all prepare steps before any apply step.
|
|
640
|
-
- Backup every existing file that may be modified.
|
|
641
|
-
- Roll back apply steps in reverse order when configured.
|
|
642
|
-
- Emit progress events for CLI/TUI.
|
|
643
|
-
- Return structured results rather than throwing unstructured partial failures.
|
|
644
|
-
|
|
645
|
-
Initial migration can keep `OperationPlan` as the planning data model and convert operations into pipeline steps.
|
|
646
|
-
|
|
647
|
-
---
|
|
648
|
-
|
|
649
|
-
## 11. Target State Model
|
|
650
|
-
|
|
651
|
-
### Keep Project State
|
|
652
|
-
|
|
653
|
-
`KyroProjectState` remains the workspace source of truth for:
|
|
654
|
-
|
|
655
|
-
- runtime version/path
|
|
656
|
-
- installed adapters for that workspace
|
|
657
|
-
- known scopes
|
|
658
|
-
- active scope
|
|
659
|
-
|
|
660
|
-
Add only when needed:
|
|
661
|
-
|
|
662
|
-
```typescript
|
|
663
|
-
lastAdapterSyncAt?: string;
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
### Add Global State Later
|
|
667
|
-
|
|
668
|
-
Global state should not be introduced until adapter detection and native config writes exist.
|
|
669
|
-
|
|
670
|
-
Target:
|
|
671
|
-
|
|
672
|
-
```typescript
|
|
673
|
-
interface KyroGlobalState {
|
|
674
|
-
schemaVersion: 1;
|
|
675
|
-
detectedAgents: Agent[];
|
|
676
|
-
lastDetectAt?: string;
|
|
677
|
-
lastSyncAt?: string;
|
|
678
|
-
pendingSync?: boolean;
|
|
679
|
-
modelAssignments?: Record<string, unknown>;
|
|
680
|
-
}
|
|
681
|
-
```
|
|
682
|
-
|
|
683
|
-
Global state location:
|
|
684
|
-
|
|
685
|
-
```text
|
|
686
|
-
~/.agents/kyro/state.json
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
Rationale: Kyro already uses `~/.agents/kyro` as its global runtime root, so this avoids introducing a second `~/.kyro` home namespace unless there is a strong reason.
|
|
690
|
-
|
|
691
|
-
### Add Install Command Resolver Later
|
|
692
|
-
|
|
693
|
-
Do not spread platform-specific install command logic across adapters. When Kyro adds optional auto-install, add a resolver equivalent to Gentle AI's `installcmd.Resolver`:
|
|
694
|
-
|
|
695
|
-
```typescript
|
|
696
|
-
interface InstallCommandResolver {
|
|
697
|
-
resolveAgentInstall(profile: PlatformProfile, agent: Agent): string[][];
|
|
698
|
-
}
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
Adapters should declare support and identity; the resolver should own package-manager command selection and preflight validation.
|
|
702
|
-
|
|
703
|
-
---
|
|
704
|
-
|
|
705
|
-
## 12. Adapter-Specific Target Decisions
|
|
706
|
-
|
|
707
|
-
### Standard
|
|
708
|
-
|
|
709
|
-
Purpose: compatibility adapter for agents that can discover `~/.agents/skills`.
|
|
710
|
-
|
|
711
|
-
Target:
|
|
712
|
-
|
|
713
|
-
- Keep command-skill projection.
|
|
714
|
-
- No binary detection required.
|
|
715
|
-
- No native system prompt.
|
|
716
|
-
- No MCP.
|
|
717
|
-
- Not auto-installable.
|
|
718
|
-
|
|
719
|
-
### OpenCode
|
|
720
|
-
|
|
721
|
-
Current: identical to Standard.
|
|
722
|
-
|
|
723
|
-
Target:
|
|
724
|
-
|
|
725
|
-
- Preserve existing command-skill projection for backward compatibility.
|
|
726
|
-
- Add detection for `~/.config/opencode`.
|
|
727
|
-
- Add native config support only after backup/rollback exists.
|
|
728
|
-
- Model OpenCode paths separately from Standard.
|
|
729
|
-
|
|
730
|
-
Open decision:
|
|
731
|
-
|
|
732
|
-
- Whether OpenCode should consume Kyro through `~/.agents/skills`, OpenCode-native commands, `AGENTS.md`, or a combination.
|
|
733
|
-
|
|
734
|
-
### Codex
|
|
735
|
-
|
|
736
|
-
Current: command skills plus workspace `AGENTS.md` managed block.
|
|
737
|
-
|
|
738
|
-
Target:
|
|
739
|
-
|
|
740
|
-
- Preserve workspace `AGENTS.md` behavior initially.
|
|
741
|
-
- Add detection for `~/.codex`.
|
|
742
|
-
- Add optional Codex-native config only in a later migration.
|
|
743
|
-
|
|
744
|
-
Open decision:
|
|
745
|
-
|
|
746
|
-
- Should Codex-native support write `~/.codex/AGENTS.md`, `~/.codex/config.toml`, or only workspace `AGENTS.md`?
|
|
747
|
-
- If both are supported, scope semantics must be explicit:
|
|
748
|
-
- `workspace`: workspace `AGENTS.md`
|
|
749
|
-
- future `global`: `~/.codex/*`
|
|
750
|
-
|
|
751
|
-
### Claude
|
|
752
|
-
|
|
753
|
-
Current: planned CLI adapter, first-class `.claude-plugin/` packaging.
|
|
754
|
-
|
|
755
|
-
Target:
|
|
756
|
-
|
|
757
|
-
- Do not treat plugin support as legacy.
|
|
758
|
-
- CLI adapter should complement the plugin, not replace it.
|
|
759
|
-
- Native writes to `~/.claude` require rollback first.
|
|
760
|
-
|
|
761
|
-
### Cursor
|
|
762
|
-
|
|
763
|
-
Current: planned stub.
|
|
764
|
-
|
|
765
|
-
Target:
|
|
766
|
-
|
|
767
|
-
- Detect Cursor config root.
|
|
768
|
-
- Use an `instructions-file` strategy for rules/instructions if supported.
|
|
769
|
-
- Avoid pretending Cursor is auto-installable unless installation behavior is verified.
|
|
770
|
-
|
|
771
|
-
---
|
|
772
|
-
|
|
773
|
-
## 13. Roadmap
|
|
774
|
-
|
|
775
|
-
### Phase 0: Baseline and Document Alignment
|
|
776
|
-
|
|
777
|
-
Goal: freeze current behavior and make architecture documentation trustworthy.
|
|
778
|
-
|
|
779
|
-
Deliverables:
|
|
780
|
-
|
|
781
|
-
- Update this document as source of truth.
|
|
782
|
-
- Add install-plan regression fixtures for:
|
|
783
|
-
- `standard`
|
|
784
|
-
- `opencode`
|
|
785
|
-
- `codex`
|
|
786
|
-
- `standard,opencode,codex`
|
|
787
|
-
- Add tests for managed block upsert/remove idempotency.
|
|
788
|
-
- Document current `OperationPlan` behavior.
|
|
789
|
-
- Confirm `npm run build` and `npm run check` expectations.
|
|
790
|
-
|
|
791
|
-
Verification:
|
|
792
|
-
|
|
793
|
-
- Build passes.
|
|
794
|
-
- Regression fixtures prove current output shape.
|
|
795
|
-
- No adapter behavior changes.
|
|
796
|
-
|
|
797
|
-
### Phase 1: Adapter Inventory and Doctor
|
|
798
|
-
|
|
799
|
-
Goal: expose adapter status without changing install behavior.
|
|
800
|
-
|
|
801
|
-
Deliverables:
|
|
802
|
-
|
|
803
|
-
- Add `kyro doctor --adapters`.
|
|
804
|
-
- Report:
|
|
805
|
-
- agent
|
|
806
|
-
- display name
|
|
807
|
-
- status
|
|
808
|
-
- capabilities known today
|
|
809
|
-
- managed files
|
|
810
|
-
- managed blocks
|
|
811
|
-
- native paths if known
|
|
812
|
-
- test fixture coverage
|
|
813
|
-
- Add adapter inventory unit tests.
|
|
814
|
-
|
|
815
|
-
Verification:
|
|
816
|
-
|
|
817
|
-
- Reports 5 adapters: 3 implemented, 2 planned.
|
|
818
|
-
- Does not require Kyro to be installed in the workspace.
|
|
819
|
-
- Existing `kyro doctor` behavior remains compatible.
|
|
820
|
-
|
|
821
|
-
### Phase 2: Adapter Contract V2 Behind Compatibility Layer
|
|
822
|
-
|
|
823
|
-
Goal: introduce the new adapter model without removing the old one.
|
|
824
|
-
|
|
825
|
-
Deliverables:
|
|
826
|
-
|
|
827
|
-
- Add `Adapter`, `AdapterRegistry`, capability types, strategy types, path types.
|
|
828
|
-
- Add `configRootsForBackup()` to the registry, modeled after Gentle AI.
|
|
829
|
-
- Implement V2 wrappers for Standard, OpenCode, Codex.
|
|
830
|
-
- Keep current `AdapterDefinition` exports or provide a compatibility adapter.
|
|
831
|
-
- Add duplicate-registration and missing-adapter tests.
|
|
832
|
-
|
|
833
|
-
Verification:
|
|
834
|
-
|
|
835
|
-
- Existing install/sync/uninstall outputs remain unchanged.
|
|
836
|
-
- Core code can query capabilities without switching on agent ID.
|
|
837
|
-
|
|
838
|
-
### Phase 3: Strategy Extraction
|
|
839
|
-
|
|
840
|
-
Goal: move write semantics out of adapters and into tested injectors.
|
|
841
|
-
|
|
842
|
-
Deliverables:
|
|
843
|
-
|
|
844
|
-
- Implement `ManagedBlockInjector` using current `kyro-ai` markers.
|
|
845
|
-
- Implement `FileWriteInjector`.
|
|
846
|
-
- Route existing Codex `AGENTS.md` block through injector logic.
|
|
847
|
-
- Keep command-skill projection as a shared projection module.
|
|
848
|
-
|
|
849
|
-
Verification:
|
|
850
|
-
|
|
851
|
-
- Codex output is byte-for-byte compatible with baseline except timestamps where expected.
|
|
852
|
-
- Managed block tests cover create, update, preserve user content, remove, missing block.
|
|
853
|
-
|
|
854
|
-
### Phase 4: Pipeline and Backup
|
|
855
|
-
|
|
856
|
-
Goal: make install/sync safe enough for native agent config writes.
|
|
857
|
-
|
|
858
|
-
Deliverables:
|
|
859
|
-
|
|
860
|
-
- Convert `OperationPlan` operations into pipeline steps.
|
|
861
|
-
- Add prepare/apply/rollback execution.
|
|
862
|
-
- Add backup store under `~/.agents/kyro/backups/{timestamp}/`.
|
|
863
|
-
- Select backup roots from adapter paths and registry `configRootsForBackup()`.
|
|
864
|
-
- Add progress callback support.
|
|
865
|
-
- Keep dry-run plan output.
|
|
866
|
-
|
|
867
|
-
Verification:
|
|
868
|
-
|
|
869
|
-
- Forced apply failure restores modified files.
|
|
870
|
-
- Existing install/sync still pass baseline fixtures.
|
|
871
|
-
- CLI reports useful failure summaries.
|
|
872
|
-
|
|
873
|
-
### Phase 5: Filesystem Detection
|
|
874
|
-
|
|
875
|
-
Goal: detect installed agents without requiring `--agent`.
|
|
876
|
-
|
|
877
|
-
Deliverables:
|
|
878
|
-
|
|
879
|
-
- Implement detection context and adapter `detect()`.
|
|
880
|
-
- Add `kyro detect`.
|
|
881
|
-
- Add registry discovery tests using temp home directories.
|
|
882
|
-
- Decide no-flag install behavior:
|
|
883
|
-
- Option A: keep default `standard` for compatibility.
|
|
884
|
-
- Option B: detect installed agents when config roots exist, fallback to `standard`.
|
|
885
|
-
|
|
886
|
-
Recommendation: choose Option B only after `kyro detect` has shipped and proven stable.
|
|
887
|
-
|
|
888
|
-
Verification:
|
|
889
|
-
|
|
890
|
-
- Detection is pure filesystem/PATH inspection.
|
|
891
|
-
- No subprocess install commands are executed.
|
|
892
|
-
- Nonexistent config dirs return clean "not found" diagnostics.
|
|
893
|
-
|
|
894
|
-
### Phase 6: Native Adapter Support
|
|
895
|
-
|
|
896
|
-
Goal: add real native config support per agent.
|
|
897
|
-
|
|
898
|
-
Order:
|
|
899
|
-
|
|
900
|
-
1. Codex native support, if global Codex behavior is decided.
|
|
901
|
-
2. OpenCode native support.
|
|
902
|
-
3. Claude CLI adapter while preserving `.claude-plugin/`.
|
|
903
|
-
4. Cursor adapter.
|
|
904
|
-
5. Gemini/Kilo/Windsurf only after the first four establish stable patterns.
|
|
905
|
-
|
|
906
|
-
Verification:
|
|
907
|
-
|
|
908
|
-
- Each native adapter has path tests, doctor tests, detection tests, install-plan tests.
|
|
909
|
-
- Native writes are protected by rollback.
|
|
910
|
-
- Existing workspace behavior remains available or has a documented migration.
|
|
911
|
-
|
|
912
|
-
### Phase 7: MCP and Optional Auto-Install
|
|
913
|
-
|
|
914
|
-
Goal: add advanced integration after adapter basics are stable.
|
|
915
|
-
|
|
916
|
-
Deliverables:
|
|
917
|
-
|
|
918
|
-
- MCP server config model.
|
|
919
|
-
- JSON merge injector.
|
|
920
|
-
- TOML injector only with preservation tests.
|
|
921
|
-
- Optional platform profile detection.
|
|
922
|
-
- Optional install command resolver.
|
|
923
|
-
- Preflight validation for command dependencies such as npm.
|
|
924
|
-
|
|
925
|
-
Verification:
|
|
926
|
-
|
|
927
|
-
- MCP add/remove is idempotent.
|
|
928
|
-
- User config keys are preserved.
|
|
929
|
-
- Auto-install commands are printed for confirmation; they are not run implicitly.
|
|
930
|
-
|
|
931
|
-
---
|
|
932
|
-
|
|
933
|
-
## 14. Development Planning Template
|
|
934
|
-
|
|
935
|
-
Every implementation plan derived from this document should include:
|
|
936
|
-
|
|
937
|
-
1. **Scope**
|
|
938
|
-
- Exact phase and feature.
|
|
939
|
-
|
|
940
|
-
2. **Current behavior to preserve**
|
|
941
|
-
- Reference baseline fixture or command output.
|
|
942
|
-
|
|
943
|
-
3. **Files expected to change**
|
|
944
|
-
- Source files.
|
|
945
|
-
- Docs.
|
|
946
|
-
- Tests.
|
|
947
|
-
|
|
948
|
-
4. **Migration risk**
|
|
949
|
-
- Workspace files touched.
|
|
950
|
-
- Home-directory files touched.
|
|
951
|
-
- Whether rollback is required.
|
|
952
|
-
|
|
953
|
-
5. **Verification**
|
|
954
|
-
- Unit tests.
|
|
955
|
-
- Integration/dry-run command.
|
|
956
|
-
- `npm run build`.
|
|
957
|
-
- Any doctor/check command.
|
|
958
|
-
|
|
959
|
-
6. **Rollback story**
|
|
960
|
-
- For code changes.
|
|
961
|
-
- For user files modified by the feature.
|
|
962
|
-
|
|
963
|
-
---
|
|
964
|
-
|
|
965
|
-
## 15. Non-Negotiable Constraints
|
|
966
|
-
|
|
967
|
-
- Do not remove `.claude-plugin/` support.
|
|
968
|
-
- Do not remove `standard` until a better compatibility adapter exists.
|
|
969
|
-
- Do not change managed block marker namespace without migration.
|
|
970
|
-
- Do not write native agent home config before backup/rollback exists.
|
|
971
|
-
- Do not introduce MCP writes without preservation tests.
|
|
972
|
-
- Do not make `kyro install` run package-manager install commands implicitly.
|
|
973
|
-
- Do not collapse Markdown artifacts into JSON-only state.
|
|
974
|
-
- Do not break `kyro repair`'s rule: rebuild JSON summaries from Markdown evidence without rewriting Markdown.
|
|
975
|
-
|
|
976
|
-
---
|
|
977
|
-
|
|
978
|
-
## 16. Immediate Next PR Recommendation
|
|
979
|
-
|
|
980
|
-
The next development PR should be **Phase 0 + Phase 1 only**:
|
|
981
|
-
|
|
982
|
-
1. Add baseline tests/fixtures for current install plans.
|
|
983
|
-
2. Add managed block idempotency tests.
|
|
984
|
-
3. Add `kyro doctor --adapters`.
|
|
985
|
-
4. Keep install/sync/uninstall behavior unchanged.
|
|
986
|
-
|
|
987
|
-
This creates a stable base for the larger adapter refactor without risking existing users.
|