swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/crates/fidget-spinner-cli/src/bundled_skill.rs
blob: 85760bcd9865274a3cfd37d3d27943110b8a7563 (plain)
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
use serde::Serialize;

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) struct BundledSkill {
    pub name: &'static str,
    pub description: &'static str,
    pub resource_uri: &'static str,
    pub body: &'static str,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
pub(crate) struct BundledSkillSummary {
    pub name: &'static str,
    pub description: &'static str,
    pub resource_uri: &'static str,
}

impl BundledSkill {
    #[must_use]
    pub const fn summary(self) -> BundledSkillSummary {
        BundledSkillSummary {
            name: self.name,
            description: self.description,
            resource_uri: self.resource_uri,
        }
    }
}

const BUNDLED_SKILLS: [BundledSkill; 2] = [
    BundledSkill {
        name: "fidget-spinner",
        description: "Base skill for working inside a Fidget Spinner project through the local DAG and MCP surface.",
        resource_uri: "fidget-spinner://skill/fidget-spinner",
        body: include_str!("../../../assets/codex-skills/fidget-spinner/SKILL.md"),
    },
    BundledSkill {
        name: "frontier-loop",
        description: "Aggressive autonomous frontier-push specialization for Fidget Spinner.",
        resource_uri: "fidget-spinner://skill/frontier-loop",
        body: include_str!("../../../assets/codex-skills/frontier-loop/SKILL.md"),
    },
];

#[must_use]
pub(crate) const fn default_bundled_skill() -> BundledSkill {
    BUNDLED_SKILLS[0]
}

#[must_use]
pub(crate) const fn frontier_loop_bundled_skill() -> BundledSkill {
    BUNDLED_SKILLS[1]
}

#[must_use]
pub(crate) fn bundled_skill(name: &str) -> Option<BundledSkill> {
    BUNDLED_SKILLS
        .iter()
        .copied()
        .find(|skill| skill.name == name)
}

#[must_use]
pub(crate) fn bundled_skill_summaries() -> Vec<BundledSkillSummary> {
    BUNDLED_SKILLS
        .iter()
        .copied()
        .map(BundledSkill::summary)
        .collect()
}