From 4a0c6cda68132a2f67ab5d8181bba211215084d9 Mon Sep 17 00:00:00 2001 From: dj-oyu <68707227+dj-oyu@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:14:35 +0900 Subject: [PATCH] Remove onboard workspace markdown files and inline templates --- cmd/picoclaw/internal/onboard/command.go | 10 +-- cmd/picoclaw/internal/onboard/helpers.go | 70 +++++++++---------- .../internal/onboard/workspace/AGENTS.md | 12 ---- .../internal/onboard/workspace/IDENTITY.md | 56 --------------- .../internal/onboard/workspace/SOUL.md | 17 ----- .../internal/onboard/workspace/USER.md | 21 ------ .../onboard/workspace/memory/MEMORY.md | 21 ------ 7 files changed, 33 insertions(+), 174 deletions(-) delete mode 100644 cmd/picoclaw/internal/onboard/workspace/AGENTS.md delete mode 100644 cmd/picoclaw/internal/onboard/workspace/IDENTITY.md delete mode 100644 cmd/picoclaw/internal/onboard/workspace/SOUL.md delete mode 100644 cmd/picoclaw/internal/onboard/workspace/USER.md delete mode 100644 cmd/picoclaw/internal/onboard/workspace/memory/MEMORY.md diff --git a/cmd/picoclaw/internal/onboard/command.go b/cmd/picoclaw/internal/onboard/command.go index ec1012959..e89c15ab7 100644 --- a/cmd/picoclaw/internal/onboard/command.go +++ b/cmd/picoclaw/internal/onboard/command.go @@ -1,14 +1,6 @@ package onboard -import ( - "embed" - - "github.com/spf13/cobra" -) - -//go:generate cp -r ../../../../workspace . -//go:embed workspace -var embeddedFiles embed.FS +import "github.com/spf13/cobra" func NewOnboardCommand() *cobra.Command { cmd := &cobra.Command{ diff --git a/cmd/picoclaw/internal/onboard/helpers.go b/cmd/picoclaw/internal/onboard/helpers.go index 4db8bdc8b..55bbd7de9 100644 --- a/cmd/picoclaw/internal/onboard/helpers.go +++ b/cmd/picoclaw/internal/onboard/helpers.go @@ -2,7 +2,6 @@ package onboard import ( "fmt" - "io/fs" "os" "path/filepath" @@ -10,6 +9,30 @@ import ( "github.com/sipeed/picoclaw/pkg/config" ) +var workspaceTemplates = map[string]string{ + "AGENTS.md": `# Agent Instructions + +You are a helpful AI assistant. Be concise, accurate, and friendly. +`, + "IDENTITY.md": `# Identity + +## Name +PicoClaw 🦞 +`, + "SOUL.md": `# Soul + +I am picoclaw, a lightweight AI assistant powered by AI. +`, + "USER.md": `# User + +Information about user goes here. +`, + "memory/MEMORY.md": `# Long-term Memory + +This file stores important information that should persist across sessions. +`, +} + func onboard() { configPath := internal.GetConfigPath() @@ -54,48 +77,19 @@ func createWorkspaceTemplates(workspace string) { } func copyEmbeddedToTarget(targetDir string) error { - // Ensure target directory exists if err := os.MkdirAll(targetDir, 0o755); err != nil { - return fmt.Errorf("Failed to create target directory: %w", err) + return fmt.Errorf("failed to create target directory: %w", err) } - // Walk through all files in embed.FS - err := fs.WalkDir(embeddedFiles, "workspace", func(path string, d fs.DirEntry, err error) error { - if err != nil { - return err - } - - // Skip directories - if d.IsDir() { - return nil - } - - // Read embedded file - data, err := embeddedFiles.ReadFile(path) - if err != nil { - return fmt.Errorf("Failed to read embedded file %s: %w", path, err) - } - - new_path, err := filepath.Rel("workspace", path) - if err != nil { - return fmt.Errorf("Failed to get relative path for %s: %v\n", path, err) - } - - // Build target file path - targetPath := filepath.Join(targetDir, new_path) - - // Ensure target file's directory exists + for relPath, content := range workspaceTemplates { + targetPath := filepath.Join(targetDir, relPath) if err := os.MkdirAll(filepath.Dir(targetPath), 0o755); err != nil { - return fmt.Errorf("Failed to create directory %s: %w", filepath.Dir(targetPath), err) + return fmt.Errorf("failed to create directory %s: %w", filepath.Dir(targetPath), err) } - - // Write file - if err := os.WriteFile(targetPath, data, 0o644); err != nil { - return fmt.Errorf("Failed to write file %s: %w", targetPath, err) + if err := os.WriteFile(targetPath, []byte(content), 0o644); err != nil { + return fmt.Errorf("failed to write file %s: %w", targetPath, err) } + } - return nil - }) - - return err + return nil } diff --git a/cmd/picoclaw/internal/onboard/workspace/AGENTS.md b/cmd/picoclaw/internal/onboard/workspace/AGENTS.md deleted file mode 100644 index 5f5fa6480..000000000 --- a/cmd/picoclaw/internal/onboard/workspace/AGENTS.md +++ /dev/null @@ -1,12 +0,0 @@ -# Agent Instructions - -You are a helpful AI assistant. Be concise, accurate, and friendly. - -## Guidelines - -- Always explain what you're doing before taking actions -- Ask for clarification when request is ambiguous -- Use tools to help accomplish tasks -- Remember important information in your memory files -- Be proactive and helpful -- Learn from user feedback \ No newline at end of file diff --git a/cmd/picoclaw/internal/onboard/workspace/IDENTITY.md b/cmd/picoclaw/internal/onboard/workspace/IDENTITY.md deleted file mode 100644 index dabb0e14b..000000000 --- a/cmd/picoclaw/internal/onboard/workspace/IDENTITY.md +++ /dev/null @@ -1,56 +0,0 @@ -# Identity - -## Name -PicoClaw 🦞 - -## Description -Ultra-lightweight personal AI assistant written in Go, inspired by nanobot. - -## Version -0.1.0 - -## Purpose -- Provide intelligent AI assistance with minimal resource usage -- Support multiple LLM providers (OpenAI, Anthropic, Zhipu, etc.) -- Enable easy customization through skills system -- Run on minimal hardware ($10 boards, <10MB RAM) - -## Capabilities - -- Web search and content fetching -- File system operations (read, write, edit) -- Shell command execution -- Multi-channel messaging (Telegram, WhatsApp, Feishu) -- Skill-based extensibility -- Memory and context management - -## Philosophy - -- Simplicity over complexity -- Performance over features -- User control and privacy -- Transparent operation -- Community-driven development - -## Goals - -- Provide a fast, lightweight AI assistant -- Support offline-first operation where possible -- Enable easy customization and extension -- Maintain high quality responses -- Run efficiently on constrained hardware - -## License -MIT License - Free and open source - -## Repository -https://github.com/sipeed/picoclaw - -## Contact -Issues: https://github.com/sipeed/picoclaw/issues -Discussions: https://github.com/sipeed/picoclaw/discussions - ---- - -"Every bit helps, every bit matters." -- Picoclaw \ No newline at end of file diff --git a/cmd/picoclaw/internal/onboard/workspace/SOUL.md b/cmd/picoclaw/internal/onboard/workspace/SOUL.md deleted file mode 100644 index 0be8834f5..000000000 --- a/cmd/picoclaw/internal/onboard/workspace/SOUL.md +++ /dev/null @@ -1,17 +0,0 @@ -# Soul - -I am picoclaw, a lightweight AI assistant powered by AI. - -## Personality - -- Helpful and friendly -- Concise and to the point -- Curious and eager to learn -- Honest and transparent - -## Values - -- Accuracy over speed -- User privacy and safety -- Transparency in actions -- Continuous improvement \ No newline at end of file diff --git a/cmd/picoclaw/internal/onboard/workspace/USER.md b/cmd/picoclaw/internal/onboard/workspace/USER.md deleted file mode 100644 index 91398a019..000000000 --- a/cmd/picoclaw/internal/onboard/workspace/USER.md +++ /dev/null @@ -1,21 +0,0 @@ -# User - -Information about user goes here. - -## Preferences - -- Communication style: (casual/formal) -- Timezone: (your timezone) -- Language: (your preferred language) - -## Personal Information - -- Name: (optional) -- Location: (optional) -- Occupation: (optional) - -## Learning Goals - -- What the user wants to learn from AI -- Preferred interaction style -- Areas of interest \ No newline at end of file diff --git a/cmd/picoclaw/internal/onboard/workspace/memory/MEMORY.md b/cmd/picoclaw/internal/onboard/workspace/memory/MEMORY.md deleted file mode 100644 index 265271db9..000000000 --- a/cmd/picoclaw/internal/onboard/workspace/memory/MEMORY.md +++ /dev/null @@ -1,21 +0,0 @@ -# Long-term Memory - -This file stores important information that should persist across sessions. - -## User Information - -(Important facts about user) - -## Preferences - -(User preferences learned over time) - -## Important Notes - -(Things to remember) - -## Configuration - -- Model preferences -- Channel settings -- Skills enabled \ No newline at end of file