[v2 of 169] feat: issue-169 (rescue from deleted branch)#187
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
Add a first-party registry + marker-fenced installer that drops the
34 bundled Skills into one of 8 supported agent families
(Claude Code / Codex / Gemini / opencode / Cursor / Windsurf /
Cline / GitHub Copilot) from a single command:
sin-code skill install <name> --agent <target>
sin-code skill install <name> --agent all
sin-code skill uninstall <name> --agent <target>
sin-code skill list [--installed] [--agent <target>] [--json]
The new package internal/skilldist exposes Target / Targets and three
Format writers:
FormatDir — copy the Skill tree (Claude Code / opencode / Gemini)
FormatRule — single .md / .mdc rule file with marker fence
(Codex / Cursor / Windsurf / Cline)
FormatMarker — one fenced block per Skill in a shared agent
instructions file (Copilot)
The marker fence is rg-friendly ASCII, with strict-mode-tolerant pads:
<!-- SIN-CODE-SKILL-START: <skill> -->
… rendered body …
<!-- SIN-CODE-SKILL-END: <skill> -->
Re-running the install replaces the block in place via
ParseMarkers-driven reconstruction, so a re-run never duplicates
content. The legacy sin-code skill install / status grammar is
preserved verbatim when --agent is not set; the new surfaces are
additive.
Tests:
- Race-safe unit suite in internal/skilldist covering registry
integrity, ParseMarkers round-trip on every edge case
(CRLF, half-opened fence, distinct skills, multi-block
preservation), Format-aware Install / Uninstall round trips,
and atomicWrite atomicity on parent-mkdir failure.
Delqhi
force-pushed
the
feat/issue-169-v2
branch
from
June 16, 2026 15:00
8746448 to
c749917
Compare
| if err != nil { | ||
| return err | ||
| } | ||
| if err := os.MkdirAll(filepath.Dir(resolved), 0o755); err != nil { |
| // re-install because the same SKILL.md's identity (path + content) is | ||
| // idempotent. | ||
| func writeSkillDir(srcRoot, resolved, skill string) error { | ||
| if err := os.MkdirAll(resolved, 0o755); err != nil { |
| return fmt.Errorf("skilldist: mkdir %q: %w", resolved, err) | ||
| } | ||
| src := filepath.Join(srcRoot, skill, "SKILL.md") | ||
| in, err := os.ReadFile(src) |
| if err != nil { | ||
| return fmt.Errorf("skilldist: read %q: %w", src, err) | ||
| } | ||
| if err := os.WriteFile(filepath.Join(resolved, "SKILL.md"), in, 0o644); err != nil { |
| if err != nil { | ||
| return fmt.Errorf("skilldist: read %q: %w", src, err) | ||
| } | ||
| if err := os.WriteFile(filepath.Join(resolved, "SKILL.md"), in, 0o644); err != nil { |
| } | ||
| return st.IsDir(), nil | ||
| case FormatRule, FormatMarker: | ||
| data, err := os.ReadFile(resolved) |
| // even though skillsmith would happily read from fs.FS. | ||
| func extractSkillFromFS(src fs.FS, dstRoot, skill string) error { | ||
| out := filepath.Join(dstRoot, skill) | ||
| if err := os.MkdirAll(out, 0o755); err != nil { |
| if err != nil { | ||
| return fmt.Errorf("extractSkillFromFS(%q): read SKILL.md: %w", skill, err) | ||
| } | ||
| if err := os.WriteFile(filepath.Join(out, "SKILL.md"), skillMD, 0o644); err != nil { |
| return err | ||
| } | ||
| subDir := filepath.Join(out, sub) | ||
| if err := os.MkdirAll(subDir, 0o755); err != nil { |
| if err := os.MkdirAll(subDir, 0o755); err != nil { | ||
| return err | ||
| } | ||
| if err := os.WriteFile(filepath.Join(subDir, e.Name()), data, 0o644); err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the deleted PR for issue-169. The v1 branch (feat/issue-169) was deleted by a cleanup pass; this v2 carries the same content.