Merge sessions/sdlc/3b6c6c3e into main

Resolved conflicts:
- analysis/memory.md: kept condensed documentation from incoming branch
- crates/g3-core/src/skills/embedded.rs: removed unused HashMap import, kept better doc comment

Additional fix:
- crates/g3-core/src/prompts.rs: updated test to match current prompt file content
This commit is contained in:
Dhanji R. Prasanna
2026-02-05 14:38:08 +11:00
15 changed files with 1472 additions and 976 deletions

View File

@@ -263,7 +263,7 @@ mod tests {
// Verify the include_str! macro successfully loads the file
let prompt = EMBEDDED_NATIVE_PROMPT;
assert!(!prompt.is_empty(), "Embedded prompt should not be empty");
assert!(prompt.starts_with("# G3 System Prompt"), "Prompt should start with header");
assert!(prompt.starts_with("You are G3"), "Prompt should start with agent introduction");
}
#[test]

View File

@@ -161,11 +161,6 @@ fn expand_tilde(path: &str) -> PathBuf {
PathBuf::from(expanded.as_ref())
}
/// Check if a skill is from an embedded source.
pub fn is_embedded_skill(skill: &Skill) -> bool {
skill.path.starts_with("<embedded:")
}
#[cfg(test)]
mod tests {
use super::*;
@@ -247,7 +242,7 @@ mod tests {
let research = skills.iter().find(|s| s.name == "research").unwrap();
assert_eq!(research.description, "Custom research skill");
assert!(!is_embedded_skill(research), "Should not be marked as embedded");
assert!(!research.path.starts_with("<embedded:"), "Should not be marked as embedded");
}
#[test]
@@ -373,11 +368,4 @@ mod tests {
let no_tilde = expand_tilde("/absolute/path");
assert_eq!(no_tilde, PathBuf::from("/absolute/path"));
}
#[test]
fn test_is_embedded_skill() {
let skills = discover_skills(None, &[]);
let research = skills.iter().find(|s| s.name == "research").unwrap();
assert!(is_embedded_skill(research));
}
}

View File

@@ -10,9 +10,7 @@
//! 4. Global `~/.g3/skills/` directory
//! 5. Embedded skills (this module - always available)
use std::collections::HashMap;
/// An embedded skill with its SKILL.md content.
/// An embedded skill with its SKILL.md content and optional scripts.
#[derive(Debug, Clone)]
pub struct EmbeddedSkill {
/// Skill name (must match the name in SKILL.md frontmatter)
@@ -43,11 +41,6 @@ pub fn get_embedded_skill(name: &str) -> Option<&'static EmbeddedSkill> {
EMBEDDED_SKILLS.iter().find(|s| s.name == name)
}
/// Get embedded skills as a map for easy lookup.
pub fn get_embedded_skills_map() -> HashMap<&'static str, &'static EmbeddedSkill> {
EMBEDDED_SKILLS.iter().map(|s| (s.name, s)).collect()
}
#[cfg(test)]
mod tests {
use super::*;
@@ -72,10 +65,4 @@ mod tests {
assert!(get_embedded_skill("research").is_some());
assert!(get_embedded_skill("nonexistent").is_none());
}
#[test]
fn test_skills_map() {
let map = get_embedded_skills_map();
assert!(map.contains_key("research"));
}
}