-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Support SYSTEM skills. #8220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SYSTEM skills. #8220
Conversation
xl-openai
commented
Dec 18, 2025
- Remove PUBLIC skills and introduce SYSTEM skills embedded in the binary and installed into $CODEX_HOME/skills/.system at startup.
- Skills are now always enabled (feature flag removed).
- Update skills/list to accept forceReload and plumb it through (not used by clients yet).
| fs::create_dir_all(&skill_dir).unwrap(); | ||
| fs::write(skill_dir.join("SKILL.md"), "not yaml").unwrap(); | ||
| }); | ||
| let mut builder = test_codex().with_pre_build_hook(|home| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make a helper and have an integration test for system skills? Maybe we can also test the priorities (system, user, repo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a list_skills_includes_system_cache_entries one :)
codex-rs/core/src/skills/system.rs
Outdated
| use std::path::Path; | ||
| use std::path::PathBuf; | ||
| use std::time::SystemTime; | ||
| use std::time::UNIX_EPOCH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use AbsolutePathBuf
codex-rs/core/src/skills/system.rs
Outdated
| Ok(()) | ||
| } | ||
|
|
||
| fn write_embedded_dir(dir: &Dir<'_>, dest: &Path) -> Result<(), SystemSkillsError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's have docstrings for the helper functions here. a bit hard to digest
codex-rs/core/src/skills/system.rs
Outdated
| } | ||
|
|
||
| write_embedded_dir(&SYSTEM_SKILLS_DIR, &staged_system)?; | ||
| atomic_swap_dir(&staged_system, &dest_system, &skills_root_dir)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need that for writing few .md files?
| impl SkillsManager { | ||
| pub fn new(codex_home: PathBuf) -> Self { | ||
| let (skills_update_tx, _skills_update_rx) = broadcast::channel(1); | ||
| if let Err(err) = install_system_skills(&codex_home) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking: we can leave a marker of the cli version or skills hash so we don't repeat this on startup every time. but I think it's not needed now it's few files.
| @@ -0,0 +1,95 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file and the above file both have the same name but the content is different though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
081956f to
16b6725
Compare
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut items: Vec<(String, Option<u64>)> = SYSTEM_SKILLS_DIR | ||
| .entries() | ||
| .iter() | ||
| .map(|entry| match entry { | ||
| include_dir::DirEntry::Dir(dir) => (dir.path().to_string_lossy().to_string(), None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include nested system skill contents in fingerprint
The fingerprint used to decide whether to reinstall embedded system skills only iterates SYSTEM_SKILLS_DIR.entries() and hashes directory entries as (path, None). The embedded skills live under subdirectories (e.g., plan/ and skill-creator/), so changes to their SKILL.md contents won’t affect the fingerprint. That means an upgraded binary with updated system skill content will keep the stale on-disk cache because the marker still matches, and install_system_skills will early-return. Consider hashing files recursively (e.g., using Dir::files() or recursing like write_embedded_dir) so any content changes update the marker and trigger a refresh.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is OK for now.