Skip to content

Commit 159da00

Browse files
docs(plugin): clarify shared bundle contracts
1 parent 96d5ca3 commit 159da00

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/agents/plugin_bundle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub(crate) fn set_mcp_command(raw: &str, bin: &str) -> Result<String> {
4848
Ok(format!("{}\n", serde_json::to_string_pretty(&mcp)?))
4949
}
5050

51-
/// One embedded plugin file: `relative` is its deploy path; `contents` is
52-
/// embedded from the shared `plugin/` tree at compile time.
51+
/// One embedded plugin file: `relative` is its deploy path; `contents` may come
52+
/// from a different source path in the shared `plugin/` tree.
5353
#[derive(Clone, Copy)]
5454
pub struct PluginFile {
5555
pub relative: &'static str,
@@ -65,7 +65,7 @@ macro_rules! plugin_file {
6565
};
6666
}
6767

68-
// Every file under `plugin/skills/`, embedded recursively by `build.rs`.
68+
// Every file under `plugin/skills/`, including support files, embedded by build.rs.
6969
include!(concat!(env!("OUT_DIR"), "/plugin_bundle_generated.rs"));
7070

7171
/// Prefix of the dispatcher skills that Cursor does **not** deploy (they are

src/automation/skill_frontmatter.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! Parser for the `SKILL.md` frontmatter subset used by plugin and managed
2-
//! skills.
2+
//! skills: fenced `key: value` scalars plus indented block values.
33
44
use std::collections::BTreeMap;
55

66
use crate::errors::{Result, TraceDecayError};
77

8-
/// One frontmatter value.
8+
/// One parsed frontmatter value.
99
#[derive(Debug, Clone, PartialEq, Eq)]
1010
pub enum SkillFrontmatterValue {
11-
/// Inline scalar with outer quotes stripped.
11+
/// Inline scalar with one level of YAML quotes stripped.
1212
Scalar(String),
1313
/// Trimmed block lines under a key with no inline value.
1414
Block(Vec<String>),
@@ -22,7 +22,7 @@ impl SkillFrontmatterValue {
2222
}
2323
}
2424

25-
/// Returns unquoted `- item` block entries.
25+
/// Returns unquoted `- item` entries when every block line is a list item.
2626
pub fn as_list_items(&self) -> Option<Vec<String>> {
2727
match self {
2828
Self::Scalar(_) => None,
@@ -42,7 +42,7 @@ impl SkillFrontmatterValue {
4242
}
4343
}
4444

45-
/// Parses the leading `---`-fenced frontmatter of a `SKILL.md` document.
45+
/// Parses leading `---`-fenced frontmatter, normalizing LF and CRLF input.
4646
pub fn parse_skill_frontmatter(contents: &str) -> Result<BTreeMap<String, SkillFrontmatterValue>> {
4747
let mut lines = contents.lines();
4848
if lines.next().map(str::trim_end) != Some("---") {
@@ -106,7 +106,7 @@ pub fn parse_skill_frontmatter(contents: &str) -> Result<BTreeMap<String, SkillF
106106
Ok(fields)
107107
}
108108

109-
/// Strips one level of YAML quoting.
109+
/// Strips one level of YAML quoting, including YAML `''` single-quote escaping.
110110
fn unquote_scalar(value: &str) -> String {
111111
if let Some(inner) = value.strip_prefix('\'').and_then(|v| v.strip_suffix('\'')) {
112112
inner.replace("''", "'")

0 commit comments

Comments
 (0)