60b10c69a7f68e87a08ce2909e4e6dd67ae4b672
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ae94571d70 |
library: a project's own instructions, in the file each agent reads
@VictorHong1022 on X asked to manage AGENTS.md per project beside a project's skills, so the shared instructions keep only general rules. A project in the Library now has instructions of its own (the Instructions tab, expand a project; `magpie library project instructions <dir>`). magpie writes them into the project file each picked agent reads there, by that agent's own name for it: Claude Code CLAUDE.md (or .claude/CLAUDE.md when that is the one there), Codex and pi their override first, Gemini GEMINI.md (or its context.fileName), Qwen QWEN.md, CodeBuddy CODEBUDDY.md, the rest AGENTS.md. magpie owns only a marked part (<!-- magpie:begin … --> to <!-- magpie:end -->): the user's own text around it is kept byte for byte, CRLF included, a hand edit of magpie's part stays until the project's text changes, a file magpie made is listed in the repo's .git/info/exclude and removed when emptied, and an agent's user-wide instructions file is refused. Worktrees of the project follow it. A first text goes to the agents the shared instructions are on for, else every agent here that reads a project file. Problems show as the project's "instructions" problem. Tested: - internal/library: 8 new tests (block kept around user text, CRLF, hand edit kept, made file excluded and removed, renamed files, global file refused, worktrees). Four broken by hand, each red. - internal/cli: TestLibraryProjectInstructionsCmd; red with the default agents dropped. - GUI: project-instructions.test.cjs, en and zh, chromium and webkit, 6 of 6. Red when Goose (no project file) was offered, and red when the defaults ignored the agents the instructions are on for. - Real use on mote: the built binary, sandbox HOME and project. add, text, agents; CLAUDE.md kept CRLF with the part appended; AGENTS.md and GEMINI.md made and excluded; the user-wide CLAUDE.md untouched; zed refused; an edited part survived `library sync`; `agents none` put CLAUDE.md back byte for byte, removed the made files and emptied the exclude block. - Full Go suite (go test ./... -timeout 45m) on mote: 103 packages ok, gofmt clean, go vet darwin, linux (nogui) and windows rc=0, at this change on origin/main |
||
|
|
025123431c |
library: add and remove a project's skills from the CLI (Sephiro_Lan on X, #5193)
magpie library project … does what the window's Library › Projects page
does, through the same library calls its page makes (AddProject,
RemoveProject, ProjectSkills, ProjectSkill, ProjectCopy):
magpie library project [--json] the projects and their skills
magpie library project add <dir>
magpie library project rm <dir> [--keep-files]
magpie library project skills <dir> [--json]
magpie library project skill add <dir> <skill…> [agents=a,b…]
magpie library project skill rm <dir> <skill…>
magpie library project skill agents <dir> <skill> <a,b…|none>
magpie library project copy <dir> on|off
<dir> may be relative or "." (library.ProjectPath / ProjectAt find the
listed project, through a link too). A skill added with no agents= goes
to the agents the page's Skills menu picks: those the project's skills
are for already, else every agent here with a project skills folder.
Each skill added says where it was placed; one that wasn't (a folder
there that isn't magpie's, left as it is) is named with why, and the
command exits 1, so a script tells "installed" from "left as it is" by
the status. --help prints the project usage; an unknown flag, command,
skill, agent or on/off value is refused, and so is rm of a skill the
project doesn't have.
Docs: the Projects row of docs/subsystems/library.md, and the site's
library page in en/zh/ja. site/public/llms-full.txt rebuilt with
`node llms-full.mjs`; it also picks up a line (Alma, Shelley) another
docs change left out of it.
Run (mote, at this tree):
- go test -count=1 -run TestLibraryProject ./internal/cli: ok; the same
on Windows (win-run, xiaomi-gpu): ok.
- go vet ./internal/cli ./internal/library for darwin, linux (-tags nogui)
and windows: ok. go test -count=1 ./internal/cli ./internal/library:
ok (45s, 99s), at this head after the rebase. site: node --test worker.test.mjs: 38 pass. gofmt -l:
clean.
- A sandbox HOME end to end with the built binary: claude and codex
installed, three library skills, a git project. add ., skill add with
no agents= (links in .claude/skills and .agents/skills, listed
in .git/info/exclude, the .gitignore left as it is), a folder of the user's in .claude/skills/pdf (named,
exit 1, untouched), agents=codex, skill agents, unknown
skill/agent/flag/command refused, skills --json, skill rm, rm .: the
links, magpie's folders and the exclude block gone, the user's
folder kept.
Broken by hand: with the not-placed exit taken out, TestLibraryProjectCmd
goes red ("a folder of the user's in the way: <nil>").
Not tried: a project's MCP servers from the CLI (the issue asks for
skills; servers stay on the page), WSL agents, and a real Linux box.
|