@@ -13,135 +13,17 @@ struct SkillFile {
1313const CLAUDE_MD : & str = include_str ! ( "../../../CLAUDE.md" ) ;
1414
1515/// All skill files embedded at compile time.
16- const SKILL_FILES : & [ SkillFile ] = & [
17- SkillFile {
18- path : ".claude/skills/rustmotion/SKILL.md" ,
19- content : include_str ! ( "../../../.claude/skills/rustmotion/SKILL.md" ) ,
20- } ,
21- // Rules
22- SkillFile {
23- path : ".claude/skills/rustmotion/rules/3d-perspective.md" ,
24- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/3d-perspective.md" ) ,
25- } ,
26- SkillFile {
27- path : ".claude/skills/rustmotion/rules/captions-workflow.md" ,
28- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/captions-workflow.md" ) ,
29- } ,
30- SkillFile {
31- path : ".claude/skills/rustmotion/rules/card-flex-layout.md" ,
32- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/card-flex-layout.md" ) ,
33- } ,
34- SkillFile {
35- path : ".claude/skills/rustmotion/rules/chart-types.md" ,
36- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/chart-types.md" ) ,
37- } ,
38- SkillFile {
39- path : ".claude/skills/rustmotion/rules/continuous-presets.md" ,
40- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/continuous-presets.md" ) ,
41- } ,
42- SkillFile {
43- path : ".claude/skills/rustmotion/rules/counter-standalone.md" ,
44- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/counter-standalone.md" ) ,
45- } ,
46- SkillFile {
47- path : ".claude/skills/rustmotion/rules/data-viz-components.md" ,
48- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/data-viz-components.md" ) ,
49- } ,
50- SkillFile {
51- path : ".claude/skills/rustmotion/rules/dot-map-coordinates.md" ,
52- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/dot-map-coordinates.md" ) ,
53- } ,
54- SkillFile {
55- path : ".claude/skills/rustmotion/rules/easing-guidelines.md" ,
56- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/easing-guidelines.md" ) ,
57- } ,
58- SkillFile {
59- path : ".claude/skills/rustmotion/rules/even-dimensions.md" ,
60- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/even-dimensions.md" ) ,
61- } ,
62- SkillFile {
63- path : ".claude/skills/rustmotion/rules/gradient-quality.md" ,
64- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/gradient-quality.md" ) ,
65- } ,
66- SkillFile {
67- path : ".claude/skills/rustmotion/rules/grid-card-height.md" ,
68- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/grid-card-height.md" ) ,
69- } ,
70- SkillFile {
71- path : ".claude/skills/rustmotion/rules/hex-colors.md" ,
72- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/hex-colors.md" ) ,
73- } ,
74- SkillFile {
75- path : ".claude/skills/rustmotion/rules/icon-format.md" ,
76- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/icon-format.md" ) ,
77- } ,
78- SkillFile {
79- path : ".claude/skills/rustmotion/rules/layer-order.md" ,
80- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/layer-order.md" ) ,
81- } ,
82- SkillFile {
83- path : ".claude/skills/rustmotion/rules/module-structure.md" ,
84- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/module-structure.md" ) ,
85- } ,
86- SkillFile {
87- path : ".claude/skills/rustmotion/rules/notification-stacking.md" ,
88- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/notification-stacking.md" ) ,
89- } ,
90- SkillFile {
91- path : ".claude/skills/rustmotion/rules/paint-context.md" ,
92- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/paint-context.md" ) ,
93- } ,
94- SkillFile {
95- path : ".claude/skills/rustmotion/rules/prefer-presets.md" ,
96- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/prefer-presets.md" ) ,
97- } ,
98- SkillFile {
99- path : ".claude/skills/rustmotion/rules/responsive-device-sizing.md" ,
100- content : include_str ! (
101- "../../../.claude/skills/rustmotion/rules/responsive-device-sizing.md"
102- ) ,
103- } ,
104- SkillFile {
105- path : ".claude/skills/rustmotion/rules/stagger-animations.md" ,
106- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/stagger-animations.md" ) ,
107- } ,
108- SkillFile {
109- path : ".claude/skills/rustmotion/rules/stat-cards.md" ,
110- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/stat-cards.md" ) ,
111- } ,
112- SkillFile {
113- path : ".claude/skills/rustmotion/rules/text-background.md" ,
114- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/text-background.md" ) ,
115- } ,
116- SkillFile {
117- path : ".claude/skills/rustmotion/rules/timeline-sequencing.md" ,
118- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/timeline-sequencing.md" ) ,
119- } ,
120- SkillFile {
121- path : ".claude/skills/rustmotion/rules/timing-constraints.md" ,
122- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/timing-constraints.md" ) ,
123- } ,
124- SkillFile {
125- path : ".claude/skills/rustmotion/rules/ui-controls.md" ,
126- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/ui-controls.md" ) ,
127- } ,
128- SkillFile {
129- path : ".claude/skills/rustmotion/rules/validate-json.md" ,
130- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/validate-json.md" ) ,
131- } ,
132- SkillFile {
133- path : ".claude/skills/rustmotion/rules/vertical-align.md" ,
134- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/vertical-align.md" ) ,
135- } ,
136- SkillFile {
137- path : ".claude/skills/rustmotion/rules/video-wizard.md" ,
138- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/video-wizard.md" ) ,
139- } ,
140- SkillFile {
141- path : ".claude/skills/rustmotion/rules/wiggle-additive.md" ,
142- content : include_str ! ( "../../../.claude/skills/rustmotion/rules/wiggle-additive.md" ) ,
143- } ,
144- ] ;
16+ ///
17+ /// Generated by `build.rs`, which walks `.claude/skills/rustmotion/` at
18+ /// build time and embeds every `.md` file it finds via `include_str!`. This
19+ /// is intentionally not a hand-maintained literal: a manually curated list
20+ /// silently drops any rule file nobody remembered to add (issue #165). See
21+ /// `tests/skill_files_match_disk.rs` for the guard that keeps this table and
22+ /// the on-disk rule set from drifting apart again.
23+ ///
24+ /// SKILL.md is always the first entry (see `build.rs`), but code here must
25+ /// not rely on that position — locate it by path instead.
26+ const SKILL_FILES : & [ SkillFile ] = include ! ( concat!( env!( "OUT_DIR" ) , "/skill_files.rs" ) ) ;
14527
14628/// Resolve the target directory for skill installation.
14729fn resolve_target ( global : bool ) -> Result < PathBuf > {
@@ -271,10 +153,14 @@ pub fn show(name: &str) -> Result<()> {
271153 }
272154 }
273155
274- // Special case: SKILL.md
156+ // Special case: SKILL.md. Matched by path rather than position — the
157+ // generated table happens to put SKILL.md first, but nothing here should
158+ // depend on that ordering to keep working if it ever changes.
275159 if needle. eq_ignore_ascii_case ( "skill" ) {
276- print ! ( "{}" , SKILL_FILES [ 0 ] . content) ;
277- return Ok ( ( ) ) ;
160+ if let Some ( sf) = SKILL_FILES . iter ( ) . find ( |sf| sf. path . ends_with ( "/SKILL.md" ) ) {
161+ print ! ( "{}" , sf. content) ;
162+ return Ok ( ( ) ) ;
163+ }
278164 }
279165
280166 Err ( RustmotionError :: UnknownSkill {
0 commit comments