1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! The `Adapter` trait: the single abstraction every agent-specific
//! installer implements.
//!
//! A canonical SKILL.md at `<skills_home>/<name>/SKILL.md` is translated
//! into a file another agent actually reads. The Claude Code adapter ships
//! in v0.2; Cursor and friends are deferred to v0.3 pending research on
//! their user-global install points.
//!
//! Contract is locked in `.rune/plan-beck-link-spec.md` ยง1. Do not add
//! methods to the trait without bumping the spec, because every new
//! adapter will inherit them.
use ;
use crate;
use crateSkill;
use crate;
/// The plan an adapter produces for a single skill, before it touches
/// disk. Phase 4 (`beck link`) prints the plan in `--dry-run` mode.
///
/// `transform` is a pure function from a `Skill` to the bytes written to
/// `target`. `None` means "symlink the source file byte-for-byte"; that is
/// the Claude Code case.
/// Every agent-specific installer implements this trait.
///
/// Lifetime contract:
/// 1. `plan(&skill)` is a pure read of `skill`. It must not touch disk
/// outside `target_root()` lookups.
/// 2. `install(&plan)` may create directories and the single file or
/// symlink at `plan.target`. It must not write anywhere else.
/// 3. `uninstall(&entry)` removes exactly the file `entry.target` and
/// must refuse if the file on disk is no longer beck-managed.
/// 4. Adapters are stateless and safe to share across threads. The
/// `Send + Sync` bound is load-bearing for the registry that owns
/// `Box<dyn Adapter>`.