Install shared authoring skill and add retained drafts browser

This commit is contained in:
2026-10-09 01:33:59 +01:00
parent 94a76f9c5c
commit 998b0941d3
28 changed files with 787 additions and 520 deletions
+16 -6
View File
@@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"git.a-wan.net/alan/pipelines/internal/author"
"net/http/httptest"
"os"
"path/filepath"
@@ -139,7 +140,11 @@ func TestCLIDraftValidateSubmitAndImmutableHistory(t *testing.T) {
}
}
func TestCLIAuthorOpenCodeGetsScopedSkillAndLeavesDraft(t *testing.T) {
func TestCLIAuthorOpenCodeReferencesGlobalSkillAndLeavesDraft(t *testing.T) {
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
if _, err := author.InstallSkill(); err != nil {
t.Fatal(err)
}
run, store, _ := setup(t)
// A fake executable captures launch behavior without spending model tokens.
root := t.TempDir()
@@ -154,13 +159,18 @@ func TestCLIAuthorOpenCodeGetsScopedSkillAndLeavesDraft(t *testing.T) {
t.Fatal(err)
}
parts := strings.SplitN(string(data), "\n", 3)
if parts[1] != "--session" || !strings.Contains(parts[2], "ses_test\n--prompt\n@pipelines") || !strings.Contains(parts[2], "Make a digest") {
if parts[1] != "--prompt" || !strings.HasPrefix(parts[2], "@pipelines") || !strings.Contains(parts[2], "Make a digest") {
t.Fatal(string(data))
}
for _, name := range []string{"DRAFT.json", ".opencode/skills/pipelines/SKILL.md", ".opencode/skills/pipelines/references/format.md"} {
if _, err := os.Stat(filepath.Join(parts[0], name)); err != nil {
t.Fatal(name, err)
}
skillDir, err := author.SkillDirectory()
if err != nil {
t.Fatal(err)
}
if _, err := os.Stat(filepath.Join(skillDir, "SKILL.md")); err != nil {
t.Fatal(err)
}
if _, err := run("new", "--opencode", script); err != nil {
t.Fatal("unnamed draft should go straight to OpenCode", err)
}
items, _ := store.List(context.Background())
if len(items) != 0 {