asdm-cli 0.1.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/README.md +784 -0
- package/dist/index.mjs +3013 -0
- package/package.json +58 -0
- package/registry/agents/.gitkeep +0 -0
- package/registry/agents/architect.asdm.md +71 -0
- package/registry/agents/code-reviewer.asdm.md +75 -0
- package/registry/agents/data-analyst.asdm.md +69 -0
- package/registry/agents/documentation-writer.asdm.md +70 -0
- package/registry/agents/mobile-engineer.asdm.md +68 -0
- package/registry/agents/security-auditor.asdm.md +74 -0
- package/registry/agents/test-engineer.asdm.md +70 -0
- package/registry/commands/.gitkeep +0 -0
- package/registry/commands/analyze-schema.asdm.md +73 -0
- package/registry/commands/audit-deps.asdm.md +76 -0
- package/registry/commands/check-file.asdm.md +58 -0
- package/registry/commands/generate-types.asdm.md +82 -0
- package/registry/commands/scaffold-component.asdm.md +89 -0
- package/registry/commands/summarize.asdm.md +61 -0
- package/registry/latest.json +253 -0
- package/registry/policy.yaml +14 -0
- package/registry/profiles/base/.gitkeep +0 -0
- package/registry/profiles/base/profile.yaml +19 -0
- package/registry/profiles/data-analytics/.gitkeep +0 -0
- package/registry/profiles/data-analytics/profile.yaml +24 -0
- package/registry/profiles/fullstack-engineer/.gitkeep +0 -0
- package/registry/profiles/fullstack-engineer/profile.yaml +38 -0
- package/registry/profiles/mobile/ios/.gitkeep +0 -0
- package/registry/profiles/mobile/profile.yaml +24 -0
- package/registry/profiles/security/profile.yaml +24 -0
- package/registry/skills/api-design/.gitkeep +0 -0
- package/registry/skills/api-design/SKILL.asdm.md +101 -0
- package/registry/skills/code-review/SKILL.asdm.md +83 -0
- package/registry/skills/data-pipeline/SKILL.asdm.md +95 -0
- package/registry/skills/frontend-design/SKILL.asdm.md +73 -0
- package/registry/skills/mobile-patterns/SKILL.asdm.md +102 -0
- package/registry/skills/pandas/.gitkeep +0 -0
- package/registry/skills/plan-protocol/SKILL.asdm.md +66 -0
- package/registry/skills/react-best-practices/.gitkeep +0 -0
- package/registry/skills/react-native/.gitkeep +0 -0
- package/registry/skills/sql/.gitkeep +0 -0
- package/registry/skills/swift-ui/.gitkeep +0 -0
- package/registry/skills/threat-modeling/SKILL.asdm.md +87 -0
- package/registry/v0.1.0.json +253 -0
- package/registry/v1.0.0.json +153 -0
- package/schemas/.gitkeep +0 -0
- package/schemas/agent.schema.json +82 -0
- package/schemas/command.schema.json +58 -0
- package/schemas/config.schema.json +29 -0
- package/schemas/lock.schema.json +65 -0
- package/schemas/manifest.schema.json +98 -0
- package/schemas/overlay.schema.json +72 -0
- package/schemas/profile.schema.json +64 -0
- package/schemas/skill.schema.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
# ⚙️ ASDM — Agentic Software Delivery Model
|
|
2
|
+
|
|
3
|
+
> **Write Once, Emit Many.**
|
|
4
|
+
> One source of truth for all your AI coding assistant configurations.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@asdm/cli)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ⚡ Quick Start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# 1. Install globally (or use npx for zero-install)
|
|
16
|
+
npm install -g @asdm/cli
|
|
17
|
+
|
|
18
|
+
# 2. Initialize your project
|
|
19
|
+
asdm init --registry github://your-org/asdm-registry --profile fullstack-engineer
|
|
20
|
+
|
|
21
|
+
# 3. Sync agents, skills, and commands from the registry
|
|
22
|
+
asdm sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
That's it. ASDM will download your team's canonical AI assistant configurations and emit them into the correct locations for every provider your project uses — OpenCode, Claude Code, and GitHub Copilot — all from a single command.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## What is ASDM?
|
|
30
|
+
|
|
31
|
+
ASDM solves a real problem: every AI coding assistant speaks a different dialect.
|
|
32
|
+
|
|
33
|
+
- **OpenCode** stores agents in `.opencode/agents/`, config in `opencode.jsonc`
|
|
34
|
+
- **Claude Code** uses `.claude/agents/`, skills in `.claude/skills/`, and `CLAUDE.md`
|
|
35
|
+
- **GitHub Copilot** expects `.github/agents/*.agent.md` and `copilot-instructions.md`
|
|
36
|
+
|
|
37
|
+
When your team upgrades a code-reviewer agent, that change needs to reach every developer in every format. Doing this manually doesn't scale. Doing it wrong breeds configuration drift — and configuration drift means inconsistent AI behavior across your codebase.
|
|
38
|
+
|
|
39
|
+
### The "Write Once, Emit Many" Model
|
|
40
|
+
|
|
41
|
+
ASDM introduces a **canonical format** — `.asdm.md` files with YAML frontmatter — that serves as the single source of truth for every agent, skill, and command. A publish step converts this format into every provider's native layout simultaneously:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
asdm-registry (GitHub)
|
|
45
|
+
└── agents/code-reviewer.asdm.md ← single source
|
|
46
|
+
│
|
|
47
|
+
├──▶ .opencode/agents/code-reviewer.md (OpenCode)
|
|
48
|
+
├──▶ .claude/agents/code-reviewer.md (Claude Code)
|
|
49
|
+
└──▶ .github/agents/code-reviewer.agent.md (GitHub Copilot)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Corporate Governance Built In
|
|
53
|
+
|
|
54
|
+
ASDM is designed for teams. The registry includes a **corporate policy** that travels with every release:
|
|
55
|
+
|
|
56
|
+
- **Allowed profiles** — developers can only use profiles the platform team approves
|
|
57
|
+
- **Locked fields** — telemetry, hook installation, and auto-verify cannot be disabled locally
|
|
58
|
+
- **Integrity verification** — SHA-256 checksums prevent silent tampering of managed files
|
|
59
|
+
- **Git hooks** — pre-commit hooks block commits if managed files have been modified
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
### Global install (recommended)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install -g @asdm/cli
|
|
69
|
+
asdm --help
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Zero-install via npx
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx @asdm/cli sync
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Requirements
|
|
79
|
+
|
|
80
|
+
- Node.js ≥ 18.0.0
|
|
81
|
+
- Git (for hook installation)
|
|
82
|
+
- A GitHub token with read access to your registry repo (set as `GITHUB_TOKEN` or `ASDM_GITHUB_TOKEN`)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Commands Reference
|
|
87
|
+
|
|
88
|
+
### Core Commands
|
|
89
|
+
|
|
90
|
+
#### `asdm init [profile]`
|
|
91
|
+
|
|
92
|
+
Initialize `.asdm.json` in the current project.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
asdm init # profile: base
|
|
96
|
+
asdm init fullstack-engineer # specify profile positionally
|
|
97
|
+
asdm init --profile data-analytics --registry github://acme/asdm-registry
|
|
98
|
+
asdm init --force # overwrite existing config
|
|
99
|
+
asdm init --gitignore # also update .gitignore
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
| Option | Description |
|
|
103
|
+
|--------|-------------|
|
|
104
|
+
| `--registry <url>` | Registry URL in `github://org/repo` format |
|
|
105
|
+
| `--force` | Overwrite existing `.asdm.json` |
|
|
106
|
+
| `--gitignore` | Add ASDM output dirs to `.gitignore` automatically |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
#### `asdm sync`
|
|
111
|
+
|
|
112
|
+
Download agents, skills, and commands from the registry and emit them for all configured providers. This is the primary command you run daily.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
asdm sync # full sync for all providers
|
|
116
|
+
asdm sync --provider opencode # sync only OpenCode files
|
|
117
|
+
asdm sync --force # re-download everything (ignore cache)
|
|
118
|
+
asdm sync --dry-run # preview changes without writing files
|
|
119
|
+
asdm sync --verbose # detailed output
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
| Option | Description |
|
|
123
|
+
|--------|-------------|
|
|
124
|
+
| `--provider <name>` | Sync only for `opencode`, `claude-code`, or `copilot` |
|
|
125
|
+
| `--force` | Re-download all assets, bypassing the local cache |
|
|
126
|
+
| `--dry-run` | Show what would change without writing anything |
|
|
127
|
+
| `--verbose` | Print each emitted file |
|
|
128
|
+
|
|
129
|
+
**Incremental sync:** ASDM compares the registry manifest against your local lockfile and only downloads assets that have changed. On a warm cache, unchanged projects sync in under 1 second.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
#### `asdm verify`
|
|
134
|
+
|
|
135
|
+
Check that all managed files match their SHA-256 checksums in the lockfile.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
asdm verify # print all violations
|
|
139
|
+
asdm verify --strict # exit 1 on any violation (used by pre-commit hook)
|
|
140
|
+
asdm verify --quiet # suppress output, just set exit code
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Exit codes:**
|
|
144
|
+
| Code | Meaning |
|
|
145
|
+
|------|---------|
|
|
146
|
+
| `0` | All managed files are intact |
|
|
147
|
+
| `1` | One or more files have been modified |
|
|
148
|
+
| `2` | Lockfile is missing — run `asdm sync` |
|
|
149
|
+
| `3` | Registry has a newer version available |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
#### `asdm status`
|
|
154
|
+
|
|
155
|
+
Show the diff between your local files and what the registry would emit.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
asdm status
|
|
159
|
+
asdm status --verbose
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
#### `asdm use <profile>`
|
|
165
|
+
|
|
166
|
+
Switch to a different profile. Writes the override to `.asdm.local.json` (gitignored) and re-runs sync automatically.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
asdm use mobile
|
|
170
|
+
asdm use fullstack-engineer
|
|
171
|
+
asdm use data-analytics
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The profile must be in the `allowed_profiles` list from corporate policy. `.asdm.local.json` is gitignored so each developer can maintain their own profile override without affecting the committed project config.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### Informational Commands
|
|
179
|
+
|
|
180
|
+
#### `asdm profiles`
|
|
181
|
+
|
|
182
|
+
List all profiles available in the registry, along with their agent/skill/command counts.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
asdm profiles
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
#### `asdm agents`
|
|
191
|
+
|
|
192
|
+
List all agents in the active profile.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
asdm agents
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
#### `asdm skills`
|
|
201
|
+
|
|
202
|
+
List all skills in the active profile.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
asdm skills
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
#### `asdm commands`
|
|
211
|
+
|
|
212
|
+
List all slash commands in the active profile.
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
asdm commands
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
#### `asdm version`
|
|
221
|
+
|
|
222
|
+
Print CLI version, Node.js version, and OS details.
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
asdm version
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### Maintenance Commands
|
|
231
|
+
|
|
232
|
+
#### `asdm doctor`
|
|
233
|
+
|
|
234
|
+
Run a full health check on the ASDM setup. Checks:
|
|
235
|
+
|
|
236
|
+
1. `.asdm.json` present
|
|
237
|
+
2. Registry reachable
|
|
238
|
+
3. Lockfile present
|
|
239
|
+
4. Managed files unmodified
|
|
240
|
+
5. All managed files on disk
|
|
241
|
+
6. Overlay references valid
|
|
242
|
+
7. `.gitignore` contains ASDM block
|
|
243
|
+
8. Local manifest version vs. registry
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
asdm doctor
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Exits `0` if all checks pass, `1` if any fail.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
#### `asdm clean`
|
|
254
|
+
|
|
255
|
+
Remove all ASDM-managed files. Use before a full reinstall or when switching to a new profile and starting fresh.
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
asdm clean # remove all managed files + lockfile
|
|
259
|
+
asdm clean --target opencode # only clean OpenCode files
|
|
260
|
+
asdm clean --target claude-code # only clean Claude Code files
|
|
261
|
+
asdm clean --dry-run # preview what would be removed
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
When run interactively (TTY), you will be prompted to confirm before any files are deleted. After cleaning, a summary shows how many files were removed and how much disk space was freed.
|
|
265
|
+
|
|
266
|
+
| Option | Description |
|
|
267
|
+
|--------|-------------|
|
|
268
|
+
| `--dry-run` | Preview what would be removed without deleting |
|
|
269
|
+
| `--target <provider>` | Only clean files for a specific provider |
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
#### `asdm hooks install`
|
|
274
|
+
|
|
275
|
+
Install git hooks that automatically verify integrity before commits and sync after merges.
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
asdm hooks install # install both hooks (default)
|
|
279
|
+
asdm hooks install --hook pre-commit # only install pre-commit hook
|
|
280
|
+
asdm hooks install --hook post-merge # only install post-merge hook
|
|
281
|
+
asdm hooks uninstall # remove both hooks
|
|
282
|
+
asdm hooks uninstall --hook pre-commit # remove only pre-commit hook
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**pre-commit hook** — Runs `asdm verify --strict --quiet` before every commit. Blocks the commit if any managed file has been tampered with.
|
|
286
|
+
|
|
287
|
+
**post-merge hook** — Runs `asdm sync` automatically after `git pull` or `git merge` when `.asdm.json` is present in the project root.
|
|
288
|
+
|
|
289
|
+
| Option | Description |
|
|
290
|
+
|--------|-------------|
|
|
291
|
+
| `--hook <type>` | `pre-commit` \| `post-merge` \| `all` (default: `all`) |
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
#### `asdm gitignore`
|
|
296
|
+
|
|
297
|
+
Add ASDM-generated output directories to `.gitignore`. Managed files should not be committed — they are regenerated by `asdm sync`.
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
asdm gitignore
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Adds a clearly-marked ASDM block to `.gitignore` that covers:
|
|
304
|
+
- `.opencode/agents/`, `.opencode/skills/`, `.opencode/commands/`
|
|
305
|
+
- `.claude/agents/`, `.claude/skills/`
|
|
306
|
+
- `.github/agents/`
|
|
307
|
+
- `.asdm.local.json` (developer profile override)
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
#### `asdm telemetry show`
|
|
312
|
+
|
|
313
|
+
Print recent local telemetry events from `.asdm-telemetry.jsonl`.
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
asdm telemetry show # last 20 events
|
|
317
|
+
asdm telemetry show --limit 50 # last 50 events
|
|
318
|
+
asdm telemetry show --json # raw JSON output
|
|
319
|
+
asdm telemetry clear --force # delete the telemetry log
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Configuration
|
|
325
|
+
|
|
326
|
+
### `.asdm.json` — Project config (committed to git)
|
|
327
|
+
|
|
328
|
+
Created by `asdm init`. This file defines the registry source, default profile, and active providers for the project.
|
|
329
|
+
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"$schema": "https://asdm.dev/schemas/config.schema.json",
|
|
333
|
+
"registry": "github://your-org/asdm-registry",
|
|
334
|
+
"profile": "fullstack-engineer",
|
|
335
|
+
"providers": ["opencode", "claude-code", "copilot"]
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
| Field | Type | Required | Description |
|
|
340
|
+
|-------|------|----------|-------------|
|
|
341
|
+
| `registry` | `string` | ✅ | Registry URL in `github://org/repo` format |
|
|
342
|
+
| `profile` | `string` | ✅ | Default profile for this project |
|
|
343
|
+
| `providers` | `string[]` | — | Active providers (default: `["opencode"]`) |
|
|
344
|
+
| `$schema` | `string` | — | JSON Schema reference for editor validation |
|
|
345
|
+
|
|
346
|
+
### `.asdm.local.json` — Developer override (gitignored)
|
|
347
|
+
|
|
348
|
+
Created automatically by `asdm use <profile>`. Never edit this manually.
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"profile": "mobile"
|
|
353
|
+
}
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### `.asdm-lock.json` — Lockfile (committed to git)
|
|
357
|
+
|
|
358
|
+
Generated by `asdm sync`. Records the exact SHA-256 of every emitted file, the manifest version, and the registry commit. Enables:
|
|
359
|
+
|
|
360
|
+
- **Offline integrity checks** — `asdm verify` works without network access
|
|
361
|
+
- **Incremental sync** — only re-download changed assets
|
|
362
|
+
- **Audit trail** — full history via git blame
|
|
363
|
+
|
|
364
|
+
### Configuration Layers
|
|
365
|
+
|
|
366
|
+
Config is resolved in three layers (highest precedence wins for non-locked fields):
|
|
367
|
+
|
|
368
|
+
```
|
|
369
|
+
Corporate Policy (manifest) → locked fields cannot be overridden
|
|
370
|
+
↓
|
|
371
|
+
.asdm.json (project) → default profile, providers, registry
|
|
372
|
+
↓
|
|
373
|
+
.asdm.local.json (user) → profile override via `asdm use`
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
**Locked fields** — set by the platform team in `policy.yaml` and embedded in every registry release:
|
|
377
|
+
- `telemetry` — cannot be disabled by developers
|
|
378
|
+
- `install_hooks` — enforced by policy
|
|
379
|
+
- `auto_verify` — enforced by policy
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Registry Structure
|
|
384
|
+
|
|
385
|
+
A registry is a Git repository with the following layout:
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
asdm-registry/
|
|
389
|
+
├── profiles/
|
|
390
|
+
│ ├── base/
|
|
391
|
+
│ │ └── profile.yaml # Agents and skills common to all
|
|
392
|
+
│ ├── fullstack-engineer/
|
|
393
|
+
│ │ └── profile.yaml # Extends base
|
|
394
|
+
│ ├── data-analytics/
|
|
395
|
+
│ │ └── profile.yaml # Extends base
|
|
396
|
+
│ └── mobile/
|
|
397
|
+
│ └── profile.yaml # Extends base
|
|
398
|
+
│
|
|
399
|
+
├── agents/
|
|
400
|
+
│ ├── code-reviewer.asdm.md # Canonical agent definition
|
|
401
|
+
│ ├── tdd-guide.asdm.md
|
|
402
|
+
│ └── architect.asdm.md
|
|
403
|
+
│
|
|
404
|
+
├── skills/
|
|
405
|
+
│ ├── react-best-practices/
|
|
406
|
+
│ │ └── SKILL.asdm.md
|
|
407
|
+
│ └── api-design/
|
|
408
|
+
│ └── SKILL.asdm.md
|
|
409
|
+
│
|
|
410
|
+
├── commands/
|
|
411
|
+
│ ├── review.asdm.md
|
|
412
|
+
│ └── test.asdm.md
|
|
413
|
+
│
|
|
414
|
+
├── policy.yaml # Corporate policy (locked fields)
|
|
415
|
+
└── manifest.json # Generated by CI — contains SHA-256 checksums
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Canonical Format — Agents
|
|
419
|
+
|
|
420
|
+
Each agent is an `.asdm.md` file with YAML frontmatter followed by the agent's instruction body:
|
|
421
|
+
|
|
422
|
+
```markdown
|
|
423
|
+
---
|
|
424
|
+
name: code-reviewer
|
|
425
|
+
type: agent
|
|
426
|
+
description: "Reviews PRs for security, performance, and clean code"
|
|
427
|
+
version: 1.3.0
|
|
428
|
+
tags: [review, security, quality]
|
|
429
|
+
|
|
430
|
+
providers:
|
|
431
|
+
opencode:
|
|
432
|
+
model: anthropic/claude-sonnet-4
|
|
433
|
+
permissions: [read, write]
|
|
434
|
+
tools: [bash, glob]
|
|
435
|
+
claude-code:
|
|
436
|
+
model: claude-sonnet-4-20250514
|
|
437
|
+
allowedTools: [Read, Write, Bash]
|
|
438
|
+
copilot:
|
|
439
|
+
on: pull_request
|
|
440
|
+
permissions:
|
|
441
|
+
pull-requests: write
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
# Code Reviewer
|
|
445
|
+
|
|
446
|
+
You are a senior code reviewer with expertise in security and design patterns.
|
|
447
|
+
|
|
448
|
+
## Rules
|
|
449
|
+
|
|
450
|
+
- NEVER approve code without proper error handling
|
|
451
|
+
- ALWAYS check that secrets are not hardcoded
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Canonical Format — Skills
|
|
455
|
+
|
|
456
|
+
```markdown
|
|
457
|
+
---
|
|
458
|
+
name: react-best-practices
|
|
459
|
+
type: skill
|
|
460
|
+
description: "React component patterns and best practices"
|
|
461
|
+
version: 2.0.0
|
|
462
|
+
trigger: "When the developer asks about React components"
|
|
463
|
+
|
|
464
|
+
providers:
|
|
465
|
+
opencode:
|
|
466
|
+
location: skills/react-best-practices/
|
|
467
|
+
claude-code:
|
|
468
|
+
location: skills/react-best-practices/
|
|
469
|
+
copilot:
|
|
470
|
+
applyTo: "**/*.tsx,**/*.jsx"
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
# React Best Practices
|
|
474
|
+
|
|
475
|
+
## Component Structure
|
|
476
|
+
|
|
477
|
+
- Use functional components with hooks exclusively
|
|
478
|
+
- Prefer composition over inheritance
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Profile Inheritance
|
|
482
|
+
|
|
483
|
+
Profiles support `extends` for layered inheritance. The `base` profile defines a minimum set of agents/skills that all developers share; specializations add on top:
|
|
484
|
+
|
|
485
|
+
```yaml
|
|
486
|
+
# profiles/fullstack-engineer/profile.yaml
|
|
487
|
+
name: fullstack-engineer
|
|
488
|
+
extends:
|
|
489
|
+
- base
|
|
490
|
+
|
|
491
|
+
agents:
|
|
492
|
+
- code-reviewer
|
|
493
|
+
- tdd-guide
|
|
494
|
+
- architect
|
|
495
|
+
|
|
496
|
+
skills:
|
|
497
|
+
- react-best-practices
|
|
498
|
+
- api-design
|
|
499
|
+
|
|
500
|
+
commands:
|
|
501
|
+
- review
|
|
502
|
+
- test
|
|
503
|
+
|
|
504
|
+
providers:
|
|
505
|
+
- opencode
|
|
506
|
+
- claude-code
|
|
507
|
+
- copilot
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Publishing New Releases
|
|
511
|
+
|
|
512
|
+
The registry uses GitHub Actions to publish:
|
|
513
|
+
|
|
514
|
+
```yaml
|
|
515
|
+
# .github/workflows/publish.yml (on merge to main)
|
|
516
|
+
- scripts/build-manifest.ts generates manifest.json with SHA-256 per asset
|
|
517
|
+
- gh release create vX.Y.Z uploads manifest + all assets as release artifacts
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
ASDM fetches `releases/latest` to determine if a sync is needed, then downloads only changed assets.
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## Providers
|
|
525
|
+
|
|
526
|
+
ASDM emits files in each provider's native format. You never write provider-specific files manually — they are all generated from the canonical `.asdm.md` sources.
|
|
527
|
+
|
|
528
|
+
### OpenCode
|
|
529
|
+
|
|
530
|
+
| Asset Type | Output Location |
|
|
531
|
+
|------------|-----------------|
|
|
532
|
+
| Agent | `.opencode/agents/{name}.md` |
|
|
533
|
+
| Skill | `.opencode/skills/{name}/SKILL.md` |
|
|
534
|
+
| Command | `.opencode/commands/{name}.md` |
|
|
535
|
+
| Root instructions | `AGENTS.md` |
|
|
536
|
+
| Config | `.opencode/opencode.jsonc` |
|
|
537
|
+
|
|
538
|
+
### Claude Code
|
|
539
|
+
|
|
540
|
+
| Asset Type | Output Location |
|
|
541
|
+
|------------|-----------------|
|
|
542
|
+
| Agent | `.claude/agents/{name}.md` |
|
|
543
|
+
| Skill | `.claude/skills/{name}/SKILL.md` |
|
|
544
|
+
| Command | `.claude/commands/{name}.md` |
|
|
545
|
+
| Root instructions | `CLAUDE.md` |
|
|
546
|
+
| Settings | `.claude/settings.json` |
|
|
547
|
+
|
|
548
|
+
### GitHub Copilot
|
|
549
|
+
|
|
550
|
+
| Asset Type | Output Location |
|
|
551
|
+
|------------|-----------------|
|
|
552
|
+
| Agent | `.github/agents/{name}.agent.md` (YAML frontmatter) |
|
|
553
|
+
| Skill | `.github/instructions/{name}.instructions.md` |
|
|
554
|
+
| Command | `.github/instructions/{name}.instructions.md` |
|
|
555
|
+
| Root instructions | `.github/copilot-instructions.md` |
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
## Integrity & Governance
|
|
560
|
+
|
|
561
|
+
### How Integrity Works
|
|
562
|
+
|
|
563
|
+
Every sync writes a SHA-256 checksum for each emitted file into `.asdm-lock.json`. Verification compares the current state of every managed file against this lockfile.
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
asdm verify
|
|
567
|
+
# ✓ .opencode/agents/code-reviewer.md ok
|
|
568
|
+
# ✗ .opencode/agents/tdd-guide.md MODIFIED (sha256 mismatch)
|
|
569
|
+
# ✓ .claude/agents/code-reviewer.md ok
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
If a managed file has been edited manually, `asdm verify` reports it as a violation and (with `--strict`) exits with code 1.
|
|
573
|
+
|
|
574
|
+
### Git Hooks
|
|
575
|
+
|
|
576
|
+
Install hooks to enforce governance automatically:
|
|
577
|
+
|
|
578
|
+
```bash
|
|
579
|
+
asdm hooks install
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
**pre-commit** — Blocks commits when managed files are tampered:
|
|
583
|
+
```sh
|
|
584
|
+
#!/usr/bin/env sh
|
|
585
|
+
# ASDM — managed pre-commit hook
|
|
586
|
+
npx asdm verify --strict --quiet
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
**post-merge** — Auto-syncs after `git pull`:
|
|
590
|
+
```sh
|
|
591
|
+
#!/usr/bin/env sh
|
|
592
|
+
# ASDM MANAGED — post-merge hook
|
|
593
|
+
if [ -f ".asdm.json" ]; then
|
|
594
|
+
echo "🔄 ASDM: syncing after merge..."
|
|
595
|
+
npx asdm sync
|
|
596
|
+
fi
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
### Corporate Policy
|
|
600
|
+
|
|
601
|
+
The registry's `policy.yaml` is embedded in every manifest release. It defines what developers can and cannot override:
|
|
602
|
+
|
|
603
|
+
```yaml
|
|
604
|
+
policy:
|
|
605
|
+
locked_fields: [registry, telemetry, install_hooks]
|
|
606
|
+
telemetry: true
|
|
607
|
+
auto_verify: true
|
|
608
|
+
install_hooks: true
|
|
609
|
+
allowed_profiles:
|
|
610
|
+
- base
|
|
611
|
+
- fullstack-engineer
|
|
612
|
+
- data-analytics
|
|
613
|
+
- mobile
|
|
614
|
+
allowed_providers:
|
|
615
|
+
- opencode
|
|
616
|
+
- claude-code
|
|
617
|
+
- copilot
|
|
618
|
+
min_cli_version: "1.0.0"
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
If a developer tries to use a profile or provider not in the allowed lists, ASDM exits with a clear policy violation error.
|
|
622
|
+
|
|
623
|
+
---
|
|
624
|
+
|
|
625
|
+
## Overlay System
|
|
626
|
+
|
|
627
|
+
The overlay system lets developers add personal agents or skills on top of the managed set — without modifying any managed files and without triggering integrity violations.
|
|
628
|
+
|
|
629
|
+
Create `.asdm-overlay.json` in your project root:
|
|
630
|
+
|
|
631
|
+
```json
|
|
632
|
+
{
|
|
633
|
+
"additional_skills": [
|
|
634
|
+
{
|
|
635
|
+
"name": "my-custom-workflow",
|
|
636
|
+
"source": "local",
|
|
637
|
+
"path": "./my-skills/workflow/SKILL.md"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"name": "community-skill",
|
|
641
|
+
"source": "github",
|
|
642
|
+
"repo": "someone/awesome-skills",
|
|
643
|
+
"path": "skills/something"
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
"additional_agents": [],
|
|
647
|
+
"provider_overrides": {
|
|
648
|
+
"opencode": {
|
|
649
|
+
"mcp_servers": [
|
|
650
|
+
{
|
|
651
|
+
"name": "local-db",
|
|
652
|
+
"command": "npx",
|
|
653
|
+
"args": ["-y", "@modelcontextprotocol/server-sqlite", "./dev.db"]
|
|
654
|
+
}
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
**Rules for overlays:**
|
|
662
|
+
|
|
663
|
+
- Overlays are **strictly additive** — they cannot modify or replace managed assets
|
|
664
|
+
- Overlay files are tracked separately in the lockfile (`managed: false`)
|
|
665
|
+
- `asdm verify` checks overlay files are still present but does not enforce their content (since you own them)
|
|
666
|
+
- `asdm doctor` validates that overlay references point to valid agents
|
|
667
|
+
|
|
668
|
+
---
|
|
669
|
+
|
|
670
|
+
## Telemetry
|
|
671
|
+
|
|
672
|
+
ASDM uses **local-only telemetry** by default. No data leaves your machine unless you set up a telemetry endpoint in your registry.
|
|
673
|
+
|
|
674
|
+
### What's collected
|
|
675
|
+
|
|
676
|
+
Events are written to `.asdm-telemetry.jsonl` in the project root:
|
|
677
|
+
|
|
678
|
+
```json
|
|
679
|
+
{
|
|
680
|
+
"event": "sync.completed",
|
|
681
|
+
"timestamp": "2026-03-31T14:22:00Z",
|
|
682
|
+
"machineId": "a3f9d2b1e4c0",
|
|
683
|
+
"version": "0.1.0",
|
|
684
|
+
"profile": "fullstack-engineer",
|
|
685
|
+
"providers": ["opencode", "claude-code"],
|
|
686
|
+
"assetCount": 24,
|
|
687
|
+
"durationMs": 1230
|
|
688
|
+
}
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
| Field | Description |
|
|
692
|
+
|-------|-------------|
|
|
693
|
+
| `machineId` | Truncated SHA-256 of hostname+username — cannot identify a person |
|
|
694
|
+
| `event` | One of: `sync.completed`, `sync.failed`, `verify.passed`, `verify.failed`, `init.completed`, `use.completed`, `doctor.ran` |
|
|
695
|
+
| `version` | CLI version |
|
|
696
|
+
| `profile` | Active profile name |
|
|
697
|
+
|
|
698
|
+
### Viewing and clearing telemetry
|
|
699
|
+
|
|
700
|
+
```bash
|
|
701
|
+
asdm telemetry show # print recent events
|
|
702
|
+
asdm telemetry show --json # raw JSON
|
|
703
|
+
asdm telemetry clear --force # delete the log
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### Disabling telemetry
|
|
707
|
+
|
|
708
|
+
If the corporate policy allows it (the `telemetry` field is not locked), you can disable telemetry locally:
|
|
709
|
+
|
|
710
|
+
```json
|
|
711
|
+
{
|
|
712
|
+
"registry": "github://your-org/asdm-registry",
|
|
713
|
+
"profile": "fullstack-engineer",
|
|
714
|
+
"telemetry": false
|
|
715
|
+
}
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
> **Note:** If the platform team has locked `telemetry: true` in policy, this field will be ignored.
|
|
719
|
+
|
|
720
|
+
---
|
|
721
|
+
|
|
722
|
+
## Contributing
|
|
723
|
+
|
|
724
|
+
### Adding a new agent or skill to the registry
|
|
725
|
+
|
|
726
|
+
1. Fork the registry repo and create a branch
|
|
727
|
+
2. Add your `.asdm.md` file under `agents/`, `skills/`, or `commands/`
|
|
728
|
+
3. Add the asset to the appropriate `profile.yaml` files
|
|
729
|
+
4. Run `npm run validate:registry` to validate your schema
|
|
730
|
+
5. Open a PR — CI will run schema validation and a dry-run manifest build
|
|
731
|
+
6. On merge to main, CI publishes a new GitHub Release automatically
|
|
732
|
+
|
|
733
|
+
### Canonical format schema
|
|
734
|
+
|
|
735
|
+
All `.asdm.md` files are validated against JSON Schemas at `schemas/` in the registry. The frontmatter must conform to:
|
|
736
|
+
|
|
737
|
+
- `schemas/agent.schema.json` for agents
|
|
738
|
+
- `schemas/skill.schema.json` for skills
|
|
739
|
+
- `schemas/command.schema.json` for commands
|
|
740
|
+
- `schemas/profile.schema.json` for profiles
|
|
741
|
+
|
|
742
|
+
### SPEC.md
|
|
743
|
+
|
|
744
|
+
The full technical specification is in [`specs/0001/SPEC.md`](specs/0001/SPEC.md). It documents the architecture, security model, telemetry schema, and the full roadmap.
|
|
745
|
+
|
|
746
|
+
### Adding a new provider adapter
|
|
747
|
+
|
|
748
|
+
1. Create `src/adapters/{provider}.ts` implementing the `EmitAdapter` interface from `src/adapters/base.ts`
|
|
749
|
+
2. Register the adapter in `src/core/syncer.ts` in the `loadAdapters` switch
|
|
750
|
+
3. Add the provider name to the union type in `src/core/config.ts`
|
|
751
|
+
4. Write tests in `tests/unit/adapters/{provider}.test.ts`
|
|
752
|
+
|
|
753
|
+
---
|
|
754
|
+
|
|
755
|
+
## License
|
|
756
|
+
|
|
757
|
+
MIT © ASDM Contributors
|
|
758
|
+
|
|
759
|
+
See [LICENSE](LICENSE) for the full text.
|
|
760
|
+
|
|
761
|
+
---
|
|
762
|
+
|
|
763
|
+
<details>
|
|
764
|
+
<summary>Architecture overview</summary>
|
|
765
|
+
|
|
766
|
+
```
|
|
767
|
+
DEV MACHINES
|
|
768
|
+
│
|
|
769
|
+
│ npx asdm sync
|
|
770
|
+
▼
|
|
771
|
+
ASDM CLI
|
|
772
|
+
├── Syncer (diff, fetch, cache)
|
|
773
|
+
├── Verifier (sha256, lockfile)
|
|
774
|
+
├── Emitters (opencode, claude-code, copilot)
|
|
775
|
+
└── Telemetry (local JSONL)
|
|
776
|
+
│
|
|
777
|
+
│ HTTPS (GitHub API)
|
|
778
|
+
▼
|
|
779
|
+
GIT-BASED REGISTRY (GitHub Releases)
|
|
780
|
+
├── manifest.json (SHA-256 checksums + corporate policy)
|
|
781
|
+
└── assets/ (agents, skills, commands as .asdm.md)
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
</details>
|